1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-11 00:39:59 +00:00
OpenMW/apps/openmw/mwgui/waitdialog.hpp

80 lines
1.8 KiB
C++
Raw Normal View History

2012-09-18 16:29:03 +00:00
#ifndef MWGUI_WAIT_DIALOG_H
#define MWGUI_WAIT_DIALOG_H
#include "timeadvancer.hpp"
#include "windowbase.hpp"
2012-09-18 16:29:03 +00:00
namespace MWGui
{
class WaitDialogProgressBar : public WindowBase
{
public:
WaitDialogProgressBar();
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:
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
virtual void exit();
void onFrame(float dt);
void bedActivated() { setCanRest(true); }
bool getSleeping() { return mTimeAdvancer.isRunning() && mSleeping; }
2012-09-29 07:41:34 +00:00
void wakeUp();
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;
MyGUI::ScrollBar* mHourSlider;
2012-09-18 18:53:32 +00:00
TimeAdvancer mTimeAdvancer;
bool mSleeping;
int mHours;
int mManualHours; // stores the hours to rest selected via slider
float mFadeTimeRemaining;
int mInterruptAt;
std::string mInterruptCreatureList;
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);
void onWaitingProgressChanged(int cur, int total);
void onWaitingInterrupted();
void onWaitingFinished();
2012-09-18 18:53:32 +00:00
void setCanRest(bool canRest);
void startWaiting(int hoursToWait);
void stopWaiting();
2012-09-18 16:29:03 +00:00
};
}
#endif