diff options
author | Max Horn | 2007-06-30 12:26:59 +0000 |
---|---|---|
committer | Max Horn | 2007-06-30 12:26:59 +0000 |
commit | 2243197f502c06076f493151429e3188b9c2a760 (patch) | |
tree | e80f331d5cdd944cec632a74dd081a166858b093 /engines/scumm | |
parent | 9720742722bc61bb3cb0c8240417816855ea4ef7 (diff) | |
download | scummvm-rg350-2243197f502c06076f493151429e3188b9c2a760.tar.gz scummvm-rg350-2243197f502c06076f493151429e3188b9c2a760.tar.bz2 scummvm-rg350-2243197f502c06076f493151429e3188b9c2a760.zip |
Changed GUI system to use Common::KeyState state
svn-id: r27786
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/dialogs.cpp | 32 | ||||
-rw-r--r-- | engines/scumm/dialogs.h | 14 |
2 files changed, 23 insertions, 23 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 85a7a4b675..16fe72531b 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -825,26 +825,26 @@ PauseDialog::PauseDialog(ScummEngine *scumm, int res) : InfoDialog(scumm, res) { } -void PauseDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { - if (ascii == ' ') // Close pause dialog if space key is pressed +void PauseDialog::handleKeyDown(Common::KeyState state) { + if (state.ascii == ' ') // Close pause dialog if space key is pressed close(); else - ScummDialog::handleKeyDown(ascii, keycode, modifiers); + ScummDialog::handleKeyDown(state); } ConfirmDialog::ConfirmDialog(ScummEngine *scumm, int res) : InfoDialog(scumm, res) { } -void ConfirmDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { - if (tolower(ascii) == 'n') { +void ConfirmDialog::handleKeyDown(Common::KeyState state) { + if (state.keycode == Common::KEYCODE_n) { setResult(0); close(); - } else if (tolower(ascii) == 'y') { + } else if (state.keycode == Common::KEYCODE_y) { setResult(1); close(); } else - ScummDialog::handleKeyDown(ascii, keycode, modifiers); + ScummDialog::handleKeyDown(state); } #pragma mark - @@ -892,11 +892,11 @@ void ValueDisplayDialog::reflowLayout() { _h = height; } -void ValueDisplayDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { - if (ascii == _incKey || ascii == _decKey) { - if (ascii == _incKey && _value < _max) +void ValueDisplayDialog::handleKeyDown(Common::KeyState state) { + if (state.ascii == _incKey || state.ascii == _decKey) { + if (state.ascii == _incKey && _value < _max) _value++; - else if (ascii == _decKey && _value > _min) + else if (state.ascii == _decKey && _value > _min) _value--; setResult(_value); @@ -924,8 +924,8 @@ void SubtitleSettingsDialog::handleTickle() { close(); } -void SubtitleSettingsDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { - if (keycode == 't' && modifiers == Common::KBD_CTRL) { +void SubtitleSettingsDialog::handleKeyDown(Common::KeyState state) { + if (state.keycode == 't' && state.flags == Common::KBD_CTRL) { cycleValue(); reflowLayout(); @@ -959,11 +959,11 @@ Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text) : InfoDialog(scumm, text) { } -void Indy3IQPointsDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { - if (ascii == 'i') +void Indy3IQPointsDialog::handleKeyDown(Common::KeyState state) { + if (state.ascii == 'i') close(); else - ScummDialog::handleKeyDown(ascii, keycode, modifiers); + ScummDialog::handleKeyDown(state); } } // End of namespace Scumm diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index b69e989f8a..23c63d8992 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -169,8 +169,8 @@ public: setResult(0); close(); } - virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers) { - setResult(ascii); + virtual void handleKeyDown(Common::KeyState state) { + setResult(state.ascii); close(); } @@ -189,7 +189,7 @@ protected: class PauseDialog : public InfoDialog { public: PauseDialog(ScummEngine *scumm, int res); - virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); + virtual void handleKeyDown(Common::KeyState state); }; /** @@ -199,7 +199,7 @@ public: class ConfirmDialog : public InfoDialog { public: ConfirmDialog(ScummEngine *scumm, int res); - virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); + virtual void handleKeyDown(Common::KeyState state); }; /** @@ -216,7 +216,7 @@ public: virtual void handleMouseDown(int x, int y, int button, int clickCount) { close(); } - virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); + virtual void handleKeyDown(Common::KeyState state); virtual void reflowLayout(); @@ -247,7 +247,7 @@ public: virtual void handleMouseDown(int x, int y, int button, int clickCount) { close(); } - virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); + virtual void handleKeyDown(Common::KeyState state); protected: int _value; uint32 _timer; @@ -259,7 +259,7 @@ protected: class Indy3IQPointsDialog : public InfoDialog { public: Indy3IQPointsDialog(ScummEngine *scumm, char* text); - virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); + virtual void handleKeyDown(Common::KeyState state); }; } // End of namespace Scumm |