diff options
author | Eugene Sandulenko | 2006-03-09 01:08:25 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-03-09 01:08:25 +0000 |
commit | c3f91ca288cd4cfb884fedb956d0d1049f857841 (patch) | |
tree | 974703ccff93ea4ebcb1eccb1f3867a218520ba0 /gui | |
parent | f5efc8b1696400061a202db614ca02f8a4a8d391 (diff) | |
download | scummvm-rg350-c3f91ca288cd4cfb884fedb956d0d1049f857841.tar.gz scummvm-rg350-c3f91ca288cd4cfb884fedb956d0d1049f857841.tar.bz2 scummvm-rg350-c3f91ca288cd4cfb884fedb956d0d1049f857841.zip |
Converted all scumm dialogs to new scheme
svn-id: r21147
Diffstat (limited to 'gui')
-rw-r--r-- | gui/browser.cpp | 4 | ||||
-rw-r--r-- | gui/eval.cpp | 6 | ||||
-rw-r--r-- | gui/launcher.cpp | 10 | ||||
-rw-r--r-- | gui/message.cpp | 2 | ||||
-rw-r--r-- | gui/newgui.cpp | 7 | ||||
-rw-r--r-- | gui/theme-config.cpp | 116 | ||||
-rw-r--r-- | gui/themes/default-theme.ini | 114 | ||||
-rw-r--r-- | gui/widget.cpp | 7 | ||||
-rw-r--r-- | gui/widget.h | 2 |
9 files changed, 218 insertions, 50 deletions
diff --git a/gui/browser.cpp b/gui/browser.cpp index 8c050402f8..d31e3b851a 100644 --- a/gui/browser.cpp +++ b/gui/browser.cpp @@ -160,10 +160,10 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser) _currentPath = NULL; // Headline - TODO: should be customizable during creation time - new StaticTextWidget(this, 10, kLineHeight, _w - 2 * 10, kLineHeight, title, kTextAlignCenter, ws); + new StaticTextWidget(this, 10, kLineHeight, _w - 2 * 10, kLineHeight, title, kTextAlignCenter); // Current path - TODO: handle long paths ? - _currentPath = new StaticTextWidget(this, 10, 2 * kLineHeight, _w - 2 * 10, kLineHeight, "DUMMY", kTextAlignLeft, ws); + _currentPath = new StaticTextWidget(this, 10, 2 * kLineHeight, _w - 2 * 10, kLineHeight, "DUMMY", kTextAlignLeft); // Add file list _fileList = new ListWidget(this, 10, 3 * kLineHeight, _w - 2 * 10, _h - 3 * kLineHeight - buttonHeight - 14, ws); diff --git a/gui/eval.cpp b/gui/eval.cpp index ba2ed1e694..18a027a830 100644 --- a/gui/eval.cpp +++ b/gui/eval.cpp @@ -26,6 +26,8 @@ #include "gui/widget.h" #include "gui/newgui.h" +#include "graphics/scaler.h" + namespace GUI { static bool isdelim(char c) { @@ -45,7 +47,7 @@ Eval::~Eval() { int Eval::eval(const String &input, const String §ion, const String &name, int startpos) { int result; - debug(3, "<%s>", input.c_str()); + debug(3, "%s=%s", name.c_str(), input.c_str()); strncpy(_input, input.c_str(), 256); _section = section; @@ -240,6 +242,8 @@ static const BuiltinConsts builtinConsts[] = { {"kNormalWidgetSize", GUI::kNormalWidgetSize}, {"kBigWidgetSize", GUI::kBigWidgetSize}, + {"kThumbnailWidth", kThumbnailWidth}, + {"false", 0}, {"true", 1}, {NULL, 0} diff --git a/gui/launcher.cpp b/gui/launcher.cpp index e539460ee5..24723ce3d1 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -191,12 +191,12 @@ EditGameDialog::EditGameDialog(const String &domain, const char *desc) yoffset = vBorder; // GUI: Label & edit widget for the game ID - new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "ID: ", kTextAlignRight, ws); + new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "ID: ", kTextAlignRight); _domainWidget = new DomainEditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10 - x, kLineHeight, _domain, ws); yoffset += _domainWidget->getHeight() + 3; // GUI: Label & edit widget for the description - new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "Name: ", kTextAlignRight, ws); + new StaticTextWidget(tab, x, yoffset + 2, labelWidth, kLineHeight, "Name: ", kTextAlignRight); _descriptionWidget = new EditTextWidget(tab, x + labelWidth, yoffset, _w - labelWidth - 10 - x, kLineHeight, description, ws); yoffset += _descriptionWidget->getHeight() + 3; @@ -229,12 +229,12 @@ EditGameDialog::EditGameDialog(const String &domain, const char *desc) // GUI: Button + Label for the game path new ButtonWidget(tab, x, yoffset, buttonWidth + 5, buttonHeight, "Game Path: ", kCmdGameBrowser, 0, ws); - _gamePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, gamePath, kTextAlignLeft, ws); + _gamePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, gamePath, kTextAlignLeft); yoffset += buttonHeight + 4; // GUI: Button + Label for the additional path new ButtonWidget(tab, x, yoffset, buttonWidth + 5, buttonHeight, "Extra Path:", kCmdExtraBrowser, 0, ws); - _extraPathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, extraPath, kTextAlignLeft, ws); + _extraPathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, extraPath, kTextAlignLeft); if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) { _extraPathWidget->setLabel("None"); } @@ -242,7 +242,7 @@ EditGameDialog::EditGameDialog(const String &domain, const char *desc) // GUI: Button + Label for the save path new ButtonWidget(tab, x, yoffset, buttonWidth + 5, buttonHeight, "Save Path: ", kCmdSaveBrowser, 0, ws); - _savePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, savePath, kTextAlignLeft, ws); + _savePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, savePath, kTextAlignLeft); if (savePath.isEmpty() || !ConfMan.hasKey("savepath", _domain)) { _savePathWidget->setLabel("Default"); } diff --git a/gui/message.cpp b/gui/message.cpp index da89a0a385..96d620bb07 100644 --- a/gui/message.cpp +++ b/gui/message.cpp @@ -83,7 +83,7 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB // Each line is represented by one static text item. for (int i = 0; i < lineCount; i++) { new StaticTextWidget(this, 10, 10 + i * kLineHeight, maxlineWidth, kLineHeight, - lines[i], kTextAlignCenter, ws); + lines[i], kTextAlignCenter); } // FIXME - allow for more than two buttons, and return in runModal() which one diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 808dea699d..67cffab6df 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -58,10 +58,13 @@ enum { // HACK. FIXME. This doesn't belong here. But otherwise it creates compulation problems GuiObject::GuiObject(Common::String name) : _firstWidget(0) { - _x = g_gui.evaluator()->getVar(name + ".x"); - _y = g_gui.evaluator()->getVar(name + ".y"); + if ((_x = g_gui.evaluator()->getVar(name + ".x")) == EVAL_UNDEF_VAR) + error("Undefined variable %s.x", name.c_str()); + if ((_y = g_gui.evaluator()->getVar(name + ".y")) == EVAL_UNDEF_VAR) + error("Undefined variable %s.y", name.c_str()); _w = g_gui.evaluator()->getVar(name + ".w"); _h = g_gui.evaluator()->getVar(name + ".h"); + _name = name; } diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp index 4249fd882c..10edc49251 100644 --- a/gui/theme-config.cpp +++ b/gui/theme-config.cpp @@ -37,6 +37,13 @@ def_kFontHeight=10\n\ def_globOptionsW=(w - 2 * 10)\n\ def_globOptionsH=(h - 1 * 40)\n\ def_tabPopupsLabelW=100\n\ +def_scummmainHOffset=8\n\ +def_scummmainVSpace=5\n\ +def_scummmainVAddOff=2\n\ +def_scummmainButtonWidth=90\n\ +def_scummmainButtonHeight=16\n\ +def_scummhelpX=5\n\ +def_scummhelpW=(w - 2 * 5)\n\ def_midiControlsSpacing=1\n\ use=XxY\n\ \n\ @@ -51,11 +58,18 @@ def_kFontHeight=14\n\ def_globOptionsW=(w - 2 * 10)\n\ def_globOptionsH=(h - 2 * 40)\n\ def_tabPopupsLabelW=150\n\ +def_scummmainHOffset=12\n\ +def_scummmainVSpace=7\n\ +def_scummmainVAddOff=3\n\ +def_scummmainButtonWidth=160\n\ +def_scummmainButtonHeight=28\n\ +def_scummhelpW=370\n\ +def_scummhelpX=((w - scummhelpW) / 2)\n\ def_midiControlsSpacing=2\n\ chooser_headline=10 6 (w - 2 * 16) (kLineHeight)\n\ chooser_list=10 (6 + kLineHeight + 2) (w - 2 * 16) (h - self.y - buttonHeight - 12)\n\ \n\ -## launcher\n\ +##### launcher\n\ hBorder=10\n\ launcher_version=hBorder 8 (w - 2 * hBorder) kLineHeight\n\ top=(h - 8 - buttonHeight)\n\ @@ -63,23 +77,23 @@ numButtons=4\n\ space=8\n\ butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)\n\ launcher_quit_button=hBorder top butWidth buttonHeight\n\ -launcher_about_button=(prev.x2 + space) top butWidth buttonHeight\n\ -launcher_options_button=(prev.x2 + space) top butWidth buttonHeight\n\ -launcher_start_button=(prev.x2 + space) top butWidth buttonHeight\n\ +launcher_about_button=(prev.x2 + space) prev.y prev.w prev.h\n\ +launcher_options_button=(prev.x2 + space) prev.y prev.w prev.h\n\ +launcher_start_button=(prev.x2 + space) prev.y prev.w prev.h\n\ top=(top - buttonHeight * 2)\n\ numButtons=3\n\ space=10\n\ butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons)\n\ launcher_addGame_button=hBorder top butWidth buttonHeight\n\ -launcher_editGame_button=(prev.x2 + space) top butWidth buttonHeight\n\ -launcher_removeGame_button=(prev.x2 + space) top butWidth buttonHeight\n\ +launcher_editGame_button=(prev.x2 + space) prev.y prev.w prev.h\n\ +launcher_removeGame_button=(prev.x2 + space) prev.y prev.w prev.h\n\ launcher_list=hBorder (kLineHeight + 16) (w - 2 * hBorder) (top - kLineHeight - 20)\n\ \n\ -# global options\n\ +### global options\n\ globaloptions=10 40 globOptionsW globOptionsH\n\ set_parent=globaloptions\n\ vBorder=5\n\ -globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight -8 - 2 * vBorder)\n\ +globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)\n\ \n\ # graphics tab\n\ opYoffset=vBorder\n\ @@ -100,17 +114,17 @@ useWithPrefix=midiControls globaloptions_\n\ # paths tab\n\ yoffset=vBorder\n\ globaloptions_savebutton=5 yoffset (buttonWidth + 5) buttonHeight\n\ -globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight\n\ +globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight\n\ yoffset=(yoffset + buttonHeight + 4)\n\ globaloptions_extrabutton=5 yoffset (buttonWidth + 5) buttonHeight\n\ -globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight\n\ +globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight\n\ yoffset=(yoffset + buttonHeight + 4)\n\ globaloptions_keysbutton=5 yoffset buttonWidth buttonHeight\n\ \n\ -globaloptions_ok=(parent.w - (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n\ globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n\ +globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h\n\ \n\ -# game options\n\ +### game options\n\ opYoffset=(vBorder + buttonHeight)\n\ opWidth=globOptionsW\n\ useWithPrefix=graphicsControls gameoptions_\n\ @@ -124,20 +138,86 @@ useWithPrefix=volumeControls gameoptions_\n\ opYoffset=(vBorder + buttonHeight)\n\ useWithPrefix=midiControls gameoptions_\n\ \n\ -### SCUMM game options\n\ +##### SCUMM dialogs\n\ +scummDummyDialog=0 80 0 16\n\ +\n\ +## Main dialog\n\ +# note that scummmain size depends on overall height\n\ +smY=(scummmainVSpace + scummmainVAddOff)\n\ +scummmain_resume=scummmainHOffset smY scummmainButtonWidth scummmainButtonHeight\n\ +smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\ +smY=(smY + scummmainVSpace)\n\ +scummmain_load=prev.x smY prev.w prev.h\n\ +smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\ +scummmain_save=prev.x smY prev.w prev.h\n\ +smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\ +smY=(smY + scummmainVSpace)\n\ +scummmain_options=prev.x smY prev.w prev.h\n\ +smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\ +scummmain_help=prev.x smY prev.w prev.h\n\ +smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\ +scummmain_about=prev.x smY prev.w prev.h\n\ +smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\ +smY=(smY + scummmainVSpace)\n\ +scummmain_quit=prev.x smY prev.w prev.h\n\ +smY=(smY + scummmainButtonHeight + scummmainVAddOff)\n\ +smW=(scummmainButtonWidth + 2 * scummmainHOffset)\n\ +smH=(smY + scummmainVSpace)\n\ +scummmain=((w - smW) / 2) ((h - smH) / 2) smW smH\n\ +\n\ +## Engine config\n\ +# note that scummconfig size depends on overall height\n\ +# hence it is on the end of the list\n\ opYoffset=8\n\ -useWithPrefix=volumeControls scummoptions_\n\ +useWithPrefix=volumeControls scummconfig_\n\ +scummconfig_subtitlesCheckbox=15 opYoffset (kFontHeight + 10 + 89) buttonHeight\n\ +opYoffset=(opYoffset + buttonHeight)\n\ +scummconfig_speechCheckbox=prev.x opYoffset (kFontHeight + 10 + 85) buttonHeight\n\ +opYoffset=(opYoffset + buttonHeight + 4)\n\ +soWidth=(8 + 3 * buttonWidth + 4)\n\ +scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) - 4) opYoffset buttonWidth buttonHeight\n\ +scummconfig_cancel=(prev.x2 + 4) prev.y prev.w prev.h\n\ +scummconfig_ok=(prev.x2 + 4) prev.y prev.w prev.h\n\ +opYoffset=(opYoffset + buttonHeight)\n\ +scummconfig=((w - soWidth) / 2) ((h - opYoffset) / 2) soWidth (opYoffset + 8)\n\ +\n\ +## Help\n\ +scummHelpNumLines=15\n\ +shH=(5 + (2 + scummHelpNumLines) * kFontHeight + buttonHeight + 7)\n\ +scummhelp=scummhelpX ((h - shH) / 2) scummhelpW shH\n\ +scummhelp_title=10 5 scummhelpW kFontHeight\n\ +scummhelp_key.x=10\n\ +scummhelp_key.yoffset=5\n\ +scummhelp_key.w=80\n\ +scummhelp_key.h=kFontHeight\n\ +scummhelp_dsc.x=90\n\ +scummhelp_dsc.yoffset=5\n\ +scummhelp_dsc.w=(scummhelpW - 10 - 90)\n\ +scummhelp_dsc.h=kFontHeight\n\ +scummhelp_prev=10 (5 + kFontHeight * (scummHelpNumLines + 2) + 2) buttonWidth buttonHeight\n\ +scummhelp_next=(prev.x2 + 8) prev.y prev.w prev.h\n\ +scummhelp_close=(scummhelpW - 8 - buttonWidth) prev.y prev.w prev.h\n\ +\n\ +# Saveload dialog\n\ +scummsaveload=8 8 (w - 2 * 8) (h - 16)\n\ +set_parent=scummsaveload\n\ +scummsaveload_title=10 6 (parent.w - 2 * 10) kLineHeight\n\ +scummsaveload_list=10 18 (parent.w - 2 * 10 - 180) (parent.h - 14 - buttonHeight - 18)\n\ +scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 22)) 18\n\ +scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n\ +scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h\n\ \n\ +############################################\n\ [graphicsControls]\n\ gcx=10\n\ gcw=(opWidth - 2 * 10)\n\ grModePopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight\n\ opYoffset=(opYoffset + kLineHeight + 4)\n\ -grRenderPopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight\n\ +grRenderPopup=prev.x opYoffset prev.w prev.h\n\ opYoffset=(opYoffset + kLineHeight + 4)\n\ grFullscreenCheckbox=gcx opYoffset (kFontHeight + 10 + 96) buttonHeight\n\ opYoffset=(opYoffset + buttonHeight)\n\ -grAspectCheckbox=gcx opYoffset (kFontHeight + 10 + 136) buttonHeight\n\ +grAspectCheckbox=prev.x opYoffset (kFontHeight + 10 + 136) prev.h\n\ opYoffset=(opYoffset + buttonHeight)\n\ \n\ [audioControls]\n\ @@ -200,7 +280,7 @@ void Theme::processSingleLine(const String §ion, const String prefix, const for (i = 0; i < str.size(); i++) { if (isspace(str[i]) && level == 0) { - value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name, start); + value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name + "." + postfixes[npostfix], start); _evaluator->setVariable(prefix + name + "." + postfixes[npostfix++], value); start = i + 1; } @@ -220,7 +300,7 @@ void Theme::processSingleLine(const String §ion, const String prefix, const error("Missing ')' in section: [%s] expression: \"%s\" start is at: %d", section.c_str(), name.c_str(), start); - value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name, start); + value = _evaluator->eval(String(&(str.c_str()[start]), i - start), section, name + "." + postfixes[npostfix], start); // process VAR=VALUE construct if (npostfix == 0) diff --git a/gui/themes/default-theme.ini b/gui/themes/default-theme.ini index 3b6e0a034b..74b8e0c138 100644 --- a/gui/themes/default-theme.ini +++ b/gui/themes/default-theme.ini @@ -141,6 +141,13 @@ def_kFontHeight=10 def_globOptionsW=(w - 2 * 10) def_globOptionsH=(h - 1 * 40) def_tabPopupsLabelW=100 +def_scummmainHOffset=8 +def_scummmainVSpace=5 +def_scummmainVAddOff=2 +def_scummmainButtonWidth=90 +def_scummmainButtonHeight=16 +def_scummhelpX=5 +def_scummhelpW=(w - 2 * 5) def_midiControlsSpacing=1 use=XxY @@ -155,11 +162,18 @@ def_kFontHeight=14 def_globOptionsW=(w - 2 * 10) def_globOptionsH=(h - 2 * 40) def_tabPopupsLabelW=150 +def_scummmainHOffset=12 +def_scummmainVSpace=7 +def_scummmainVAddOff=3 +def_scummmainButtonWidth=160 +def_scummmainButtonHeight=28 +def_scummhelpW=370 +def_scummhelpX=((w - scummhelpW) / 2) def_midiControlsSpacing=2 chooser_headline=10 6 (w - 2 * 16) (kLineHeight) chooser_list=10 (6 + kLineHeight + 2) (w - 2 * 16) (h - self.y - buttonHeight - 12) -## launcher +##### launcher hBorder=10 launcher_version=hBorder 8 (w - 2 * hBorder) kLineHeight top=(h - 8 - buttonHeight) @@ -167,23 +181,23 @@ numButtons=4 space=8 butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons) launcher_quit_button=hBorder top butWidth buttonHeight -launcher_about_button=(prev.x2 + space) top butWidth buttonHeight -launcher_options_button=(prev.x2 + space) top butWidth buttonHeight -launcher_start_button=(prev.x2 + space) top butWidth buttonHeight +launcher_about_button=(prev.x2 + space) prev.y prev.w prev.h +launcher_options_button=(prev.x2 + space) prev.y prev.w prev.h +launcher_start_button=(prev.x2 + space) prev.y prev.w prev.h top=(top - buttonHeight * 2) numButtons=3 space=10 butWidth=((w - 2 * hBorder - space * (numButtons - 1)) / numButtons) launcher_addGame_button=hBorder top butWidth buttonHeight -launcher_editGame_button=(prev.x2 + space) top butWidth buttonHeight -launcher_removeGame_button=(prev.x2 + space) top butWidth buttonHeight +launcher_editGame_button=(prev.x2 + space) prev.y prev.w prev.h +launcher_removeGame_button=(prev.x2 + space) prev.y prev.w prev.h launcher_list=hBorder (kLineHeight + 16) (w - 2 * hBorder) (top - kLineHeight - 20) -# global options +### global options globaloptions=10 40 globOptionsW globOptionsH set_parent=globaloptions vBorder=5 -globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight -8 - 2 * vBorder) +globaloptions_tabwidget=0, vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder) # graphics tab opYoffset=vBorder @@ -204,17 +218,17 @@ useWithPrefix=midiControls globaloptions_ # paths tab yoffset=vBorder globaloptions_savebutton=5 yoffset (buttonWidth + 5) buttonHeight -globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight +globaloptions_savepath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight yoffset=(yoffset + buttonHeight + 4) globaloptions_extrabutton=5 yoffset (buttonWidth + 5) buttonHeight -globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (5 + buttonWidth + 20) - 10) kLineHeight +globaloptions_extrapath=(prev.x2 + 20) (vBorder + 3) (parent.w - (prev.w + 20) - 10) kLineHeight yoffset=(yoffset + buttonHeight + 4) globaloptions_keysbutton=5 yoffset buttonWidth buttonHeight -globaloptions_ok=(parent.w - (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight globaloptions_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight +globaloptions_ok=(prev.x2 + 10) prev.y prev.w prev.h -# game options +### game options opYoffset=(vBorder + buttonHeight) opWidth=globOptionsW useWithPrefix=graphicsControls gameoptions_ @@ -228,20 +242,86 @@ useWithPrefix=volumeControls gameoptions_ opYoffset=(vBorder + buttonHeight) useWithPrefix=midiControls gameoptions_ -### SCUMM game options +##### SCUMM dialogs +scummDummyDialog=0 80 0 16 + +## Main dialog +# note that scummmain size depends on overall height +smY=(scummmainVSpace + scummmainVAddOff) +scummmain_resume=scummmainHOffset smY scummmainButtonWidth scummmainButtonHeight +smY=(smY + scummmainButtonHeight + scummmainVAddOff) +smY=(smY + scummmainVSpace) +scummmain_load=prev.x smY prev.w prev.h +smY=(smY + scummmainButtonHeight + scummmainVAddOff) +scummmain_save=prev.x smY prev.w prev.h +smY=(smY + scummmainButtonHeight + scummmainVAddOff) +smY=(smY + scummmainVSpace) +scummmain_options=prev.x smY prev.w prev.h +smY=(smY + scummmainButtonHeight + scummmainVAddOff) +scummmain_help=prev.x smY prev.w prev.h +smY=(smY + scummmainButtonHeight + scummmainVAddOff) +scummmain_about=prev.x smY prev.w prev.h +smY=(smY + scummmainButtonHeight + scummmainVAddOff) +smY=(smY + scummmainVSpace) +scummmain_quit=prev.x smY prev.w prev.h +smY=(smY + scummmainButtonHeight + scummmainVAddOff) +smW=(scummmainButtonWidth + 2 * scummmainHOffset) +smH=(smY + scummmainVSpace) +scummmain=((w - smW) / 2) ((h - smH) / 2) smW smH + +## Engine config +# note that scummconfig size depends on overall height +# hence it is on the end of the list opYoffset=8 -useWithPrefix=volumeControls scummoptions_ - +useWithPrefix=volumeControls scummconfig_ +scummconfig_subtitlesCheckbox=15 opYoffset (kFontHeight + 10 + 89) buttonHeight +opYoffset=(opYoffset + buttonHeight) +scummconfig_speechCheckbox=prev.x opYoffset (kFontHeight + 10 + 85) buttonHeight +opYoffset=(opYoffset + buttonHeight + 4) +soWidth=(8 + 3 * buttonWidth + 4) +scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) - 4) opYoffset buttonWidth buttonHeight +scummconfig_cancel=(prev.x2 + 4) prev.y prev.w prev.h +scummconfig_ok=(prev.x2 + 4) prev.y prev.w prev.h +opYoffset=(opYoffset + buttonHeight) +scummconfig=((w - soWidth) / 2) ((h - opYoffset) / 2) soWidth (opYoffset + 8) + +## Help +scummHelpNumLines=15 +shH=(5 + (2 + scummHelpNumLines) * kFontHeight + buttonHeight + 7) +scummhelp=scummhelpX ((h - shH) / 2) scummhelpW shH +scummhelp_title=10 5 scummhelpW kFontHeight +scummhelp_key.x=10 +scummhelp_key.yoffset=5 +scummhelp_key.w=80 +scummhelp_key.h=kFontHeight +scummhelp_dsc.x=90 +scummhelp_dsc.yoffset=5 +scummhelp_dsc.w=(scummhelpW - 10 - 90) +scummhelp_dsc.h=kFontHeight +scummhelp_prev=10 (5 + kFontHeight * (scummHelpNumLines + 2) + 2) buttonWidth buttonHeight +scummhelp_next=(prev.x2 + 8) prev.y prev.w prev.h +scummhelp_close=(scummhelpW - 8 - buttonWidth) prev.y prev.w prev.h + +# Saveload dialog +scummsaveload=8 8 (w - 2 * 8) (h - 16) +set_parent=scummsaveload +scummsaveload_title=10 6 (parent.w - 2 * 10) kLineHeight +scummsaveload_list=10 18 (parent.w - 2 * 10 - 180) (parent.h - 14 - buttonHeight - 18) +scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 22)) 18 +scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight +scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h + +############################################ [graphicsControls] gcx=10 gcw=(opWidth - 2 * 10) grModePopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight opYoffset=(opYoffset + kLineHeight + 4) -grRenderPopup=(gcx - 5) opYoffset (gcw + 5) kLineHeight +grRenderPopup=prev.x opYoffset prev.w prev.h opYoffset=(opYoffset + kLineHeight + 4) grFullscreenCheckbox=gcx opYoffset (kFontHeight + 10 + 96) buttonHeight opYoffset=(opYoffset + buttonHeight) -grAspectCheckbox=gcx opYoffset (kFontHeight + 10 + 136) buttonHeight +grAspectCheckbox=prev.x opYoffset (kFontHeight + 10 + 136) prev.h opYoffset=(opYoffset + buttonHeight) [audioControls] diff --git a/gui/widget.cpp b/gui/widget.cpp index 21b18a1f1b..54383c073f 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -123,8 +123,9 @@ bool Widget::isVisible() const { #pragma mark - -StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align, WidgetSize ws) - : Widget(boss, x, y, w, h), _align(align), _ws(ws) { +StaticTextWidget::StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align) + : Widget(boss, x, y, w, h), _align(align) { + _ws = g_gui.getWidgetSize(); _flags = WIDGET_ENABLED; _type = kStaticTextWidget; _label = text; @@ -169,7 +170,7 @@ void StaticTextWidget::drawWidget(bool hilite) { #pragma mark - ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey, WidgetSize ws) - : StaticTextWidget(boss, x, y, w, h, label, kTextAlignCenter, ws), CommandSender(boss), + : StaticTextWidget(boss, x, y, w, h, label, kTextAlignCenter), CommandSender(boss), _cmd(cmd), _hotkey(hotkey) { _flags = WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG; _type = kButtonWidget; diff --git a/gui/widget.h b/gui/widget.h index 17ad52221a..112177db8e 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -163,7 +163,7 @@ protected: TextAlignment _align; WidgetSize _ws; public: - StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align, WidgetSize ws = kDefaultWidgetSize); + StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, TextAlignment align); StaticTextWidget(GuiObject *boss, String name, const String &text, TextAlignment align); void setValue(int value); void setLabel(const String &label); |