diff options
-rw-r--r-- | scumm/dialogs.cpp | 10 | ||||
-rw-r--r-- | scumm/dialogs.h | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index 3effb415ff..75bfaeb6a7 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -608,9 +608,6 @@ ValueDisplayDialog::ValueDisplayDialog(const Common::String& label, int minVal, _x = (320 - width) / 2; _w = width; - setResult(_value); - - _timer = getMillis() + kDisplayDelay; } void ValueDisplayDialog::drawDialog() { @@ -646,11 +643,16 @@ void ValueDisplayDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) _timer = getMillis() + kDisplayDelay; draw(); } else { - setResult(_value); close(); } } +void ValueDisplayDialog::open() { + GUI::Dialog::open(); + setResult(_value); + _timer = getMillis() + kDisplayDelay; +} + } // End of namespace Scumm diff --git a/scumm/dialogs.h b/scumm/dialogs.h index 82ca94f3eb..faf4ad4bdc 100644 --- a/scumm/dialogs.h +++ b/scumm/dialogs.h @@ -173,9 +173,9 @@ 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 open(); + virtual void drawDialog(); + virtual void handleTickle(); virtual void handleMouseDown(int x, int y, int button, int clickCount) { close(); } |