XEEN: RU change hotkeys in dialogs_char_info, dialogs_control_panel

This commit is contained in:
Maxim Kovalenko 2021-07-19 18:57:29 +03:00 committed by Eugene Sandulenko
parent 9f80f452e4
commit 15063fb740
2 changed files with 62 additions and 15 deletions

View File

@ -175,6 +175,10 @@ void CharacterInfo::execute(int charIndex) {
break;
}
case Common::KEYCODE_c:
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_e:
if (oldMode == MODE_COMBAT) {
ErrorScroll::show(_vm, Res.EXCHANGING_IN_COMBAT, WT_FREEZE_WAIT);
@ -186,6 +190,10 @@ void CharacterInfo::execute(int charIndex) {
}
break;
case Common::KEYCODE_d:
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_i:
_vm->_mode = oldMode;
_vm->_combat->_itemFlag = _vm->_mode == MODE_COMBAT;
@ -200,6 +208,10 @@ void CharacterInfo::execute(int charIndex) {
redrawFlag = true;
break;
case Common::KEYCODE_COMMA:
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_q:
QuickReferenceDialog::show(_vm);
redrawFlag = true;
@ -271,9 +283,15 @@ void CharacterInfo::addButtons() {
addButton(Common::Rect(177, 70, 201, 90), 1018, &_iconSprites);
addButton(Common::Rect(177, 93, 201, 113), 1019, &_iconSprites);
addButton(Common::Rect(177, 116, 201, 136), 1020, &_iconSprites);
addButton(Common::Rect(285, 11, 309, 31), Common::KEYCODE_i, &_iconSprites);
addButton(Common::Rect(285, 43, 309, 63), Common::KEYCODE_q, &_iconSprites);
addButton(Common::Rect(285, 75, 309, 95), Common::KEYCODE_e, &_iconSprites);
if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) {
addButton(Common::Rect(285, 11, 309, 31), Common::KEYCODE_d, &_iconSprites); // russian key Â
addButton(Common::Rect(285, 43, 309, 63), Common::KEYCODE_COMMA, &_iconSprites); // russian key Á
addButton(Common::Rect(285, 75, 309, 95), Common::KEYCODE_c, &_iconSprites); // russian key Ñ
} else {
addButton(Common::Rect(285, 11, 309, 31), Common::KEYCODE_i, &_iconSprites);
addButton(Common::Rect(285, 43, 309, 63), Common::KEYCODE_q, &_iconSprites);
addButton(Common::Rect(285, 75, 309, 95), Common::KEYCODE_e, &_iconSprites);
}
addButton(Common::Rect(285, 107, 309, 127), Common::KEYCODE_ESCAPE, &_iconSprites);
addPartyButtons(_vm);
}

View File

@ -20,6 +20,7 @@
*
*/
#include "common/config-manager.h"
#include "xeen/dialogs/dialogs_control_panel.h"
#include "xeen/dialogs/dialogs_query.h"
#include "xeen/party.h"
@ -84,6 +85,10 @@ int ControlPanel::execute() {
} while (!_buttonValue && events.timeElapsed() < 2);
switch (_buttonValue) {
case Common::KEYCODE_d:
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_q:
if (Confirm::show(g_vm, Res.CONFIRM_QUIT)) {
g_vm->_gameMode = GMODE_QUIT;
@ -91,6 +96,12 @@ int ControlPanel::execute() {
}
break;
case Common::KEYCODE_g:
// Goober cheat sequence
debugCtr = 1;
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_w:
if (Confirm::show(g_vm, Res.MR_WIZARD)) {
w.close();
@ -114,6 +125,10 @@ int ControlPanel::execute() {
}
break;
case Common::KEYCODE_p:
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_l:
if (_vm->_mode == MODE_COMBAT) {
ErrorScroll::show(_vm, Res.NO_LOADING_IN_COMBAT);
@ -123,6 +138,10 @@ int ControlPanel::execute() {
}
break;
case Common::KEYCODE_c:
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_s:
if (_vm->_mode == MODE_COMBAT) {
ErrorScroll::show(_vm, Res.NO_SAVING_IN_COMBAT);
@ -136,6 +155,10 @@ int ControlPanel::execute() {
sound.setFxOn(!sound._fxOn);
break;
case Common::KEYCODE_v:
if (Common::RU_RUS != Common::parseLanguage(ConfMan.get("language"))) {
break;
}
case Common::KEYCODE_m:
sound.setMusicOn(!sound._musicOn);
break;
@ -145,9 +168,6 @@ int ControlPanel::execute() {
break;
// Goober cheat sequence
case Common::KEYCODE_g:
debugCtr = 1;
break;
case Common::KEYCODE_o:
debugCtr = (debugCtr == 1 || debugCtr == 2) ? 2 : 0;
break;
@ -181,18 +201,27 @@ int ControlPanel::execute() {
void ControlPanel::loadButtons() {
_iconSprites.load("cpanel.icn");
if (Common::RU_RUS == Common::parseLanguage(ConfMan.get("language"))) {
addButton(Common::Rect(214, 56, 244, 69), Common::KEYCODE_e, 0, &_iconSprites); // russian key Ó
addButton(Common::Rect(214, 75, 244, 88), Common::KEYCODE_v, 0, &_iconSprites); // russian key Ì
addButton(Common::Rect(135, 56, 165, 69), Common::KEYCODE_p, 0, &_iconSprites); // russian key Ç
addButton(Common::Rect(135, 75, 165, 88), Common::KEYCODE_c, 0, &_iconSprites); // russian key Ñ
addButton(Common::Rect(135, 94, 165, 107), Common::KEYCODE_d, 0, &_iconSprites); // russian key Â
addButton(Common::Rect(175, 113, 205, 126), Common::KEYCODE_g, 0, &_iconSprites); // russian key Ï
} else {
addButton(Common::Rect(214, 56, 244, 69), Common::KEYCODE_e, 0, &_iconSprites);
addButton(Common::Rect(214, 75, 244, 88), Common::KEYCODE_m, 0, &_iconSprites);
addButton(Common::Rect(135, 56, 165, 69), Common::KEYCODE_l, 0, &_iconSprites);
addButton(Common::Rect(135, 75, 165, 88), Common::KEYCODE_s, 0, &_iconSprites);
addButton(Common::Rect(214, 56, 244, 69), Common::KEYCODE_e, 0, &_iconSprites);
addButton(Common::Rect(214, 75, 244, 88), Common::KEYCODE_m, 0, &_iconSprites);
addButton(Common::Rect(135, 56, 165, 69), Common::KEYCODE_l, 0, &_iconSprites);
addButton(Common::Rect(135, 75, 165, 88), Common::KEYCODE_s, 0, &_iconSprites);
// For ScummVM we've merged both Save and Save As into a single
// save item, so we don't need this one
addButton(Common::Rect(), 0);
// For ScummVM we've merged both Save and Save As into a single
// save item, so we don't need this one
addButton(Common::Rect(), 0);
addButton(Common::Rect(135, 94, 165, 107), Common::KEYCODE_q, 0, &_iconSprites);
addButton(Common::Rect(175, 113, 205, 126), Common::KEYCODE_w, 0, &_iconSprites);
addButton(Common::Rect(135, 94, 165, 107), Common::KEYCODE_q, 0, &_iconSprites);
addButton(Common::Rect(175, 113, 205, 126), Common::KEYCODE_w, 0, &_iconSprites);
}
}
Common::String ControlPanel::getButtonText() {