SLUDGE: use multiple entries for language selection
This commit is contained in:
parent
6b794d3da7
commit
ef5e8091f6
5 changed files with 19 additions and 14 deletions
|
@ -30,11 +30,10 @@ namespace Sludge {
|
||||||
|
|
||||||
struct SludgeGameDescription {
|
struct SludgeGameDescription {
|
||||||
ADGameDescription desc;
|
ADGameDescription desc;
|
||||||
|
uint languageID;
|
||||||
int gameType;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int SludgeEngine::getGameType() const { return _gameDescription->gameType; }
|
uint SludgeEngine::getLanguageID() const { return _gameDescription->languageID; }
|
||||||
const char *SludgeEngine::getGameId() const { return _gameDescription->desc.gameId;}
|
const char *SludgeEngine::getGameId() const { return _gameDescription->desc.gameId;}
|
||||||
uint32 SludgeEngine::getFeatures() const { return _gameDescription->desc.flags; }
|
uint32 SludgeEngine::getFeatures() const { return _gameDescription->desc.flags; }
|
||||||
Common::Language SludgeEngine::getLanguage() const { return _gameDescription->desc.language; }
|
Common::Language SludgeEngine::getLanguage() const { return _gameDescription->desc.language; }
|
||||||
|
|
|
@ -49,6 +49,18 @@ static const SludgeGameDescription gameDescriptions[] = {
|
||||||
0
|
0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"verbcoin",
|
||||||
|
"",
|
||||||
|
AD_ENTRY1s("Verb Coin.slg", "e39ec315dcbf3a1137481f0a5fe1617d", 980270),
|
||||||
|
Common::DE_DEU,
|
||||||
|
Common::kPlatformUnknown,
|
||||||
|
ADGF_NO_FLAGS,
|
||||||
|
GUIO0()
|
||||||
|
},
|
||||||
|
1
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,12 +31,12 @@
|
||||||
|
|
||||||
namespace Sludge {
|
namespace Sludge {
|
||||||
|
|
||||||
int *languageTable;
|
uint *languageTable;
|
||||||
Common::String *languageName;
|
Common::String *languageName;
|
||||||
settingsStruct gameSettings;
|
settingsStruct gameSettings;
|
||||||
|
|
||||||
void makeLanguageTable(Common::File *table) {
|
void makeLanguageTable(Common::File *table) {
|
||||||
languageTable = new int[gameSettings.numLanguages + 1];
|
languageTable = new uint[gameSettings.numLanguages + 1];
|
||||||
if (!checkNew(languageTable))
|
if (!checkNew(languageTable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ int getLanguageForFileB() {
|
||||||
if (languageTable[i] == gameSettings.languageID)
|
if (languageTable[i] == gameSettings.languageID)
|
||||||
indexNum = i;
|
indexNum = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return indexNum;
|
return indexNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
SludgeEngine(OSystem *syst, const SludgeGameDescription *gameDesc);
|
SludgeEngine(OSystem *syst, const SludgeGameDescription *gameDesc);
|
||||||
virtual ~SludgeEngine();
|
virtual ~SludgeEngine();
|
||||||
|
|
||||||
int getGameType() const;
|
uint getLanguageID() const;
|
||||||
const char *getGameId() const;
|
const char *getGameId() const;
|
||||||
uint32 getFeatures() const;
|
uint32 getFeatures() const;
|
||||||
Common::Language getLanguage() const;
|
Common::Language getLanguage() const;
|
||||||
|
|
|
@ -511,14 +511,9 @@ bool initSludge(const Common::String &filename) {
|
||||||
if (chdir(gameName)) return fatal("This game's preference folder is inaccessible!\nI can't access the following directory (maybe there's a file with the same name, or maybe it's read-protected):", gameName);
|
if (chdir(gameName)) return fatal("This game's preference folder is inaccessible!\nI can't access the following directory (maybe there's a file with the same name, or maybe it's read-protected):", gameName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get user settings
|
// Get language selected by user
|
||||||
readIniFile(filename);
|
gameSettings.languageID = g_sludge->getLanguageID();
|
||||||
|
|
||||||
// There's no startup window on Linux and respecting this
|
|
||||||
// option from the ini file would disable commandline options.
|
|
||||||
saveIniFile(filename);
|
|
||||||
|
|
||||||
|
|
||||||
// Now set file indices properly to the chosen language.
|
// Now set file indices properly to the chosen language.
|
||||||
languageNum = getLanguageForFileB();
|
languageNum = getLanguageForFileB();
|
||||||
if (languageNum < 0)
|
if (languageNum < 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue