Implemented the last menu (the settings screen). Walking speed, text speed,

and speech modes (text only, speech only, speech & text) can now be
configured. Toggling music and sound in general is not enabled yet.
Also formatted the static menu resources a bit differently, made
sure some vars in the menu code always got initalized, and
fixed a slight formatting error :).

svn-id: r21145
This commit is contained in:
Oystein Eftevaag 2006-03-08 13:15:13 +00:00
parent 4c1e4c6987
commit 39c9af43ae
8 changed files with 305 additions and 49 deletions

View file

@ -414,10 +414,12 @@ int KyraEngine::buttonMenuCallback(Button *caller) {
_screen->savePageToDisk("SEENPAGE.TMP", 0); _screen->savePageToDisk("SEENPAGE.TMP", 0);
gui_fadePalette(); gui_fadePalette();
for ( int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
calcCoords(_menu[i]); calcCoords(_menu[i]);
_menuRestoreScreen = true; _menuRestoreScreen = true;
_keyboardEvent.pending = 0;
_keyboardEvent.repeat = 0;
_toplevelMenu = 0; _toplevelMenu = 0;
if (_menuDirectlyToLoad) if (_menuDirectlyToLoad)
@ -500,22 +502,24 @@ void KyraEngine::initMenu(Menu menu) {
_screen->fillRect(x1, y1, x2, y2, menu.item[i].bgcolor); _screen->fillRect(x1, y1, x2, y2, menu.item[i].bgcolor);
_screen->drawShadedBox(x1, y1, x2, y2, menu.item[i].color1, menu.item[i].color2); _screen->drawShadedBox(x1, y1, x2, y2, menu.item[i].color1, menu.item[i].color2);
if (menu.item[i].field_12 != -1) if (menu.item[i].itemString) {
textX = x1 + menu.item[i].field_12 + 3; if (menu.item[i].field_12 != -1)
else textX = x1 + menu.item[i].field_12 + 3;
textX = _text->getCenterStringX(menu.item[i].itemString, x1, x2); else
textX = _text->getCenterStringX(menu.item[i].itemString, x1, x2);
textY = y1 + 2; textY = y1 + 2;
_text->printText(menu.item[i].itemString, textX - 1, textY + 1, 12, 0, 0); _text->printText(menu.item[i].itemString, textX - 1, textY + 1, 12, 0, 0);
if (i == menu.highlightedItem) if (i == menu.highlightedItem)
_text->printText(menu.item[i].itemString, textX, textY, menu.item[i].highlightColor, 0, 0); _text->printText(menu.item[i].itemString, textX, textY, menu.item[i].highlightColor, 0, 0);
else else
_text->printText(menu.item[i].itemString, textX, textY, menu.item[i].textColor, 0, 0); _text->printText(menu.item[i].itemString, textX, textY, menu.item[i].textColor, 0, 0);
if (menu.item[i].labelString) { if (menu.item[i].labelString) {
_text->printText(menu.item[i].labelString, menu.x + menu.item[i].field_21 - 1, menu.y + menu.item[i].field_23 + 1, 12, 0, 0); _text->printText(menu.item[i].labelString, menu.x + menu.item[i].labelX - 1, menu.y + menu.item[i].labelY + 1, 12, 0, 0);
_text->printText(menu.item[i].labelString, menu.x + menu.item[i].field_21, menu.y + menu.item[i].field_23, 253, 0, 0); _text->printText(menu.item[i].labelString, menu.x + menu.item[i].labelX, menu.y + menu.item[i].labelY, 253, 0, 0);
}
} }
} }
@ -799,8 +803,6 @@ int KyraEngine::gui_saveGame(Button *button) {
} }
gui_redrawTextfield(); gui_redrawTextfield();
_keyboardEvent.pending = 0;
_keyboardEvent.repeat = 0;
while (_displaySubMenu) { while (_displaySubMenu) {
gui_getInput(); gui_getInput();
gui_updateSavegameString(); gui_updateSavegameString();
@ -905,6 +907,181 @@ int KyraEngine::gui_quitConfirmNo(Button *button) {
return 0; return 0;
} }
int KyraEngine::gui_gameControlsMenu(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_gameControlsMenu()");
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
_screen->savePageToDisk("SEENPAGE.TMP", 0);
if (_features & GF_TALKIE) {
_menu[5].width = 230;
for (int i = 0; i < 5; i++) {
_menu[5].item[i].labelX = 24;
_menu[5].item[i].x = 115;
_menu[5].item[i].width = 94;
}
_menu[5].item[3].labelString = "Voice / Text ";
_menu[5].item[3].callback = &KyraEngine::gui_controlsChangeVoice;
} else {
_menu[5].height = 136;
_menu[5].item[5].y = 110;
_menu[5].item[4].enabled = 0;
_menu[5].item[3].labelString = "Text speed ";
_menu[5].item[3].callback = &KyraEngine::gui_controlsChangeText;
}
calcCoords(_menu[5]);
gui_setupControls(_menu[5]);
processAllMenuButtons();
_displaySubMenu = true;
_cancelSubMenu = false;
while (_displaySubMenu) {
gui_getInput();
gui_processHighlights(_menu[5]);
processButtonList(_menuButtonList);
}
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
_screen->savePageToDisk("SEENPAGE.TMP", 0);
if (_cancelSubMenu) {
initMenu(_menu[_toplevelMenu]);
processAllMenuButtons();
}
return 0;
}
void KyraEngine::gui_setupControls(Menu &menu) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_setupControls()");
if (_configMusic)
menu.item[0].itemString = "On";
else
menu.item[0].itemString = "Off";
if (_configSounds)
menu.item[1].itemString = "On";
else
menu.item[1].itemString = "Off";
switch (_configWalkspeed) {
case 0:
menu.item[2].itemString = "Slowest";
break;
case 1:
menu.item[2].itemString = "Slow";
break;
case 2:
menu.item[2].itemString = "Normal";
break;
case 3:
menu.item[2].itemString = "Fast";
break;
case 4:
menu.item[2].itemString = "Fastest";
break;
default:
menu.item[2].itemString = "ERROR";
}
int textControl = 3;
if (_features & GF_TALKIE) {
textControl = 4;
if (_configVoice == 0)
_menu[5].item[4].enabled = 1;
else
_menu[5].item[4].enabled = 0;
switch (_configVoice) {
case 0:
menu.item[3].itemString = "Text only";
break;
case 1:
menu.item[3].itemString = "Voice & Text";
break;
case 2:
menu.item[3].itemString = "Voice only";
break;
default:
menu.item[3].itemString = "ERROR";
}
}
switch (_configTextspeed) {
case 0:
menu.item[textControl].itemString = "Slow";
break;
case 1:
menu.item[textControl].itemString = "Normal";
break;
case 2:
menu.item[textControl].itemString = "Fast";
break;
case 3:
menu.item[textControl].itemString = "Clickable";
break;
default:
menu.item[textControl].itemString = "ERROR";
}
initMenu(menu);
}
int KyraEngine::gui_controlsChangeMusic(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeMusic()");
processMenuButton(button);
_configMusic = !_configMusic;
gui_setupControls(_menu[5]);
return 0;
}
int KyraEngine::gui_controlsChangeSounds(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeSounds()");
processMenuButton(button);
_configSounds = !_configSounds;
gui_setupControls(_menu[5]);
return 0;
}
int KyraEngine::gui_controlsChangeWalk(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeWalk()");
processMenuButton(button);
_configWalkspeed = ++_configWalkspeed % 5;
setWalkspeed(_configWalkspeed);
gui_setupControls(_menu[5]);
return 0;
}
int KyraEngine::gui_controlsChangeText(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeText()");
processMenuButton(button);
_configTextspeed = ++_configTextspeed % 4;
gui_setupControls(_menu[5]);
return 0;
}
int KyraEngine::gui_controlsChangeVoice(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeVoice()");
processMenuButton(button);
_configVoice = ++_configVoice % 3;
gui_setupControls(_menu[5]);
return 0;
}
int KyraEngine::gui_scrollUp(Button *button) { int KyraEngine::gui_scrollUp(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_scrollUp()"); debugC(9, kDebugLevelGUI, "KyraEngine::gui_scrollUp()");
processMenuButton(button); processMenuButton(button);

View file

@ -440,7 +440,12 @@ int KyraEngine::init(GameDetector &detector) {
assert(_movFacingTable); assert(_movFacingTable);
_movFacingTable[0] = 8; _movFacingTable[0] = 8;
_configTalkspeed = 1; _configTextspeed = 1;
_configWalkspeed = 2;
_configMusic = true;
_configSounds = true;
_configVoice = 1;
_skipFlag = false; _skipFlag = false;
_marbleVaseItem = -1; _marbleVaseItem = -1;

View file

@ -201,8 +201,8 @@ struct MenuItem {
int (KyraEngine::*callback)(Button*); int (KyraEngine::*callback)(Button*);
int16 field_1b; int16 field_1b;
const char *labelString; const char *labelString;
uint16 field_21; uint16 labelX;
uint8 field_23; uint8 labelY;
uint8 field_24; uint8 field_24;
uint32 field_25; uint32 field_25;
}; };
@ -641,7 +641,8 @@ protected:
void updateAnimFlag2(int timerNum); void updateAnimFlag2(int timerNum);
void drawAmulet(); void drawAmulet();
void setTextFadeTimerCountdown(int16 countdown); void setTextFadeTimerCountdown(int16 countdown);
void setWalkspeed(uint8 newSpeed);
int buttonInventoryCallback(Button *caller); int buttonInventoryCallback(Button *caller);
int buttonAmuletCallback(Button *caller); int buttonAmuletCallback(Button *caller);
int buttonMenuCallback(Button *caller); int buttonMenuCallback(Button *caller);
@ -663,6 +664,7 @@ protected:
int gui_resumeGame(Button *button); int gui_resumeGame(Button *button);
int gui_loadGameMenu(Button *button); int gui_loadGameMenu(Button *button);
int gui_saveGameMenu(Button *button); int gui_saveGameMenu(Button *button);
int gui_gameControlsMenu(Button *button);
int gui_quitPlaying(Button *button); int gui_quitPlaying(Button *button);
int gui_quitConfirmYes(Button *button); int gui_quitConfirmYes(Button *button);
int gui_quitConfirmNo(Button *button); int gui_quitConfirmNo(Button *button);
@ -672,6 +674,11 @@ protected:
int gui_cancelSubMenu(Button *button); int gui_cancelSubMenu(Button *button);
int gui_scrollUp(Button *button); int gui_scrollUp(Button *button);
int gui_scrollDown(Button *button); int gui_scrollDown(Button *button);
int gui_controlsChangeMusic(Button *button);
int gui_controlsChangeSounds(Button *button);
int gui_controlsChangeWalk(Button *button);
int gui_controlsChangeText(Button *button);
int gui_controlsChangeVoice(Button *button);
bool gui_quitConfirm(const char *str); bool gui_quitConfirm(const char *str);
void gui_getInput(); void gui_getInput();
@ -682,6 +689,7 @@ protected:
void gui_redrawTextfield(); void gui_redrawTextfield();
void gui_fadePalette(); void gui_fadePalette();
void gui_restorePalette(); void gui_restorePalette();
void gui_setupControls(Menu &menu);
uint8 _game; uint8 _game;
bool _quitFlag; bool _quitFlag;
@ -781,8 +789,12 @@ protected:
int8 _startSentencePalIndex; int8 _startSentencePalIndex;
bool _fadeText; bool _fadeText;
uint8 _configTalkspeed; uint8 _configTextspeed;
uint8 _configWalkspeed;
bool _configMusic;
bool _configSounds;
uint8 _configVoice;
Common::String _targetName; Common::String _targetName;
int _curMusicTheme; int _curMusicTheme;

View file

@ -28,7 +28,7 @@
#include "common/savefile.h" #include "common/savefile.h"
#include "common/system.h" #include "common/system.h"
#define CURRENT_VERSION 3 #define CURRENT_VERSION 4
namespace Kyra { namespace Kyra {
void KyraEngine::loadGame(const char *fileName) { void KyraEngine::loadGame(const char *fileName) {
@ -178,6 +178,14 @@ void KyraEngine::loadGame(const char *fileName) {
snd_playWanderScoreViaMap(_lastMusicCommand, 1); snd_playWanderScoreViaMap(_lastMusicCommand, 1);
} }
if (version >= 4) {
_configTextspeed = in->readByte();
_configWalkspeed = in->readByte();
_configMusic = in->readByte();
_configSounds = in->readByte();
_configVoice = in->readByte();
}
if (queryGameFlag(0x2D)) { if (queryGameFlag(0x2D)) {
loadMainScreen(8); loadMainScreen(8);
loadBitmap("AMULET3.CPS", 10, 10, 0); loadBitmap("AMULET3.CPS", 10, 10, 0);
@ -310,6 +318,12 @@ void KyraEngine::saveGame(const char *fileName, const char *saveName) {
out->writeSint16BE(_lastMusicCommand); out->writeSint16BE(_lastMusicCommand);
out->writeByte(_configTextspeed);
out->writeByte(_configWalkspeed);
out->writeByte(_configMusic);
out->writeByte(_configSounds);
out->writeByte(_configVoice);
out->flush(); out->flush();
// check for errors // check for errors

View file

@ -44,9 +44,12 @@ int KyraEngine::cmd_characterSays(ScriptState *script) {
_skipFlag = false; _skipFlag = false;
if (_features & GF_TALKIE) { if (_features & GF_TALKIE) {
debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(%p) (%d, '%s', %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3)); debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(%p) (%d, '%s', %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
snd_voiceWaitForFinish(); if (_configVoice == 1 || _configVoice == 2) {
snd_playVoiceFile(stackPos(0)); snd_voiceWaitForFinish();
characterSays(stackPosString(1), stackPos(2), stackPos(3)); snd_playVoiceFile(stackPos(0));
}
if (_configVoice == 0 || _configVoice == 1)
characterSays(stackPosString(1), stackPos(2), stackPos(3));
} else { } else {
debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2)); debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2));
characterSays(stackPosString(0), stackPos(1), stackPos(2)); characterSays(stackPosString(0), stackPos(1), stackPos(2));
@ -613,10 +616,14 @@ int KyraEngine::cmd_loadPageFromDisk(ScriptState *script) {
int KyraEngine::cmd_customPrintTalkString(ScriptState *script) { int KyraEngine::cmd_customPrintTalkString(ScriptState *script) {
if (_features & GF_TALKIE) { if (_features & GF_TALKIE) {
debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(%p) (%d, '%s', %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF); debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(%p) (%d, '%s', %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
snd_voiceWaitForFinish();
snd_playVoiceFile(stackPos(0)); if (_configVoice == 1 || _configVoice == 2) {
snd_voiceWaitForFinish();
snd_playVoiceFile(stackPos(0));
}
_skipFlag = false; _skipFlag = false;
_text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2); if (_configVoice == 0 || _configVoice == 1)
_text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2);
} else { } else {
debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF); debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF);
_skipFlag = false; _skipFlag = false;
@ -1447,8 +1454,7 @@ int KyraEngine::cmd_totalItemsInScene(ScriptState *script) {
int KyraEngine::cmd_restoreBrandonsMovementDelay(ScriptState *script) { int KyraEngine::cmd_restoreBrandonsMovementDelay(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "cmd_restoreBrandonsMovementDelay(%p) ()", (const void *)script); debugC(3, kDebugLevelScriptFuncs, "cmd_restoreBrandonsMovementDelay(%p) ()", (const void *)script);
//TODO: Use movement set by menu, instead of 5. setWalkspeed(_configWalkspeed);
setTimerDelay(5, 5);
return 0; return 0;
} }

View file

@ -907,55 +907,88 @@ Menu KyraEngine::_menu[] = {
{ -1, -1, 208, 136, 248, 249, 250, "The Legend of Kyrandia", 251, -1, 8, 0, 5, -1, -1, -1, -1, { -1, -1, 208, 136, 248, 249, 250, "The Legend of Kyrandia", 251, -1, 8, 0, 5, -1, -1, -1, -1,
{ {
{1, 0, 0, "Load a Game", -1, -1, 30, 148, 15, 252, 253, 24, 0, {1, 0, 0, "Load a Game", -1, -1, 30, 148, 15, 252, 253, 24, 0,
248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "Save this Game", -1, -1, 47, 148, 15, 252, 253, 24, 0, {1, 0, 0, "Save this Game", -1, -1, 47, 148, 15, 252, 253, 24, 0,
248, 249, 250, &KyraEngine::gui_saveGameMenu, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_saveGameMenu, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "Game Controls", -1, -1, 64, 148, 15, 252, 253, 24, 0, {1, 0, 0, "Game Controls", -1, -1, 64, 148, 15, 252, 253, 24, 0,
248, 249, 250, /*&menu_gameControls*/ 0, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_gameControlsMenu, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "Quit playing", -1, -1, 81, 148, 15, 252, 253, 24, 0, {1, 0, 0, "Quit playing", -1, -1, 81, 148, 15, 252, 253, 24, 0,
248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "Resume game", 86, 0, 110, 92, 15, 252, 253, -1, 255, {1, 0, 0, "Resume game", 86, 0, 110, 92, 15, 252, 253, -1, 255,
248, 249, 250, &KyraEngine::gui_resumeGame, -1, 0, 0, 0, 0, 0} 248, 249, 250, &KyraEngine::gui_resumeGame, -1, 0, 0, 0, 0, 0}
} }
}, },
{ -1, -1, 288, 56, 248, 249, 250, 0, 254,-1, 8, 0, 2, -1, -1, -1, -1, { -1, -1, 288, 56, 248, 249, 250, 0, 254,-1, 8, 0, 2, -1, -1, -1, -1,
{ {
{1, 0, 0, "Yes", 24, 0, 30, 72, 15, 252, 253, -1, 255, {1, 0, 0, "Yes", 24, 0, 30, 72, 15, 252, 253, -1, 255,
248, 249, 250, &KyraEngine::gui_quitConfirmYes, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_quitConfirmYes, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "No", 192, 0, 30, 72, 15, 252, 253, -1, 255, {1, 0, 0, "No", 192, 0, 30, 72, 15, 252, 253, -1, 255,
248, 249, 250, &KyraEngine::gui_quitConfirmNo, -1, 0, 0, 0, 0, 0} 248, 249, 250, &KyraEngine::gui_quitConfirmNo, -1, 0, 0, 0, 0, 0}
} }
}, },
{ -1, -1, 288, 160, 248, 249, 250, 0, 251, -1, 8, 0, 6, 132, 22, 132, 124, { -1, -1, 288, 160, 248, 249, 250, 0, 251, -1, 8, 0, 6, 132, 22, 132, 124,
{ {
{1, 0, 0, 0, -1, 255, 39, 256, 15, 252, 253, 5, 0, {1, 0, 0, 0, -1, 255, 39, 256, 15, 252, 253, 5, 0,
248, 249, 250, 0, -1, 0, 0, 0, 0, 0}, 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
{1, 0, 0, 0, -1, 255, 56, 256, 15, 252, 253, 5, 0, {1, 0, 0, 0, -1, 255, 56, 256, 15, 252, 253, 5, 0,
248, 249, 250, 0, -1, 0, 0, 0, 0, 0}, 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
{1, 0, 0, 0, -1, 255, 73, 256, 15, 252, 253, 5, 0, {1, 0, 0, 0, -1, 255, 73, 256, 15, 252, 253, 5, 0,
248, 249, 250, 0, -1, 0, 0, 0, 0, 0}, 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
{1, 0, 0, 0, -1, 255, 90, 256, 15, 252, 253, 5, 0, {1, 0, 0, 0, -1, 255, 90, 256, 15, 252, 253, 5, 0,
248, 249, 250, 0, -1, 0, 0, 0, 0, 0}, 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
{1, 0, 0, 0, -1, 255, 107, 256, 15, 252, 253, 5, 0, {1, 0, 0, 0, -1, 255, 107, 256, 15, 252, 253, 5, 0,
248, 249, 250, 0, -1, 0, 0, 0, 0, 0}, 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "Cancel", 184, 0, 134, 88, 15, 252, 253, -1, 255, {1, 0, 0, "Cancel", 184, 0, 134, 88, 15, 252, 253, -1, 255,
248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0},
} }
}, },
{ -1, -1, 288, 67, 248, 249, 250, "Enter a description of your saved game:", 251, -1, 8, 0, 3, -1, -1, -1, -1, { -1, -1, 288, 67, 248, 249, 250, "Enter a description of your saved game:", 251, -1, 8, 0, 3, -1, -1, -1, -1,
{ {
{1, 0, 0, "Save", 24, 0, 44, 72, 15, 252, 253, -1, 255, {1, 0, 0, "Save", 24, 0, 44, 72, 15, 252, 253, -1, 255,
248, 249, 250, &KyraEngine::gui_savegameConfirm, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_savegameConfirm, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "Cancel", 192, 0, 44, 72, 15, 252, 253, -1, 255, {1, 0, 0, "Cancel", 192, 0, 44, 72, 15, 252, 253, -1, 255,
248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0} 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0}
} }
}, },
{ -1, -1, 208, 76, 248, 249, 250, "Rest in peace, Brandon.", 251, -1, 8, 0, 2, -1, -1, -1, -1, { -1, -1, 208, 76, 248, 249, 250, "Rest in peace, Brandon.", 251, -1, 8, 0, 2, -1, -1, -1, -1,
{ {
{1, 0, 0, "Load a game", -1, -1, 30, 148, 15, 252, 253, 24, 0, {1, 0, 0, "Load a game", -1, -1, 30, 148, 15, 252, 253, 24, 0,
248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0}, 248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0},
{1, 0, 0, "Quit playing", -1, -1, 47, 148, 15, 252, 253, 24, 0, {1, 0, 0, "Quit playing", -1, -1, 47, 148, 15, 252, 253, 24, 0,
248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0} 248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0}
}
},
{ -1, -1, 208, 153, 248, 249, 250, "Game Controls", 251, -1, 8, 0, 6, -1, -1, -1, -1,
{
{1, 0, 0, 0, 110, 0, 30, 64, 15, 252, 253, 5, 0,
248, 249, 250, &KyraEngine::gui_controlsChangeMusic, -1, "Music is ", 34, 32, 0, 0},
{1, 0, 0, 0, 110, 0, 47, 64, 15, 252, 253, 5, 0,
248, 249, 250, &KyraEngine::gui_controlsChangeSounds, -1, "Sounds are ", 34, 49, 0, 0},
{1, 0, 0, 0, 110, 0, 64, 64, 15, 252, 253, 5, 0,
248, 249, 250, &KyraEngine::gui_controlsChangeWalk, -1, "Walk speed ", 34, 66, 0, 0},
{1, 0, 0, 0, 110, 0, 81, 64, 15, 252, 253, 5, 0,
248, 249, 250, 0, -1, 0, 34, 83, 0, 0 },
{1, 0, 0, 0, 110, 0, 98, 64, 15, 252, 253, 5, 0,
248, 249, 250, &KyraEngine::gui_controlsChangeText, -1, "Text speed ", 34, 100, 0, 0 },
{1, 0, 0, "Main Menu", 64, 0, 127, 92, 15, 252, 253, -1, 255,
248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, -0, 0, 0, 0, 0}
} }
} }
}; };

View file

@ -46,7 +46,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch
uint32 timeToEnd = strlen(chatStr) * 8 * _tickLength + _system->getMillis(); uint32 timeToEnd = strlen(chatStr) * 8 * _tickLength + _system->getMillis();
if (chatDuration != -1 ) { if (chatDuration != -1 ) {
switch (_configTalkspeed) { switch (_configTextspeed) {
case 0: chatDuration *= 2; case 0: chatDuration *= 2;
break; break;
case 2: chatDuration /= 4; case 2: chatDuration /= 4;

View file

@ -276,5 +276,14 @@ void KyraEngine::drawAmulet() {
} }
_screen->showMouse(); _screen->showMouse();
} }
void KyraEngine::setWalkspeed(uint8 newSpeed) {
debugC(9, kDebugLevelMain, "KyraEngine::setWalkspeed(%i)", newSpeed);
static const uint8 speeds[] = {11, 9, 6, 5, 3};
assert(newSpeed < ARRAYSIZE(speeds));
setTimerDelay(5, speeds[newSpeed]);
}
} // end of namespace Kyra } // end of namespace Kyra