aboutsummaryrefslogtreecommitdiff
path: root/common/util.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-15 10:57:28 +0000
committerEugene Sandulenko2010-06-15 10:57:28 +0000
commit01bc5dda944f121187a4499f03d3a3814741f093 (patch)
tree1d08ad7b5f2e6c7c9209c5d6b3f2e80307969d35 /common/util.cpp
parent8dcc49251f08492968ddfcbb825bfe0a17d0747b (diff)
downloadscummvm-rg350-01bc5dda944f121187a4499f03d3a3814741f093.tar.gz
scummvm-rg350-01bc5dda944f121187a4499f03d3a3814741f093.tar.bz2
scummvm-rg350-01bc5dda944f121187a4499f03d3a3814741f093.zip
GUI: Implemented Languages as GUI options.
SCUMM and AdvancedDetector support this feature. svn-id: r49786
Diffstat (limited to 'common/util.cpp')
-rw-r--r--common/util.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/common/util.cpp b/common/util.cpp
index 895bcebef7..b8bd327a0a 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -322,9 +322,26 @@ bool checkGameGUIOption(GameGUIOption option, const String &str) {
return false;
}
+bool checkGameGUIOptionLanguage(Language lang, const String &str) {
+ if (!str.contains("lang_")) // If no languages are specified
+ return true;
+
+ if (str.contains(getGameGUIOptionsDescriptionLanguage(lang)))
+ return true;
+
+ return false;
+}
+
+const String getGameGUIOptionsDescriptionLanguage(Language lang) {
+ if (lang == UNK_LANG)
+ return "";
+
+ return String(String("lang_") + getLanguageDescription(lang));
+}
+
uint32 parseGameGUIOptions(const String &str) {
uint32 res = 0;
-
+
for (int i = 0; g_gameOptions[i].desc; i++)
if (str.contains(g_gameOptions[i].desc))
res |= g_gameOptions[i].option;
@@ -332,7 +349,7 @@ uint32 parseGameGUIOptions(const String &str) {
return res;
}
-String getGameGUIOptionsDescription(uint32 options) {
+const String getGameGUIOptionsDescription(uint32 options) {
String res = "";
for (int i = 0; g_gameOptions[i].desc; i++)