COMMON: Move language GUIO code to language.h

This commit is contained in:
Max Horn 2012-02-29 12:57:34 +01:00
parent 92d219715f
commit c0d54bdd8d
4 changed files with 25 additions and 21 deletions

View File

@ -79,23 +79,6 @@ bool checkGameGUIOption(const String &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("lang_") + getLanguageDescription(lang);
}
String parseGameGUIOptions(const String &str) {
String res;

View File

@ -23,8 +23,6 @@
#ifndef COMMON_GUI_OPTIONS_H
#define COMMON_GUI_OPTIONS_H
#include "common/language.h"
#define GUIO_NONE "\000"
#define GUIO_NOSUBTITLES "\001"
#define GUIO_NOMUSIC "\002"
@ -68,12 +66,11 @@
namespace Common {
class String;
bool checkGameGUIOption(const String &option, const String &str);
bool checkGameGUIOptionLanguage(Common::Language lang, const String &str);
String parseGameGUIOptions(const String &str);
const String getGameGUIOptionsDescription(const String &options);
const String getGameGUIOptionsDescriptionLanguage(Common::Language lang);
/**
* Updates the GUI options of the current config manager

View File

@ -20,6 +20,7 @@
*/
#include "common/language.h"
#include "common/gui_options.h"
#include "common/str.h"
namespace Common {
@ -104,4 +105,21 @@ const char *getLanguageDescription(Language id) {
return 0;
}
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("lang_") + getLanguageDescription(lang);
}
} // End of namespace Common

View File

@ -75,6 +75,12 @@ extern const char *getLanguageCode(Language id);
extern const char *getLanguageLocale(Language id);
extern const char *getLanguageDescription(Language id);
// TODO: Document this GUIO related function
const String getGameGUIOptionsDescriptionLanguage(Common::Language lang);
// TODO: Document this GUIO related function
bool checkGameGUIOptionLanguage(Common::Language lang, const String &str);
} // End of namespace Common
#endif