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 onOpen();
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  void setPtr(const MWWorld::Ptr &ptr);
31 
32  virtual void onOpen();
33 
34  virtual bool exit();
35 
36  virtual void clear();
37 
38  void onFrame(float dt);
39 
40  bool getSleeping() { return mTimeAdvancer.isRunning() && mSleeping; }
41  void wakeUp();
42  void autosave();
43 
45 
46  protected:
47  MyGUI::TextBox* mDateTimeText;
48  MyGUI::TextBox* mRestText;
49  MyGUI::TextBox* mHourText;
50  MyGUI::Button* mUntilHealedButton;
51  MyGUI::Button* mWaitButton;
52  MyGUI::Button* mCancelButton;
53  MyGUI::ScrollBar* mHourSlider;
54 
56  bool mSleeping;
57  int mHours;
58  int mManualHours; // stores the hours to rest selected via slider
60 
63 
65 
66  void onUntilHealedButtonClicked(MyGUI::Widget* sender);
67  void onWaitButtonClicked(MyGUI::Widget* sender);
68  void onCancelButtonClicked(MyGUI::Widget* sender);
69  void onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position);
70  void onKeyButtonPressed(MyGUI::Widget* sender, MyGUI::KeyCode key, MyGUI::Char character);
71 
72  void onWaitingProgressChanged(int cur, int total);
73  void onWaitingInterrupted();
74  void onWaitingFinished();
75 
76  void setCanRest(bool canRest);
77 
78  void startWaiting(int hoursToWait);
79  void stopWaiting();
80  };
81 
82 }
83 
84 #endif
virtual bool exit()
Gracefully exits the window.
Definition: waitdialog.cpp:94
void setCanRest(bool canRest)
Definition: waitdialog.cpp:266
void stopWaiting()
Definition: waitdialog.cpp:306
MyGUI::Button * mCancelButton
Definition: waitdialog.hpp:52
MyGUI::Button * mWaitButton
Definition: waitdialog.hpp:51
int mHours
Definition: waitdialog.hpp:57
Definition: waitdialog.hpp:25
int mInterruptAt
Definition: waitdialog.hpp:61
MyGUI::ProgressBar * mProgressBar
Definition: waitdialog.hpp:21
Definition: waitdialog.hpp:11
WaitDialog()
Definition: waitdialog.cpp:52
void onWaitingFinished()
Definition: waitdialog.cpp:250
void onHourSliderChangedPosition(MyGUI::ScrollBar *sender, size_t position)
Definition: waitdialog.cpp:214
WaitDialogProgressBar mProgressBar
Definition: waitdialog.hpp:64
WaitDialogProgressBar()
Definition: waitdialog.cpp:31
virtual void onOpen()
Notify that window has been made visible.
Definition: waitdialog.cpp:105
MyGUI::TextBox * mRestText
Definition: waitdialog.hpp:48
MyGUI::ScrollBar * mHourSlider
Definition: waitdialog.hpp:53
void onWaitButtonClicked(MyGUI::Widget *sender)
Definition: waitdialog.cpp:161
virtual void clear()
Clear any state specific to the running game.
Definition: waitdialog.cpp:99
int mManualHours
Definition: waitdialog.hpp:58
TimeAdvancer mTimeAdvancer
Definition: waitdialog.hpp:55
void onWaitingProgressChanged(int cur, int total)
Definition: waitdialog.cpp:232
MyGUI::TextBox * mHourText
Definition: waitdialog.hpp:49
MyGUI::TextBox * mProgressText
Definition: waitdialog.hpp:22
void setProgress(int cur, int total)
Definition: waitdialog.cpp:43
std::string mInterruptCreatureList
Definition: waitdialog.hpp:62
void setPtr(const MWWorld::Ptr &ptr)
Open this object in the GUI, for windows that support it.
Definition: waitdialog.cpp:84
void onKeyButtonPressed(MyGUI::Widget *sender, MyGUI::KeyCode key, MyGUI::Char character)
Definition: waitdialog.cpp:221
virtual void onOpen()
Notify that window has been made visible.
Definition: waitdialog.cpp:38
void onCancelButtonClicked(MyGUI::Widget *sender)
Definition: waitdialog.cpp:209
void onWaitingInterrupted()
Definition: waitdialog.cpp:243
Definition: windowbase.hpp:21
bool getSleeping()
Definition: waitdialog.hpp:40
float mFadeTimeRemaining
Definition: waitdialog.hpp:59
MyGUI::TextBox * mDateTimeText
Definition: waitdialog.hpp:47
bool isRunning()
Definition: timeadvancer.cpp:69
void onUntilHealedButtonClicked(MyGUI::Widget *sender)
Definition: waitdialog.cpp:154
MyGUI::Button * mUntilHealedButton
Definition: waitdialog.hpp:50
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
void startWaiting(int hoursToWait)
Definition: waitdialog.cpp:166
Definition: timeadvancer.hpp:8
bool mSleeping
Definition: waitdialog.hpp:56
void wakeUp()
Definition: waitdialog.cpp:315
void onFrame(float dt)
Called every frame if the window is in an active GUI mode.
Definition: waitdialog.cpp:290
KeyCode
Keyboard scan codes.
Definition: OISCompat.hpp:10
WindowBase * getProgressBar()
Definition: waitdialog.hpp:44