1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 23:19:56 +00:00
openmw-tes3mp/apps/openmw/mwgui/waitdialog.hpp

85 lines
2 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();
void onOpen() override;
void setProgress(int cur, int total);
protected:
MyGUI::ProgressBar* mProgressBar;
MyGUI::TextBox* mProgressText;
};
class WaitDialog : public WindowBase
2012-09-18 16:29:03 +00:00
{
public:
WaitDialog();
2012-09-18 16:29:03 +00:00
void setPtr(const MWWorld::Ptr &ptr) override;
2017-09-23 13:06:11 +00:00
void onOpen() override;
2012-09-18 16:29:03 +00:00
bool exit() override;
void clear() override;
void onFrame(float dt) override;
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
WindowBase* getProgressBar() { return &mProgressBar; }
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 onKeyButtonPressed(MyGUI::Widget* sender, MyGUI::KeyCode key, MyGUI::Char character);
2012-09-18 18:53:32 +00:00
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