diff options
author | Filippos Karapetis | 2007-05-02 17:12:30 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-05-02 17:12:30 +0000 |
commit | 74f839d6c89289b09fd11666e1abfe90b74fa431 (patch) | |
tree | d61e81c3896f915c6d0ed11e86f9f95d5e2b7bb7 | |
parent | ab78c626f46803fcb258d08a2434457fc30cfc94 (diff) | |
download | scummvm-rg350-74f839d6c89289b09fd11666e1abfe90b74fa431.tar.gz scummvm-rg350-74f839d6c89289b09fd11666e1abfe90b74fa431.tar.bz2 scummvm-rg350-74f839d6c89289b09fd11666e1abfe90b74fa431.zip |
IHNM: Added the options dialog and quit dialog with very basic functionality (continue and exit game).
The buttons are still wrong and not all the options are implemented yet, but at least the game doesn't freeze when the user tries to open the options dialog and it's now possible to exit normally
svn-id: r26735
-rw-r--r-- | engines/saga/displayinfo.h | 18 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 30 |
2 files changed, 37 insertions, 11 deletions
diff --git a/engines/saga/displayinfo.h b/engines/saga/displayinfo.h index 4820533623..e728666b2f 100644 --- a/engines/saga/displayinfo.h +++ b/engines/saga/displayinfo.h @@ -318,11 +318,19 @@ static PanelButton IHNM_ConversePanelButtons[] = { }; static PanelButton IHNM_OptionPanelButtons[] = { - {kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO + //TODO: Add the rest of the buttons + //TODO: Those coordinates might not be pixel perfect, check with the original interpreter + {kPanelButtonOption, 20,150, 200,25, kTextQuitGame,'q',0, 0,0,0}, //quit + {kPanelButtonOption, 20,175, 200,25, kTextContinuePlaying,'c',0, 0,0,0}, //continue + //..... }; static PanelButton IHNM_QuitPanelButtons[] = { - {kPanelButtonArrow, 0,0, 0,0, 0,'-',0, 0,0,0}, //TODO + //FIXME: Show the correct quit dialog background + //TODO: Those coordinates might not be pixel perfect, check with the original interpreter + {kPanelButtonQuit, 25,80, 80,25, kTextQuit,'q',0, 0,0,0}, + {kPanelButtonQuit, 155,80, 80,25, kTextCancel,'c',0, 0,0,0}, + {kPanelButtonQuitText, -1,5, 0,0, kTextQuitTheGameQuestion,'-',0, 0,0,0}, }; static PanelButton IHNM_LoadPanelButtons[] = { @@ -372,12 +380,12 @@ static const GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all -1, -1, // save file index 0, // optionSaveFileVisible - 0, 0, // option panel offsets + 100, 75, // option panel offsets ARRAYSIZE(IHNM_OptionPanelButtons), IHNM_OptionPanelButtons, - 0,0, // quit panel offsets - 0,0, // quit panel width & height + 190,180, // quit panel offsets + 260,115, // quit panel width & height ARRAYSIZE(IHNM_QuitPanelButtons), IHNM_QuitPanelButtons, diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index abf706310f..08ed30c8a2 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -719,7 +719,6 @@ void Interface::drawOption() { Rect rect2; PanelButton *panelButton; Point textPoint; - if (_optionSaveFileSlider == NULL) return;//TODO:REMOVE backBuffer = _vm->_gfx->getBackBuffer(); @@ -737,9 +736,17 @@ void Interface::drawOption() { } if (_optionSaveRectTop.height() > 0) { - backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey); + if (_vm->getGameType() == GType_ITE) { + backBuffer->drawRect(_optionSaveRectTop, kITEColorDarkGrey); + } else { + // TODO: Draw the button graphic properly for IHNM + } } + // FIXME: The _optionSaveFileSlider checks exist for IHNM, where + // _optionSaveFileSlider is not initialized correctly yet + if (_optionSaveFileSlider == NULL) return; //TODO:REMOVE + drawButtonBox(backBuffer, _optionSaveRectSlider, kSlider, _optionSaveFileSlider->state > 0); if (_optionSaveRectBottom.height() > 0) { @@ -1890,8 +1897,14 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut } text = _vm->getTextString(textId); - textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal); - textHeight = _vm->_font->getHeight(kKnownFontMedium); + // TODO: This looks like to be the proper font for IHNM, check for validity + if (_vm->getGameType() == GType_ITE) { + textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal); + textHeight = _vm->_font->getHeight(kKnownFontMedium); + } else { + textWidth = _vm->_font->getStringWidth(kKnownFontVerb, text, 0, kFontNormal); + textHeight = _vm->_font->getHeight(kKnownFontVerb); + } point.x = panel->x + panelButton->xOffset + (panelButton->width / 2) - (textWidth / 2); point.y = panel->y + panelButton->yOffset + (panelButton->height / 2) - (textHeight / 2); @@ -1905,8 +1918,13 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut panel->calcPanelButtonRect(panelButton, rect); drawButtonBox(ds, rect, kButton, panelButton->state > 0); - _vm->_font->textDraw(kKnownFontMedium, ds, text, point, - _vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); + // TODO: This looks like to be the proper font for IHNM, check for validity + if (_vm->getGameType() == GType_ITE) + _vm->_font->textDraw(kKnownFontMedium, ds, text, point, + _vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); + else + _vm->_font->textDraw(kKnownFontVerb, ds, text, point, + _vm->KnownColor2ColorId(textColor), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow); } void Interface::drawPanelButtonArrow(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) { |