2012-09-18 18:29:03 +02:00
|
|
|
#include "waitdialog.hpp"
|
|
|
|
|
2015-01-10 02:50:43 +01:00
|
|
|
#include <MyGUI_ProgressBar.h>
|
2017-09-27 00:04:01 +02:00
|
|
|
#include <MyGUI_InputManager.h>
|
2017-09-27 12:40:47 +02:00
|
|
|
#include <MyGUI_ScrollBar.h>
|
2015-01-10 02:50:43 +01:00
|
|
|
|
2015-04-22 17:58:55 +02:00
|
|
|
#include <components/misc/rng.hpp>
|
2015-03-15 14:07:47 +13:00
|
|
|
|
2014-09-12 05:14:21 +02:00
|
|
|
#include <components/widgets/box.hpp>
|
2015-01-31 23:27:34 +01:00
|
|
|
#include <components/settings/settings.hpp>
|
2014-09-12 05:14:21 +02:00
|
|
|
|
2012-09-18 20:53:32 +02:00
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
2012-09-21 17:53:16 +02:00
|
|
|
#include "../mwbase/mechanicsmanager.hpp"
|
2014-04-23 23:12:30 -04:00
|
|
|
#include "../mwbase/statemanager.hpp"
|
2012-09-18 20:53:32 +02:00
|
|
|
|
2012-09-19 02:53:06 +02:00
|
|
|
#include "../mwworld/class.hpp"
|
2014-02-23 20:11:05 +01:00
|
|
|
#include "../mwworld/cellstore.hpp"
|
2014-12-19 11:26:54 +01:00
|
|
|
#include "../mwworld/esmstore.hpp"
|
2012-09-19 02:53:06 +02:00
|
|
|
|
2013-02-16 13:35:03 -05:00
|
|
|
#include "../mwmechanics/creaturestats.hpp"
|
2012-09-19 02:53:06 +02:00
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
2015-08-21 21:12:39 +12:00
|
|
|
#include "../mwmechanics/actorutil.hpp"
|
2012-09-18 20:53:32 +02:00
|
|
|
|
2014-04-23 23:12:30 -04:00
|
|
|
#include "../mwstate/charactermanager.hpp"
|
2012-09-18 20:53:32 +02:00
|
|
|
|
2012-09-18 18:29:03 +02:00
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
2013-04-10 14:46:21 -04:00
|
|
|
WaitDialogProgressBar::WaitDialogProgressBar()
|
|
|
|
: WindowBase("openmw_wait_dialog_progressbar.layout")
|
2012-09-19 02:53:06 +02:00
|
|
|
{
|
|
|
|
getWidget(mProgressBar, "ProgressBar");
|
|
|
|
getWidget(mProgressText, "ProgressText");
|
|
|
|
}
|
|
|
|
|
2017-09-22 17:10:53 +02:00
|
|
|
void WaitDialogProgressBar::onOpen()
|
2012-09-19 02:53:06 +02:00
|
|
|
{
|
|
|
|
center();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialogProgressBar::setProgress (int cur, int total)
|
|
|
|
{
|
|
|
|
mProgressBar->setProgressRange (total);
|
|
|
|
mProgressBar->setProgressPosition (cur);
|
2015-01-10 03:01:01 +01:00
|
|
|
mProgressText->setCaption(MyGUI::utility::toString(cur) + "/" + MyGUI::utility::toString(total));
|
2012-09-19 02:53:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------
|
|
|
|
|
2013-04-10 14:46:21 -04:00
|
|
|
WaitDialog::WaitDialog()
|
|
|
|
: WindowBase("openmw_wait_dialog.layout")
|
2015-03-08 13:07:29 +13:00
|
|
|
, mTimeAdvancer(0.05f)
|
2012-09-19 02:53:06 +02:00
|
|
|
, mSleeping(false)
|
|
|
|
, mHours(1)
|
2013-07-31 18:46:32 +02:00
|
|
|
, mManualHours(1)
|
2015-02-07 04:05:28 +01:00
|
|
|
, mFadeTimeRemaining(0)
|
2014-01-14 07:40:17 +01:00
|
|
|
, mInterruptAt(-1)
|
2015-04-30 19:24:27 -05:00
|
|
|
, mProgressBar()
|
2012-09-18 18:29:03 +02:00
|
|
|
{
|
2012-09-18 20:53:32 +02:00
|
|
|
getWidget(mDateTimeText, "DateTimeText");
|
|
|
|
getWidget(mRestText, "RestText");
|
|
|
|
getWidget(mHourText, "HourText");
|
|
|
|
getWidget(mUntilHealedButton, "UntilHealedButton");
|
|
|
|
getWidget(mWaitButton, "WaitButton");
|
|
|
|
getWidget(mCancelButton, "CancelButton");
|
2013-07-02 17:29:47 +02:00
|
|
|
getWidget(mHourSlider, "HourSlider");
|
2012-09-18 20:53:32 +02:00
|
|
|
|
|
|
|
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WaitDialog::onCancelButtonClicked);
|
|
|
|
mUntilHealedButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WaitDialog::onUntilHealedButtonClicked);
|
|
|
|
mWaitButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WaitDialog::onWaitButtonClicked);
|
|
|
|
mHourSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &WaitDialog::onHourSliderChangedPosition);
|
2012-09-19 02:53:06 +02:00
|
|
|
|
2017-09-27 00:04:01 +02:00
|
|
|
mCancelButton->eventKeyButtonPressed += MyGUI::newDelegate(this, &WaitDialog::onKeyButtonPressed);
|
|
|
|
mWaitButton->eventKeyButtonPressed += MyGUI::newDelegate(this, &WaitDialog::onKeyButtonPressed);
|
|
|
|
mUntilHealedButton->eventKeyButtonPressed += MyGUI::newDelegate(this, &WaitDialog::onKeyButtonPressed);
|
|
|
|
|
2015-02-07 04:05:28 +01:00
|
|
|
mTimeAdvancer.eventProgressChanged += MyGUI::newDelegate(this, &WaitDialog::onWaitingProgressChanged);
|
|
|
|
mTimeAdvancer.eventInterrupted += MyGUI::newDelegate(this, &WaitDialog::onWaitingInterrupted);
|
|
|
|
mTimeAdvancer.eventFinished += MyGUI::newDelegate(this, &WaitDialog::onWaitingFinished);
|
2012-09-18 20:53:32 +02:00
|
|
|
}
|
|
|
|
|
2017-09-23 15:06:11 +02:00
|
|
|
void WaitDialog::setPtr(const MWWorld::Ptr &ptr)
|
|
|
|
{
|
2019-05-14 20:38:41 +03:00
|
|
|
setCanRest(!ptr.isEmpty() || MWBase::Environment::get().getWorld ()->canRest () == MWBase::World::Rest_Allowed);
|
2017-09-27 00:04:01 +02:00
|
|
|
|
2019-05-14 20:38:41 +03:00
|
|
|
if (ptr.isEmpty() && MWBase::Environment::get().getWorld ()->canRest() == MWBase::World::Rest_PlayerIsInAir)
|
|
|
|
{
|
|
|
|
// Resting in air is not allowed unless you're using a bed
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage1}");
|
|
|
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Rest);
|
|
|
|
}
|
|
|
|
|
2017-09-27 00:04:01 +02:00
|
|
|
if (mUntilHealedButton->getVisible())
|
2019-06-09 02:08:09 +03:00
|
|
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mUntilHealedButton);
|
2017-09-27 00:04:01 +02:00
|
|
|
else
|
2019-06-09 02:08:09 +03:00
|
|
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mWaitButton);
|
2017-09-23 15:06:11 +02:00
|
|
|
}
|
|
|
|
|
2017-09-23 12:18:39 +02:00
|
|
|
bool WaitDialog::exit()
|
2014-05-26 23:13:37 -04:00
|
|
|
{
|
2017-09-24 12:58:14 +02:00
|
|
|
return (!mTimeAdvancer.isRunning()); //Only exit if not currently waiting
|
2014-05-26 23:13:37 -04:00
|
|
|
}
|
|
|
|
|
2017-11-08 00:03:02 +01:00
|
|
|
void WaitDialog::clear()
|
|
|
|
{
|
|
|
|
mSleeping = false;
|
|
|
|
mTimeAdvancer.stop();
|
|
|
|
}
|
|
|
|
|
2017-09-22 17:10:53 +02:00
|
|
|
void WaitDialog::onOpen()
|
2012-09-18 20:53:32 +02:00
|
|
|
{
|
2017-09-24 12:58:14 +02:00
|
|
|
if (mTimeAdvancer.isRunning())
|
|
|
|
{
|
|
|
|
mProgressBar.setVisible(true);
|
|
|
|
setVisible(false);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mProgressBar.setVisible(false);
|
|
|
|
}
|
|
|
|
|
2012-09-19 02:53:06 +02:00
|
|
|
if (!MWBase::Environment::get().getWindowManager ()->getRestEnabled ())
|
|
|
|
{
|
2013-04-10 00:32:05 -04:00
|
|
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
2012-09-19 02:53:06 +02:00
|
|
|
}
|
|
|
|
|
2018-09-23 02:46:29 +03:00
|
|
|
MWBase::World::RestPermitted canRest = MWBase::Environment::get().getWorld ()->canRest ();
|
2012-09-19 02:53:06 +02:00
|
|
|
|
2018-09-23 02:46:29 +03:00
|
|
|
if (canRest == MWBase::World::Rest_EnemiesAreNearby)
|
2018-09-23 01:52:56 +03:00
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage2}");
|
|
|
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
2018-09-23 02:46:29 +03:00
|
|
|
}
|
|
|
|
else if (canRest == MWBase::World::Rest_PlayerIsUnderwater)
|
2012-09-19 02:53:06 +02:00
|
|
|
{
|
2019-04-04 17:18:49 +03:00
|
|
|
// resting underwater not allowed
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage1}");
|
|
|
|
MWBase::Environment::get().getWindowManager()->popGuiMode ();
|
|
|
|
}
|
2012-09-19 02:53:06 +02:00
|
|
|
|
2012-09-18 20:53:32 +02:00
|
|
|
onHourSliderChangedPosition(mHourSlider, 0);
|
|
|
|
mHourSlider->setScrollPosition (0);
|
|
|
|
|
2013-11-26 12:47:30 +01:00
|
|
|
std::string month = MWBase::Environment::get().getWorld ()->getMonthName();
|
2015-03-08 13:07:29 +13:00
|
|
|
int hour = static_cast<int>(MWBase::Environment::get().getWorld()->getTimeStamp().getHour());
|
2012-09-18 20:53:32 +02:00
|
|
|
bool pm = hour >= 12;
|
|
|
|
if (hour >= 13) hour -= 12;
|
2012-11-06 13:19:35 -05:00
|
|
|
if (hour == 0) hour = 12;
|
2012-09-18 20:53:32 +02:00
|
|
|
|
|
|
|
std::string dateTimeText =
|
2015-01-10 03:01:01 +01:00
|
|
|
MyGUI::utility::toString(MWBase::Environment::get().getWorld ()->getDay ()) + " "
|
|
|
|
+ month + " (#{sDay} " + MyGUI::utility::toString(MWBase::Environment::get().getWorld ()->getTimeStamp ().getDay())
|
|
|
|
+ ") " + MyGUI::utility::toString(hour) + " " + (pm ? "#{sSaveMenuHelp05}" : "#{sSaveMenuHelp04}");
|
2012-09-18 20:53:32 +02:00
|
|
|
|
|
|
|
mDateTimeText->setCaptionWithReplacing (dateTimeText);
|
2012-09-18 18:29:03 +02:00
|
|
|
}
|
|
|
|
|
2012-09-18 20:53:32 +02:00
|
|
|
void WaitDialog::onUntilHealedButtonClicked(MyGUI::Widget* sender)
|
|
|
|
{
|
2014-01-14 02:52:34 +01:00
|
|
|
int autoHours = MWBase::Environment::get().getMechanicsManager()->getHoursToRest();
|
2013-03-25 11:53:02 +01:00
|
|
|
|
2013-02-16 13:35:03 -05:00
|
|
|
startWaiting(autoHours);
|
2012-09-18 20:53:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::onWaitButtonClicked(MyGUI::Widget* sender)
|
|
|
|
{
|
2013-02-16 13:35:03 -05:00
|
|
|
startWaiting(mManualHours);
|
2012-09-19 02:53:06 +02:00
|
|
|
}
|
|
|
|
|
2013-02-16 13:35:03 -05:00
|
|
|
void WaitDialog::startWaiting(int hoursToWait)
|
2012-09-19 02:53:06 +02:00
|
|
|
{
|
2017-08-12 09:06:31 +04:00
|
|
|
if(Settings::Manager::getBool("autosave","Saves")) //autosaves when enabled
|
2014-05-22 11:03:45 +02:00
|
|
|
MWBase::Environment::get().getStateManager()->quickSave("Autosave");
|
|
|
|
|
2014-01-14 07:40:17 +01:00
|
|
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
2015-03-08 13:07:29 +13:00
|
|
|
MWBase::Environment::get().getWindowManager()->fadeScreenOut(0.2f);
|
|
|
|
mFadeTimeRemaining = 0.4f;
|
2012-09-19 02:53:06 +02:00
|
|
|
setVisible(false);
|
2013-03-25 11:53:02 +01:00
|
|
|
|
2013-02-16 13:35:03 -05:00
|
|
|
mHours = hoursToWait;
|
2013-03-25 11:53:02 +01:00
|
|
|
|
2014-01-14 07:40:17 +01:00
|
|
|
// FIXME: move this somewhere else?
|
|
|
|
mInterruptAt = -1;
|
|
|
|
MWWorld::Ptr player = world->getPlayerPtr();
|
|
|
|
if (mSleeping && player.getCell()->isExterior())
|
|
|
|
{
|
2014-02-21 11:35:46 +01:00
|
|
|
std::string regionstr = player.getCell()->getCell()->mRegion;
|
2014-01-14 07:40:17 +01:00
|
|
|
if (!regionstr.empty())
|
|
|
|
{
|
|
|
|
const ESM::Region *region = world->getStore().get<ESM::Region>().find (regionstr);
|
|
|
|
if (!region->mSleepList.empty())
|
|
|
|
{
|
2015-03-15 14:07:47 +13:00
|
|
|
// figure out if player will be woken while sleeping
|
2015-05-23 20:33:44 +02:00
|
|
|
int x = Misc::Rng::rollDice(hoursToWait);
|
2018-08-29 18:38:12 +03:00
|
|
|
float fSleepRandMod = world->getStore().get<ESM::GameSetting>().find("fSleepRandMod")->mValue.getFloat();
|
2015-09-07 22:31:11 +02:00
|
|
|
if (x < fSleepRandMod * hoursToWait)
|
2014-01-14 07:40:17 +01:00
|
|
|
{
|
2018-08-29 18:38:12 +03:00
|
|
|
float fSleepRestMod = world->getStore().get<ESM::GameSetting>().find("fSleepRestMod")->mValue.getFloat();
|
2015-09-07 22:31:11 +02:00
|
|
|
int interruptAtHoursRemaining = int(fSleepRestMod * hoursToWait);
|
|
|
|
if (interruptAtHoursRemaining != 0)
|
|
|
|
{
|
|
|
|
mInterruptAt = hoursToWait - interruptAtHoursRemaining;
|
|
|
|
mInterruptCreatureList = region->mSleepList;
|
|
|
|
}
|
2014-01-14 07:40:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-07 04:05:28 +01:00
|
|
|
mProgressBar.setProgress (0, hoursToWait);
|
2012-09-18 20:53:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::onCancelButtonClicked(MyGUI::Widget* sender)
|
|
|
|
{
|
2017-09-23 15:06:11 +02:00
|
|
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Rest);
|
2012-09-18 20:53:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position)
|
|
|
|
{
|
2015-01-10 03:01:01 +01:00
|
|
|
mHourText->setCaptionWithReplacing (MyGUI::utility::toString(position+1) + " #{sRestMenu2}");
|
2013-02-16 13:35:03 -05:00
|
|
|
mManualHours = position+1;
|
2019-06-09 02:08:09 +03:00
|
|
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mWaitButton);
|
2017-09-27 00:04:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::onKeyButtonPressed(MyGUI::Widget *sender, MyGUI::KeyCode key, MyGUI::Char character)
|
|
|
|
{
|
|
|
|
if (key == MyGUI::KeyCode::ArrowDown)
|
|
|
|
mHourSlider->setScrollPosition(std::min(mHourSlider->getScrollPosition()+1, mHourSlider->getScrollRange()-1));
|
|
|
|
else if (key == MyGUI::KeyCode::ArrowUp)
|
|
|
|
mHourSlider->setScrollPosition(std::max(static_cast<int>(mHourSlider->getScrollPosition())-1, 0));
|
|
|
|
else
|
|
|
|
return;
|
|
|
|
onHourSliderChangedPosition(mHourSlider, mHourSlider->getScrollPosition());
|
2012-09-18 20:53:32 +02:00
|
|
|
}
|
|
|
|
|
2015-02-07 04:05:28 +01:00
|
|
|
void WaitDialog::onWaitingProgressChanged(int cur, int total)
|
|
|
|
{
|
|
|
|
mProgressBar.setProgress(cur, total);
|
2019-01-25 20:04:35 +04:00
|
|
|
MWBase::Environment::get().getMechanicsManager()->rest(1, mSleeping);
|
2016-07-06 00:20:23 +02:00
|
|
|
MWBase::Environment::get().getWorld()->advanceTime(1);
|
2016-07-06 00:15:25 +02:00
|
|
|
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
if (player.getClass().getCreatureStats(player).isDead())
|
|
|
|
stopWaiting();
|
2015-02-07 04:05:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::onWaitingInterrupted()
|
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sSleepInterrupt}");
|
|
|
|
MWBase::Environment::get().getWorld()->spawnRandomCreature(mInterruptCreatureList);
|
|
|
|
stopWaiting();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::onWaitingFinished()
|
|
|
|
{
|
|
|
|
stopWaiting();
|
|
|
|
|
2015-08-21 21:12:39 +12:00
|
|
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
2015-02-07 04:05:28 +01:00
|
|
|
const MWMechanics::NpcStats &pcstats = player.getClass().getNpcStats(player);
|
|
|
|
|
|
|
|
// trigger levelup if possible
|
|
|
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
2018-08-29 18:38:12 +03:00
|
|
|
if (mSleeping && pcstats.getLevelProgress () >= gmst.find("iLevelUpTotal")->mValue.getInteger())
|
2015-02-07 04:05:28 +01:00
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode (GM_Levelup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-18 20:53:32 +02:00
|
|
|
void WaitDialog::setCanRest (bool canRest)
|
|
|
|
{
|
2015-08-21 21:12:39 +12:00
|
|
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
2014-05-22 20:37:22 +02:00
|
|
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
2014-08-11 20:07:49 +02:00
|
|
|
bool full = (stats.getHealth().getCurrent() >= stats.getHealth().getModified())
|
2013-07-30 22:07:27 +02:00
|
|
|
&& (stats.getMagicka().getCurrent() >= stats.getMagicka().getModified());
|
2014-05-22 20:37:22 +02:00
|
|
|
MWMechanics::NpcStats& npcstats = player.getClass().getNpcStats(player);
|
2013-08-08 18:30:47 -07:00
|
|
|
bool werewolf = npcstats.isWerewolf();
|
2013-07-30 22:07:27 +02:00
|
|
|
|
|
|
|
mUntilHealedButton->setVisible(canRest && !full);
|
2012-09-18 20:53:32 +02:00
|
|
|
mWaitButton->setCaptionWithReplacing (canRest ? "#{sRest}" : "#{sWait}");
|
2013-08-08 18:30:47 -07:00
|
|
|
mRestText->setCaptionWithReplacing (canRest ? "#{sRestMenu3}"
|
|
|
|
: (werewolf ? "#{sWerewolfRestMessage}"
|
|
|
|
: "#{sRestIllegal}"));
|
2012-09-19 02:53:06 +02:00
|
|
|
|
|
|
|
mSleeping = canRest;
|
|
|
|
|
2014-09-13 04:07:40 +02:00
|
|
|
Gui::Box* box = dynamic_cast<Gui::Box*>(mMainWidget);
|
2018-10-09 10:21:12 +04:00
|
|
|
if (box == nullptr)
|
2014-09-13 04:07:40 +02:00
|
|
|
throw std::runtime_error("main widget must be a box");
|
|
|
|
box->notifyChildrenSizeChanged();
|
2012-09-19 02:53:06 +02:00
|
|
|
center();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::onFrame(float dt)
|
|
|
|
{
|
2015-02-07 04:05:28 +01:00
|
|
|
mTimeAdvancer.onFrame(dt);
|
2012-09-19 02:53:06 +02:00
|
|
|
|
2015-02-07 04:05:28 +01:00
|
|
|
if (mFadeTimeRemaining <= 0)
|
|
|
|
return;
|
2014-01-14 07:40:17 +01:00
|
|
|
|
2015-02-07 04:05:28 +01:00
|
|
|
mFadeTimeRemaining -= dt;
|
2012-09-19 02:53:06 +02:00
|
|
|
|
2015-02-07 04:05:28 +01:00
|
|
|
if (mFadeTimeRemaining <= 0)
|
2012-09-19 02:53:06 +02:00
|
|
|
{
|
2015-02-07 04:05:28 +01:00
|
|
|
mProgressBar.setVisible(true);
|
|
|
|
mTimeAdvancer.run(mHours, mInterruptAt);
|
2014-05-22 11:08:36 +02:00
|
|
|
}
|
2012-09-19 02:53:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void WaitDialog::stopWaiting ()
|
|
|
|
{
|
2015-03-08 13:07:29 +13:00
|
|
|
MWBase::Environment::get().getWindowManager()->fadeScreenIn(0.2f);
|
2012-09-19 02:53:06 +02:00
|
|
|
mProgressBar.setVisible (false);
|
2013-04-10 00:32:05 -04:00
|
|
|
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_Rest);
|
2015-02-07 04:05:28 +01:00
|
|
|
mTimeAdvancer.stop();
|
2014-04-23 23:12:30 -04:00
|
|
|
}
|
|
|
|
|
2012-09-18 20:53:32 +02:00
|
|
|
|
2012-09-29 09:41:34 +02:00
|
|
|
void WaitDialog::wakeUp ()
|
|
|
|
{
|
|
|
|
mSleeping = false;
|
2018-06-10 17:47:05 +03:00
|
|
|
if (mInterruptAt != -1)
|
|
|
|
onWaitingInterrupted();
|
|
|
|
else
|
|
|
|
stopWaiting();
|
2012-09-29 09:41:34 +02:00
|
|
|
}
|
|
|
|
|
2012-09-18 18:29:03 +02:00
|
|
|
}
|