OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
waitdialog.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_WAIT_DIALOG_H
2 #define MWGUI_WAIT_DIALOG_H
3 
4 #include "timeadvancer.hpp"
5 
6 #include "windowbase.hpp"
7 
8 namespace MWGui
9 {
10 
12  {
13  public:
15 
16  virtual void open();
17 
18  void setProgress(int cur, int total);
19 
20  protected:
21  MyGUI::ProgressBar* mProgressBar;
22  MyGUI::TextBox* mProgressText;
23  };
24 
25  class WaitDialog : public WindowBase
26  {
27  public:
28  WaitDialog();
29 
30  virtual void open();
31 
32  virtual void exit();
33 
34  void onFrame(float dt);
35 
36  void bedActivated() { setCanRest(true); }
37 
38  bool getSleeping() { return mTimeAdvancer.isRunning() && mSleeping; }
39  void wakeUp();
40  void autosave();
41 
42  protected:
43  MyGUI::TextBox* mDateTimeText;
44  MyGUI::TextBox* mRestText;
45  MyGUI::TextBox* mHourText;
46  MyGUI::Button* mUntilHealedButton;
47  MyGUI::Button* mWaitButton;
48  MyGUI::Button* mCancelButton;
49  MyGUI::ScrollBar* mHourSlider;
50 
52  bool mSleeping;
53  int mHours;
54  int mManualHours; // stores the hours to rest selected via slider
56 
59 
61 
62  void onUntilHealedButtonClicked(MyGUI::Widget* sender);
63  void onWaitButtonClicked(MyGUI::Widget* sender);
64  void onCancelButtonClicked(MyGUI::Widget* sender);
65  void onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position);
66 
67  void onWaitingProgressChanged(int cur, int total);
68  void onWaitingInterrupted();
69  void onWaitingFinished();
70 
71  void setCanRest(bool canRest);
72 
73  void startWaiting(int hoursToWait);
74  void stopWaiting();
75  };
76 
77 }
78 
79 #endif
void setCanRest(bool canRest)
Definition: waitdialog.cpp:223
virtual void open()
Notify that window has been made visible.
Definition: waitdialog.cpp:88
void stopWaiting()
Definition: waitdialog.cpp:263
MyGUI::Button * mCancelButton
Definition: waitdialog.hpp:48
MyGUI::Button * mWaitButton
Definition: waitdialog.hpp:47
int mHours
Definition: waitdialog.hpp:53
Definition: waitdialog.hpp:25
int mInterruptAt
Definition: waitdialog.hpp:57
MyGUI::ProgressBar * mProgressBar
Definition: waitdialog.hpp:21
Definition: waitdialog.hpp:11
WaitDialog()
Definition: waitdialog.cpp:52
void onWaitingFinished()
Definition: waitdialog.cpp:207
void onHourSliderChangedPosition(MyGUI::ScrollBar *sender, size_t position)
Definition: waitdialog.cpp:183
WaitDialogProgressBar mProgressBar
Definition: waitdialog.hpp:60
WaitDialogProgressBar()
Definition: waitdialog.cpp:31
MyGUI::TextBox * mRestText
Definition: waitdialog.hpp:44
virtual void open()
Notify that window has been made visible.
Definition: waitdialog.cpp:38
MyGUI::ScrollBar * mHourSlider
Definition: waitdialog.hpp:49
void onWaitButtonClicked(MyGUI::Widget *sender)
Definition: waitdialog.cpp:130
int mManualHours
Definition: waitdialog.hpp:54
TimeAdvancer mTimeAdvancer
Definition: waitdialog.hpp:51
void onWaitingProgressChanged(int cur, int total)
Definition: waitdialog.cpp:189
MyGUI::TextBox * mHourText
Definition: waitdialog.hpp:45
MyGUI::TextBox * mProgressText
Definition: waitdialog.hpp:22
void setProgress(int cur, int total)
Definition: waitdialog.cpp:43
std::string mInterruptCreatureList
Definition: waitdialog.hpp:58
void onCancelButtonClicked(MyGUI::Widget *sender)
Definition: waitdialog.cpp:178
void onWaitingInterrupted()
Definition: waitdialog.cpp:200
Definition: windowbase.hpp:16
bool getSleeping()
Definition: waitdialog.hpp:38
float mFadeTimeRemaining
Definition: waitdialog.hpp:55
MyGUI::TextBox * mDateTimeText
Definition: waitdialog.hpp:43
void bedActivated()
Definition: waitdialog.hpp:36
virtual void exit()
Gracefully exits the window.
Definition: waitdialog.cpp:82
bool isRunning()
Definition: timeadvancer.cpp:69
void onUntilHealedButtonClicked(MyGUI::Widget *sender)
Definition: waitdialog.cpp:123
MyGUI::Button * mUntilHealedButton
Definition: waitdialog.hpp:46
void startWaiting(int hoursToWait)
Definition: waitdialog.cpp:135
Definition: timeadvancer.hpp:8
bool mSleeping
Definition: waitdialog.hpp:52
void wakeUp()
Definition: waitdialog.cpp:273
void onFrame(float dt)
Definition: waitdialog.cpp:247