More IHNM options panel improvements: added text and working widgets for read speed, music and sound, matched the font and the coordinates of the options panel and the widgets with the ones of the original interpreter

svn-id: r26738
This commit is contained in:
Filippos Karapetis 2007-05-02 23:27:25 +00:00
parent 7e16ca13c6
commit 463c5fcec8
2 changed files with 19 additions and 8 deletions

View File

@ -319,9 +319,16 @@ static PanelButton IHNM_ConversePanelButtons[] = {
static PanelButton IHNM_OptionPanelButtons[] = {
//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
{kPanelButtonOptionText,28,36, 0,0, kTextReadingSpeed,'-',0, 0,0,0}, // text: read speed
{kPanelButtonOptionText,60,61, 0,0, kTextMusic,'-',0, 0,0,0}, // text: music
{kPanelButtonOptionText,60,86, 0,0, kTextSound,'-',0, 0,0,0}, // text: noise
// TODO: Add Voices text here
{kPanelButtonOption, 154,30, 79,23, kTextReadingSpeed,'r',0, 0,0,0}, //read speed
{kPanelButtonOption, 154,55, 79,23, kTextMusic,'m',0, 0,0,0}, //music
{kPanelButtonOption, 154,80, 79,23, kTextSound,'n',0, 0,0,0}, //sound-noise
// TODO: Add Voices widget here
{kPanelButtonOption, 19,149, 200,25, kTextQuitGame,'q',0, 0,0,0}, //quit
{kPanelButtonOption, 19,177, 200,25, kTextContinuePlaying,'c',0, 0,0,0}, //continue
//.....
};
@ -380,7 +387,7 @@ static const GameDisplayInfo IHNM_DisplayInfo = { //TODO: fill it all
-1, -1, // save file index
0, // optionSaveFileVisible
100, 75, // option panel offsets
92, 46, // option panel offsets
ARRAYSIZE(IHNM_OptionPanelButtons),
IHNM_OptionPanelButtons,

View File

@ -697,14 +697,20 @@ void Interface::drawPanelText(Surface *ds, InterfacePanel *panel, PanelButton *p
text = _vm->getTextString(panelButton->id);
panel->calcPanelButtonRect(panelButton, rect);
if (panelButton->xOffset < 0) {
textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal);
if (_vm->getGameType() == GType_ITE)
textWidth = _vm->_font->getStringWidth(kKnownFontMedium, text, 0, kFontNormal);
else
textWidth = _vm->_font->getStringWidth(kKnownFontVerb, text, 0, kFontNormal);
rect.left += 2 + (panel->imageWidth - 1 - textWidth) / 2;
}
textPoint.x = rect.left;
textPoint.y = rect.top + 1;
_vm->_font->textDraw(kKnownFontMedium, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
if (_vm->getGameType() == GType_ITE)
_vm->_font->textDraw(kKnownFontMedium, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
else
_vm->_font->textDraw(kKnownFontVerb, ds, text, textPoint, _vm->KnownColor2ColorId(kKnownColorVerbText), _vm->KnownColor2ColorId(kKnownColorVerbTextShadow), kFontShadow);
}
void Interface::drawOption() {
@ -1897,7 +1903,6 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut
}
text = _vm->getTextString(textId);
// 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);
@ -1918,7 +1923,6 @@ void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelBut
panel->calcPanelButtonRect(panelButton, rect);
drawButtonBox(ds, rect, kButton, panelButton->state > 0);
// 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);