mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 18:32:44 +01:00
Allow language selection in config
This commit is contained in:
parent
e7c772967f
commit
f7fca167dc
@ -79,6 +79,11 @@ int GameConfig::handler(void* user,
|
|||||||
{
|
{
|
||||||
self->m_gamePath = value;
|
self->m_gamePath = value;
|
||||||
}
|
}
|
||||||
|
else if (MATCH("game", "language"))
|
||||||
|
{
|
||||||
|
// @todo Don't allow path seperators and relative directories
|
||||||
|
self->m_gameLanguage = value;
|
||||||
|
}
|
||||||
else if (MATCH("input", "invert_y"))
|
else if (MATCH("input", "invert_y"))
|
||||||
{
|
{
|
||||||
self->m_inputInvertY = atoi(value) > 0;
|
self->m_inputInvertY = atoi(value) > 0;
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
bool isValid();
|
bool isValid();
|
||||||
|
|
||||||
const std::string& getGameDataPath() const { return m_gamePath; }
|
const std::string& getGameDataPath() const { return m_gamePath; }
|
||||||
|
const std::string& getGameLanguage() const { return m_gameLanguage; }
|
||||||
bool getInputInvertY() const { return m_inputInvertY; }
|
bool getInputInvertY() const { return m_inputInvertY; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -40,6 +41,9 @@ private:
|
|||||||
/// Path to the game data
|
/// Path to the game data
|
||||||
std::string m_gamePath;
|
std::string m_gamePath;
|
||||||
|
|
||||||
|
/// Language for game
|
||||||
|
std::string m_gameLanguage = "american";
|
||||||
|
|
||||||
/// Invert the y axis for camera control.
|
/// Invert the y axis for camera control.
|
||||||
bool m_inputInvertY;
|
bool m_inputInvertY;
|
||||||
};
|
};
|
||||||
|
@ -126,8 +126,7 @@ RWGame::RWGame(int argc, char* argv[])
|
|||||||
|
|
||||||
data->loadDynamicObjects(config.getGameDataPath() + "/data/object.dat");
|
data->loadDynamicObjects(config.getGameDataPath() + "/data/object.dat");
|
||||||
|
|
||||||
/// @TODO language choices.
|
data->loadGXT(config.getGameLanguage() + ".gxt");
|
||||||
data->loadGXT("american.gxt");
|
|
||||||
|
|
||||||
getRenderer()->water.setWaterTable(data->waterHeights, 48, data->realWater, 128*128);
|
getRenderer()->water.setWaterTable(data->waterHeights, 48, data->realWater, 128*128);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user