[Scummvm-git-logs] scummvm master -> 824e8096981ef314856b2b9e0d2185befe140406
criezy
criezy at scummvm.org
Mon Apr 19 22:19:41 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
982ccb12eb COMMON: Add GUIO_NOLANG GUI option to hide the lang selector
824e809698 AGS: Use GUIO_NOLANG option and mark all games as unknown language
Commit: 982ccb12eb5dd3a4c2cf554725545ff1df4404ff
https://github.com/scummvm/scummvm/commit/982ccb12eb5dd3a4c2cf554725545ff1df4404ff
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-19T23:10:12+01:00
Commit Message:
COMMON: Add GUIO_NOLANG GUI option to hide the lang selector
Changed paths:
common/gui_options.cpp
common/gui_options.h
gui/editgamedialog.cpp
diff --git a/common/gui_options.cpp b/common/gui_options.cpp
index e568230705..2941fbaa0d 100644
--- a/common/gui_options.cpp
+++ b/common/gui_options.cpp
@@ -42,6 +42,8 @@ const struct GameOpt {
{ GUIO_LINKMUSICTOSFX, "sndLinkMusicToSfx" },
{ GUIO_NOSPEECHVOLUME, "sndNoSpchVolume" },
+ { GUIO_NOLANG, "noLang"},
+
{ GUIO_NOLAUNCHLOAD, "launchNoLoad" },
{ GUIO_MIDIPCSPK, "midiPCSpk" },
diff --git a/common/gui_options.h b/common/gui_options.h
index fe35ff4bb6..d771fd9739 100644
--- a/common/gui_options.h
+++ b/common/gui_options.h
@@ -64,6 +64,8 @@
#define GUIO_LINKMUSICTOSFX "\x25"
#define GUIO_NOSPEECHVOLUME "\x26"
+#define GUIO_NOLANG "\x27"
+
// Special GUIO flags for the AdvancedDetector's caching of game specific
// options.
#define GUIO_GAMEOPTIONS1 "\x30"
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 19eb243df0..4d26df07be 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -156,14 +156,18 @@ EditGameDialog::EditGameDialog(const String &domain)
_descriptionWidget = new EditTextWidget(tab, "GameOptions_Game.Desc", description, _("Full title of the game"));
// Language popup
- _langPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.LangPopupDesc", _("Language:"), _("Language of the game. This will not turn your Spanish game version into English"));
- _langPopUp = new PopUpWidget(tab, "GameOptions_Game.LangPopup", _("Language of the game. This will not turn your Spanish game version into English"));
- _langPopUp->appendEntry(_("<default>"), (uint32)Common::UNK_LANG);
- _langPopUp->appendEntry("", (uint32)Common::UNK_LANG);
- const Common::LanguageDescription *l = Common::g_languages;
- for (; l->code; ++l) {
- if (checkGameGUIOptionLanguage(l->id, _guioptionsString))
- _langPopUp->appendEntry(l->description, l->id);
+ _langPopUpDesc = nullptr;
+ _langPopUp = nullptr;
+ if (!_guioptions.contains(GUIO_NOLANG)) {
+ _langPopUpDesc = new StaticTextWidget(tab, "GameOptions_Game.LangPopupDesc", _("Language:"), _("Language of the game. This will not turn your Spanish game version into English"));
+ _langPopUp = new PopUpWidget(tab, "GameOptions_Game.LangPopup", _("Language of the game. This will not turn your Spanish game version into English"));
+ _langPopUp->appendEntry(_("<default>"), (uint32)Common::UNK_LANG);
+ _langPopUp->appendEntry("", (uint32)Common::UNK_LANG);
+ const Common::LanguageDescription *l = Common::g_languages;
+ for (; l->code; ++l) {
+ if (checkGameGUIOptionLanguage(l->id, _guioptionsString))
+ _langPopUp->appendEntry(l->description, l->id);
+ }
}
// Platform popup
@@ -446,17 +450,19 @@ void EditGameDialog::open() {
// TODO: game path
- const Common::Language lang = Common::parseLanguage(ConfMan.get("language", _domain));
+ if (_langPopUp != nullptr) {
+ const Common::Language lang = Common::parseLanguage(ConfMan.get("language", _domain));
- if (ConfMan.hasKey("language", _domain)) {
- _langPopUp->setSelectedTag(lang);
- } else {
- _langPopUp->setSelectedTag((uint32)Common::UNK_LANG);
- }
+ if (ConfMan.hasKey("language", _domain)) {
+ _langPopUp->setSelectedTag(lang);
+ } else {
+ _langPopUp->setSelectedTag((uint32)Common::UNK_LANG);
+ }
- if (_langPopUp->numEntries() <= 3) { // If only one language is avaliable
- _langPopUpDesc->setEnabled(false);
- _langPopUp->setEnabled(false);
+ if (_langPopUp->numEntries() <= 3) { // If only one language is avaliable
+ _langPopUpDesc->setEnabled(false);
+ _langPopUp->setEnabled(false);
+ }
}
if (_engineOptions) {
@@ -476,11 +482,13 @@ void EditGameDialog::open() {
void EditGameDialog::apply() {
ConfMan.set("description", _descriptionWidget->getEditString(), _domain);
- Common::Language lang = (Common::Language)_langPopUp->getSelectedTag();
- if (lang < 0)
- ConfMan.removeKey("language", _domain);
- else
- ConfMan.set("language", Common::getLanguageCode(lang), _domain);
+ if (_langPopUp != nullptr) {
+ Common::Language lang = (Common::Language)_langPopUp->getSelectedTag();
+ if (lang < 0)
+ ConfMan.removeKey("language", _domain);
+ else
+ ConfMan.set("language", Common::getLanguageCode(lang), _domain);
+ }
U32String gamePath(_gamePathWidget->getLabel());
if (!gamePath.empty())
Commit: 824e8096981ef314856b2b9e0d2185befe140406
https://github.com/scummvm/scummvm/commit/824e8096981ef314856b2b9e0d2185befe140406
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-19T23:13:38+01:00
Commit Message:
AGS: Use GUIO_NOLANG option and mark all games as unknown language
In AGS we cannot easily determine the game language during detection
as multiple languages may be present in the form of additional .tra
files. Thus we have a Game language option in the engine tab to
allow selecting the tra file to use. Hiding the language selector
in the Game tab removes some confusion between the two.
Also marking the game as UNK_LANG means we do not add a language
to the game description string, which can also be confusing when
we get it wrong, or when multiple languages are available.
Changed paths:
engines/ags/detection_tables.h
diff --git a/engines/ags/detection_tables.h b/engines/ags/detection_tables.h
index a3d3f180e4..b870935897 100644
--- a/engines/ags/detection_tables.h
+++ b/engines/ags/detection_tables.h
@@ -1436,52 +1436,52 @@ const PlainGameDescriptor GAME_NAMES[] = {
#define UNSUPPORTED_ENTRY(ID, FILENAME, MD5, SIZE, LANG, PLATFORM) \
{{ ID, PLATFORM, AD_ENTRY1s(FILENAME, MD5, SIZE), LANG, \
- Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO0() }, nullptr }
+ Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO1(GUIO_NOLANG) }, nullptr }
#define UNSUPPORTED_DEMO_ENTRY(ID, FILENAME, MD5, SIZE) \
- UNSUPPORTED_ENTRY(ID, FILENAME, MD5, SIZE, Common::EN_ANY, "Demo")
+ UNSUPPORTED_ENTRY(ID, FILENAME, MD5, SIZE, Common::UNK_LANG, "Demo")
#define UNSUPPORTED_GAME_ENTRY(ID, FILENAME, MD5, SIZE) \
- UNSUPPORTED_ENTRY(ID, FILENAME, MD5, SIZE, Common::EN_ANY, nullptr)
+ UNSUPPORTED_ENTRY(ID, FILENAME, MD5, SIZE, Common::UNK_LANG, nullptr)
#define INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, LANG, PLATFORM) \
{{ ID, PLATFORM, AD_ENTRY1s(FILENAME, MD5, SIZE), LANG, \
- Common::kPlatformUnknown, ADGF_TESTING, GUIO0() }, nullptr }
+ Common::kPlatformUnknown, ADGF_TESTING, GUIO1(GUIO_NOLANG) }, nullptr }
#define DEMO_ENTRY(ID, FILENAME, MD5, SIZE) \
- INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, Common::EN_ANY, "Demo")
+ INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, Common::UNK_LANG, "Demo")
#define DEMO_ENTRY_LANG(ID, FILENAME, MD5, SIZE, LANG) \
INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, LANG, "Demo")
#define GAME_ENTRY(ID, FILENAME, MD5, SIZE) \
- INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, Common::EN_ANY, nullptr)
+ INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, Common::UNK_LANG, nullptr)
#define GAME_ENTRY_LANG(ID, FILENAME, MD5, SIZE, LANG) \
INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, LANG, nullptr)
#define GAME_ENTRY_PLATFORM(ID, FILENAME, MD5, SIZE, PLATFORM) \
- INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, Common::EN_ANY, PLATFORM)
+ INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, Common::UNK_LANG, PLATFORM)
#define GAME_ENTRY_LANG_PLATFORM(ID, FILENAME, MD5, SIZE, LANG, PLATFORM) \
INTERNAL_ENTRY(ID, FILENAME, MD5, SIZE, LANG, PLATFORM)
#define GAME_ENTRY_PLUGIN(ID, FILENAME, MD5, SIZE, PLUGIN_ARR) \
- {{ ID, nullptr, AD_ENTRY1s(FILENAME, MD5, SIZE), Common::EN_ANY, \
- Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO0() }, PLUGIN_ARR }
+ {{ ID, nullptr, AD_ENTRY1s(FILENAME, MD5, SIZE), Common::UNK_LANG, \
+ Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO1(GUIO_NOLANG) }, PLUGIN_ARR }
#define GAME_ENTRY_PLUGIN_LANG(ID, FILENAME, MD5, SIZE, PLUGIN_ARR, LANG) \
{{ ID, nullptr, AD_ENTRY1s(FILENAME, MD5, SIZE), LANG, \
- Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO0() }, PLUGIN_ARR }
+ Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO1(GUIO_NOLANG) }, PLUGIN_ARR }
#define GAME_ENTRY_PLUGIN_PLATFORM(ID, FILENAME, MD5, SIZE, PLUGIN_ARR, PLATFORM) \
- {{ ID, PLATFORM, AD_ENTRY1s(FILENAME, MD5, SIZE), Common::EN_ANY, \
- Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO0() }, PLUGIN_ARR }
+ {{ ID, PLATFORM, AD_ENTRY1s(FILENAME, MD5, SIZE), Common::UNK_LANG, \
+ Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO1(GUIO_NOLANG) }, PLUGIN_ARR }
#define GAME_ENTRY_PLUGIN_LANG_PLATFORM(ID, FILENAME, MD5, SIZE, PLUGIN_ARR, LANG, PLATFORM) \
{{ ID, PLATFORM, AD_ENTRY1s(FILENAME, MD5, SIZE), LANG, \
- Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO0() }, PLUGIN_ARR }
+ Common::kPlatformUnknown, ADGF_UNSTABLE, GUIO1(GUIO_NOLANG) }, PLUGIN_ARR }
static const PluginVersion AGSTEAM_WADJETEYE[] = { { "agsteam", kWadjetEye }, { nullptr, 0 } };
static const PluginVersion AGS_FLASHLIGHT[] = { { "agsflashlight", 0 }, { nullptr, 0 } };
@@ -3181,7 +3181,7 @@ static AGSGameDescription g_fallbackDesc = {
Common::UNK_LANG,
Common::kPlatformWindows,
ADGF_NO_FLAGS,
- GUIO0()
+ GUIO1(GUIO_NOLANG)
},
nullptr
};
More information about the Scummvm-git-logs
mailing list