mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-17 02:46:34 +00:00
Merge branch 'fasterwait' into 'master'
More closely match rest/wait progress speed to vanilla See merge request OpenMW/openmw!4772
This commit is contained in:
commit
2504550c6f
5 changed files with 11 additions and 10 deletions
|
@ -23,7 +23,6 @@ namespace MWGui
|
|||
: WindowBase("openmw_jail_screen.layout")
|
||||
, mDays(1)
|
||||
, mFadeTimeRemaining(0)
|
||||
, mTimeAdvancer(0.01f)
|
||||
{
|
||||
getWidget(mProgressBar, "ProgressBar");
|
||||
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
#include "timeadvancer.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
// Time per hour tick
|
||||
constexpr float kProgressStepDelay = 1.0f / 60.0f;
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
TimeAdvancer::TimeAdvancer(float delay)
|
||||
TimeAdvancer::TimeAdvancer()
|
||||
: mRunning(false)
|
||||
, mCurHour(0)
|
||||
, mHours(1)
|
||||
, mInterruptAt(-1)
|
||||
, mDelay(delay)
|
||||
, mRemainingTime(delay)
|
||||
, mRemainingTime(kProgressStepDelay)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -17,7 +22,7 @@ namespace MWGui
|
|||
mHours = hours;
|
||||
mCurHour = 0;
|
||||
mInterruptAt = interruptAt;
|
||||
mRemainingTime = mDelay;
|
||||
mRemainingTime = kProgressStepDelay;
|
||||
|
||||
mRunning = true;
|
||||
}
|
||||
|
@ -43,7 +48,7 @@ namespace MWGui
|
|||
|
||||
while (mRemainingTime <= 0)
|
||||
{
|
||||
mRemainingTime += mDelay;
|
||||
mRemainingTime += kProgressStepDelay;
|
||||
++mCurHour;
|
||||
|
||||
if (mCurHour <= mHours)
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace MWGui
|
|||
class TimeAdvancer
|
||||
{
|
||||
public:
|
||||
TimeAdvancer(float delay);
|
||||
TimeAdvancer();
|
||||
|
||||
void run(int hours, int interruptAt = -1);
|
||||
void stop();
|
||||
|
@ -32,7 +32,6 @@ namespace MWGui
|
|||
int mHours;
|
||||
int mInterruptAt;
|
||||
|
||||
float mDelay;
|
||||
float mRemainingTime;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ namespace MWGui
|
|||
|
||||
TrainingWindow::TrainingWindow()
|
||||
: WindowBase("openmw_trainingwindow.layout")
|
||||
, mTimeAdvancer(0.05f)
|
||||
{
|
||||
getWidget(mTrainingOptions, "TrainingOptions");
|
||||
getWidget(mCancelButton, "CancelButton");
|
||||
|
|
|
@ -52,7 +52,6 @@ namespace MWGui
|
|||
|
||||
WaitDialog::WaitDialog()
|
||||
: WindowBase("openmw_wait_dialog.layout")
|
||||
, mTimeAdvancer(0.05f)
|
||||
, mSleeping(false)
|
||||
, mHours(1)
|
||||
, mManualHours(1)
|
||||
|
|
Loading…
Reference in a new issue