aboutsummaryrefslogtreecommitdiff
path: root/scumm/dialogs.h
diff options
context:
space:
mode:
authorMax Horn2005-03-06 18:00:54 +0000
committerMax Horn2005-03-06 18:00:54 +0000
commita0d5debc7a8f4b24b6888de668d18fa8e0aedab9 (patch)
tree376f92d6891a17f33b9bc1208b8e881bec97c669 /scumm/dialogs.h
parente55d31ba39cab6384bfae0cac12ab4e9013a0b06 (diff)
downloadscummvm-rg350-a0d5debc7a8f4b24b6888de668d18fa8e0aedab9.tar.gz
scummvm-rg350-a0d5debc7a8f4b24b6888de668d18fa8e0aedab9.tar.bz2
scummvm-rg350-a0d5debc7a8f4b24b6888de668d18fa8e0aedab9.zip
Added dialogs which are shown when you modify the talkspeed or music volume using hotkeys (FR #1153300)
svn-id: r17009
Diffstat (limited to 'scumm/dialogs.h')
-rw-r--r--scumm/dialogs.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/scumm/dialogs.h b/scumm/dialogs.h
index e9eedeecb3..05ba1c08d7 100644
--- a/scumm/dialogs.h
+++ b/scumm/dialogs.h
@@ -119,6 +119,12 @@ protected:
GUI::CheckboxWidget *subtitlesCheckbox;
};
+/**
+ * A dialog which displays an arbitrary message to the user and returns
+ * ther users reply as its result value. More specifically, it returns
+ * the ASCII code of the key used to close the dialog (0 if a mouse
+ * click closed the dialog).
+ */
class InfoDialog : public ScummDialog {
public:
// arbitrary message
@@ -127,6 +133,7 @@ public:
InfoDialog(ScummEngine *scumm, int res);
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
+ setResult(0);
close();
}
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers) {
@@ -138,18 +145,56 @@ protected:
void setInfoText (const String& message);
};
+/**
+ * The pause dialog, visible whenever the user activates pause mode. Goes
+ * away uon any key or mouse button press.
+ */
class PauseDialog : public InfoDialog {
public:
PauseDialog(ScummEngine *scumm, int res);
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
};
+/**
+ * A simple yes/no dialog, used to ask the user whether to really
+ * quit/restart ScummVM.
+ */
class ConfirmDialog : public InfoDialog {
public:
ConfirmDialog(ScummEngine *scumm, const String& message);
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
};
+/**
+ * A dialog used to display the music volume / text speed.
+ * Given a label string, and a float value in the range of 0.0 to 1.0,
+ * it will display a corresponding graphic.
+ * Automatically closes after a brief time passed.
+ */
+class ValueDisplayDialog : public GUI::Dialog {
+public:
+ ValueDisplayDialog(const Common::String& label, int minVal, int maxVal, int val, uint16 incKey, uint16 decKey);
+
+ void drawDialog();
+ void handleTickle();
+
+ virtual void handleMouseDown(int x, int y, int button, int clickCount) {
+ close();
+ }
+ virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
+
+protected:
+ enum {
+ kPercentBarWidth = 50,
+ kDisplayDelay = 1500
+ };
+ Common::String _label;
+ const int _min, _max;
+ const uint16 _incKey, _decKey;
+ int _value;
+ uint32 _timer;
+};
+
} // End of namespace Scumm
#endif