aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-30 05:28:09 +0000
committerAlejandro Marzini2010-07-30 05:28:09 +0000
commitfb4086cadb8ce3e473dae40558d713e7a31b3858 (patch)
tree95c19d544da914c43a43f0538a1977f43e17cb39 /gui
parent7b070bbef8275ff25dfc2cbc3106acfdc8de74a5 (diff)
parenta17e3c444917ca90dfd537c2102a6150e7ffe977 (diff)
downloadscummvm-rg350-fb4086cadb8ce3e473dae40558d713e7a31b3858.tar.gz
scummvm-rg350-fb4086cadb8ce3e473dae40558d713e7a31b3858.tar.bz2
scummvm-rg350-fb4086cadb8ce3e473dae40558d713e7a31b3858.zip
Merged from trunk, from Rev 50841 to HEAD
svn-id: r51495
Diffstat (limited to 'gui')
-rw-r--r--gui/GuiManager.cpp36
-rw-r--r--gui/GuiManager.h6
-rw-r--r--gui/ListWidget.cpp5
-rw-r--r--gui/ThemeEngine.cpp110
-rw-r--r--gui/ThemeEngine.h4
-rw-r--r--gui/ThemeParser.cpp6
-rw-r--r--gui/Tooltip.cpp101
-rw-r--r--gui/Tooltip.h50
-rw-r--r--gui/console.cpp4
-rw-r--r--gui/credits.h5
-rw-r--r--gui/debugger.cpp61
-rw-r--r--gui/debugger.h116
-rw-r--r--gui/launcher.cpp34
-rw-r--r--gui/module.mk1
-rw-r--r--gui/options.cpp193
-rw-r--r--gui/options.h11
-rw-r--r--gui/themes/default.inc993
-rw-r--r--gui/themes/scummclassic.zipbin56900 -> 58510 bytes
-rw-r--r--gui/themes/scummclassic/classic_gfx.stx8
-rw-r--r--gui/themes/scummclassic/classic_layout.stx60
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx64
-rw-r--r--gui/themes/scummmodern.zipbin164185 -> 165851 bytes
-rw-r--r--gui/themes/scummmodern/helvb12-iso-8859-1.fcc (renamed from gui/themes/scummmodern/helvr12-l1.fcc)bin5615 -> 5615 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_gfx.stx9
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx60
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx64
-rw-r--r--gui/widget.cpp81
-rw-r--r--gui/widget.h27
28 files changed, 1229 insertions, 880 deletions
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index ff747c6e92..ab370425ab 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -45,11 +45,12 @@ namespace GUI {
enum {
kDoubleClickDelay = 500, // milliseconds
- kCursorAnimateDelay = 250
+ kCursorAnimateDelay = 250,
+ kTooltipDelay = 1250
};
// Constructor
-GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled),
+GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled), _tooltipCheck(false),
_stateIsSaved(false), _cursorAnimateCounter(0), _cursorAnimateTimer(0) {
_theme = 0;
_useStdCursor = false;
@@ -77,7 +78,7 @@ GuiManager::GuiManager() : _redrawStatus(kRedrawDisabled),
}
}
- _tooltip = new Tooltip(this);
+ _tooltip = 0;
}
GuiManager::~GuiManager() {
@@ -224,13 +225,6 @@ Dialog *GuiManager::getTopDialog() const {
return _dialogStack.top();
}
-static void tooltipCallback(void *ref) {
- GuiManager *guiManager = (GuiManager *)ref;
-
- guiManager->getTooltip()->setVisible(true);
- g_system->getTimerManager()->removeTimerProc(&tooltipCallback);
-}
-
void GuiManager::runLoop() {
Dialog *activeDialog = getTopDialog();
bool didSaveState = false;
@@ -321,7 +315,14 @@ void GuiManager::runLoop() {
break;
case Common::EVENT_MOUSEMOVE:
activeDialog->handleMouseMoved(mouse.x, mouse.y, 0);
- _tooltip->setMouseXY(mouse.x, mouse.y);
+
+ if (mouse.x != _lastMousePosition.x || mouse.y != _lastMousePosition.y) {
+ _lastMousePosition.x = mouse.x;
+ _lastMousePosition.y = mouse.y;
+ _lastMousePosition.time = _system->getMillis();
+ }
+
+ _tooltipCheck = true;
eventTookplace = true;
break;
// We don't distinguish between mousebuttons (for now at least)
@@ -367,11 +368,16 @@ void GuiManager::runLoop() {
}
}
- if (eventTookplace) {
- _tooltip->setVisible(false);
+ if (_tooltipCheck && _lastMousePosition.time + kTooltipDelay < _system->getMillis()) {
+ if (_tooltip == 0)
+ _tooltip = new Tooltip();
+
+ _tooltipCheck = false;
+ _tooltip->tooltipModal(_lastMousePosition.x, _lastMousePosition.y);
+ }
- _system->getTimerManager()->removeTimerProc(&tooltipCallback);
- _system->getTimerManager()->installTimerProc(&tooltipCallback, 2*1000000, this);
+ if (eventTookplace && _tooltip) {
+ _tooltip->mustClose();
}
// Delay for a moment
diff --git a/gui/GuiManager.h b/gui/GuiManager.h
index 2a187a92f9..ee1351dc9b 100644
--- a/gui/GuiManager.h
+++ b/gui/GuiManager.h
@@ -33,6 +33,7 @@
#include "graphics/font.h"
#include "gui/widget.h"
+#include "gui/Tooltip.h"
#include "gui/ThemeEngine.h"
class OSystem;
@@ -93,8 +94,6 @@ public:
*/
bool checkScreenChange();
- Tooltip *getTooltip() { return _tooltip; }
-
protected:
enum RedrawStatus {
kRedrawDisabled = 0,
@@ -119,13 +118,14 @@ protected:
bool _useStdCursor;
Tooltip *_tooltip;
+ bool _tooltipCheck;
// position and time of last mouse click (used to detect double clicks)
struct {
int16 x, y; // Position of mouse when the click occurred
uint32 time; // Time
int count; // How often was it already pressed?
- } _lastClick;
+ } _lastClick, _lastMousePosition;
// mouse cursor state
int _cursorAnimateCounter;
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index e08bc09b0b..4447b62244 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -439,11 +439,6 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
_scrollBar->draw();
}
-#if !defined(PALMOS_MODE)
- // not done on PalmOS because keyboard is emulated and keyup is not generated
- _currentKeyDown = state.keycode;
-#endif
-
return handled;
}
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 30bacbb617..b491b12065 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -44,10 +44,6 @@
#include "gui/ThemeEval.h"
#include "gui/ThemeParser.h"
-#if defined(MACOSX) || defined(IPHONE)
-#include <CoreFoundation/CoreFoundation.h>
-#endif
-
#define GUI_ENABLE_BUILTIN_THEME
namespace GUI {
@@ -169,6 +165,7 @@ static const DrawDataInfo kDrawDataDefaults[] = {
{kDDMainDialogBackground, "mainmenu_bg", true, kDDNone},
{kDDSpecialColorBackground, "special_bg", true, kDDNone},
{kDDPlainColorBackground, "plain_bg", true, kDDNone},
+ {kDDTooltipBackground, "tooltip_bg", true, kDDNone},
{kDDDefaultBackground, "default_bg", true, kDDNone},
{kDDTextSelectionBackground, "text_selection", false, kDDNone},
{kDDTextSelectionFocusBackground, "text_selection_focus", false, kDDNone},
@@ -396,15 +393,23 @@ bool ThemeEngine::init() {
// Try to create a Common::Archive with the files of the theme.
if (!_themeArchive && !_themeFile.empty()) {
Common::FSNode node(_themeFile);
- if (node.getName().hasSuffix(".zip") && !node.isDirectory()) {
- Common::Archive *zipArchive = Common::makeZipArchive(node);
-
- if (!zipArchive) {
- warning("Failed to open Zip archive '%s'.", node.getPath().c_str());
- }
- _themeArchive = zipArchive;
- } else if (node.isDirectory()) {
+ if (node.isDirectory()) {
_themeArchive = new Common::FSDirectory(node);
+ } else if (_themeFile.hasSuffix(".zip")) {
+ // TODO: Also use "node" directly?
+ // Look for the zip file via SearchMan
+ Common::ArchiveMemberPtr member = SearchMan.getMember(_themeFile);
+ if (member) {
+ _themeArchive = Common::makeZipArchive(member->createReadStream());
+ if (!_themeArchive) {
+ warning("Failed to open Zip archive '%s'.", member->getDisplayName().c_str());
+ }
+ } else {
+ _themeArchive = Common::makeZipArchive(node);
+ if (!_themeArchive) {
+ warning("Failed to open Zip archive '%s'.", node.getPath().c_str());
+ }
+ }
}
}
@@ -980,6 +985,10 @@ void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground b
queueDD(kDDPlainColorBackground, r);
break;
+ case kDialogBackgroundTooltip:
+ queueDD(kDDTooltipBackground, r);
+ break;
+
case kDialogBackgroundDefault:
queueDD(kDDDefaultBackground, r);
break;
@@ -1058,12 +1067,16 @@ void ThemeEngine::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, co
if (i == active)
continue;
+ if (r.left + i * tabWidth > r.right || r.left + (i + 1) * tabWidth > r.right)
+ continue;
+
Common::Rect tabRect(r.left + i * tabWidth, r.top, r.left + (i + 1) * tabWidth, r.top + tabHeight);
queueDD(kDDTabInactive, tabRect);
queueDDText(getTextData(kDDTabInactive), getTextColor(kDDTabInactive), tabRect, tabs[i], false, false, _widgets[kDDTabInactive]->_textAlignH, _widgets[kDDTabInactive]->_textAlignV);
}
- if (active >= 0) {
+ if (active >= 0 &&
+ (r.left + active * tabWidth < r.right) && (r.left + (active + 1) * tabWidth < r.right)) {
Common::Rect tabRect(r.left + active * tabWidth, r.top, r.left + (active + 1) * tabWidth, r.top + tabHeight);
const uint16 tabLeft = active * tabWidth;
const uint16 tabRight = MAX(r.right - tabRect.right, 0);
@@ -1225,7 +1238,7 @@ void ThemeEngine::restoreState(StoredState *state) {
src += state->backBuffer.pitch;
dst += _backBuffer.pitch;
}
-
+
addDirtyRect(state->r);
}
@@ -1553,6 +1566,28 @@ bool ThemeEngine::themeConfigParseHeader(Common::String header, Common::String &
return tok.empty();
}
+bool ThemeEngine::themeConfigUsable(const Common::ArchiveMember &member, Common::String &themeName) {
+ Common::File stream;
+ bool foundHeader = false;
+
+ if (member.getName().hasSuffix(".zip")) {
+ Common::Archive *zipArchive = Common::makeZipArchive(member.createReadStream());
+
+ if (zipArchive && zipArchive->hasFile("THEMERC")) {
+ stream.open("THEMERC", *zipArchive);
+ }
+
+ delete zipArchive;
+ }
+
+ if (stream.isOpen()) {
+ Common::String stxHeader = stream.readLine();
+ foundHeader = themeConfigParseHeader(stxHeader, themeName);
+ }
+
+ return foundHeader;
+}
+
bool ThemeEngine::themeConfigUsable(const Common::FSNode &node, Common::String &themeName) {
Common::File stream;
bool foundHeader = false;
@@ -1608,26 +1643,7 @@ void ThemeEngine::listUsableThemes(Common::List<ThemeDescriptor> &list) {
if (ConfMan.hasKey("themepath"))
listUsableThemes(Common::FSNode(ConfMan.get("themepath")), list);
-#ifdef DATA_PATH
- listUsableThemes(Common::FSNode(DATA_PATH), list);
-#endif
-
-#if defined(MACOSX) || defined(IPHONE)
- CFURLRef resourceUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
- if (resourceUrl) {
- char buf[256];
- if (CFURLGetFileSystemRepresentation(resourceUrl, true, (UInt8 *)buf, 256)) {
- Common::FSNode resourcePath(buf);
- listUsableThemes(resourcePath, list);
- }
- CFRelease(resourceUrl);
- }
-#endif
-
- if (ConfMan.hasKey("extrapath"))
- listUsableThemes(Common::FSNode(ConfMan.get("extrapath")), list);
-
- listUsableThemes(Common::FSNode("."), list, 1);
+ listUsableThemes(SearchMan, list);
// Now we need to strip all duplicates
// TODO: It might not be the best idea to strip duplicates. The user might
@@ -1646,6 +1662,32 @@ void ThemeEngine::listUsableThemes(Common::List<ThemeDescriptor> &list) {
output.clear();
}
+void ThemeEngine::listUsableThemes(Common::Archive &archive, Common::List<ThemeDescriptor> &list) {
+ ThemeDescriptor td;
+
+ Common::ArchiveMemberList fileList;
+ archive.listMatchingMembers(fileList, "*.zip");
+ for (Common::ArchiveMemberList::iterator i = fileList.begin();
+ i != fileList.end(); ++i) {
+ td.name.clear();
+ if (themeConfigUsable(**i, td.name)) {
+ td.filename = (*i)->getName();
+ td.id = (*i)->getDisplayName();
+
+ // If the name of the node object also contains
+ // the ".zip" suffix, we will strip it.
+ if (td.id.hasSuffix(".zip")) {
+ for (int j = 0; j < 4; ++j)
+ td.id.deleteLastChar();
+ }
+
+ list.push_back(td);
+ }
+ }
+
+ fileList.clear();
+}
+
void ThemeEngine::listUsableThemes(const Common::FSNode &node, Common::List<ThemeDescriptor> &list, int depth) {
if (!node.exists() || !node.isReadable() || !node.isDirectory())
return;
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index f0d4e2585d..f736559def 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -61,6 +61,7 @@ enum DrawData {
kDDMainDialogBackground,
kDDSpecialColorBackground,
kDDPlainColorBackground,
+ kDDTooltipBackground,
kDDDefaultBackground,
kDDTextSelectionBackground,
kDDTextSelectionFocusBackground,
@@ -162,6 +163,7 @@ public:
kDialogBackgroundMain,
kDialogBackgroundSpecial,
kDialogBackgroundPlain,
+ kDialogBackgroundTooltip,
kDialogBackgroundDefault
};
@@ -583,11 +585,13 @@ public:
static void listUsableThemes(Common::List<ThemeDescriptor> &list);
private:
static bool themeConfigUsable(const Common::FSNode &node, Common::String &themeName);
+ static bool themeConfigUsable(const Common::ArchiveMember &member, Common::String &themeName);
static bool themeConfigParseHeader(Common::String header, Common::String &themeName);
static Common::String getThemeFile(const Common::String &id);
static Common::String getThemeId(const Common::String &filename);
static void listUsableThemes(const Common::FSNode &node, Common::List<ThemeDescriptor> &list, int depth = -1);
+ static void listUsableThemes(Common::Archive &archive, Common::List<ThemeDescriptor> &list);
protected:
OSystem *_system; /** Global system object. */
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index 4cabf6ad2e..c809447cbd 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -365,10 +365,8 @@ bool ThemeParser::parserCallback_drawdata(ParserNode *node) {
if (_theme->addDrawData(node->values["id"], cached) == false)
return parserError("Error adding Draw Data set: Invalid DrawData name.");
- if (_defaultStepLocal) {
- delete _defaultStepLocal;
- _defaultStepLocal = 0;
- }
+ delete _defaultStepLocal;
+ _defaultStepLocal = 0;
return true;
}
diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
new file mode 100644
index 0000000000..64c34688df
--- /dev/null
+++ b/gui/Tooltip.cpp
@@ -0,0 +1,101 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "common/util.h"
+#include "graphics/fontman.h"
+#include "gui/widget.h"
+#include "gui/dialog.h"
+#include "gui/GuiManager.h"
+
+#include "gui/Tooltip.h"
+#include "gui/ThemeEval.h"
+
+namespace GUI {
+
+
+Tooltip::Tooltip() :
+ Dialog(-1, -1, -1, -1), _maxWidth(-1) {
+
+ _backgroundType = GUI::ThemeEngine::kDialogBackgroundTooltip;
+}
+
+void Tooltip::mustClose() {
+ if (isVisible())
+ Dialog::close();
+}
+
+bool Tooltip::tooltipModal(int x, int y) {
+ Widget *wdg;
+
+ if (!g_gui.getTopDialog())
+ return false;
+
+ wdg = g_gui.getTopDialog()->findWidget(x, y);
+
+ if (!wdg || !wdg->getTooltip())
+ return false;
+
+ if (_maxWidth == -1) {
+ _maxWidth = g_gui.xmlEval()->getVar("Globals.Tooltip.MaxWidth", 100);
+ _xdelta = g_gui.xmlEval()->getVar("Globals.Tooltip.XDelta", 0);
+ _ydelta = g_gui.xmlEval()->getVar("Globals.Tooltip.YDelta", 0);
+ }
+
+ const Graphics::Font *tooltipFont = g_gui.theme()->getFont(ThemeEngine::kFontStyleTooltip);
+
+ _wrappedLines.clear();
+ _w = tooltipFont->wordWrapText(wdg->getTooltip(), _maxWidth - 4, _wrappedLines);
+ _h = (tooltipFont->getFontHeight() + 2) * _wrappedLines.size();
+
+ _x = MIN<int16>(g_gui.getTopDialog()->_x + x + _xdelta, g_gui.getWidth() - _w - 3);
+ _y = MIN<int16>(g_gui.getTopDialog()->_y + y + _ydelta, g_gui.getHeight() - _h - 3);
+
+ open();
+ g_gui.runLoop();
+
+ return true;
+}
+
+void Tooltip::drawDialog() {
+ int num = 0;
+ int h = g_gui.theme()->getFontHeight(ThemeEngine::kFontStyleTooltip) + 2;
+
+ Dialog::drawDialog();
+
+ for (Common::StringArray::const_iterator i = _wrappedLines.begin(); i != _wrappedLines.end(); ++i, ++num) {
+ g_gui.theme()->drawText(
+ Common::Rect(_x + 1, _y + 1 + num * h, _x + 1 +_w, _y + 1+ (num + 1) * h), *i,
+ ThemeEngine::kStateEnabled,
+ Graphics::kTextAlignLeft,
+ ThemeEngine::kTextInversionNone,
+ 0,
+ false,
+ ThemeEngine::kFontStyleTooltip,
+ ThemeEngine::kFontColorNormal,
+ false
+ );
+ }
+}
+
+}
diff --git a/gui/Tooltip.h b/gui/Tooltip.h
new file mode 100644
index 0000000000..60f3cf3a19
--- /dev/null
+++ b/gui/Tooltip.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#ifndef GUI_TOOLTIP_H
+#define GUI_TOOLTIP_H
+
+#include "gui/dialog.h"
+
+namespace GUI {
+
+class Tooltip : public Dialog {
+public:
+ Tooltip();
+ ~Tooltip() {}
+
+ void drawDialog();
+ bool tooltipModal(int x, int y);
+ void mustClose();
+
+protected:
+ Common::String _text;
+ int _maxWidth;
+ int _xdelta, _ydelta;
+
+ Common::StringArray _wrappedLines;
+};
+}
+
+#endif
diff --git a/gui/console.cpp b/gui/console.cpp
index a2aa56f5b3..a53e97888b 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -669,11 +669,7 @@ int ConsoleDialog::printf(const char *format, ...) {
}
int ConsoleDialog::vprintf(const char *format, va_list argptr) {
-#ifdef PALMOS_MODE
- char buf[256];
-#else
char buf[2048];
-#endif
#if defined(WIN32)
int count = _vsnprintf(buf, sizeof(buf), format, argptr);
diff --git a/gui/credits.h b/gui/credits.h
index ae658e1196..c0e1870226 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -213,9 +213,6 @@ static const char *credits[] = {
"C1""Nintendo DS",
"C0""Neil Millstone",
"",
-"C1""PalmOS",
-"C0""Chris Apers",
-"",
"C1""PocketPC / WinCE",
"C0""Nicolas Bacca",
"C2""(retired)",
@@ -286,6 +283,8 @@ static const char *credits[] = {
"C2""Wiki editor",
"",
"C1""Retired Team Members",
+"C0""Chris Apers",
+"C2""Former PalmOS porter",
"C0""Ralph Brorsen",
"C2""Help with GUI implementation",
"C0""Jamieson Christian",
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 13dc02452d..9bd3b35915 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -39,9 +39,8 @@
namespace GUI {
Debugger::Debugger() {
- _frame_countdown = 0;
- _detach_now = false;
- _isAttached = false;
+ _frameCountdown = 0;
+ _isActive = false;
_errStr = NULL;
_firstTime = true;
#ifndef USE_TEXT_CONSOLE
@@ -50,6 +49,10 @@ Debugger::Debugger() {
_debuggerDialog->setCompletionCallback(debuggerCompletionCallback, this);
#endif
+ // Register variables
+ DVar_Register("debug_countdown", &_frameCountdown, DVAR_INT, 0);
+
+ // Register commands
//DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
DCmd_Register("exit", WRAP_METHOD(Debugger, Cmd_Exit));
DCmd_Register("quit", WRAP_METHOD(Debugger, Cmd_Exit));
@@ -84,40 +87,32 @@ int Debugger::DebugPrintf(const char *format, ...) {
}
void Debugger::attach(const char *entry) {
-
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
- if (entry) {
- _errStr = strdup(entry);
- }
+ // Set error string (if any)
+ free(_errStr);
+ _errStr = entry ? strdup(entry) : 0;
- _frame_countdown = 1;
- _detach_now = false;
- _isAttached = true;
+ // Reset frame countdown (i.e. attach immediately)
+ _frameCountdown = 1;
}
void Debugger::detach() {
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
-
- _detach_now = false;
- _isAttached = false;
}
// Temporary execution handler
void Debugger::onFrame() {
- if (_frame_countdown == 0)
- return;
- --_frame_countdown;
-
- if (!_frame_countdown) {
-
- preEnter();
- enter();
- postEnter();
-
- // Detach if we're finished with the debugger
- if (_detach_now)
- detach();
+ // Count down until 0 is reached
+ if (_frameCountdown > 0) {
+ --_frameCountdown;
+ if (_frameCountdown == 0) {
+ _isActive = true;
+ preEnter();
+ enter();
+ postEnter();
+ _isActive = false;
+ }
}
}
@@ -250,8 +245,8 @@ bool Debugger::parseCommand(const char *inputOrig) {
} else {
int element = atoi(chr+1);
int32 *var = *(int32 **)_dvars[i].variable;
- if (element >= _dvars[i].optional) {
- DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional);
+ if (element >= _dvars[i].arraySize) {
+ DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].arraySize);
} else {
var[element] = atoi(param[1]);
DebugPrintf("(int)%s = %d\n", param[0], var[element]);
@@ -281,8 +276,8 @@ bool Debugger::parseCommand(const char *inputOrig) {
} else {
int element = atoi(chr+1);
const int32 *var = *(const int32 **)_dvars[i].variable;
- if (element >= _dvars[i].optional) {
- DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].optional);
+ if (element >= _dvars[i].arraySize) {
+ DebugPrintf("%s is out of range (array is %d elements big)\n", param[0], _dvars[i].arraySize);
} else {
DebugPrintf("(int)%s = %d\n", param[0], var[element]);
}
@@ -383,7 +378,7 @@ char *Debugger::readlineComplete(const char *input, int state) {
#endif
// Variable registration function
-void Debugger::DVar_Register(const Common::String &varname, void *pointer, int type, int optional) {
+void Debugger::DVar_Register(const Common::String &varname, void *pointer, VarType type, int arraySize) {
// TODO: Filter out duplicates
// TODO: Sort this list? Then we can do binary search later on when doing lookups.
assert(pointer);
@@ -392,7 +387,7 @@ void Debugger::DVar_Register(const Common::String &varname, void *pointer, int t
tmp.name = varname;
tmp.type = type;
tmp.variable = pointer;
- tmp.optional = optional;
+ tmp.arraySize = arraySize;
_dvars.push_back(tmp);
}
@@ -406,7 +401,7 @@ void Debugger::DCmd_Register(const Common::String &cmdname, Debuglet *debuglet)
// Detach ("exit") the debugger
bool Debugger::Cmd_Exit(int argc, const char **argv) {
- _detach_now = true;
+ detach();
return false;
}
diff --git a/gui/debugger.h b/gui/debugger.h
index 07fdddb808..6f06befdf1 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -43,20 +43,46 @@ public:
int DebugPrintf(const char *format, ...);
+ /**
+ * The onFrame() method should be invoked by the engine at regular
+ * intervals (usually once per main loop iteration) whenever the
+ * debugger is attached.
+ * This will open up the console and accept user input if certain
+ * preconditions are met, such as the frame countdown having
+ * reached zero.
+ *
+ * Subclasses can override this to e.g. check for breakpoints being
+ * triggered.
+ */
virtual void onFrame();
+ /**
+ * 'Attach' the debugger. This ensures that the next time onFrame()
+ * is invoked, the debugger will activate and accept user input.
+ */
virtual void attach(const char *entry = 0);
- bool isAttached() const { return _isAttached; }
+
+ /**
+ * Return true if the debugger is currently active (i.e. executing
+ * a command or waiting for use input).
+ */
+ bool isActive() const { return _isActive; }
protected:
typedef Common::Functor2<int, const char **, bool> Debuglet;
- // Convenience macro for registering a method of a debugger class
- // as the current command.
+ /**
+ * Convenience macro that makes it either to register a method
+ * of a debugger subclass as a command.
+ * Usage example:
+ * DCmd_Register("COMMAND", WRAP_METHOD(MyDebugger, MyCmd));
+ * would register the method MyDebugger::MyCmd(int, const char **)
+ * under the command name "COMMAND".
+ */
#define WRAP_METHOD(cls, method) \
new Common::Functor2Mem<int, const char **, bool, cls>(this, &cls::method)
- enum {
+ enum VarType {
DVAR_BYTE,
DVAR_INT,
DVAR_BOOL,
@@ -67,50 +93,100 @@ protected:
struct DVar {
Common::String name;
void *variable;
- int type;
- int optional;
+ VarType type;
+ int arraySize;
};
- int _frame_countdown;
- bool _detach_now;
+
+ /**
+ * Register a variable with the debugger. This allows the user to read and modify
+ * this variable.
+ * @param varname the identifier with which the user may access the variable
+ * @param variable pointer to the actual storage of the variable
+ * @param type the type of the variable (byte, int, bool, ...)
+ * @paral arraySize for type DVAR_INTARRAY this specifies the size of the array
+ *
+ * @todo replace this single method by type safe variants.
+ */
+ void DVar_Register(const Common::String &varname, void *variable, VarType type, int arraySize);
+ void DCmd_Register(const Common::String &cmdname, Debuglet *debuglet);
+
private:
+ /**
+ * The frame countdown specifies a number of frames that must pass
+ * until the console will show up. This value is decremented by one
+ * each time onFrame() is called, until it reaches 0, at which point
+ * onFrame() will open the console and handle input into it.
+ *
+ * The user can modify this value using the debug_countdown command.
+ *
+ * Note: The console must be in *attached* state, otherwise, it
+ * won't show up (and the countdown won't count down either).
+ */
+ uint _frameCountdown;
+
Common::Array<DVar> _dvars;
typedef Common::HashMap<Common::String, Common::SharedPtr<Debuglet>, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> CommandsMap;
CommandsMap _cmds;
- bool _isAttached;
+ /**
+ * True if the debugger is currently active (i.e. executing
+ * a command or waiting for use input).
+ */
+ bool _isActive;
+
char *_errStr;
+
+ /**
+ * Initially true, set to false when Debugger::enter is called
+ * the first time. We use this flag to show a greeting message
+ * to the user once, when he opens the debugger for the first
+ * time.
+ */
bool _firstTime;
+
#ifndef USE_TEXT_CONSOLE
GUI::ConsoleDialog *_debuggerDialog;
#endif
protected:
- // Hook for subclasses: Called just before enter() is run
+ /**
+ * Hook for subclasses which is called just before enter() is run.
+ * A typical usage example is pausing music and sound effects.
+ */
virtual void preEnter() {}
- // Hook for subclasses: Called just after enter() was run
+ /**
+ * Hook for subclasses which is called just after enter() was run.
+ * A typical usage example is resuming music and sound effects.
+ */
virtual void postEnter() {}
- // Hook for subclasses: Process the given command line.
- // Should return true if and only if argv[0] is a known command and was
- // handled, false otherwise.
- virtual bool handleCommand(int argc, const char **argv, bool &keepRunning);
-
+ /**
+ * Subclasses should invoke the detach() method in their Cmd_FOO methods
+ * if that command will resume execution of the program (as opposed to
+ * executing, say, a "single step through code" command).
+ *
+ * This currently only hides the virtual keyboard, if any.
+ */
+ void detach();
private:
- void detach();
void enter();
bool parseCommand(const char *input);
bool tabComplete(const char *input, Common::String &completion) const;
-protected:
- void DVar_Register(const Common::String &varname, void *pointer, int type, int optional);
- void DCmd_Register(const Common::String &cmdname, Debuglet *debuglet);
+ /**
+ * Process the given command line.
+ * Returns true if and only if argv[0] is a known command and was
+ * handled, false otherwise.
+ */
+ virtual bool handleCommand(int argc, const char **argv, bool &keepRunning);
+protected:
bool Cmd_Exit(int argc, const char **argv);
bool Cmd_Help(int argc, const char **argv);
bool Cmd_DebugFlagsList(int argc, const char **argv);
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 1daf9ffd50..d50e7ce578 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -72,6 +72,7 @@ enum {
kCmdGlobalGraphicsOverride = 'OGFX',
kCmdGlobalAudioOverride = 'OSFX',
kCmdGlobalMIDIOverride = 'OMID',
+ kCmdGlobalMT32Override = 'OM32',
kCmdGlobalVolumeOverride = 'OVOL',
kCmdChooseSoundFontCmd = 'chsf',
@@ -144,6 +145,7 @@ protected:
CheckboxWidget *_globalGraphicsOverride;
CheckboxWidget *_globalAudioOverride;
CheckboxWidget *_globalMIDIOverride;
+ CheckboxWidget *_globalMT32Override;
CheckboxWidget *_globalVolumeOverride;
};
@@ -199,7 +201,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
}
//
- // 3) The graphics tab
+ // 2) The graphics tab
//
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? _("Graphics") : _("GFX"));
@@ -208,7 +210,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
addGraphicControls(tab, "GameOptions_Graphics.");
//
- // 4) The audio tab
+ // 3) The audio tab
//
tab->addTab(_("Audio"));
@@ -218,7 +220,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
addSubtitleControls(tab, "GameOptions_Audio.");
//
- // 5) The volume tab
+ // 4) The volume tab
//
tab->addTab(_("Volume"));
@@ -227,7 +229,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
addVolumeControls(tab, "GameOptions_Volume.");
//
- // 6) The MIDI tab
+ // 5) The MIDI tab
//
tab->addTab(_("MIDI"));
@@ -239,7 +241,19 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
addMIDIControls(tab, "GameOptions_MIDI.");
//
- // 2) The 'Path' tab
+ // 6) The MT-32 tab
+ //
+ tab->addTab(_("MT-32"));
+
+ _globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _("Override global MT-32 settings"), 0, kCmdGlobalMT32Override);
+
+ //if (_guioptions & Common::GUIO_NOMIDI)
+ // _globalMT32Override->setEnabled(false);
+
+ addMT32Controls(tab, "GameOptions_MT32.");
+
+ //
+ // 7) The Paths tab
//
tab->addTab(_("Paths"));
@@ -305,11 +319,13 @@ void EditGameDialog::open() {
e = ConfMan.hasKey("soundfont", _domain) ||
ConfMan.hasKey("multi_midi", _domain) ||
- ConfMan.hasKey("native_mt32", _domain) ||
- ConfMan.hasKey("enable_gs", _domain) ||
ConfMan.hasKey("midi_gain", _domain);
_globalMIDIOverride->setState(e);
+ e = ConfMan.hasKey("native_mt32", _domain) ||
+ ConfMan.hasKey("enable_gs", _domain);
+ _globalMT32Override->setState(e);
+
// TODO: game path
const Common::Language lang = Common::parseLanguage(ConfMan.get("language", _domain));
@@ -383,6 +399,10 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
setMIDISettingsState(data != 0);
draw();
break;
+ case kCmdGlobalMT32Override:
+ setMT32SettingsState(data != 0);
+ draw();
+ break;
case kCmdGlobalVolumeOverride:
setVolumeSettingsState(data != 0);
draw();
diff --git a/gui/module.mk b/gui/module.mk
index 9bf1a08d4b..72b5fa18f3 100644
--- a/gui/module.mk
+++ b/gui/module.mk
@@ -25,6 +25,7 @@ MODULE_OBJS := \
ThemeEval.o \
ThemeLayout.o \
ThemeParser.o \
+ Tooltip.o \
widget.o
ifdef MACOSX
diff --git a/gui/options.cpp b/gui/options.cpp
index 856eb668fa..d3bda228a7 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -100,13 +100,14 @@ void OptionsDialog::init() {
_aspectCheckbox = 0;
_enableAudioSettings = false;
_midiPopUp = 0;
- _mt32DevicePopUp = 0;
- _gmDevicePopUp = 0;
_oplPopUp = 0;
_outputRatePopUp = 0;
_enableMIDISettings = false;
+ _gmDevicePopUp = 0;
_multiMidiCheckbox = 0;
+ _enableMT32Settings = false;
_mt32Checkbox = 0;
+ _mt32DevicePopUp = 0;
_enableGSCheckbox = 0;
_enableVolumeSettings = false;
_musicVolumeDesc = 0;
@@ -197,24 +198,6 @@ void OptionsDialog::open() {
if (!loadMusicDeviceSetting(_midiPopUp, "music_driver"))
_midiPopUp->setSelected(0);
- if (!loadMusicDeviceSetting(_mt32DevicePopUp, "mt32_device")) {
- if (_domain.equals(Common::ConfigManager::kApplicationDomain)) {
- if (!loadMusicDeviceSetting(_mt32DevicePopUp, Common::String(), MT_MT32))
- _mt32DevicePopUp->setSelected(0);
- } else {
- _mt32DevicePopUp->setSelected(0);
- }
- }
-
- if (!loadMusicDeviceSetting(_gmDevicePopUp, "gm_device")) {
- if (_domain.equals(Common::ConfigManager::kApplicationDomain)) {
- if (!loadMusicDeviceSetting(_gmDevicePopUp, Common::String(), MT_GM))
- _gmDevicePopUp->setSelected(0);
- } else {
- _gmDevicePopUp->setSelected(0);
- }
- }
-
if (_oplPopUp) {
OPL::Config::DriverId id = MAX<OPL::Config::DriverId>(OPL::Config::parse(ConfMan.get("opl_driver", _domain)), 0);
_oplPopUp->setSelectedTag(id);
@@ -230,16 +213,18 @@ void OptionsDialog::open() {
}
if (_multiMidiCheckbox) {
+ if (!loadMusicDeviceSetting(_gmDevicePopUp, "gm_device")) {
+ if (_domain.equals(Common::ConfigManager::kApplicationDomain)) {
+ if (!loadMusicDeviceSetting(_gmDevicePopUp, Common::String(), MT_GM))
+ _gmDevicePopUp->setSelected(0);
+ } else {
+ _gmDevicePopUp->setSelected(0);
+ }
+ }
// Multi midi setting
_multiMidiCheckbox->setState(ConfMan.getBool("multi_midi", _domain));
- // Native mt32 setting
- _mt32Checkbox->setState(ConfMan.getBool("native_mt32", _domain));
-
- // GS extensions setting
- _enableGSCheckbox->setState(ConfMan.getBool("enable_gs", _domain));
-
Common::String soundFont(ConfMan.get("soundfont", _domain));
if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) {
_soundFont->setLabel(_("None"));
@@ -257,6 +242,24 @@ void OptionsDialog::open() {
_midiGainLabel->setLabel(buf);
}
+ // MT-32 options
+ if (_mt32DevicePopUp) {
+ if (!loadMusicDeviceSetting(_mt32DevicePopUp, "mt32_device")) {
+ if (_domain.equals(Common::ConfigManager::kApplicationDomain)) {
+ if (!loadMusicDeviceSetting(_mt32DevicePopUp, Common::String(), MT_MT32))
+ _mt32DevicePopUp->setSelected(0);
+ } else {
+ _mt32DevicePopUp->setSelected(0);
+ }
+ }
+
+ // Native mt32 setting
+ _mt32Checkbox->setState(ConfMan.getBool("native_mt32", _domain));
+
+ // GS extensions setting
+ _enableGSCheckbox->setState(ConfMan.getBool("enable_gs", _domain));
+ }
+
// Volume options
if (_musicVolumeSlider) {
int vol;
@@ -353,12 +356,8 @@ void OptionsDialog::close() {
if (_midiPopUp) {
if (_enableAudioSettings) {
saveMusicDeviceSetting(_midiPopUp, "music_driver");
- saveMusicDeviceSetting(_mt32DevicePopUp, "mt32_device");
- saveMusicDeviceSetting(_gmDevicePopUp, "gm_device");
} else {
ConfMan.removeKey("music_driver", _domain);
- ConfMan.removeKey("mt32_device", _domain);
- ConfMan.removeKey("gm_device", _domain);
}
}
@@ -391,9 +390,9 @@ void OptionsDialog::close() {
// MIDI options
if (_multiMidiCheckbox) {
if (_enableMIDISettings) {
+ saveMusicDeviceSetting(_gmDevicePopUp, "gm_device");
+
ConfMan.setBool("multi_midi", _multiMidiCheckbox->getState(), _domain);
- ConfMan.setBool("native_mt32", _mt32Checkbox->getState(), _domain);
- ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain);
ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain);
Common::String soundFont(_soundFont->getLabel());
@@ -402,14 +401,26 @@ void OptionsDialog::close() {
else
ConfMan.removeKey("soundfont", _domain);
} else {
+ ConfMan.removeKey("gm_device", _domain);
ConfMan.removeKey("multi_midi", _domain);
- ConfMan.removeKey("native_mt32", _domain);
- ConfMan.removeKey("enable_gs", _domain);
ConfMan.removeKey("midi_gain", _domain);
ConfMan.removeKey("soundfont", _domain);
}
}
+ // MT-32 options
+ if (_mt32DevicePopUp) {
+ if (_enableMT32Settings) {
+ saveMusicDeviceSetting(_mt32DevicePopUp, "mt32_device");
+ ConfMan.setBool("native_mt32", _mt32Checkbox->getState(), _domain);
+ ConfMan.setBool("enable_gs", _enableGSCheckbox->getState(), _domain);
+ } else {
+ ConfMan.removeKey("mt32_device", _domain);
+ ConfMan.removeKey("native_mt32", _domain);
+ ConfMan.removeKey("enable_gs", _domain);
+ }
+ }
+
// Subtitle options
if (_subToggleGroup) {
if (_enableSubtitleSettings) {
@@ -513,10 +524,6 @@ void OptionsDialog::setAudioSettingsState(bool enabled) {
_enableAudioSettings = enabled;
_midiPopUpDesc->setEnabled(enabled);
_midiPopUp->setEnabled(enabled);
- _mt32DevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
- _mt32DevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
- _gmDevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
- _gmDevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
uint32 allFlags = MidiDriver::musicType2GUIO((uint32)-1);
@@ -537,6 +544,9 @@ void OptionsDialog::setMIDISettingsState(bool enabled) {
if (_guioptions & Common::GUIO_NOMIDI)
enabled = false;
+ _gmDevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
+ _gmDevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
+
_enableMIDISettings = enabled;
_soundFontButton->setEnabled(enabled);
@@ -548,13 +558,21 @@ void OptionsDialog::setMIDISettingsState(bool enabled) {
_soundFontClearButton->setEnabled(false);
_multiMidiCheckbox->setEnabled(enabled);
- _mt32Checkbox->setEnabled(enabled);
- _enableGSCheckbox->setEnabled(enabled);
_midiGainDesc->setEnabled(enabled);
_midiGainSlider->setEnabled(enabled);
_midiGainLabel->setEnabled(enabled);
}
+void OptionsDialog::setMT32SettingsState(bool enabled) {
+ _enableMT32Settings = enabled;
+
+ _mt32DevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
+ _mt32DevicePopUp->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false);
+
+ _mt32Checkbox->setEnabled(enabled);
+ _enableGSCheckbox->setEnabled(enabled);
+}
+
void OptionsDialog::setVolumeSettingsState(bool enabled) {
bool ena;
@@ -645,11 +663,6 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
_midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", _domain == Common::ConfigManager::kApplicationDomain ? _("Preferred Device:") : _("Music Device:"), _domain == Common::ConfigManager::kApplicationDomain ? _("Specifies preferred sound device or sound card emulator") : _("Specifies output sound device or sound card emulator"));
_midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", _("Specifies output sound device or sound card emulator"));
- _mt32DevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefMt32PopupDesc", _("MT-32 Device:"), _("Specifies default sound device for Roland MT-32/LAPC1/CM32l/CM64 output"));
- _mt32DevicePopUp = new PopUpWidget(boss, prefix + "auPrefMt32Popup");
- _gmDevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefGmPopupDesc", _("GM Device:"), _("Specifies default sound device for General MIDI output"));
- _gmDevicePopUp = new PopUpWidget(boss, prefix + "auPrefGmPopup");
-
// Populate it
uint32 allFlags = MidiDriver::musicType2GUIO((uint32)-1);
@@ -657,27 +670,20 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
MusicDevices i = (**m)->getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
+ const uint32 deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType());
+
if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS) // global dialog - skip useless FM-Towns option there
|| (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified
- || _guioptions & (MidiDriver::musicType2GUIO(d->getMusicType())) // flag is present
+ || (_guioptions & deviceGuiOption) // flag is present
+ // HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set,
+ // else we would not show for example external devices connected via ALSA, since they are always
+ // marked as General MIDI device.
+ || (deviceGuiOption == Common::GUIO_MIDIGM && (_guioptions & Common::GUIO_MIDIMT32))
|| d->getMusicDriverId() == "auto" || d->getMusicDriverId() == "null") // always add default and null device
_midiPopUp->appendEntry(d->getCompleteName(), d->getHandle());
-
- if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") {
- _mt32DevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
- if (d->getMusicType() != MT_MT32)
- _gmDevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
- }
}
}
- if (!_domain.equals(Common::ConfigManager::kApplicationDomain)) {
- _mt32DevicePopUpDesc->setEnabled(false);
- _mt32DevicePopUp->setEnabled(false);
- _gmDevicePopUpDesc->setEnabled(false);
- _gmDevicePopUp->setEnabled(false);
- }
-
// The OPL emulator popup & a label
_oplPopUpDesc = new StaticTextWidget(boss, prefix + "auOPLPopupDesc", _("AdLib emulator:"), _("AdLib is used for music in many games"));
_oplPopUp = new PopUpWidget(boss, prefix + "auOPLPopup", _("AdLib is used for music in many games"));
@@ -701,6 +707,26 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref
}
void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefix) {
+ _gmDevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefGmPopupDesc", _("GM Device:"), _("Specifies default sound device for General MIDI output"));
+ _gmDevicePopUp = new PopUpWidget(boss, prefix + "auPrefGmPopup");
+
+ // Populate
+ const MusicPlugin::List p = MusicMan.getPlugins();
+ for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (**m)->getDevices();
+ for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
+ if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") {
+ if (d->getMusicType() != MT_MT32)
+ _gmDevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
+ }
+ }
+ }
+
+ if (!_domain.equals(Common::ConfigManager::kApplicationDomain)) {
+ _gmDevicePopUpDesc->setEnabled(false);
+ _gmDevicePopUp->setEnabled(false);
+ }
+
// SoundFont
_soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd);
_soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"));
@@ -709,12 +735,6 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
// Multi midi setting
_multiMidiCheckbox = new CheckboxWidget(boss, prefix + "mcMixedCheckbox", _("Mixed AdLib/MIDI mode"), _("Use both MIDI and AdLib sound generation"));
- // Native mt32 setting
- _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer"));
-
- // GS Extensions setting
- _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), _("Turns off General MIDI mapping for games with Roland MT-32 soundtrack"));
-
// MIDI gain setting (FluidSynth uses this)
_midiGainDesc = new StaticTextWidget(boss, prefix + "mcMidiGainText", _("MIDI gain:"));
_midiGainSlider = new SliderWidget(boss, prefix + "mcMidiGainSlider", 0, kMidiGainChanged);
@@ -725,6 +745,34 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
_enableMIDISettings = true;
}
+void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefix) {
+ _mt32DevicePopUpDesc = new StaticTextWidget(boss, prefix + "auPrefMt32PopupDesc", _("MT-32 Device:"), _("Specifies default sound device for Roland MT-32/LAPC1/CM32l/CM64 output"));
+ _mt32DevicePopUp = new PopUpWidget(boss, prefix + "auPrefMt32Popup");
+
+ // Native mt32 setting
+ _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer"));
+
+ // GS Extensions setting
+ _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), _("Turns off General MIDI mapping for games with Roland MT-32 soundtrack"));
+
+ const MusicPlugin::List p = MusicMan.getPlugins();
+ for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
+ MusicDevices i = (**m)->getDevices();
+ for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
+ if (d->getMusicType() >= MT_GM || d->getMusicDriverId() == "auto") {
+ _mt32DevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
+ }
+ }
+ }
+
+ if (!_domain.equals(Common::ConfigManager::kApplicationDomain)) {
+ _mt32DevicePopUpDesc->setEnabled(false);
+ _mt32DevicePopUp->setEnabled(false);
+ }
+
+ _enableMIDISettings = true;
+}
+
// The function has an extra slider range parameter, since both the launcher and SCUMM engine
// make use of the widgets. The launcher range is 0-255. SCUMM's 0-9
void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal) {
@@ -790,7 +838,7 @@ bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String se
return true;
if (_domain != Common::ConfigManager::kApplicationDomain || ConfMan.hasKey(setting, _domain) || preferredType) {
- const Common::String drv = ConfMan.get(setting, (_domain != Common::ConfigManager::kApplicationDomain && !ConfMan.hasKey(setting, _domain)) ? Common::ConfigManager::kApplicationDomain : _domain);
+ const Common::String drv = ConfMan.get(setting, (_domain != Common::ConfigManager::kApplicationDomain && !ConfMan.hasKey(setting, _domain)) ? Common::ConfigManager::kApplicationDomain : _domain);
const MusicPlugin::List p = MusicMan.getPlugins();
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
@@ -810,7 +858,7 @@ bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String se
void OptionsDialog::saveMusicDeviceSetting(PopUpWidget *popup, Common::String setting) {
if (!popup || !_enableAudioSettings)
return;
-
+
const MusicPlugin::List p = MusicMan.getPlugins();
bool found = false;
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end() && !found; ++m) {
@@ -886,7 +934,13 @@ GlobalOptionsDialog::GlobalOptionsDialog()
addMIDIControls(tab, "GlobalOptions_MIDI.");
//
- // 4) The miscellaneous tab
+ // 4) The MT-32 tab
+ //
+ tab->addTab(_("MT-32"));
+ addMT32Controls(tab, "GlobalOptions_MT32.");
+
+ //
+ // 5) The Paths tab
//
tab->addTab(_("Paths"));
@@ -910,6 +964,9 @@ GlobalOptionsDialog::GlobalOptionsDialog()
#endif
#endif
+ //
+ // 6) The miscellaneous tab
+ //
tab->addTab(_("Misc"));
new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), 0, kChooseThemeCmd);
diff --git a/gui/options.h b/gui/options.h
index 235cb24462..c05f263d00 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -68,6 +68,7 @@ protected:
void addGraphicControls(GuiObject *boss, const Common::String &prefix);
void addAudioControls(GuiObject *boss, const Common::String &prefix);
void addMIDIControls(GuiObject *boss, const Common::String &prefix);
+ void addMT32Controls(GuiObject *boss, const Common::String &prefix);
void addVolumeControls(GuiObject *boss, const Common::String &prefix);
// The default value is the launcher's non-scaled talkspeed value. When SCUMM uses the widget,
// it uses its own scale
@@ -76,6 +77,7 @@ protected:
void setGraphicSettingsState(bool enabled);
void setAudioSettingsState(bool enabled);
void setMIDISettingsState(bool enabled);
+ void setMT32SettingsState(bool enabled);
void setVolumeSettingsState(bool enabled);
void setSubtitleSettingsState(bool enabled);
@@ -120,13 +122,18 @@ private:
//
bool _enableMIDISettings;
CheckboxWidget *_multiMidiCheckbox;
- CheckboxWidget *_mt32Checkbox;
- CheckboxWidget *_enableGSCheckbox;
StaticTextWidget *_midiGainDesc;
SliderWidget *_midiGainSlider;
StaticTextWidget *_midiGainLabel;
//
+ // MT-32 controls
+ //
+ bool _enableMT32Settings;
+ CheckboxWidget *_mt32Checkbox;
+ CheckboxWidget *_enableGSCheckbox;
+
+ //
// Subtitle controls
//
int getSubtitleMode(bool subtitles, bool speech_mute);
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 086fecc123..f03b3fc61e 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1,5 +1,5 @@
"<?xml version = '1.0'?>"
-"<layout_info resolution='320xY,256x240,Xx272'> "
+"<layout_info resolution='320xY,256x240,Xx272,Xx350'> "
"<globals> "
"<def var='Line.Height' value='12' /> "
"<def var='Font.Height' value='10' /> "
@@ -57,11 +57,11 @@
"padding='0,0,2,0' "
"/> "
"<widget name='TabWidget.Body' "
-"padding='0,0,0,0' "
+"padding='0,0,0,-8' "
"/> "
"<widget name='TabWidget.NavButton' "
"size='32,18' "
-"padding='0,3,4,0' "
+"padding='0,0,1,0' "
"/> "
"</globals> "
"<dialog name='Launcher' overlays='screen'> "
@@ -190,22 +190,6 @@
"/> "
"</layout> "
"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'> "
-"<widget name='auPrefMt32PopupDesc' "
-"type='OptionsLabel' "
-"/> "
-"<widget name='auPrefMt32Popup' "
-"type='PopUp' "
-"/> "
-"</layout> "
-"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'> "
-"<widget name='auPrefGmPopupDesc' "
-"type='OptionsLabel' "
-"/> "
-"<widget name='auPrefGmPopup' "
-"type='PopUp' "
-"/> "
-"</layout> "
-"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'> "
"<widget name='auOPLPopupDesc' "
"type='OptionsLabel' "
"/> "
@@ -293,6 +277,14 @@
"</dialog> "
"<dialog name='GlobalOptions_MIDI' overlays='Dialog.GlobalOptions.TabWidget'> "
"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
+"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'> "
+"<widget name='auPrefGmPopupDesc' "
+"type='OptionsLabel' "
+"/> "
+"<widget name='auPrefGmPopup' "
+"type='PopUp' "
+"/> "
+"</layout> "
"<layout type='horizontal' padding='0,0,0,0' spacing='16' center='true'> "
"<widget name='mcFontButton' "
"type='Button' "
@@ -308,12 +300,6 @@
"<widget name='mcMixedCheckbox' "
"type='Checkbox' "
"/> "
-"<widget name='mcMt32Checkbox' "
-"type='Checkbox' "
-"/> "
-"<widget name='mcGSCheckbox' "
-"type='Checkbox' "
-"/> "
"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'> "
"<widget name='mcMidiGainText' "
"type='OptionsLabel' "
@@ -328,6 +314,24 @@
"</layout> "
"</layout> "
"</dialog> "
+"<dialog name='GlobalOptions_MT32' overlays='Dialog.GlobalOptions.TabWidget'> "
+"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
+"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'> "
+"<widget name='auPrefMt32PopupDesc' "
+"type='OptionsLabel' "
+"/> "
+"<widget name='auPrefMt32Popup' "
+"type='PopUp' "
+"/> "
+"</layout> "
+"<widget name='mcMt32Checkbox' "
+"type='Checkbox' "
+"/> "
+"<widget name='mcGSCheckbox' "
+"type='Checkbox' "
+"/> "
+"</layout> "
+"</dialog> "
"<dialog name='GlobalOptions_Paths' overlays='Dialog.GlobalOptions.TabWidget'> "
"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
"<layout type='horizontal' padding='0,0,0,0' spacing='16'> "
@@ -471,6 +475,14 @@
"<import layout='Dialog.GlobalOptions_MIDI' /> "
"</layout> "
"</dialog> "
+"<dialog name='GameOptions_MT32' overlays='Dialog.GlobalOptions.TabWidget'> "
+"<layout type='vertical' padding='8,8,8,8' spacing='6'> "
+"<widget name='EnableTabCheckbox' "
+"type='Checkbox' "
+"/> "
+"<import layout='Dialog.GlobalOptions_MT32' /> "
+"</layout> "
+"</dialog> "
"<dialog name='GameOptions_Volume' overlays='Dialog.GlobalOptions.TabWidget'> "
"<layout type='vertical' padding='8,8,8,8' spacing='6'> "
"<widget name='EnableTabCheckbox' "
@@ -776,440 +788,7 @@
"</layout> "
"</dialog> "
"</layout_info> "
-"<render_info> "
-"<palette> "
-"<color name='black' "
-"rgb='0,0,0' "
-"/> "
-"<color name='lightgrey' "
-"rgb='104,104,104' "
-"/> "
-"<color name='darkgrey' "
-"rgb='64,64,64' "
-"/> "
-"<color name='green' "
-"rgb='32,160,32' "
-"/> "
-"<color name='green2' "
-"rgb='0,255,0' "
-"/> "
-"</palette> "
-"<fonts> "
-"<font id='text_default' "
-"file='helvb12.bdf' "
-"/> "
-"<font resolution='320xY,256x240' "
-"id='text_default' "
-"file='clR6x12.bdf' "
-"/> "
-"<font id='text_button' "
-"file='helvb12.bdf' "
-"/> "
-"<font resolution='320xY,256x240' "
-"id='text_button' "
-"file='clR6x12.bdf' "
-"/> "
-"<font id='text_normal' "
-"file='helvb12.bdf' "
-"/> "
-"<font resolution='320xY,256x240' "
-"id='text_normal' "
-"file='clR6x12.bdf' "
-"/> "
-"<font id='tooltip_normal' "
-"file='fixed5x8.bdf' "
-"/> "
-"<text_color id='color_normal' "
-"color='green' "
-"/> "
-"<text_color id='color_normal_inverted' "
-"color='black' "
-"/> "
-"<text_color id='color_normal_hover' "
-"color='green2' "
-"/> "
-"<text_color id='color_normal_disabled' "
-"color='lightgrey' "
-"/> "
-"<text_color id='color_alternative' "
-"color='lightgrey' "
-"/> "
-"<text_color id='color_alternative_inverted' "
-"color='255,255,255' "
-"/> "
-"<text_color id='color_alternative_hover' "
-"color='176,176,176' "
-"/> "
-"<text_color id='color_alternative_disabled' "
-"color='darkgrey' "
-"/> "
-"<text_color id='color_button' "
-"color='green' "
-"/> "
-"<text_color id='color_button_hover' "
-"color='green2' "
-"/> "
-"<text_color id='color_button_disabled' "
-"color='lightgrey' "
-"/> "
-"</fonts> "
-"<defaults fill='foreground' fg_color='darkgrey' bg_color='black' shadow='0' bevel_color='lightgrey'/> "
-"<drawdata id='text_selection' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='text_selection_focus' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='mainmenu_bg' cache='false'> "
-"<drawstep func='fill' "
-"fill='foreground' "
-"fg_color='black' "
-"/> "
-"</drawdata> "
-"<drawdata id='special_bg' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='separator' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"height='2' "
-"ypos='center' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_base' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_handle_hover' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green2' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_handle_idle' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_button_idle' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green' "
-"fill='foreground' "
-"width='auto' "
-"height='auto' "
-"xpos='center' "
-"ypos='center' "
-"orientation='top' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_button_hover' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green2' "
-"fill='foreground' "
-"width='auto' "
-"height='auto' "
-"xpos='center' "
-"ypos='center' "
-"orientation='top' "
-"/> "
-"</drawdata> "
-"<drawdata id='tab_active' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal_hover' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='tab' "
-"bevel='2' "
-"radius='0' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='tab_inactive' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='tab' "
-"bevel='2' "
-"radius='0' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='tab_background' cache='false'> "
-"</drawdata> "
-"<drawdata id='widget_slider' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='slider_disabled' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='slider_full' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='slider_hover' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green2' "
-"/> "
-"</drawdata> "
-"<drawdata id='widget_small' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='popup_idle' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green' "
-"fill='foreground' "
-"width='height' "
-"height='auto' "
-"xpos='right' "
-"ypos='center' "
-"orientation='bottom' "
-"/> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"</drawdata> "
-"<drawdata id='popup_disabled' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='lightgrey' "
-"fill='foreground' "
-"width='height' "
-"height='auto' "
-"xpos='right' "
-"ypos='center' "
-"orientation='bottom' "
-"/> "
-"<text font='text_default' "
-"text_color='color_normal_disabled' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"</drawdata> "
-"<drawdata id='popup_hover' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green2' "
-"fill='foreground' "
-"width='height' "
-"height='auto' "
-"xpos='right' "
-"ypos='center' "
-"orientation='bottom' "
-"/> "
-"<text font='text_default' "
-"text_color='color_normal_hover' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"</drawdata> "
-"<drawdata id='widget_textedit' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='plain_bg' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='caret' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='default_bg' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='button_idle' cache='false'> "
-"<text font='text_button' "
-"text_color='color_button' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='button_hover' cache='false'> "
-"<text font='text_button' "
-"text_color='color_button_hover' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='button_disabled' cache='false'> "
-"<text font='text_button' "
-"text_color='color_button_disabled' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='checkbox_disabled' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal_disabled' "
-"vertical_align='top' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='checkbox_selected' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='top' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='cross' "
-"fill='foreground' "
-"stroke='2' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='checkbox_default' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='top' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='radiobutton_default' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='circle' "
-"width='7' "
-"height='7' "
-"radius='7' "
-"fill='background' "
-"bg_color='darkgrey' "
-"xpos='0' "
-"ypos='0' "
-"/> "
-"</drawdata> "
-"<drawdata id='radiobutton_selected' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='circle' "
-"width='7' "
-"height='7' "
-"radius='7' "
-"fg_color='darkgrey' "
-"fill='none' "
-"xpos='0' "
-"ypos='0' "
-"/> "
-"<drawstep func='circle' "
-"width='7' "
-"height='7' "
-"radius='5' "
-"fg_color='green' "
-"fill='foreground' "
-"xpos='2' "
-"ypos='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='radiobutton_disabled' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal_disabled' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='circle' "
-"width='7' "
-"height='7' "
-"radius='7' "
-"bg_color='lightgrey' "
-"fill='background' "
-"xpos='0' "
-"ypos='0' "
-"/> "
-"</drawdata> "
-"<drawdata id='widget_default' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='widget_small' cache='false'> "
-"<drawstep func='square' "
-"stroke='0' "
-"/> "
-"</drawdata> "
-"</render_info> "
-"<layout_info resolution='-320xY,-256x240,-Xx272'> "
+"<layout_info resolution='-320xY,-256x240,-Xx272,-Xx350'> "
"<globals> "
"<def var='Line.Height' value='16' /> "
"<def var='Font.Height' value='16' /> "
@@ -1404,22 +983,6 @@
"/> "
"</layout> "
"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'> "
-"<widget name='auPrefMt32PopupDesc' "
-"type='OptionsLabel' "
-"/> "
-"<widget name='auPrefMt32Popup' "
-"type='PopUp' "
-"/> "
-"</layout> "
-"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'> "
-"<widget name='auPrefGmPopupDesc' "
-"type='OptionsLabel' "
-"/> "
-"<widget name='auPrefGmPopup' "
-"type='PopUp' "
-"/> "
-"</layout> "
-"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'> "
"<widget name='auOPLPopupDesc' "
"type='OptionsLabel' "
"/> "
@@ -1509,6 +1072,14 @@
"<dialog name='GlobalOptions_MIDI' overlays='Dialog.GlobalOptions.TabWidget'> "
"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'> "
+"<widget name='auPrefGmPopupDesc' "
+"type='OptionsLabel' "
+"/> "
+"<widget name='auPrefGmPopup' "
+"type='PopUp' "
+"/> "
+"</layout> "
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'> "
"<widget name='mcFontButton' "
"type='Button' "
"/> "
@@ -1523,12 +1094,6 @@
"<widget name='mcMixedCheckbox' "
"type='Checkbox' "
"/> "
-"<widget name='mcMt32Checkbox' "
-"type='Checkbox' "
-"/> "
-"<widget name='mcGSCheckbox' "
-"type='Checkbox' "
-"/> "
"<layout type='horizontal' padding='0,0,0,0'> "
"<widget name='mcMidiGainText' "
"type='OptionsLabel' "
@@ -1543,6 +1108,24 @@
"</layout> "
"</layout> "
"</dialog> "
+"<dialog name='GlobalOptions_MT32' overlays='Dialog.GlobalOptions.TabWidget'> "
+"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'> "
+"<widget name='auPrefMt32PopupDesc' "
+"type='OptionsLabel' "
+"/> "
+"<widget name='auPrefMt32Popup' "
+"type='PopUp' "
+"/> "
+"</layout> "
+"<widget name='mcMt32Checkbox' "
+"type='Checkbox' "
+"/> "
+"<widget name='mcGSCheckbox' "
+"type='Checkbox' "
+"/> "
+"</layout> "
+"</dialog> "
"<dialog name='GlobalOptions_Paths' overlays='Dialog.GlobalOptions.TabWidget'> "
"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'> "
@@ -1680,6 +1263,14 @@
"<import layout='Dialog.GlobalOptions_MIDI' /> "
"</layout> "
"</dialog> "
+"<dialog name='GameOptions_MT32' overlays='Dialog.GlobalOptions.TabWidget'> "
+"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
+"<widget name='EnableTabCheckbox' "
+"type='Checkbox' "
+"/> "
+"<import layout='Dialog.GlobalOptions_MT32' /> "
+"</layout> "
+"</dialog> "
"<dialog name='GameOptions_Volume' overlays='Dialog.GlobalOptions.TabWidget'> "
"<layout type='vertical' padding='16,16,16,16' spacing='8'> "
"<widget name='EnableTabCheckbox' "
@@ -1984,3 +1575,443 @@
"</layout> "
"</dialog> "
"</layout_info> "
+"<render_info> "
+"<palette> "
+"<color name='black' "
+"rgb='0,0,0' "
+"/> "
+"<color name='lightgrey' "
+"rgb='104,104,104' "
+"/> "
+"<color name='darkgrey' "
+"rgb='64,64,64' "
+"/> "
+"<color name='green' "
+"rgb='32,160,32' "
+"/> "
+"<color name='green2' "
+"rgb='0,255,0' "
+"/> "
+"</palette> "
+"<fonts> "
+"<font id='text_default' "
+"file='helvb12.bdf' "
+"/> "
+"<font resolution='320xY,256x240' "
+"id='text_default' "
+"file='clR6x12.bdf' "
+"/> "
+"<font id='text_button' "
+"file='helvb12.bdf' "
+"/> "
+"<font resolution='320xY,256x240' "
+"id='text_button' "
+"file='clR6x12.bdf' "
+"/> "
+"<font id='text_normal' "
+"file='helvb12.bdf' "
+"/> "
+"<font resolution='320xY,256x240' "
+"id='text_normal' "
+"file='clR6x12.bdf' "
+"/> "
+"<font id='tooltip_normal' "
+"file='fixed5x8.bdf' "
+"/> "
+"<text_color id='color_normal' "
+"color='green' "
+"/> "
+"<text_color id='color_normal_inverted' "
+"color='black' "
+"/> "
+"<text_color id='color_normal_hover' "
+"color='green2' "
+"/> "
+"<text_color id='color_normal_disabled' "
+"color='lightgrey' "
+"/> "
+"<text_color id='color_alternative' "
+"color='lightgrey' "
+"/> "
+"<text_color id='color_alternative_inverted' "
+"color='255,255,255' "
+"/> "
+"<text_color id='color_alternative_hover' "
+"color='176,176,176' "
+"/> "
+"<text_color id='color_alternative_disabled' "
+"color='darkgrey' "
+"/> "
+"<text_color id='color_button' "
+"color='green' "
+"/> "
+"<text_color id='color_button_hover' "
+"color='green2' "
+"/> "
+"<text_color id='color_button_disabled' "
+"color='lightgrey' "
+"/> "
+"</fonts> "
+"<defaults fill='foreground' fg_color='darkgrey' bg_color='black' shadow='0' bevel_color='lightgrey'/> "
+"<drawdata id='text_selection' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='text_selection_focus' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='mainmenu_bg' cache='false'> "
+"<drawstep func='fill' "
+"fill='foreground' "
+"fg_color='black' "
+"/> "
+"</drawdata> "
+"<drawdata id='special_bg' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='tooltip_bg' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='foreground' "
+"fg_color='black' "
+"/> "
+"</drawdata> "
+"<drawdata id='separator' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"height='2' "
+"ypos='center' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_base' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_handle_hover' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green2' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_handle_idle' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_button_idle' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green' "
+"fill='foreground' "
+"width='auto' "
+"height='auto' "
+"xpos='center' "
+"ypos='center' "
+"orientation='top' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_button_hover' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green2' "
+"fill='foreground' "
+"width='auto' "
+"height='auto' "
+"xpos='center' "
+"ypos='center' "
+"orientation='top' "
+"/> "
+"</drawdata> "
+"<drawdata id='tab_active' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal_hover' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='tab' "
+"bevel='2' "
+"radius='0' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='tab_inactive' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='tab' "
+"bevel='2' "
+"radius='0' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='tab_background' cache='false'> "
+"</drawdata> "
+"<drawdata id='widget_slider' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='slider_disabled' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='slider_full' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='slider_hover' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green2' "
+"/> "
+"</drawdata> "
+"<drawdata id='widget_small' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='popup_idle' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green' "
+"fill='foreground' "
+"width='height' "
+"height='auto' "
+"xpos='right' "
+"ypos='center' "
+"orientation='bottom' "
+"/> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"</drawdata> "
+"<drawdata id='popup_disabled' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='lightgrey' "
+"fill='foreground' "
+"width='height' "
+"height='auto' "
+"xpos='right' "
+"ypos='center' "
+"orientation='bottom' "
+"/> "
+"<text font='text_default' "
+"text_color='color_normal_disabled' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"</drawdata> "
+"<drawdata id='popup_hover' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green2' "
+"fill='foreground' "
+"width='height' "
+"height='auto' "
+"xpos='right' "
+"ypos='center' "
+"orientation='bottom' "
+"/> "
+"<text font='text_default' "
+"text_color='color_normal_hover' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"</drawdata> "
+"<drawdata id='widget_textedit' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='plain_bg' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='caret' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='default_bg' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='button_idle' cache='false'> "
+"<text font='text_button' "
+"text_color='color_button' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='button_hover' cache='false'> "
+"<text font='text_button' "
+"text_color='color_button_hover' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='button_disabled' cache='false'> "
+"<text font='text_button' "
+"text_color='color_button_disabled' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='checkbox_disabled' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal_disabled' "
+"vertical_align='top' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='checkbox_selected' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='top' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='cross' "
+"fill='foreground' "
+"stroke='2' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='checkbox_default' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='top' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='radiobutton_default' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='circle' "
+"width='7' "
+"height='7' "
+"radius='7' "
+"fill='background' "
+"bg_color='darkgrey' "
+"xpos='0' "
+"ypos='0' "
+"/> "
+"</drawdata> "
+"<drawdata id='radiobutton_selected' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='circle' "
+"width='7' "
+"height='7' "
+"radius='7' "
+"fg_color='darkgrey' "
+"fill='none' "
+"xpos='0' "
+"ypos='0' "
+"/> "
+"<drawstep func='circle' "
+"width='7' "
+"height='7' "
+"radius='5' "
+"fg_color='green' "
+"fill='foreground' "
+"xpos='2' "
+"ypos='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='radiobutton_disabled' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal_disabled' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='circle' "
+"width='7' "
+"height='7' "
+"radius='7' "
+"bg_color='lightgrey' "
+"fill='background' "
+"xpos='0' "
+"ypos='0' "
+"/> "
+"</drawdata> "
+"<drawdata id='widget_default' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='widget_small' cache='false'> "
+"<drawstep func='square' "
+"stroke='0' "
+"/> "
+"</drawdata> "
+"</render_info> "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index b5866337ad..299bc41339 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/classic_gfx.stx b/gui/themes/scummclassic/classic_gfx.stx
index 8c03aa932c..d672db2540 100644
--- a/gui/themes/scummclassic/classic_gfx.stx
+++ b/gui/themes/scummclassic/classic_gfx.stx
@@ -142,6 +142,14 @@
/>
</drawdata>
+ <drawdata id = 'tooltip_bg' cache = 'false'>
+ <drawstep func = 'bevelsq'
+ bevel = '2'
+ fill = 'foreground'
+ fg_color = 'black'
+ />
+ </drawdata>
+
<drawdata id = 'separator' cache = 'false'>
<drawstep func = 'square'
fill = 'foreground'
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 80bc4bf41e..74b8bf4b2c 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -23,7 +23,7 @@
- $Id$
-
-->
-<layout_info resolution = '-320xY, -256x240, -Xx272'>
+<layout_info resolution = '-320xY, -256x240, -Xx272, -Xx350'>
<globals>
<def var = 'Line.Height' value = '16' />
<def var = 'Font.Height' value = '16' />
@@ -232,22 +232,6 @@
/>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
- <widget name = 'auPrefMt32PopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefMt32Popup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
- <widget name = 'auPrefGmPopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefGmPopup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'auOPLPopupDesc'
type = 'OptionsLabel'
/>
@@ -339,6 +323,14 @@
<dialog name = 'GlobalOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'auPrefGmPopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefGmPopup'
+ type = 'PopUp'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'mcFontButton'
type = 'Button'
/>
@@ -353,12 +345,6 @@
<widget name = 'mcMixedCheckbox'
type = 'Checkbox'
/>
- <widget name = 'mcMt32Checkbox'
- type = 'Checkbox'
- />
- <widget name = 'mcGSCheckbox'
- type = 'Checkbox'
- />
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
<widget name = 'mcMidiGainText'
type = 'OptionsLabel'
@@ -374,6 +360,25 @@
</layout>
</dialog>
+ <dialog name = 'GlobalOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'auPrefMt32PopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefMt32Popup'
+ type = 'PopUp'
+ />
+ </layout>
+ <widget name = 'mcMt32Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'mcGSCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalOptions_Paths' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
@@ -518,6 +523,15 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'EnableTabCheckbox'
+ type = 'Checkbox'
+ />
+ <import layout = 'Dialog.GlobalOptions_MT32' />
+ </layout>
+ </dialog>
+
<dialog name = 'GameOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<widget name = 'EnableTabCheckbox'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 64ac6e200a..622c23439e 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -23,7 +23,7 @@
- $Id$
-
-->
-<layout_info resolution = "320xY, 256x240, Xx272">
+<layout_info resolution = "320xY, 256x240, Xx272, Xx350">
<globals>
<def var = 'Line.Height' value = '12' />
<def var = 'Font.Height' value = '10' />
@@ -90,11 +90,11 @@
padding = '0, 0, 2, 0'
/>
<widget name = 'TabWidget.Body'
- padding = '0, 0, 0, 0'
+ padding = '0, 0, 0, -8'
/>
<widget name = 'TabWidget.NavButton'
size = '32, 18'
- padding = '0, 3, 4, 0'
+ padding = '0, 0, 1, 0'
/>
</globals>
@@ -230,22 +230,6 @@
/>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
- <widget name = 'auPrefMt32PopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefMt32Popup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
- <widget name = 'auPrefGmPopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefGmPopup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<widget name = 'auOPLPopupDesc'
type = 'OptionsLabel'
/>
@@ -335,6 +319,14 @@
<dialog name = 'GlobalOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <widget name = 'auPrefGmPopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefGmPopup'
+ type = 'PopUp'
+ />
+ </layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'>
<widget name = 'mcFontButton'
type = 'Button'
@@ -350,12 +342,6 @@
<widget name = 'mcMixedCheckbox'
type = 'Checkbox'
/>
- <widget name = 'mcMt32Checkbox'
- type = 'Checkbox'
- />
- <widget name = 'mcGSCheckbox'
- type = 'Checkbox'
- />
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<widget name = 'mcMidiGainText'
type = 'OptionsLabel'
@@ -371,6 +357,25 @@
</layout>
</dialog>
+ <dialog name = 'GlobalOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <widget name = 'auPrefMt32PopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefMt32Popup'
+ type = 'PopUp'
+ />
+ </layout>
+ <widget name = 'mcMt32Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'mcGSCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalOptions_Paths' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'>
@@ -521,6 +526,15 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '8, 8, 8, 8' spacing = '6'>
+ <widget name = 'EnableTabCheckbox'
+ type = 'Checkbox'
+ />
+ <import layout = 'Dialog.GlobalOptions_MT32' />
+ </layout>
+ </dialog>
+
<dialog name = 'GameOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '8, 8, 8, 8' spacing = '6'>
<widget name = 'EnableTabCheckbox'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index aba0c944c3..cd24d781bb 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/helvr12-l1.fcc b/gui/themes/scummmodern/helvb12-iso-8859-1.fcc
index 651a25934a..651a25934a 100644
--- a/gui/themes/scummmodern/helvr12-l1.fcc
+++ b/gui/themes/scummmodern/helvb12-iso-8859-1.fcc
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_gfx.stx b/gui/themes/scummmodern/scummmodern_gfx.stx
index ad41475a96..cfe00a7016 100644
--- a/gui/themes/scummmodern/scummmodern_gfx.stx
+++ b/gui/themes/scummmodern/scummmodern_gfx.stx
@@ -516,6 +516,15 @@
/>
</drawdata>
+ <!-- Tooltip -->
+ <drawdata id = 'tooltip_bg' cache = 'false'>
+ <drawstep func = 'square'
+ fill = 'foreground'
+ fg_color = 'blandyellow'
+ shadow = '3'
+ />
+ </drawdata>
+
<!-- Idle button -->
<drawdata id = 'button_idle' cache = 'false'>
<text font = 'text_button'
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 796d4d9a94..484dd15429 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -23,7 +23,7 @@
- $Id$
-
-->
-<layout_info resolution = '-320xY, -256x240, -Xx272'>
+<layout_info resolution = '-320xY, -256x240, -Xx272, -Xx350'>
<globals>
<def var = 'Line.Height' value = '16' />
<def var = 'Font.Height' value = '16' />
@@ -247,22 +247,6 @@
/>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
- <widget name = 'auPrefMt32PopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefMt32Popup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
- <widget name = 'auPrefGmPopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefGmPopup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'auOPLPopupDesc'
type = 'OptionsLabel'
/>
@@ -354,6 +338,14 @@
<dialog name = 'GlobalOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'auPrefGmPopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefGmPopup'
+ type = 'PopUp'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'mcFontButton'
type = 'Button'
/>
@@ -368,12 +360,6 @@
<widget name = 'mcMixedCheckbox'
type = 'Checkbox'
/>
- <widget name = 'mcMt32Checkbox'
- type = 'Checkbox'
- />
- <widget name = 'mcGSCheckbox'
- type = 'Checkbox'
- />
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'mcMidiGainText'
type = 'OptionsLabel'
@@ -389,6 +375,25 @@
</layout>
</dialog>
+ <dialog name = 'GlobalOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'auPrefMt32PopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefMt32Popup'
+ type = 'PopUp'
+ />
+ </layout>
+ <widget name = 'mcMt32Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'mcGSCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalOptions_Paths' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
@@ -533,6 +538,15 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'EnableTabCheckbox'
+ type = 'Checkbox'
+ />
+ <import layout = 'Dialog.GlobalOptions_MT32' />
+ </layout>
+ </dialog>
+
<dialog name = 'GameOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<widget name = 'EnableTabCheckbox'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 8bb31e9f8a..5998c50b60 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -23,7 +23,7 @@
- $Id$
-
-->
-<layout_info resolution = "320xY, 256x240, Xx272">
+<layout_info resolution = "320xY, 256x240, Xx272, Xx350">
<globals>
<def var = 'Line.Height' value = '12' />
<def var = 'Font.Height' value = '10' />
@@ -88,11 +88,11 @@
padding = '0, 0, 2, 0'
/>
<widget name = 'TabWidget.Body'
- padding = '0, 0, 0, 0'
+ padding = '0, 0, 0, -8'
/>
<widget name = 'TabWidget.NavButton'
size = '32, 18'
- padding = '0, 3, 4, 0'
+ padding = '0, 0, 2, 0'
/>
</globals>
@@ -228,22 +228,6 @@
/>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
- <widget name = 'auPrefMt32PopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefMt32Popup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
- <widget name = 'auPrefGmPopupDesc'
- type = 'OptionsLabel'
- />
- <widget name = 'auPrefGmPopup'
- type = 'PopUp'
- />
- </layout>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<widget name = 'auOPLPopupDesc'
type = 'OptionsLabel'
/>
@@ -333,6 +317,14 @@
<dialog name = 'GlobalOptions_MIDI' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <widget name = 'auPrefGmPopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefGmPopup'
+ type = 'PopUp'
+ />
+ </layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'>
<widget name = 'mcFontButton'
type = 'Button'
@@ -348,12 +340,6 @@
<widget name = 'mcMixedCheckbox'
type = 'Checkbox'
/>
- <widget name = 'mcMt32Checkbox'
- type = 'Checkbox'
- />
- <widget name = 'mcGSCheckbox'
- type = 'Checkbox'
- />
<layout type = 'horizontal' padding = '0, 0, 0, 0' center = 'true'>
<widget name = 'mcMidiGainText'
type = 'OptionsLabel'
@@ -369,6 +355,25 @@
</layout>
</dialog>
+ <dialog name = 'GlobalOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <widget name = 'auPrefMt32PopupDesc'
+ type = 'OptionsLabel'
+ />
+ <widget name = 'auPrefMt32Popup'
+ type = 'PopUp'
+ />
+ </layout>
+ <widget name = 'mcMt32Checkbox'
+ type = 'Checkbox'
+ />
+ <widget name = 'mcGSCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
+
<dialog name = 'GlobalOptions_Paths' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'>
@@ -519,6 +524,15 @@
</layout>
</dialog>
+ <dialog name = 'GameOptions_MT32' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '8, 8, 8, 8' spacing = '6'>
+ <widget name = 'EnableTabCheckbox'
+ type = 'Checkbox'
+ />
+ <import layout = 'Dialog.GlobalOptions_MT32' />
+ </layout>
+ </dialog>
+
<dialog name = 'GameOptions_Volume' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '8, 8, 8, 8' spacing = '6'>
<widget name = 'EnableTabCheckbox'
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 14cb61006b..07cf4407a2 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -218,85 +218,8 @@ Common::String Widget::cleanupHotkey(const Common::String &label) {
for (uint i = 0; i < label.size() ; i++)
if (label[i] != '~')
res = res + label[i];
-
- return res;
-}
-
-#pragma mark -
-
-Tooltip::Tooltip(GuiManager *guiManager) : GuiObject(0, 0, 0, 0) {
- _guiManager = guiManager;
-
- _visible = false;
- _maxWidth = -1;
- _storedState = 0;
-}
-
-void Tooltip::draw() {
- int num = 0;
- int h = g_gui.theme()->getFontHeight(ThemeEngine::kFontStyleTooltip) + 2;
-
- // Make Rect bigger for compensating the shadow
- _storedState = g_gui.theme()->storeState(Common::Rect(_x - 5, _y - 5, _x + _w + 5, _y + _h + 5));
-
- g_gui.theme()->startBuffering();
- g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0, ThemeEngine::kWidgetBackgroundBorderSmall);
-
- for (Common::StringArray::const_iterator i = _wrappedLines.begin(); i != _wrappedLines.end(); ++i, ++num) {
- g_gui.theme()->drawText(Common::Rect(_x + 1, _y + 1 + num * h, _x + 1 +_w, _y + 1+ (num + 1) * h), *i, ThemeEngine::kStateEnabled, Graphics::kTextAlignLeft, ThemeEngine::kTextInversionNone, 0, false, ThemeEngine::kFontStyleTooltip, ThemeEngine::kFontColorNormal, false);
- }
- g_gui.theme()->finishBuffering();
-}
-
-void Tooltip::reflowLayout() {
-}
-
-void Tooltip::setMouseXY(int x, int y) {
- _mouseX = x;
- _mouseY = y;
-}
-void Tooltip::setVisible(bool state) {
- if (state == _visible)
- return;
-
- if (state) {
- if (!_guiManager->getTopDialog())
- return;
-
- Widget *wdg = _guiManager->getTopDialog()->findWidget(_mouseX, _mouseY);
-
- if (!wdg)
- return;
-
- if (wdg->getTooltip()) {
- _visible = state;
-
- // Cache config values.
- // NOTE: we cannot do it in the consturctor
- if (_maxWidth == -1) {
- _maxWidth = g_gui.xmlEval()->getVar("Globals.Tooltip.MaxWidth", 100);
- _xdelta = g_gui.xmlEval()->getVar("Globals.Tooltip.XDelta", 0);
- _ydelta = g_gui.xmlEval()->getVar("Globals.Tooltip.YDelta", 0);
- }
-
- const Graphics::Font *tooltipFont = g_gui.theme()->getFont(ThemeEngine::kFontStyleTooltip);
-
- _wrappedLines.clear();
- _w = tooltipFont->wordWrapText(wdg->getTooltip(), _maxWidth - 4, _wrappedLines);
- _h = (tooltipFont->getFontHeight() + 2) * _wrappedLines.size();
-
- _x = MIN<int16>(_guiManager->getTopDialog()->_x + _mouseX + _xdelta, g_gui.getWidth() - _w - 3);
- _y = MIN<int16>(_guiManager->getTopDialog()->_y + _mouseY + _ydelta, g_gui.getHeight() - _h - 3);
-
- draw();
- }
- } else {
- _visible = state;
-
- g_gui.theme()->restoreState(_storedState);
- delete _storedState;
- }
+ return res;
}
#pragma mark -
@@ -361,7 +284,7 @@ ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Co
}
ButtonWidget::ButtonWidget(GuiObject *boss, const Common::String &name, const Common::String &label, const char *tooltip, uint32 cmd, uint8 hotkey)
- : StaticTextWidget(boss, name, cleanupHotkey(label), tooltip), CommandSender(boss),
+ : StaticTextWidget(boss, name, cleanupHotkey(label), tooltip), CommandSender(boss),
_cmd(cmd) {
if (hotkey == 0)
_hotkey = parseHotkey(label);
diff --git a/gui/widget.h b/gui/widget.h
index 7b5fe9253f..92bfbf8256 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -159,31 +159,6 @@ protected:
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { assert(_boss); _boss->handleCommand(sender, cmd, data); }
};
-class GuiManager;
-
-class Tooltip : public GuiObject {
-public:
- Tooltip(GuiManager *guiManager);
-
- bool isVisible() const { return _visible; }
- void draw();
- void reflowLayout();
- void releaseFocus() {}
- void setVisible(bool state);
- void setMouseXY(int x, int y);
-
-protected:
- Common::String _text;
- GuiManager *_guiManager;
- bool _visible;
- int _mouseX, _mouseY;
- int _maxWidth;
- int _xdelta, _ydelta;
-
- Common::StringArray _wrappedLines;
- ThemeEngine::StoredState *_storedState;
-};
-
/* StaticTextWidget */
class StaticTextWidget : public Widget {
protected:
@@ -272,7 +247,7 @@ class RadiobuttonWidget : public ButtonWidget {
protected:
bool _state;
int _value;
-
+
public:
RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0);
RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::String &label, const char *tooltip = 0, uint8 hotkey = 0);