XEEN: RU Moving translated hotkeys to resources.

Hotkeys changed in locations, CoX Menu.
Margin fix
This commit is contained in:
Maxim Kovalenko 2021-07-19 19:00:12 +03:00 committed by Eugene Sandulenko
parent 2da836da6c
commit b655cfc03e
9 changed files with 187 additions and 113 deletions

View File

@ -555,6 +555,23 @@ void LangConstants::writeConstants(Common::String num, CCArchive &cc) {
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_WITH());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_GOLD());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_GEMS());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_BROWSE());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_BUY_SPELLS());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_SPELL_INFO());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_SIGN_IN());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_DRINK());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_FOOD());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_TIP());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_RUMORS());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_HEAL());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_DONATION());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_UNCURSE());
keys.syncNumber(KEY_CONSTANTS()->LOCATIONS()->KEY_TRAIN());
keys.syncNumber(KEY_CONSTANTS()->CLOUDSOFXEENMENU()->KEY_START_NEW_GAME());
keys.syncNumber(KEY_CONSTANTS()->CLOUDSOFXEENMENU()->KEY_LOAD_GAME());
keys.syncNumber(KEY_CONSTANTS()->CLOUDSOFXEENMENU()->KEY_SHOW_CREDITS());
keys.syncNumber(KEY_CONSTANTS()->CLOUDSOFXEENMENU()->KEY_VIEW_ENDGAME());
cc.add("CONSTKEYS" + num, keys);
}

View File

@ -1351,8 +1351,29 @@ public:
virtual const int KEY_WITH() = 0;
virtual const int KEY_GOLD() = 0;
virtual const int KEY_GEMS() = 0;
virtual const int KEY_BROWSE() = 0;
virtual const int KEY_BUY_SPELLS() = 0;
virtual const int KEY_SPELL_INFO() = 0;
virtual const int KEY_SIGN_IN() = 0;
virtual const int KEY_DRINK() = 0;
virtual const int KEY_FOOD() = 0;
virtual const int KEY_TIP() = 0;
virtual const int KEY_RUMORS() = 0;
virtual const int KEY_HEAL() = 0;
virtual const int KEY_DONATION() = 0;
virtual const int KEY_UNCURSE() = 0;
virtual const int KEY_TRAIN() = 0;
};
virtual Locations *LOCATIONS() = 0;
class CloudsOfXeenMenu {
public:
virtual const int KEY_START_NEW_GAME() = 0;
virtual const int KEY_LOAD_GAME() = 0;
virtual const int KEY_SHOW_CREDITS() = 0;
virtual const int KEY_VIEW_ENDGAME() = 0;
};
virtual CloudsOfXeenMenu *CLOUDSOFXEENMENU() = 0;
};
virtual KeyConstants *KEY_CONSTANTS() = 0;
};

View File

@ -2117,16 +2117,41 @@ public:
class EN_Locations : public Locations {
public:
const int KEY_DEP() { return Common::KEYCODE_d; }
const int KEY_WITH() { return Common::KEYCODE_w; }
const int KEY_GOLD() { return Common::KEYCODE_o; }
const int KEY_GEMS() { return Common::KEYCODE_e; }
const int KEY_DEP() { return Common::KEYCODE_d; }
const int KEY_WITH() { return Common::KEYCODE_w; }
const int KEY_GOLD() { return Common::KEYCODE_o; }
const int KEY_GEMS() { return Common::KEYCODE_e; }
const int KEY_BROWSE() { return Common::KEYCODE_b; }
const int KEY_BUY_SPELLS() { return Common::KEYCODE_b; }
const int KEY_SPELL_INFO() { return Common::KEYCODE_s; }
const int KEY_SIGN_IN() { return Common::KEYCODE_s; }
const int KEY_DRINK() { return Common::KEYCODE_d; }
const int KEY_FOOD() { return Common::KEYCODE_f; }
const int KEY_TIP() { return Common::KEYCODE_t; }
const int KEY_RUMORS() { return Common::KEYCODE_r; }
const int KEY_HEAL() { return Common::KEYCODE_h; }
const int KEY_DONATION() { return Common::KEYCODE_d; }
const int KEY_UNCURSE() { return Common::KEYCODE_u; }
const int KEY_TRAIN() { return Common::KEYCODE_t; }
};
EN_Locations *LOCATIONS() {
if (!_l) _l = new EN_Locations();
return _l;
}
class EN_CloudsOfXeenMenu : public CloudsOfXeenMenu {
public:
const int KEY_START_NEW_GAME() { return Common::KEYCODE_s; }
const int KEY_LOAD_GAME() { return Common::KEYCODE_l; }
const int KEY_SHOW_CREDITS() { return Common::KEYCODE_c; }
const int KEY_VIEW_ENDGAME() { return Common::KEYCODE_e; }
};
EN_CloudsOfXeenMenu *CLOUDSOFXEENMENU() {
if (!_soxm)
_soxm = new EN_CloudsOfXeenMenu();
return _soxm;
}
private:
EN_DialogsCharInfo *_dci = NULL;
EN_DialogsControlPanel *_dcp = NULL;
@ -2138,6 +2163,7 @@ public:
EN_DialogsQuickFight *_dqf = NULL;
EN_DialogsSpells *_ds = NULL;
EN_Locations *_l = NULL;
EN_CloudsOfXeenMenu *_soxm = NULL;
};
EN_KeyConstants *KEY_CONSTANTS() {

View File

@ -585,7 +585,7 @@ public:
const char *TRAINING_TEXT() {
return "\r\x3""c\x8E\xA1\xE3\xE7\xA5\xAD\xA8\xA5\n" // "\r\x3""cОбучение\n"
"\n" // "\n"
"%s\x3""l\v090\t000\x87\xAE\xAB\x3""r\t000%s\x2\x3""c\v122\t021" // "%s\x3""l\v090\t000Зол\x3""r\t000%s\x2\x3""c\v122\t021"
"%s\x3""l\v090\t000\x87\xAE\xAB\x3""r\t000%s\x2\x3""c\v122\t025" // "%s\x3""l\v090\t000Зол\x3""r\t000%s\x2\x3""c\v122\t025"
"\f37\x8E\fd\xA1\xE3\xE7\xA5\xAD\xA8\xA5\t060ESC\x1"; // "\f37О\fdбучение\t060ESC\x1";
}
@ -2123,16 +2123,40 @@ public:
class RU_Locations : public Locations {
public:
const int KEY_DEP() { return Common::KEYCODE_d; }
const int KEY_WITH() { return Common::KEYCODE_c; }
const int KEY_GOLD() { return Common::KEYCODE_p; }
const int KEY_GEMS() { return Common::KEYCODE_f; }
const int KEY_DEP() { return Common::KEYCODE_d; }
const int KEY_WITH() { return Common::KEYCODE_c; }
const int KEY_GOLD() { return Common::KEYCODE_p; }
const int KEY_GEMS() { return Common::KEYCODE_f; }
const int KEY_BROWSE() { return Common::KEYCODE_c; }
const int KEY_BUY_SPELLS() { return Common::KEYCODE_r; }
const int KEY_SPELL_INFO() { return Common::KEYCODE_j; }
const int KEY_SIGN_IN() { return Common::KEYCODE_j; }
const int KEY_DRINK() { return Common::KEYCODE_d; }
const int KEY_FOOD() { return Common::KEYCODE_t; }
const int KEY_TIP() { return Common::KEYCODE_x; }
const int KEY_RUMORS() { return Common::KEYCODE_c; }
const int KEY_HEAL() { return Common::KEYCODE_k; }
const int KEY_DONATION() { return Common::KEYCODE_l; }
const int KEY_UNCURSE() { return Common::KEYCODE_c; }
const int KEY_TRAIN() { return Common::KEYCODE_j; }
};
RU_Locations *LOCATIONS() {
if (!_l) _l = new RU_Locations();
return _l;
}
class RU_CloudsOfXeenMenu : public CloudsOfXeenMenu {
public:
const int KEY_START_NEW_GAME() { return Common::KEYCODE_y; }
const int KEY_LOAD_GAME() { return Common::KEYCODE_p; }
const int KEY_SHOW_CREDITS() { return Common::KEYCODE_c; }
const int KEY_VIEW_ENDGAME() { return Common::KEYCODE_a; }
};
RU_CloudsOfXeenMenu *CLOUDSOFXEENMENU() {
if (!_soxm)
_soxm = new RU_CloudsOfXeenMenu();
return _soxm;
}
private:
RU_DialogsCharInfo *_dci = NULL;
RU_DialogsControlPanel *_dcp = NULL;
@ -2144,6 +2168,7 @@ public:
RU_DialogsQuickFight *_dqf = NULL;
RU_DialogsSpells *_ds = NULL;
RU_Locations *_l = NULL;
RU_CloudsOfXeenMenu *_soxm = NULL;
};
RU_KeyConstants *KEY_CONSTANTS() {

Binary file not shown.

View File

@ -453,7 +453,7 @@ BlacksmithLocation::BlacksmithLocation() : BaseLocation(BLACKSMITH) {
_icons1.load("esc.icn");
addButton(Common::Rect(261, 108, 285, 128), Common::KEYCODE_ESCAPE, &_icons1);
addButton(Common::Rect(234, 54, 308, 62), 0);
addButton(Common::Rect(234, 64, 308, 72), Common::KEYCODE_b);
addButton(Common::Rect(234, 64, 308, 72), Res.KEY_CONSTANTS.LOCATIONS.KEY_BROWSE);
addButton(Common::Rect(234, 74, 308, 82), 0);
addButton(Common::Rect(234, 84, 308, 92), 0);
@ -477,7 +477,7 @@ Character *BlacksmithLocation::doOptions(Character *c) {
c = &party._activeParty[_buttonValue];
intf.highlightChar(_buttonValue);
}
} else if (_buttonValue == Common::KEYCODE_b) {
} else if (_buttonValue == Res.KEY_CONSTANTS.LOCATIONS.KEY_BROWSE) {
c = ItemsDialog::show(_vm, c, ITEMMODE_BUY);
_buttonValue = 0;
}
@ -501,8 +501,8 @@ GuildLocation::GuildLocation() : BaseLocation(GUILD) {
_icons1.load("esc.icn");
addButton(Common::Rect(261, 108, 285, 128), Common::KEYCODE_ESCAPE, &_icons1);
addButton(Common::Rect(234, 54, 308, 62), 0);
addButton(Common::Rect(234, 64, 308, 72), Common::KEYCODE_b);
addButton(Common::Rect(234, 74, 308, 82), Common::KEYCODE_s);
addButton(Common::Rect(234, 64, 308, 72), Res.KEY_CONSTANTS.LOCATIONS.KEY_BUY_SPELLS);
addButton(Common::Rect(234, 74, 308, 82), Res.KEY_CONSTANTS.LOCATIONS.KEY_SPELL_INFO);
addButton(Common::Rect(234, 84, 308, 92), 0);
g_vm->_mode = MODE_INTERACTIVE7;
@ -536,11 +536,11 @@ Character *GuildLocation::doOptions(Character *c) {
sound.playSound(_ccNum ? "skull1.voc" : "guild11.voc", 1);
}
}
} else if (_buttonValue == Common::KEYCODE_s) {
} else if (_buttonValue == Res.KEY_CONSTANTS.LOCATIONS.KEY_SPELL_INFO) {
if (c->guildMember())
c = SpellsDialog::show(_vm, this, c, SPELLS_DIALOG_INFO);
_buttonValue = 0;
} else if (_buttonValue == Common::KEYCODE_b) {
} else if (_buttonValue == Res.KEY_CONSTANTS.LOCATIONS.KEY_BUY_SPELLS) {
if (!c->noActions()) {
if (c->guildMember())
c = SpellsDialog::show(_vm, this, c, SPELLS_DIALOG_BUY);
@ -562,11 +562,11 @@ TavernLocation::TavernLocation() : BaseLocation(TAVERN) {
loadStrings("tavern.bin");
_icons1.load("tavern.icn");
addButton(Common::Rect(281, 108, 305, 128), Common::KEYCODE_ESCAPE, &_icons1);
addButton(Common::Rect(242, 108, 266, 128), Common::KEYCODE_s, &_icons1);
addButton(Common::Rect(234, 54, 308, 62), Common::KEYCODE_d);
addButton(Common::Rect(234, 64, 308, 72), Common::KEYCODE_f);
addButton(Common::Rect(234, 74, 308, 82), Common::KEYCODE_t);
addButton(Common::Rect(234, 84, 308, 92), Common::KEYCODE_r);
addButton(Common::Rect(242, 108, 266, 128), Res.KEY_CONSTANTS.LOCATIONS.KEY_SIGN_IN, &_icons1);
addButton(Common::Rect(234, 54, 308, 62), Res.KEY_CONSTANTS.LOCATIONS.KEY_DRINK);
addButton(Common::Rect(234, 64, 308, 72), Res.KEY_CONSTANTS.LOCATIONS.KEY_FOOD);
addButton(Common::Rect(234, 74, 308, 82), Res.KEY_CONSTANTS.LOCATIONS.KEY_TIP);
addButton(Common::Rect(234, 84, 308, 92), Res.KEY_CONSTANTS.LOCATIONS.KEY_RUMORS);
g_vm->_mode = MODE_INTERACTIVE7;
_vocName = _ccNum ? "hello1.voc" : "hello.voc";
@ -587,13 +587,13 @@ Character *TavernLocation::doOptions(Character *c) {
Windows &windows = *g_vm->_windows;
int idx = 0;
switch (_buttonValue) {
case Common::KEYCODE_F1:
case Common::KEYCODE_F2:
case Common::KEYCODE_F3:
case Common::KEYCODE_F4:
case Common::KEYCODE_F5:
case Common::KEYCODE_F6:
if (
Common::KEYCODE_F1 == _buttonValue ||
Common::KEYCODE_F2 == _buttonValue ||
Common::KEYCODE_F3 == _buttonValue ||
Common::KEYCODE_F4 == _buttonValue ||
Common::KEYCODE_F5 == _buttonValue ||
Common::KEYCODE_F6 == _buttonValue) {
// Switch character
_buttonValue -= Common::KEYCODE_F1;
if (_buttonValue < (int)party._activeParty.size()) {
@ -601,9 +601,7 @@ Character *TavernLocation::doOptions(Character *c) {
intf.highlightChar(_buttonValue);
_v21 = 0;
}
break;
case Common::KEYCODE_d:
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_DRINK == _buttonValue) {
// Drink
if (!c->noActions()) {
if (party.subtract(CONS_GOLD, 1, WHERE_PARTY, WT_LOC_WAIT)) {
@ -626,9 +624,7 @@ Character *TavernLocation::doOptions(Character *c) {
wait();
}
}
break;
case Common::KEYCODE_f: {
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_FOOD == _buttonValue) {
// Food
if (party._mazeId == (_ccNum ? 29 : 28)) {
_v22 = party._activeParty.size() * 15;
@ -675,10 +671,7 @@ Character *TavernLocation::doOptions(Character *c) {
windows[12].close();
windows[10].open();
_buttonValue = 0;
break;
}
case Common::KEYCODE_r: {
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_RUMORS == _buttonValue) {
// Rumors
if (party._mazeId == (_ccNum ? 29 : 28)) {
idx = 0;
@ -697,10 +690,7 @@ Character *TavernLocation::doOptions(Character *c) {
wait();
w.close();
break;
}
case Common::KEYCODE_s: {
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_SIGN_IN == _buttonValue) {
// Sign In
// Set location and position for afterwards
if (g_vm->getGameID() == GType_Swords) {
@ -763,10 +753,7 @@ Character *TavernLocation::doOptions(Character *c) {
if (party._mazeId != 0)
map.load(party._mazeId);
_exitToUi = true;
break;
}
case Common::KEYCODE_t:
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_TIP == _buttonValue) {
if (!c->noActions()) {
if (!_v21) {
windows[10].writeString(Common::String::format(Res.TAVERN_TEXT,
@ -813,10 +800,6 @@ Character *TavernLocation::doOptions(Character *c) {
}
}
}
break;
default:
break;
}
return c;
@ -849,9 +832,9 @@ TempleLocation::TempleLocation() : BaseLocation(TEMPLE) {
_icons1.load("esc.icn");
addButton(Common::Rect(261, 108, 285, 128), Common::KEYCODE_ESCAPE, &_icons1);
addButton(Common::Rect(234, 54, 308, 62), Common::KEYCODE_h);
addButton(Common::Rect(234, 64, 308, 72), Common::KEYCODE_d);
addButton(Common::Rect(234, 74, 308, 82), Common::KEYCODE_u);
addButton(Common::Rect(234, 54, 308, 62), Res.KEY_CONSTANTS.LOCATIONS.KEY_HEAL);
addButton(Common::Rect(234, 64, 308, 72), Res.KEY_CONSTANTS.LOCATIONS.KEY_DONATION);
addButton(Common::Rect(234, 74, 308, 82), Res.KEY_CONSTANTS.LOCATIONS.KEY_UNCURSE);
addButton(Common::Rect(234, 84, 308, 92), 0);
_vocName = _ccNum ? "help2.voc" : "maywe2.voc";
@ -925,13 +908,12 @@ Character *TempleLocation::doOptions(Character *c) {
Party &party = *g_vm->_party;
Sound &sound = *g_vm->_sound;
switch (_buttonValue) {
case Common::KEYCODE_F1:
case Common::KEYCODE_F2:
case Common::KEYCODE_F3:
case Common::KEYCODE_F4:
case Common::KEYCODE_F5:
case Common::KEYCODE_F6:
if (Common::KEYCODE_F1 == _buttonValue ||
Common::KEYCODE_F2 == _buttonValue ||
Common::KEYCODE_F3 == _buttonValue ||
Common::KEYCODE_F4 == _buttonValue ||
Common::KEYCODE_F5 == _buttonValue ||
Common::KEYCODE_F6 == _buttonValue) {
// Switch character
_buttonValue -= Common::KEYCODE_F1;
if (_buttonValue < (int)party._activeParty.size()) {
@ -939,9 +921,7 @@ Character *TempleLocation::doOptions(Character *c) {
intf.highlightChar(_buttonValue);
_dayOfWeek = 0;
}
break;
case Common::KEYCODE_d:
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_DONATION == _buttonValue) {
if (_donation && party.subtract(CONS_GOLD, _donation, WHERE_PARTY, WT_LOC_WAIT)) {
sound.stopSound();
sound.playSound("coina.voc", 1);
@ -964,9 +944,7 @@ Character *TempleLocation::doOptions(Character *c) {
_donation = 0;
}
}
break;
case Common::KEYCODE_h:
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_HEAL == _buttonValue) {
if (_healCost && party.subtract(CONS_GOLD, _healCost, WHERE_PARTY, WT_LOC_WAIT)) {
c->_magicResistence._temporary = 0;
c->_energyResistence._temporary = 0;
@ -991,9 +969,7 @@ Character *TempleLocation::doOptions(Character *c) {
sound.stopSound();
sound.playSound("ahh.voc", 1);
}
break;
case Common::KEYCODE_u:
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_UNCURSE == _buttonValue) {
if (_uncurseCost && party.subtract(CONS_GOLD, _uncurseCost, WHERE_PARTY, WT_LOC_WAIT)) {
c->_items.curseUncurse(false);
c->_conditions[CURSED] = 0;
@ -1002,10 +978,6 @@ Character *TempleLocation::doOptions(Character *c) {
sound.stopSound();
sound.playSound("ahh.voc", 1);
}
break;
default:
break;
}
return c;
@ -1020,7 +992,7 @@ TrainingLocation::TrainingLocation() : BaseLocation(TRAINING) {
_icons1.load("train.icn");
addButton(Common::Rect(281, 108, 305, 128), Common::KEYCODE_ESCAPE, &_icons1);
addButton(Common::Rect(242, 108, 266, 128), Common::KEYCODE_t, &_icons1);
addButton(Common::Rect(242, 108, 266, 128), Res.KEY_CONSTANTS.LOCATIONS.KEY_TRAIN, &_icons1);
_vocName = _ccNum ? "youtrn1.voc" : "training.voc";
}
@ -1088,13 +1060,12 @@ Character *TrainingLocation::doOptions(Character *c) {
Party &party = *g_vm->_party;
Sound &sound = *g_vm->_sound;
switch (_buttonValue) {
case Common::KEYCODE_F1:
case Common::KEYCODE_F2:
case Common::KEYCODE_F3:
case Common::KEYCODE_F4:
case Common::KEYCODE_F5:
case Common::KEYCODE_F6:
if (Common::KEYCODE_F1 == _buttonValue ||
Common::KEYCODE_F2 == _buttonValue ||
Common::KEYCODE_F3 == _buttonValue ||
Common::KEYCODE_F4 == _buttonValue ||
Common::KEYCODE_F5 == _buttonValue ||
Common::KEYCODE_F6 == _buttonValue) {
// Switch character
_buttonValue -= Common::KEYCODE_F1;
if (_buttonValue < (int)party._activeParty.size()) {
@ -1102,9 +1073,7 @@ Character *TrainingLocation::doOptions(Character *c) {
c = &party._activeParty[_buttonValue];
intf.highlightChar(_buttonValue);
}
break;
case Common::KEYCODE_t:
} else if (Res.KEY_CONSTANTS.LOCATIONS.KEY_TRAIN == _buttonValue) {
if (_experienceToNextLevel) {
sound.stopSound();
_drawFrameIndex = 0;
@ -1139,10 +1108,6 @@ Character *TrainingLocation::doOptions(Character *c) {
intf.drawParty(true);
}
}
break;
default:
break;
}
return c;

View File

@ -487,6 +487,23 @@ void Resources::loadData() {
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_WITH);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_GOLD);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_GEMS);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_BROWSE);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_BUY_SPELLS);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_SPELL_INFO);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_SIGN_IN);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_DRINK);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_FOOD);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_TIP);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_RUMORS);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_HEAL);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_DONATION);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_UNCURSE);
keys.syncNumber(KEY_CONSTANTS.LOCATIONS.KEY_TRAIN);
keys.syncNumber(KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_START_NEW_GAME);
keys.syncNumber(KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_LOAD_GAME);
keys.syncNumber(KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_SHOW_CREDITS);
keys.syncNumber(KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_VIEW_ENDGAME);
}
} // End of namespace Xeen

View File

@ -561,7 +561,26 @@ public:
int KEY_WITH;
int KEY_GOLD;
int KEY_GEMS;
int KEY_BROWSE;
int KEY_BUY_SPELLS;
int KEY_SPELL_INFO;
int KEY_SIGN_IN;
int KEY_DRINK;
int KEY_FOOD;
int KEY_TIP;
int KEY_RUMORS;
int KEY_HEAL;
int KEY_DONATION;
int KEY_UNCURSE;
int KEY_TRAIN;
} LOCATIONS;
struct {
int KEY_START_NEW_GAME;
int KEY_LOAD_GAME;
int KEY_SHOW_CREDITS;
int KEY_VIEW_ENDGAME;
} CLOUDSOFXEENMENU;
} KEY_CONSTANTS;

View File

@ -262,8 +262,7 @@ bool MainMenuDialog::handleEvents() {
checkEvents(g_vm);
int difficulty;
switch (_buttonValue) {
case Common::KEYCODE_s:
if (Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_START_NEW_GAME == _buttonValue) {
// Start new game
difficulty = DifficultyDialog::show(g_vm);
if (difficulty == -1)
@ -273,9 +272,7 @@ bool MainMenuDialog::handleEvents() {
g_vm->_saves->newGame();
g_vm->_party->_difficulty = (Difficulty)difficulty;
g_vm->_gameMode = GMODE_PLAY_GAME;
break;
case Common::KEYCODE_l: {
} else if (Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_LOAD_GAME == _buttonValue) {
// Load existing game
int ccNum = files._ccNum;
g_vm->_saves->newGame();
@ -285,20 +282,12 @@ bool MainMenuDialog::handleEvents() {
}
g_vm->_gameMode = GMODE_PLAY_GAME;
break;
}
case Common::KEYCODE_c:
case Common::KEYCODE_v:
} else if (Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_SHOW_CREDITS == _buttonValue) {
// Show credits
CreditsScreen::show(g_vm);
break;
case Common::KEYCODE_ESCAPE:
} else if (Common::KEYCODE_ESCAPE == _buttonValue) {
// Exit dialog (returning to just the animated background)
break;
default:
} else {
return false;
}
@ -327,11 +316,11 @@ CloudsMenuDialog::~CloudsMenuDialog() {
void CloudsMenuDialog::loadButtons() {
_buttonSprites.load("start.icn");
addButton(Common::Rect(93, 53, 227, 73), Common::KEYCODE_s, &_buttonSprites);
addButton(Common::Rect(93, 78, 227, 98), Common::KEYCODE_l, &_buttonSprites);
addButton(Common::Rect(93, 103, 227, 123), Common::KEYCODE_c, &_buttonSprites);
addButton(Common::Rect(93, 53, 227, 73), Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_START_NEW_GAME, &_buttonSprites);
addButton(Common::Rect(93, 78, 227, 98), Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_LOAD_GAME, &_buttonSprites);
addButton(Common::Rect(93, 103, 227, 123), Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_SHOW_CREDITS, &_buttonSprites);
if (g_vm->_gameWon[0])
addButton(Common::Rect(93, 128, 227, 148), Common::KEYCODE_e, &_buttonSprites);
addButton(Common::Rect(93, 128, 227, 148), Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_VIEW_ENDGAME, &_buttonSprites);
}
void CloudsMenuDialog::draw() {
@ -347,8 +336,7 @@ bool CloudsMenuDialog::handleEvents() {
if (MainMenuDialog::handleEvents())
return true;
switch (_buttonValue) {
case Common::KEYCODE_e:
if (Res.KEY_CONSTANTS.CLOUDSOFXEENMENU.KEY_VIEW_ENDGAME == _buttonValue) {
if (g_vm->_gameWon[0]) {
// Close the window
delete this;
@ -358,10 +346,6 @@ bool CloudsMenuDialog::handleEvents() {
WOX_VM.showCloudsEnding(g_vm->_finalScore);
return true;
}
break;
default:
break;
}
return false;