diff options
author | Willem Jan Palenstijn | 2013-04-18 23:34:29 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:39:44 +0200 |
commit | 01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6 (patch) | |
tree | 544b07f3aa41abe7907bcd2040cdad11ebc324bb /gui | |
parent | 9cf2c83e5e5a35816ab153bf8443dac691829ea8 (diff) | |
parent | a41d72a44a660c72fdadbc3a8ef580e5e03cb890 (diff) | |
download | scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.gz scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.bz2 scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.zip |
Merge branch 'master'
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ThemeEngine.cpp | 15 | ||||
-rw-r--r-- | gui/console.cpp | 9 | ||||
-rw-r--r-- | gui/credits.h | 163 | ||||
-rw-r--r-- | gui/debugger.h | 1 | ||||
-rw-r--r-- | gui/gui-manager.cpp | 2 | ||||
-rw-r--r-- | gui/launcher.cpp | 8 | ||||
-rw-r--r-- | gui/options.cpp | 44 | ||||
-rw-r--r-- | gui/options.h | 2 | ||||
-rw-r--r-- | gui/saveload.cpp | 37 | ||||
-rw-r--r-- | gui/themebrowser.cpp | 1 | ||||
-rw-r--r-- | gui/themebrowser.h | 1 | ||||
-rw-r--r-- | gui/themes/fonts/topaz/README.ScummVM | 1 | ||||
-rw-r--r-- | gui/themes/translations.dat | bin | 220969 -> 273189 bytes | |||
-rw-r--r-- | gui/widget.cpp | 4 | ||||
-rw-r--r-- | gui/widget.h | 2 | ||||
-rw-r--r-- | gui/widgets/scrollbar.cpp | 8 |
16 files changed, 169 insertions, 129 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 73c1835c9e..cf16eec238 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -33,6 +33,7 @@ #include "graphics/imagedec.h" #include "graphics/surface.h" #include "graphics/VectorRenderer.h" +#include "graphics/fonts/bdf.h" #include "gui/widget.h" #include "gui/ThemeEngine.h" @@ -589,7 +590,7 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &file) { #ifdef USE_TRANSLATION TransMan.setLanguage("C"); #endif - warning("Failed to load localized font '%s'. Using non-localized font and default GUI language instead", file.c_str()); + warning("Failed to load localized font '%s'. Using non-localized font and default GUI language instead", localized.c_str()); } } } @@ -659,6 +660,8 @@ bool ThemeEngine::addDrawData(const Common::String &data, bool cached) { void ThemeEngine::loadTheme(const Common::String &themeId) { unloadTheme(); + debug(6, "Loading theme %s", themeId.c_str()); + if (themeId == "builtin") { _themeOk = loadDefaultXML(); } else { @@ -1394,7 +1397,7 @@ const Graphics::Font *ThemeEngine::loadFontFromArchive(const Common::String &fil if (_themeArchive) stream = _themeArchive->createReadStreamForMember(filename); if (stream) { - font = Graphics::NewFont::loadFont(*stream); + font = Graphics::BdfFont::loadFont(*stream); delete stream; } @@ -1408,7 +1411,7 @@ const Graphics::Font *ThemeEngine::loadCachedFontFromArchive(const Common::Strin if (_themeArchive) stream = _themeArchive->createReadStreamForMember(filename); if (stream) { - font = Graphics::NewFont::loadFromCache(*stream); + font = Graphics::BdfFont::loadFromCache(*stream); delete stream; } @@ -1422,7 +1425,7 @@ const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename) { if (!cacheFilename.empty()) { if (fontFile.open(cacheFilename)) { - font = Graphics::NewFont::loadFromCache(fontFile); + font = Graphics::BdfFont::loadFromCache(fontFile); } if (font) @@ -1434,7 +1437,7 @@ const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename) { // normal open if (fontFile.open(filename)) { - font = Graphics::NewFont::loadFont(fontFile); + font = Graphics::BdfFont::loadFont(fontFile); } if (!font) { @@ -1443,7 +1446,7 @@ const Graphics::Font *ThemeEngine::loadFont(const Common::String &filename) { if (font) { if (!cacheFilename.empty()) { - if (!Graphics::NewFont::cacheFontData(*(const Graphics::NewFont *)font, cacheFilename)) { + if (!Graphics::BdfFont::cacheFontData(*(const Graphics::BdfFont *)font, cacheFilename)) { warning("Couldn't create cache file for font '%s'", filename.c_str()); } } diff --git a/gui/console.cpp b/gui/console.cpp index b656d23a09..dc2c5c4f33 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -665,12 +665,11 @@ int ConsoleDialog::printFormat(int dummy, const char *format, ...) { } int ConsoleDialog::vprintFormat(int dummy, const char *format, va_list argptr) { - char buf[2048]; + Common::String buf = Common::String::vformat(format, argptr); - int count = vsnprintf(buf, sizeof(buf), format, argptr); - buf[sizeof(buf)-1] = 0; // ensure termination - print(buf); - return count; + print(buf.c_str()); + + return buf.size(); } void ConsoleDialog::printChar(int c) { diff --git a/gui/credits.h b/gui/credits.h index 5bc6d56ff4..3a7e77c146 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -2,9 +2,20 @@ static const char *credits[] = { "C1""ScummVM Team", "", -"C1""Project Leaders", +"C1""Project Leader", "C0""Eugene Sandulenko", "", +"C1""PR Office", +"C0""Arnaud Boutonn\351", +"C2""Public Relations Officer, Project Administrator", +"C0""Eugene Sandulenko", +"C2""Project Leader", +"", +"C1""Core Team", +"C0""Willem Jan Palenstijn", +"C0""Eugene Sandulenko", +"C0""Johannes Schickel", +"", "C1""Retired Project Leaders", "C0""James Brown", "C0""Vincent Hamm", @@ -25,7 +36,6 @@ static const char *credits[] = { "C0""Max Horn", "C2""(retired)", "C0""Travis Howell", -"C2""(retired)", "C0""Pawel Kolodziejski", "C2""Codecs, iMUSE, Smush, etc.", "C0""Gregory Montoir", @@ -38,7 +48,6 @@ static const char *credits[] = { "C0""Jonathan Gray", "C2""(retired)", "C0""Travis Howell", -"C2""(retired)", "C0""Gregory Montoir", "C0""Eugene Sandulenko", "", @@ -48,6 +57,7 @@ static const char *credits[] = { "C0""Filippos Karapetis", "C0""Pawel Kolodziejski", "C0""Walter van Niftrik", +"C2""(retired)", "C0""Kari Salminen", "C0""Eugene Sandulenko", "C0""David Symonds", @@ -57,12 +67,15 @@ static const char *credits[] = { "C0""Torbj\366rn Andersson", "C0""Paul Gilbert", "C0""Travis Howell", -"C2""(retired)", "C0""Oliver Kiehl", "C2""(retired)", "C0""Ludvig Strigeus", "C2""(retired)", "", +"C1""CGE", +"C0""Arnaud Boutonn\351", +"C0""Paul Gilbert", +"", "C1""Cine", "C0""Vincent Hamm", "C2""(retired)", @@ -85,8 +98,9 @@ static const char *credits[] = { "C0""Pawel Kolodziejski", "", "C1""DreamWeb", -"C0""Vladimir Menshakov", "C0""Torbj\366rn Andersson", +"C0""Bertrand Augereau", +"C0""Vladimir Menshakov", "", "C1""Gob", "C0""Torbj\366rn Andersson", @@ -161,6 +175,7 @@ static const char *credits[] = { "C0""Filippos Karapetis", "C0""Martin Kiewitz", "C0""Walter van Niftrik", +"C2""(retired)", "C0""Willem Jan Palenstijn", "C0""Jordi Vilalta Prat", "C0""Lars Skovlund", @@ -188,12 +203,12 @@ static const char *credits[] = { "C2""(retired)", "", "C1""Sword25", -"C0""Eugene Sandulenko", -"C0""Filippos Karapetis", +"C0""Torbj\366rn Andersson", +"C0""Paul Gilbert", "C0""Max Horn", "C2""(retired)", -"C0""Paul Gilbert", -"C0""Torbj\366rn Andersson", +"C0""Filippos Karapetis", +"C0""Eugene Sandulenko", "", "C1""TeenAgent", "C0""Robert Megone", @@ -218,8 +233,8 @@ static const char *credits[] = { "C0""Gregory Montoir", "", "C1""TsAGE", -"C0""Paul Gilbert", "C0""Arnaud Boutonn\351", +"C0""Paul Gilbert", "", "C1""Tucker", "C0""Gregory Montoir", @@ -230,6 +245,9 @@ static const char *credits[] = { "C0""Andre Heider", "C0""Angus Lees", "", +"C1""BADA", +"C0""Chris Warren-Smith", +"", "C1""Dreamcast", "C0""Marcus Comstedt", "", @@ -244,11 +262,15 @@ static const char *credits[] = { "", "C1""Maemo", "C0""Frantisek Dufka", +"C2""(retired)", +"C0""Tarek Soliman", "", "C1""Nintendo 64", "C0""Fabio Battaglia", "", "C1""Nintendo DS", +"C0""Bertrand Augereau", +"C2""HQ software scaler", "C0""Neil Millstone", "", "C1""OpenPandora", @@ -267,8 +289,8 @@ static const char *credits[] = { "C0""Max Lingua", "", "C1""PSP (PlayStation Portable)", -"C0""Joost Peters", "C0""Yotam Barnoy", +"C0""Joost Peters", "", "C1""SDL (Win/Linux/OS X/etc.)", "C0""Max Horn", @@ -419,7 +441,6 @@ static const char *credits[] = { "", "C1""Win32", "C0""Travis Howell", -"C2""(retired)", "", "C1""Win64", "C0""Chris Gray", @@ -481,16 +502,16 @@ static const char *credits[] = { "C1""Websites (design)", "C0""Dob\363 Bal\341zs", "C2""Website design", +"C0""William Claydon", +"C2""Skins for doxygen, buildbot and wiki", "C0""Yaroslav Fedevych", "C2""HTML/CSS for the website", -"C0""David Jensen", -"C2""SVG logo conversion", "C0""Jean Marc Gimenez", "C2""ScummVM logo", +"C0""David Jensen", +"C2""SVG logo conversion", "C0""Raina", "C2""ScummVM forum buttons", -"C0""William Claydon", -"C2""Skins for doxygen, buildbot and wiki", "", "C1""Code contributions", "C0""Ori Avtalion", @@ -529,7 +550,7 @@ static const char *credits[] = { "C2""Initial MI1 CD music support", "C0""Quietust", "C2""Sound support for Amiga SCUMM V2/V3 games, MM NES support", -"C0""segra", +"C0""Robert Crossfield", "C2""Improved support for Apple II/C64 versions of MM", "C0""Andreas R\366ver", "C2""Broken Sword I & II MPEG2 cutscene support", @@ -541,76 +562,76 @@ static const char *credits[] = { "C2""SDL-based OpenGL renderer", "", "C1""FreeSCI Contributors", -"C0""Anders Baden Nielsen", -"C2""PPC testing", -"C0""Bas Zoetekouw", -"C2""Man pages, debian package management, CVS maintenance", -"C0""Carl Muckenhoupt", -"C2""Sources to the SCI resource viewer tools that started it all", +"C0""Francois-R Boyer", +"C2""MT-32 information and mapping code", +"C0""Rainer Canavan", +"C2""IRIX MIDI driver and bug fixes", +"C0""Xiaojun Chen", +"C0""Paul David Doherty", +"C2""Game version information", +"C0""Vyacheslav Dikonov", +"C2""Config script improvements", +"C0""Ruediger Hanke", +"C2""Port to the MorphOS platform", +"C0""Matt Hargett", +"C2""Clean-ups, bugfixes, Hardcore QA, Win32", +"C0""Max Horn", +"C2""SetJump implementation", +"C0""Ravi I.", +"C2""SCI0 sound resource specification", +"C0""Emmanuel Jeandel", +"C2""Bugfixes and bug reports", +"C0""Dmitry Jemerov", +"C2""Port to the Win32 platform, numerous bugfixes", "C0""Chris Kehler", "C2""Makefile enhancements", -"C0""Christoph Reichenbach", -"C2""UN*X code, VM/Graphics/Sound/other infrastructure", "C0""Christopher T. Lansdown", "C2""Original CVS maintainer, Alpha compatibility fixes", +"C0""Sergey Lapin", +"C2""Port of Carl's type 2 decompression code", +"C0""Rickard Lind", +"C2""MT-32->GM MIDI mapping magic, sound research", +"C0""Hubert Maier", +"C2""AmigaOS 4 port", +"C0""Johannes Manhave", +"C2""Document format translation", "C0""Claudio Matsuoka", "C2""CVS snapshots, daily builds, BeOS and cygwin ports", "C0""Dark Minister", "C2""SCI research (bytecode and parser)", -"C0""Dmitry Jemerov", -"C2""Port to the Win32 platform, numerous bugfixes", -"C0""Emmanuel Jeandel", -"C2""Bugfixes and bug reports", -"C0""Francois-R Boyer", -"C2""MT-32 information and mapping code", +"C0""Carl Muckenhoupt", +"C2""Sources to the SCI resource viewer tools that started it all", +"C0""Anders Baden Nielsen", +"C2""PPC testing", +"C0""Walter van Niftrik", +"C2""Ports to the Dreamcast and GP32 platforms", +"C0""Rune Orsval", +"C2""Configuration file editor", +"C0""Solomon Peachy", +"C2""SDL ports and much of the sound subsystem", +"C0""Robey Pointer", +"C2""Bug tracking system hosting", +"C0""Magnus Reftel", +"C2""Heap implementation, Python class viewer, bugfixes", +"C0""Christoph Reichenbach", +"C2""UN*X code, VM/Graphics/Sound/other infrastructure", "C0""George Reid", "C2""FreeBSD package management", -"C0""Hubert Maier", -"C2""AmigaOS 4 port", +"C0""Lars Skovlund", +"C2""Project maintenance, most documentation, bugfixes, SCI1 support", +"C0""Rink Springer", +"C2""Port to the DOS platform, several bug fixes", +"C0""Rainer De Temple", +"C2""SCI research", +"C0""Sean Terrell", "C0""Hugues Valois", "C2""Game selection menu", -"C0""Johannes Manhave", -"C2""Document format translation", "C0""Jordi Vilalta", "C2""Numerous code and website clean-up patches", -"C0""Lars Skovlund", -"C2""Project maintenance, most documentation, bugfixes, SCI1 support", -"C0""Magnus Reftel", -"C2""Heap implementation, Python class viewer, bugfixes", -"C0""Matt Hargett", -"C2""Clean-ups, bugfixes, Hardcore QA, Win32", -"C0""Max Horn", -"C2""SetJump implementation", -"C0""Paul David Doherty", -"C2""Game version information", "C0""Petr Vyhnak", "C2""The DCL-INFLATE algorithm, many Win32 improvements", -"C0""Rainer Canavan", -"C2""IRIX MIDI driver and bug fixes", -"C0""Rainer De Temple", -"C2""SCI research", -"C0""Ravi I.", -"C2""SCI0 sound resource specification", -"C0""Ruediger Hanke", -"C2""Port to the MorphOS platform", -"C0""Rune Orsval", -"C2""Configuration file editor", -"C0""Rickard Lind", -"C2""MT-32->GM MIDI mapping magic, sound research", -"C0""Rink Springer", -"C2""Port to the DOS platform, several bug fixes", -"C0""Robey Pointer", -"C2""Bug tracking system hosting", -"C0""Sergey Lapin", -"C2""Port of Carl's type 2 decompression code", -"C0""Solomon Peachy", -"C2""SDL ports and much of the sound subsystem", -"C0""Vyacheslav Dikonov", -"C2""Config script improvements", -"C0""Walter van Niftrik", -"C2""Ports to the Dreamcast and GP32 platforms", -"C0""Xiaojun Chen", -"C0""Sean Terrell", +"C0""Bas Zoetekouw", +"C2""Man pages, debian package management, CVS maintenance", "C0""Special thanks to Prof. Dr. Gary Nutt for allowing the FreeSCI VM extension as a course project in his Advanced OS course.", "C0""", "C0""Special thanks to Bob Heitman and Corey Cole for their support of FreeSCI.", diff --git a/gui/debugger.h b/gui/debugger.h index b74b0d6f0f..3a587d2723 100644 --- a/gui/debugger.h +++ b/gui/debugger.h @@ -26,6 +26,7 @@ #include "common/ptr.h" #include "common/hashmap.h" #include "common/hash-str.h" +#include "common/array.h" namespace GUI { diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index af1852d56d..212d68430c 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -39,7 +39,9 @@ #include "graphics/cursorman.h" +namespace Common { DECLARE_SINGLETON(GUI::GuiManager); +} namespace GUI { diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 6920e0ccd2..8e94c140a4 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -252,7 +252,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) else _globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", _c("Override global MIDI settings", "lowres"), 0, kCmdGlobalMIDIOverride); - if (_guioptions & Common::GUIO_NOMIDI) + if (_guioptions.contains(GUIO_NOMIDI)) _globalMIDIOverride->setEnabled(false); addMIDIControls(tab, "GameOptions_MIDI."); @@ -267,7 +267,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) else _globalMT32Override = new CheckboxWidget(tab, "GameOptions_MT32.EnableTabCheckbox", _c("Override global MT-32 settings", "lowres"), 0, kCmdGlobalMT32Override); - //if (_guioptions & Common::GUIO_NOMIDI) + //if (_guioptions.contains(GUIO_NOMIDI)) // _globalMT32Override->setEnabled(false); addMT32Controls(tab, "GameOptions_MT32."); @@ -1038,7 +1038,7 @@ void LauncherDialog::updateButtons() { bool en = enable; if (item >= 0) - en = !(Common::checkGameGUIOption(Common::GUIO_NOLAUNCHLOAD, ConfMan.get("guioptions", _domains[item]))); + en = !(Common::checkGameGUIOption(GUIO_NOLAUNCHLOAD, ConfMan.get("guioptions", _domains[item]))); if (en != _loadButton->isEnabled()) { _loadButton->setEnabled(en); @@ -1052,7 +1052,7 @@ void LauncherDialog::updateButtons() { const char *newAddButtonLabel = massAdd ? (lowRes ? _c("Mass Add...", "lowres") : _("Mass Add...")) - : (lowRes ? _c("Add Game...", "lowres") : _("Add Game...")); + : (lowRes ? _c("~A~dd Game...", "lowres") : _("~A~dd Game...")); if (_addButton->getLabel() != newAddButtonLabel) _addButton->setLabel(newAddButtonLabel); diff --git a/gui/options.cpp b/gui/options.cpp index 3cc2eea6b9..67204fc343 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -141,7 +141,7 @@ void OptionsDialog::init() { _oldTheme = g_gui.theme()->getThemeId(); // Retrieve game GUI options - _guioptions = 0; + _guioptions = ""; if (ConfMan.hasKey("guioptions", _domain)) { _guioptionsString = ConfMan.get("guioptions", _domain); _guioptions = parseGameGUIOptions(_guioptionsString); @@ -155,7 +155,7 @@ void OptionsDialog::open() { setResult(0); // Retrieve game GUI options - _guioptions = 0; + _guioptions = ""; if (ConfMan.hasKey("guioptions", _domain)) { _guioptionsString = ConfMan.get("guioptions", _domain); _guioptions = parseGameGUIOptions(_guioptionsString); @@ -595,11 +595,15 @@ void OptionsDialog::setAudioSettingsState(bool enabled) { _midiPopUpDesc->setEnabled(enabled); _midiPopUp->setEnabled(enabled); - uint32 allFlags = MidiDriver::musicType2GUIO((uint32)-1); + Common::String allFlags = MidiDriver::musicType2GUIO((uint32)-1); + char opt[256]; + + strncpy(opt, _guioptions.c_str(), 256); + bool hasMidiDefined = (strtok(opt, allFlags.c_str()) != NULL); if (_domain != Common::ConfigManager::kApplicationDomain && // global dialog - (_guioptions & allFlags) && // No flags are specified - !(_guioptions & Common::GUIO_MIDIADLIB)) { + hasMidiDefined && // No flags are specified + !(_guioptions.contains(GUIO_MIDIADLIB))) { _oplPopUpDesc->setEnabled(false); _oplPopUp->setEnabled(false); } else { @@ -611,7 +615,7 @@ void OptionsDialog::setAudioSettingsState(bool enabled) { } void OptionsDialog::setMIDISettingsState(bool enabled) { - if (_guioptions & Common::GUIO_NOMIDI) + if (_guioptions.contains(GUIO_NOMIDI)) enabled = false; _gmDevicePopUpDesc->setEnabled(_domain.equals(Common::ConfigManager::kApplicationDomain) ? enabled : false); @@ -649,7 +653,7 @@ void OptionsDialog::setVolumeSettingsState(bool enabled) { _enableVolumeSettings = enabled; ena = enabled && !_muteCheckbox->getState(); - if (_guioptions & Common::GUIO_NOMUSIC) + if (_guioptions.contains(GUIO_NOMUSIC)) ena = false; _musicVolumeDesc->setEnabled(ena); @@ -657,7 +661,7 @@ void OptionsDialog::setVolumeSettingsState(bool enabled) { _musicVolumeLabel->setEnabled(ena); ena = enabled && !_muteCheckbox->getState(); - if (_guioptions & Common::GUIO_NOSFX) + if (_guioptions.contains(GUIO_NOSFX)) ena = false; _sfxVolumeDesc->setEnabled(ena); @@ -665,7 +669,7 @@ void OptionsDialog::setVolumeSettingsState(bool enabled) { _sfxVolumeLabel->setEnabled(ena); ena = enabled && !_muteCheckbox->getState(); - if (_guioptions & Common::GUIO_NOSPEECH) + if (_guioptions.contains(GUIO_NOSPEECH)) ena = false; _speechVolumeDesc->setEnabled(ena); @@ -680,14 +684,14 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) { _enableSubtitleSettings = enabled; ena = enabled; - if ((_guioptions & Common::GUIO_NOSUBTITLES) || (_guioptions & Common::GUIO_NOSPEECH)) + if ((_guioptions.contains(GUIO_NOSUBTITLES)) || (_guioptions.contains(GUIO_NOSPEECH))) ena = false; _subToggleGroup->setEnabled(ena); _subToggleDesc->setEnabled(ena); ena = enabled; - if (_guioptions & Common::GUIO_NOSUBTITLES) + if (_guioptions.contains(GUIO_NOSUBTITLES)) ena = false; _subSpeedDesc->setEnabled(ena); @@ -741,22 +745,26 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", _("Specifies output sound device or sound card emulator")); // Populate it - uint32 allFlags = MidiDriver::musicType2GUIO((uint32)-1); + Common::String allFlags = MidiDriver::musicType2GUIO((uint32)-1); + char opt[256]; + + strncpy(opt, _guioptions.c_str(), 256); + bool hasMidiDefined = (strtok(opt, allFlags.c_str()) != NULL); 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) { - const uint32 deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType()); + Common::String deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType()); if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS // global dialog - skip useless FM-Towns, C64, Amiga, AppleIIGS options there && d->getMusicType() != MT_C64 && d->getMusicType() != MT_AMIGA && d->getMusicType() != MT_APPLEIIGS && d->getMusicType() != MT_PC98) - || (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified - || (_guioptions & deviceGuiOption) // flag is present + || (_domain != Common::ConfigManager::kApplicationDomain && !hasMidiDefined) // No flags are specified + || (_guioptions.contains(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)) + || (deviceGuiOption.contains(GUIO_MIDIGM) && (_guioptions.contains(GUIO_MIDIMT32))) || d->getMusicDriverId() == "auto" || d->getMusicDriverId() == "null") // always add default and null device _midiPopUp->appendEntry(d->getCompleteName(), d->getHandle()); } @@ -997,9 +1005,9 @@ void OptionsDialog::saveMusicDeviceSetting(PopUpWidget *popup, Common::String se } int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) { - if (_guioptions & Common::GUIO_NOSUBTITLES) + if (_guioptions.contains(GUIO_NOSUBTITLES)) return kSubtitlesSpeech; // Speech only - if (_guioptions & Common::GUIO_NOSPEECH) + if (_guioptions.contains(GUIO_NOSPEECH)) return kSubtitlesSubs; // Subtitles only if (!subtitles && !speech_mute) // Speech only diff --git a/gui/options.h b/gui/options.h index f17669a3cc..c6b1d328c1 100644 --- a/gui/options.h +++ b/gui/options.h @@ -172,7 +172,7 @@ protected: // // Game GUI options // - uint32 _guioptions; + Common::String _guioptions; Common::String _guioptionsString; // diff --git a/gui/saveload.cpp b/gui/saveload.cpp index 460246e5fc..ae950a21fb 100644 --- a/gui/saveload.cpp +++ b/gui/saveload.cpp @@ -131,7 +131,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da if (_list->isEditable() || !_list->getSelectedString().empty()) { _list->endEditMode(); if (!_saveList.empty()) { - setResult(atoi(_saveList[selItem].save_slot().c_str())); + setResult(_saveList[selItem].getSaveSlot()); _resultString = _list->getSelectedString(); } close(); @@ -141,7 +141,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da case kChooseCmd: _list->endEditMode(); if (!_saveList.empty()) { - setResult(atoi(_saveList[selItem].save_slot().c_str())); + setResult(_saveList[selItem].getSaveSlot()); _resultString = _list->getSelectedString(); } close(); @@ -154,7 +154,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da MessageDialog alert(_("Do you really want to delete this savegame?"), _("Delete"), _("Cancel")); if (alert.runModal() == GUI::kMessageOK) { - (*_plugin)->removeSaveState(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str())); + (*_plugin)->removeSaveState(_target.c_str(), _saveList[selItem].getSaveSlot()); setResult(-1); _list->setSelected(-1); @@ -240,11 +240,11 @@ void SaveLoadChooser::updateSelection(bool redraw) { _time->setLabel(_("No time saved")); _playtime->setLabel(_("No playtime saved")); - if (selItem >= 0 && !_list->getSelectedString().empty() && _metaInfoSupport) { - SaveStateDescriptor desc = (*_plugin)->querySaveMetaInfos(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str())); + if (selItem >= 0 && _metaInfoSupport) { + SaveStateDescriptor desc = (*_plugin)->querySaveMetaInfos(_target.c_str(), _saveList[selItem].getSaveSlot()); - isDeletable = desc.getBool("is_deletable") && _delSupport; - isWriteProtected = desc.getBool("is_write_protected"); + isDeletable = desc.getDeletableFlag() && _delSupport; + isWriteProtected = desc.getWriteProtectedFlag(); // Don't allow the user to change the description of write protected games if (isWriteProtected) @@ -259,16 +259,19 @@ void SaveLoadChooser::updateSelection(bool redraw) { } if (_saveDateSupport) { - if (desc.contains("save_date")) - _date->setLabel(_("Date: ") + desc.getVal("save_date")); + const Common::String &saveDate = desc.getSaveDate(); + if (!saveDate.empty()) + _date->setLabel(_("Date: ") + saveDate); - if (desc.contains("save_time")) - _time->setLabel(_("Time: ") + desc.getVal("save_time")); + const Common::String &saveTime = desc.getSaveTime(); + if (!saveTime.empty()) + _time->setLabel(_("Time: ") + saveTime); } if (_playTimeSupport) { - if (desc.contains("play_time")) - _playtime->setLabel(_("Playtime: ") + desc.getVal("play_time")); + const Common::String &playTime = desc.getPlayTime(); + if (!playTime.empty()) + _playtime->setLabel(_("Playtime: ") + playTime); } } @@ -326,25 +329,25 @@ void SaveLoadChooser::updateSaveList() { ListWidget::ColorList colors; for (SaveStateList::const_iterator x = _saveList.begin(); x != _saveList.end(); ++x) { // Handle gaps in the list of save games - saveSlot = atoi(x->save_slot().c_str()); + saveSlot = x->getSaveSlot(); if (curSlot < saveSlot) { while (curSlot < saveSlot) { SaveStateDescriptor dummySave(curSlot, ""); _saveList.insert_at(curSlot, dummySave); - saveNames.push_back(dummySave.description()); + saveNames.push_back(dummySave.getDescription()); colors.push_back(ThemeEngine::kFontColorNormal); curSlot++; } // Sync the save list iterator for (x = _saveList.begin(); x != _saveList.end(); ++x) { - if (atoi(x->save_slot().c_str()) == saveSlot) + if (x->getSaveSlot() == saveSlot) break; } } // Show "Untitled savestate" for empty/whitespace savegame descriptions - Common::String description = x->description(); + Common::String description = x->getDescription(); Common::String trimmedDescription = description; trimmedDescription.trim(); if (trimmedDescription.empty()) { diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp index 831cee1996..c22603b822 100644 --- a/gui/themebrowser.cpp +++ b/gui/themebrowser.cpp @@ -117,4 +117,3 @@ void ThemeBrowser::updateListing() { } } // End of namespace GUI - diff --git a/gui/themebrowser.h b/gui/themebrowser.h index 9da57622db..daea3836fc 100644 --- a/gui/themebrowser.h +++ b/gui/themebrowser.h @@ -54,4 +54,3 @@ private: } // End of namespace GUI #endif - diff --git a/gui/themes/fonts/topaz/README.ScummVM b/gui/themes/fonts/topaz/README.ScummVM index 3beea8a048..55b0b16856 100644 --- a/gui/themes/fonts/topaz/README.ScummVM +++ b/gui/themes/fonts/topaz/README.ScummVM @@ -3,4 +3,3 @@ You will find detailed information in topazLT.readme. The Parallaction engine in ScummVM uses this font's bitmap, namely file topazlt/8. Data has been extracted and placed in the array named _amigaTopazFont which can be found in engines/parallaction/staticres.cpp. - diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat Binary files differindex f218747182..770f76ddf1 100644 --- a/gui/themes/translations.dat +++ b/gui/themes/translations.dat diff --git a/gui/widget.cpp b/gui/widget.cpp index 8420391a3f..c4d288eb11 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -298,6 +298,10 @@ void ButtonWidget::drawWidget() { g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, getFlags()); } +void ButtonWidget::setLabel(const Common::String &label) { + StaticTextWidget::setLabel(cleanupHotkey(label)); +} + #pragma mark - PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip, uint32 cmd, uint8 hotkey) diff --git a/gui/widget.h b/gui/widget.h index 70f2da4c98..acd575a90b 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -186,6 +186,8 @@ public: void setCmd(uint32 cmd) { _cmd = cmd; } uint32 getCmd() const { return _cmd; } + void setLabel(const Common::String &label); + void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); } void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); } diff --git a/gui/widgets/scrollbar.cpp b/gui/widgets/scrollbar.cpp index cc8e587668..e0dbcec59c 100644 --- a/gui/widgets/scrollbar.cpp +++ b/gui/widgets/scrollbar.cpp @@ -55,7 +55,7 @@ static void upArrowRepeater(void *ref) { sb->checkBounds(old_pos); g_system->getTimerManager()->removeTimerProc(&upArrowRepeater); - g_system->getTimerManager()->installTimerProc(&upArrowRepeater, 1000000/10, ref); + g_system->getTimerManager()->installTimerProc(&upArrowRepeater, 1000000/10, ref, "guiScrollBarUp"); } static void downArrowRepeater(void *ref) { @@ -66,7 +66,7 @@ static void downArrowRepeater(void *ref) { sb->checkBounds(old_pos); g_system->getTimerManager()->removeTimerProc(&downArrowRepeater); - g_system->getTimerManager()->installTimerProc(&downArrowRepeater, 1000000/10, ref); + g_system->getTimerManager()->installTimerProc(&downArrowRepeater, 1000000/10, ref, "guiScrollBarDown"); } void ScrollBarWidget::handleMouseDown(int x, int y, int button, int clickCount) { @@ -80,12 +80,12 @@ void ScrollBarWidget::handleMouseDown(int x, int y, int button, int clickCount) // Up arrow _currentPos--; _draggingPart = kUpArrowPart; - g_system->getTimerManager()->installTimerProc(&upArrowRepeater, 1000000/2, this); + g_system->getTimerManager()->installTimerProc(&upArrowRepeater, 1000000/2, this, "guiScrollBarUp"); } else if (y >= _h - UP_DOWN_BOX_HEIGHT) { // Down arrow _currentPos++; _draggingPart = kDownArrowPart; - g_system->getTimerManager()->installTimerProc(&downArrowRepeater, 1000000/2, this); + g_system->getTimerManager()->installTimerProc(&downArrowRepeater, 1000000/2, this, "guiScrollBarDown"); } else if (y < _sliderPos) { _currentPos -= _entriesPerPage - 1; } else if (y >= _sliderPos + _sliderHeight) { |