Skip to content

Commit

Permalink
SCUMM: Added support for localization in Y/N dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 20, 2011
1 parent 52147dc commit 4294c6c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions engines/scumm/dialogs.cpp
Expand Up @@ -23,6 +23,7 @@
#include "common/savefile.h"
#include "common/system.h"
#include "common/events.h"
#include "common/localization.h"
#include "common/translation.h"

#include "graphics/scaler.h"
Expand Down Expand Up @@ -482,10 +483,14 @@ ConfirmDialog::ConfirmDialog(ScummEngine *scumm, int res)
}

void ConfirmDialog::handleKeyDown(Common::KeyState state) {
if (state.keycode == Common::KEYCODE_n || state.ascii == _noKey) {
Common::KeyCode keyYes, keyNo;

Common::getLanguageYesNo(Common::parseLanguageFromLocale(TransMan.getCurrentLanguage().c_str()), keyYes, keyNo);

if (state.keycode == Common::KEYCODE_n || state.ascii == _noKey || state.ascii == keyNo) {
setResult(0);
close();
} else if (state.keycode == Common::KEYCODE_y || state.ascii == _yesKey) {
} else if (state.keycode == Common::KEYCODE_y || state.ascii == _yesKey || state.ascii == keyYes) {
setResult(1);
close();
} else
Expand Down

0 comments on commit 4294c6c

Please sign in to comment.