ousnius / BodySlide-and-Outfit-Studio

BodySlide and Outfit Studio, a tool to convert, create, and customize outfits and bodies for Bethesda games.
GNU General Public License v3.0
290 stars 64 forks source link

Progress bar interpolation changes #400

Closed daz001 closed 2 years ago

daz001 commented 2 years ago
ProgressStack
{0, 10000}

Add first subprogress (same result for new and old formula) StartSubProgress(10,20):

ProgressStack:
{0, 10000}
{1001, 2001} (range = 10000 - 0 = 10000, push(0 + 1001, 0 + 2001)

Add another subprogress: StartSubProgress(10,15):

Old Formula:

ProgressStack:
{0, 10000}
{1001, 2001}
{100, 151} (range = 1001 - 0 = 1001, push(0 + 101, 0 + 151)

^^ this will give us a progress which is less than the previous progress (when displaying on the progress bar)

New Formula

ProgressStack
{0, 10000}
{1001, 2001}
{1101, 1151} (range = 2001 - 1001 = 1000, push(1000 + 101, 1000 + 151)

^^ this will give us a progress display that is always using the previous value as the minimum and interpolates the percentage in the same way, no matter how many sub progresses are on the stack

Currently I don't believe there are any methods that push onto the stack more than a single sub progress at a time, so the issue isn't visible. But I have future changes that would use this

The other change just allows for the progress stack to empty completely, for example - if an error occurs mid progress