1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/apps/openmw/mwgui/waitdialog.hpp

85 lines
2.0 KiB
C++
Raw Normal View History

2012-09-18 18:29:03 +02:00
#ifndef MWGUI_WAIT_DIALOG_H
#define MWGUI_WAIT_DIALOG_H
#include "timeadvancer.hpp"
#include "windowbase.hpp"
2012-09-18 18:29:03 +02: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 18:29:03 +02:00
{
public:
WaitDialog();
2012-09-18 18:29:03 +02:00
void setPtr(const MWWorld::Ptr &ptr) override;
2017-09-23 15:06:11 +02:00
void onOpen() override;
2012-09-18 18:29:03 +02:00
bool exit() override;
void clear() override;
void onFrame(float dt) override;
bool getSleeping() { return mTimeAdvancer.isRunning() && mSleeping; }
2012-09-29 09:41:34 +02:00
void wakeUp();
void autosave();
2012-09-19 03:11:23 +02:00
WindowBase* getProgressBar() { return &mProgressBar; }
2012-09-18 20:53:32 +02: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 20:53:32 +02: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 20:53:32 +02: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 20:53:32 +02:00
void onWaitingProgressChanged(int cur, int total);
void onWaitingInterrupted();
void onWaitingFinished();
2012-09-18 20:53:32 +02:00
void setCanRest(bool canRest);
void startWaiting(int hoursToWait);
void stopWaiting();
2012-09-18 18:29:03 +02:00
};
}
#endif