2012-09-18 16:29:03 +00:00
|
|
|
#ifndef MWGUI_WAIT_DIALOG_H
|
|
|
|
#define MWGUI_WAIT_DIALOG_H
|
|
|
|
|
2015-02-07 03:05:28 +00:00
|
|
|
#include "timeadvancer.hpp"
|
|
|
|
|
2013-04-10 04:32:05 +00:00
|
|
|
#include "windowbase.hpp"
|
2012-09-18 16:29:03 +00:00
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
2012-09-19 00:53:06 +00:00
|
|
|
class WaitDialogProgressBar : public WindowBase
|
|
|
|
{
|
|
|
|
public:
|
2013-04-10 18:46:21 +00:00
|
|
|
WaitDialogProgressBar();
|
2012-09-19 00:53:06 +00:00
|
|
|
|
|
|
|
virtual void open();
|
|
|
|
|
|
|
|
void setProgress(int cur, int total);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
MyGUI::ProgressBar* mProgressBar;
|
|
|
|
MyGUI::TextBox* mProgressText;
|
|
|
|
};
|
|
|
|
|
2012-09-18 16:29:03 +00:00
|
|
|
class WaitDialog : public WindowBase
|
|
|
|
{
|
|
|
|
public:
|
2013-04-10 18:46:21 +00:00
|
|
|
WaitDialog();
|
2012-09-18 16:29:03 +00:00
|
|
|
|
2012-09-18 18:53:32 +00:00
|
|
|
virtual void open();
|
2012-09-18 16:29:03 +00:00
|
|
|
|
2014-05-27 03:13:37 +00:00
|
|
|
virtual void exit();
|
|
|
|
|
2012-09-19 00:53:06 +00:00
|
|
|
void onFrame(float dt);
|
|
|
|
|
|
|
|
void bedActivated() { setCanRest(true); }
|
|
|
|
|
2015-02-07 03:05:28 +00:00
|
|
|
bool getSleeping() { return mTimeAdvancer.isRunning() && mSleeping; }
|
2012-09-29 07:41:34 +00:00
|
|
|
void wakeUp();
|
2014-04-24 03:12:30 +00:00
|
|
|
void autosave();
|
2012-09-19 01:11:23 +00:00
|
|
|
|
2012-09-18 18:53:32 +00:00
|
|
|
protected:
|
|
|
|
MyGUI::TextBox* mDateTimeText;
|
|
|
|
MyGUI::TextBox* mRestText;
|
|
|
|
MyGUI::TextBox* mHourText;
|
|
|
|
MyGUI::Button* mUntilHealedButton;
|
|
|
|
MyGUI::Button* mWaitButton;
|
|
|
|
MyGUI::Button* mCancelButton;
|
2015-10-24 14:04:08 +00:00
|
|
|
MyGUI::ScrollBar* mHourSlider;
|
2012-09-18 18:53:32 +00:00
|
|
|
|
2015-02-07 03:05:28 +00:00
|
|
|
TimeAdvancer mTimeAdvancer;
|
2012-09-19 00:53:06 +00:00
|
|
|
bool mSleeping;
|
|
|
|
int mHours;
|
2013-02-16 18:35:03 +00:00
|
|
|
int mManualHours; // stores the hours to rest selected via slider
|
2015-02-07 03:05:28 +00:00
|
|
|
float mFadeTimeRemaining;
|
2012-09-19 00:53:06 +00:00
|
|
|
|
2014-01-14 06:40:17 +00:00
|
|
|
int mInterruptAt;
|
|
|
|
std::string mInterruptCreatureList;
|
|
|
|
|
2012-09-19 00:53:06 +00:00
|
|
|
WaitDialogProgressBar mProgressBar;
|
|
|
|
|
2012-09-18 18:53:32 +00:00
|
|
|
void onUntilHealedButtonClicked(MyGUI::Widget* sender);
|
|
|
|
void onWaitButtonClicked(MyGUI::Widget* sender);
|
|
|
|
void onCancelButtonClicked(MyGUI::Widget* sender);
|
|
|
|
void onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position);
|
|
|
|
|
2015-02-07 03:05:28 +00:00
|
|
|
void onWaitingProgressChanged(int cur, int total);
|
|
|
|
void onWaitingInterrupted();
|
|
|
|
void onWaitingFinished();
|
|
|
|
|
2012-09-18 18:53:32 +00:00
|
|
|
void setCanRest(bool canRest);
|
2012-09-19 00:53:06 +00:00
|
|
|
|
2013-02-16 18:35:03 +00:00
|
|
|
void startWaiting(int hoursToWait);
|
2012-09-19 00:53:06 +00:00
|
|
|
void stopWaiting();
|
2012-09-18 16:29:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|