a little refactoring of function names in language class

This commit is contained in:
Mark Vejvoda 2013-10-29 06:13:38 +00:00
parent dda2f99e01
commit d2ba7b163b
51 changed files with 1201 additions and 1205 deletions

View File

@ -221,18 +221,18 @@ string getTeammateName(int i) {
}
string getTeammateRole(int i) {
Lang &l= Lang::getInstance();
Lang &lang = Lang::getInstance();
switch(i){
case 0: return l.get("Programming");
case 1: return l.get("SoundAndMusic");
case 2: return l.get("3dAnd2dArt");
case 3: return l.get("2dArtAndWeb");
case 4: return l.get("Animation");
case 5: return l.get("3dArt");
case 6: return l.get("LinuxPort");
case 7: return l.get("Megaglest3d2dProgramming");
case 8: return l.get("MegaglestProgramming");
switch(i) {
case 0: return lang.getString("Programming");
case 1: return lang.getString("SoundAndMusic");
case 2: return lang.getString("3dAnd2dArt");
case 3: return lang.getString("2dArtAndWeb");
case 4: return lang.getString("Animation");
case 5: return lang.getString("3dArt");
case 6: return lang.getString("LinuxPort");
case 7: return lang.getString("Megaglest3d2dProgramming");
case 8: return lang.getString("MegaglestProgramming");
}
return "";
}

View File

@ -120,7 +120,7 @@ void Logger::loadLoadingScreen(string filepath) {
}
Lang &lang = Lang::getInstance();
buttonCancel.setText(lang.get("Cancel"));
buttonCancel.setText(lang.getString("Cancel"));
}
void Logger::loadGameHints(string filePathEnglish,string filePathTranslation,bool clearList) {
@ -270,7 +270,7 @@ void Logger::renderLoadingScreen() {
if(gameHintToShow != "") {
Lang &lang = Lang::getInstance();
string hintText = lang.get("Hint","",true);
string hintText = lang.getString("Hint","",true);
char szBuf[8096]="";
snprintf(szBuf,8096,hintText.c_str(),gameHintToShow.c_str());
hintText = szBuf;
@ -297,7 +297,7 @@ void Logger::renderLoadingScreen() {
//Show next Hint
if(buttonNextHint.getEnabled() == false) {
buttonNextHint.init((metrics.getVirtualW() / 2) - (300 / 2), 90 * metrics.getVirtualH() / 100 + 20,175);
buttonNextHint.setText(lang.get("ShowNextHint","",true));
buttonNextHint.setText(lang.getString("ShowNextHint","",true));
buttonNextHint.setEnabled(true);
buttonNextHint.setVisible(true);
buttonNextHint.setEditable(true);
@ -310,7 +310,7 @@ void Logger::renderLoadingScreen() {
int xLocationHint = (metrics.getVirtualW() / 2) - (coreData.getMenuFontBig3D()->getMetrics()->getTextWidth(hintText) / 2);
renderer.renderText3D(
lang.get("ShowNextHint","",true), coreData.getMenuFontNormal3D(), nextHintTitleColor,
lang.getString("ShowNextHint","",true), coreData.getMenuFontNormal3D(), nextHintTitleColor,
//xLocation*1.5f,
xLocationHint,
93 * metrics.getVirtualH() / 100, false);
@ -319,7 +319,7 @@ void Logger::renderLoadingScreen() {
int xLocationHint = (metrics.getVirtualW() / 2) - (coreData.getMenuFontBig()->getMetrics()->getTextWidth(hintText) / 2);
renderer.renderText(
lang.get("ShowNextHint","",true), coreData.getMenuFontNormal(), nextHintTitleColor,
lang.getString("ShowNextHint","",true), coreData.getMenuFontNormal(), nextHintTitleColor,
//xLocation*1.5f,
xLocationHint,
93 * metrics.getVirtualH() / 100, false);
@ -342,7 +342,7 @@ void Logger::setCancelLoadingEnabled(bool value) {
//string containerName = "logger";
//buttonCancel.registerGraphicComponent(containerName,"buttonCancel");
buttonCancel.init((metrics.getVirtualW() / 2) - (125 / 2), 50 * metrics.getVirtualH() / 100, 125);
buttonCancel.setText(lang.get("Cancel"));
buttonCancel.setText(lang.getString("Cancel"));
buttonCancel.setEnabled(value);
//GraphicComponent::applyAllCustomProperties(containerName);
}

View File

@ -110,10 +110,10 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) {
if (!inMenu) {
if (teamMode == true) {
teamMode = false;
console->addLine(lang.get("ChatMode") + ": " + lang.get("All"));
console->addLine(lang.getString("ChatMode") + ": " + lang.getString("All"));
} else {
teamMode = true;
console->addLine(lang.get("ChatMode") + ": " + lang.get("Team"));
console->addLine(lang.getString("ChatMode") + ": " + lang.getString("Team"));
}
}
}

View File

@ -611,7 +611,7 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("PlayerSwitchedTeam",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("PlayerSwitchedTeam",languageList[i]).c_str(),settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,newTeam);
snprintf(szMsg,8096,lang.getString("PlayerSwitchedTeam",languageList[i]).c_str(),settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,newTeam);
}
else {
snprintf(szMsg,8096,"Player %s switched from team# %d to team# %d.",settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,newTeam);
@ -704,7 +704,7 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("PlayerSwitchedTeam",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("PlayerSwitchedTeam",languageList[i]).c_str(),settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,vote->newTeam);
snprintf(szMsg,8096,lang.getString("PlayerSwitchedTeam",languageList[i]).c_str(),settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,vote->newTeam);
}
else {
snprintf(szMsg,8096,"Player %s switched from team# %d to team# %d.",settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,vote->newTeam);
@ -729,7 +729,7 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("PlayerSwitchedTeamDenied",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("PlayerSwitchedTeamDenied",languageList[i]).c_str(),settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,vote->newTeam);
snprintf(szMsg,8096,lang.getString("PlayerSwitchedTeamDenied",languageList[i]).c_str(),settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,vote->newTeam);
}
else {
snprintf(szMsg,8096,"Player %s was denied the request to switch from team# %d to team# %d.",settings->getNetworkPlayerName(factionIndex).c_str(),oldTeam,vote->newTeam);

View File

@ -51,19 +51,19 @@ void Console::resetFonts() {
void Console::addStdMessage(const string &s,bool clearOtherLines) {
if(clearOtherLines == true) {
addLineOnly(Lang::getInstance().get(s));
addLineOnly(Lang::getInstance().getString(s));
}
else {
addLine(Lang::getInstance().get(s));
addLine(Lang::getInstance().getString(s));
}
}
void Console::addStdMessage(const string &s,string failText, bool clearOtherLines) {
if(clearOtherLines == true) {
addLineOnly(Lang::getInstance().get(s) + failText);
addLineOnly(Lang::getInstance().getString(s) + failText);
}
else {
addLine(Lang::getInstance().get(s) + failText);
addLine(Lang::getInstance().getString(s) + failText);
}
}

View File

@ -333,9 +333,9 @@ void Game::endGame() {
logger.clearHints();
logger.loadLoadingScreen("");
logger.setState(Lang::getInstance().get("Deleting"));
logger.setState(Lang::getInstance().getString("Deleting"));
//logger.add("Game", true);
logger.add(Lang::getInstance().get("LogScreenGameLoading","",true), false);
logger.add(Lang::getInstance().getString("LogScreenGameLoading","",true), false);
logger.hideProgress();
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
@ -396,9 +396,9 @@ Game::~Game() {
Renderer &renderer= Renderer::getInstance();
logger.loadLoadingScreen("");
logger.setState(Lang::getInstance().get("Deleting"));
logger.setState(Lang::getInstance().getString("Deleting"));
//logger.add("Game", true);
logger.add(Lang::getInstance().get("LogScreenGameLoading","",true), false);
logger.add(Lang::getInstance().getString("LogScreenGameLoading","",true), false);
logger.hideProgress();
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
@ -869,7 +869,7 @@ string Game::findFactionLogoFile(const GameSettings *settings, Logger *logger,
bool loadingImageUsed = false;
if(logger != NULL) {
logger->setState(Lang::getInstance().get("Loading"));
logger->setState(Lang::getInstance().getString("Loading"));
if(scenarioName.empty()) {
string scenarioDir = extractDirectoryPathFromFile(settings->getScenarioDir());
@ -1207,7 +1207,7 @@ void Game::init(bool initForPreviewOnly) {
Map *map= world.getMap();
NetworkManager &networkManager= NetworkManager::getInstance();
GameSettings::playerDisconnectedText = "*" + lang.get("AI") + "* ";
GameSettings::playerDisconnectedText = "*" + lang.getString("AI") + "* ";
if(map == NULL) {
throw megaglest_runtime_error("map == NULL");
@ -1216,14 +1216,14 @@ void Game::init(bool initForPreviewOnly) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
if(initForPreviewOnly == false) {
logger.setState(lang.get("Initializing"));
logger.setState(lang.getString("Initializing"));
//mesage box
mainMessageBox.init(lang.get("Yes"), lang.get("No"));
mainMessageBox.init(lang.getString("Yes"), lang.getString("No"));
mainMessageBox.setEnabled(false);
//mesage box
errorMessageBox.init(lang.get("Ok"));
errorMessageBox.init(lang.getString("Ok"));
errorMessageBox.setEnabled(false);
errorMessageBox.setY(mainMessageBox.getY() - mainMessageBox.getH() - 10);
@ -1383,7 +1383,7 @@ void Game::init(bool initForPreviewOnly) {
aiInterfaces[i]->loadGame(loadGameNode,faction);
}
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingCreatingAIFaction","",true).c_str(),i);
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingCreatingAIFaction","",true).c_str(),i);
logger.add(szBuf, true);
slaveThreadList.push_back(aiInterfaces[i]->getWorkerThread());
@ -1415,14 +1415,14 @@ void Game::init(bool initForPreviewOnly) {
if(withRainEffect) {
//weather particle systems
if(world.getTileset()->getWeather() == wRainy) {
logger.add(Lang::getInstance().get("LogScreenGameLoadingCreatingRainParticles","",true), true);
logger.add(Lang::getInstance().getString("LogScreenGameLoadingCreatingRainParticles","",true), true);
weatherParticleSystem= new RainParticleSystem();
weatherParticleSystem->setSpeed(12.f / GameConstants::updateFps);
weatherParticleSystem->setPos(gameCamera.getPos());
renderer.manageParticleSystem(weatherParticleSystem, rsGame);
}
else if(world.getTileset()->getWeather() == wSnowy) {
logger.add(Lang::getInstance().get("LogScreenGameLoadingCreatingSnowParticles","",true), true);
logger.add(Lang::getInstance().getString("LogScreenGameLoadingCreatingSnowParticles","",true), true);
weatherParticleSystem= new SnowParticleSystem(1200);
weatherParticleSystem->setSpeed(1.5f / GameConstants::updateFps);
weatherParticleSystem->setPos(gameCamera.getPos());
@ -1444,7 +1444,7 @@ void Game::init(bool initForPreviewOnly) {
//init renderer state
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Initializing renderer\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__);
logger.add(Lang::getInstance().get("LogScreenGameLoadingInitRenderer","",true), true);
logger.add(Lang::getInstance().getString("LogScreenGameLoadingInitRenderer","",true), true);
//printf("Before renderer.initGame\n");
renderer.initGame(this,this->getGameCameraPtr());
@ -1476,13 +1476,13 @@ void Game::init(bool initForPreviewOnly) {
SDL_PumpEvents();
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Waiting for network\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__);
logger.add(Lang::getInstance().get("LogScreenGameLoadingWaitForNetworkPlayers","",true), true);
logger.add(Lang::getInstance().getString("LogScreenGameLoadingWaitForNetworkPlayers","",true), true);
networkManager.getGameNetworkInterface()->waitUntilReady(&checksum);
//std::string worldLog = world.DumpWorldToLog(true);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Starting music stream\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
logger.add(Lang::getInstance().get("LogScreenGameLoadingStartingMusic","",true), true);
logger.add(Lang::getInstance().getString("LogScreenGameLoadingStartingMusic","",true), true);
if(this->masterserverMode == false) {
if(world.getThisFaction() == NULL) {
@ -1506,7 +1506,7 @@ void Game::init(bool initForPreviewOnly) {
//rain
if(tileset->getWeather() == wRainy && ambientSounds->isEnabledRain()) {
logger.add(Lang::getInstance().get("LogScreenGameLoadingStartingAmbient","",true), true);
logger.add(Lang::getInstance().getString("LogScreenGameLoadingStartingAmbient","",true), true);
currentAmbientSound = ambientSounds->getRain();
//printf("In [%s:%s] Line: %d currentAmbientSound = [%p]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,currentAmbientSound);
soundRenderer.playAmbient(currentAmbientSound);
@ -1514,7 +1514,7 @@ void Game::init(bool initForPreviewOnly) {
//snow
if(tileset->getWeather() == wSnowy && ambientSounds->isEnabledSnow()) {
logger.add(Lang::getInstance().get("LogScreenGameLoadingStartingAmbient","",true), true);
logger.add(Lang::getInstance().getString("LogScreenGameLoadingStartingAmbient","",true), true);
currentAmbientSound = ambientSounds->getSnow();
//printf("In [%s:%s] Line: %d currentAmbientSound = [%p]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,currentAmbientSound);
soundRenderer.playAmbient(currentAmbientSound);
@ -1525,7 +1525,7 @@ void Game::init(bool initForPreviewOnly) {
soundRenderer.playMusic(gameMusic);
}
logger.add(Lang::getInstance().get("LogScreenGameLoadingLaunchGame","",true));
logger.add(Lang::getInstance().getString("LogScreenGameLoadingLaunchGame","",true));
}
if(showPerfStats) {
@ -1654,37 +1654,37 @@ void Game::setupPopupMenus(bool checkClientAdminOverrideOnly) {
}
//PopupMenu popupMenu;
std::vector<string> menuItems;
menuItems.push_back(lang.get("ExitGameMenu?"));
menuItems.push_back(lang.getString("ExitGameMenu?"));
exitGamePopupMenuIndex = menuItems.size()-1;
if((gameSettings.getFlagTypes1() & ft1_allow_team_switching) == ft1_allow_team_switching &&
world.getThisFaction() != NULL && world.getThisFaction()->getPersonalityType() != fpt_Observer) {
menuItems.push_back(lang.get("JoinOtherTeam"));
menuItems.push_back(lang.getString("JoinOtherTeam"));
joinTeamPopupMenuIndex = menuItems.size()-1;
}
if(allowAdminMenuItems == true){
menuItems.push_back(lang.get("PauseResumeGame"));
menuItems.push_back(lang.getString("PauseResumeGame"));
pauseGamePopupMenuIndex= menuItems.size() - 1;
if(gameSettings.isNetworkGame() == false){
menuItems.push_back(lang.get("SaveGame"));
menuItems.push_back(lang.getString("SaveGame"));
saveGamePopupMenuIndex= menuItems.size() - 1;
}
if(gameSettings.isNetworkGame() == true){
menuItems.push_back(lang.get("DisconnectNetorkPlayer"));
menuItems.push_back(lang.getString("DisconnectNetorkPlayer"));
disconnectPlayerPopupMenuIndex= menuItems.size() - 1;
}
}
menuItems.push_back(lang.get("Keyboardsetup"));
menuItems.push_back(lang.getString("Keyboardsetup"));
keyboardSetupPopupMenuIndex = menuItems.size()-1;
menuItems.push_back(lang.get("Cancel"));
menuItems.push_back(lang.getString("Cancel"));
popupMenu.setW(100);
popupMenu.setH(100);
popupMenu.init(lang.get("GameMenuTitle"),menuItems);
popupMenu.init(lang.getString("GameMenuTitle"),menuItems);
popupMenu.setEnabled(false);
popupMenu.setVisible(false);
@ -1786,14 +1786,14 @@ void Game::update() {
char szBuf[8096]="";
if(lang.hasString("AllowPlayerJoinTeam") == true) {
snprintf(szBuf,8096,lang.get("AllowPlayerJoinTeam").c_str(),settings->getNetworkPlayerName(vote->factionIndex).c_str(),vote->oldTeam,vote->newTeam);
snprintf(szBuf,8096,lang.getString("AllowPlayerJoinTeam").c_str(),settings->getNetworkPlayerName(vote->factionIndex).c_str(),vote->oldTeam,vote->newTeam);
}
else {
snprintf(szBuf,8096,"Allow player [%s] to join your team\n(changing from team# %d to team# %d)?",settings->getNetworkPlayerName(vote->factionIndex).c_str(),vote->oldTeam,vote->newTeam);
}
switchTeamConfirmMessageBox.setText(szBuf);
switchTeamConfirmMessageBox.init(lang.get("Yes"), lang.get("No"));
switchTeamConfirmMessageBox.init(lang.getString("Yes"), lang.getString("No"));
switchTeamConfirmMessageBox.setEnabled(true);
world.getThisFactionPtr()->setCurrentSwitchTeamVoteFactionIndex(vote->factionIndex);
@ -2376,8 +2376,8 @@ void Game::update() {
this->gameSettings.getFactionControl(i) == ctNetwork &&
aiInterfaces[i] == NULL) {
faction->setFactionDisconnectHandled(false);
//this->gameSettings.setNetworkPlayerName(i,lang.get("AI") + intToStr(i+1));
//server->gameSettings.setNetworkPlayerName(i,lang.get("AI") + intToStr(i+1));
//this->gameSettings.setNetworkPlayerName(i,lang.getString("AI") + intToStr(i+1));
//server->gameSettings.setNetworkPlayerName(i,lang.getString("AI") + intToStr(i+1));
}
}
@ -2472,7 +2472,7 @@ void Game::update() {
char szBuf[8096]="";
Lang &lang= Lang::getInstance();
snprintf(szBuf,8096,lang.get("GameSaved","",true).c_str(),file.c_str());
snprintf(szBuf,8096,lang.getString("GameSaved","",true).c_str(),file.c_str());
console.addLine(szBuf);
for(int i = 0; i < world.getFactionCount(); ++i) {
@ -3006,7 +3006,7 @@ void Game::ReplaceDisconnectedNetworkPlayersWithAI(bool isNetworkGame, NetworkRo
if(faction->getPersonalityType() != fpt_Observer) {
aiInterfaces[i] = new AiInterface(*this, i, faction->getTeam(), faction->getStartLocationIndex());
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingCreatingAIFaction","",true).c_str(),i);
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingCreatingAIFaction","",true).c_str(),i);
logger.add(szBuf, true);
commander.tryNetworkPlayerDisconnected(i);
@ -3023,14 +3023,14 @@ void Game::ReplaceDisconnectedNetworkPlayersWithAI(bool isNetworkGame, NetworkRo
if(isPlayerObserver == false) {
string msg = "Player #%d [%s] has disconnected, switching player to AI mode!";
if(lang.hasString("GameSwitchPlayerToAI",languageList[j],true)) {
msg = lang.get("GameSwitchPlayerToAI",languageList[j],true);
msg = lang.getString("GameSwitchPlayerToAI",languageList[j],true);
}
snprintf(szBuf,8096,msg.c_str(),i+1,this->gameSettings.getNetworkPlayerName(i).c_str());
}
else {
string msg = "Player #%d [%s] has disconnected, but player was only an observer!";
if(lang.hasString("GameSwitchPlayerObserverToAI",languageList[j],true)) {
msg = lang.get("GameSwitchPlayerObserverToAI",languageList[j],true);
msg = lang.getString("GameSwitchPlayerObserverToAI",languageList[j],true);
}
snprintf(szBuf,8096,msg.c_str(),i+1,this->gameSettings.getNetworkPlayerName(i).c_str());
}
@ -3424,7 +3424,7 @@ void Game::startMarkCell() {
}
else {
Lang &lang= Lang::getInstance();
console.addLine(lang.get("MaxMarkerCount") + " " + intToStr(MAX_MARKER_COUNT));
console.addLine(lang.getString("MaxMarkerCount") + " " + intToStr(MAX_MARKER_COUNT));
}
}
@ -3582,7 +3582,7 @@ void Game::mouseDownLeft(int x, int y) {
// Exit game
if(result.first == exitGamePopupMenuIndex) {
showMessageBox(Lang::getInstance().get("ExitGameMenu?"), "", true);
showMessageBox(Lang::getInstance().getString("ExitGameMenu?"), "", true);
}
else if(result.first == joinTeamPopupMenuIndex) {
@ -3603,7 +3603,7 @@ void Game::mouseDownLeft(int x, int y) {
world.getThisFaction()->getTeam() != faction->getTeam()) {
char szBuf[8096]="";
if(lang.hasString("JoinPlayerTeam") == true) {
snprintf(szBuf,8096,lang.get("JoinPlayerTeam").c_str(),faction->getIndex(),this->gameSettings.getNetworkPlayerName(i).c_str(),faction->getTeam());
snprintf(szBuf,8096,lang.getString("JoinPlayerTeam").c_str(),faction->getIndex(),this->gameSettings.getNetworkPlayerName(i).c_str(),faction->getTeam());
}
else {
snprintf(szBuf,8096,"Join player #%d - %s on Team: %d",faction->getIndex(),this->gameSettings.getNetworkPlayerName(i).c_str(),faction->getTeam());
@ -3616,15 +3616,15 @@ void Game::mouseDownLeft(int x, int y) {
}
if(uniqueTeamNumbersUsed.size() < 8) {
menuItems.push_back(lang.get("CreateNewTeam"));
menuItems.push_back(lang.getString("CreateNewTeam"));
switchTeamIndexMap[menuItems.size()-1] = CREATE_NEW_TEAM;
}
menuItems.push_back(lang.get("Cancel"));
menuItems.push_back(lang.getString("Cancel"));
switchTeamIndexMap[menuItems.size()-1] = CANCEL_SWITCH_TEAM;
popupMenuSwitchTeams.setW(100);
popupMenuSwitchTeams.setH(100);
popupMenuSwitchTeams.init(lang.get("SwitchTeams"),menuItems);
popupMenuSwitchTeams.init(lang.getString("SwitchTeams"),menuItems);
popupMenuSwitchTeams.setEnabled(true);
popupMenuSwitchTeams.setVisible(true);
}
@ -3664,7 +3664,7 @@ void Game::mouseDownLeft(int x, int y) {
char szBuf[8096]="";
if(lang.hasString("DisconnectNetorkPlayerIndex") == true) {
snprintf(szBuf,8096,lang.get("DisconnectNetorkPlayerIndex").c_str(),faction->getIndex()+1,this->gameSettings.getNetworkPlayerName(i).c_str());
snprintf(szBuf,8096,lang.getString("DisconnectNetorkPlayerIndex").c_str(),faction->getIndex()+1,this->gameSettings.getNetworkPlayerName(i).c_str());
}
else {
snprintf(szBuf,8096,"Disconnect player #%d - %s:",faction->getIndex()+1,this->gameSettings.getNetworkPlayerName(i).c_str());
@ -3677,12 +3677,12 @@ void Game::mouseDownLeft(int x, int y) {
}
}
menuItems.push_back(lang.get("Cancel"));
menuItems.push_back(lang.getString("Cancel"));
disconnectPlayerIndexMap[menuItems.size()-1] = CANCEL_DISCONNECT_PLAYER;
popupMenuDisconnectPlayer.setW(100);
popupMenuDisconnectPlayer.setH(100);
popupMenuDisconnectPlayer.init(lang.get("DisconnectNetorkPlayer"),menuItems);
popupMenuDisconnectPlayer.init(lang.getString("DisconnectNetorkPlayer"),menuItems);
popupMenuDisconnectPlayer.setEnabled(true);
popupMenuDisconnectPlayer.setVisible(true);
}
@ -3805,14 +3805,14 @@ void Game::mouseDownLeft(int x, int y) {
char szBuf[8096]="";
if(lang.hasString("DisconnectNetorkPlayerIndexConfirm") == true) {
snprintf(szBuf,8096,lang.get("DisconnectNetorkPlayerIndexConfirm").c_str(),factionIndex+1,settings->getNetworkPlayerName(factionIndex).c_str());
snprintf(szBuf,8096,lang.getString("DisconnectNetorkPlayerIndexConfirm").c_str(),factionIndex+1,settings->getNetworkPlayerName(factionIndex).c_str());
}
else {
snprintf(szBuf,8096,"Confirm disconnection for player #%d - %s?",factionIndex+1,settings->getNetworkPlayerName(factionIndex).c_str());
}
disconnectPlayerConfirmMessageBox.setText(szBuf);
disconnectPlayerConfirmMessageBox.init(lang.get("Yes"), lang.get("No"));
disconnectPlayerConfirmMessageBox.init(lang.getString("Yes"), lang.getString("No"));
disconnectPlayerConfirmMessageBox.setEnabled(true);
playerIndexDisconnect = world.getFaction(factionIndex)->getStartLocationIndex();
@ -3824,7 +3824,7 @@ void Game::mouseDownLeft(int x, int y) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DisconnectNetorkPlayerIndexConfirmed",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DisconnectNetorkPlayerIndexConfirmed",languageList[i]).c_str(),factionIndex+1,settings->getNetworkPlayerName(factionIndex).c_str());
snprintf(szMsg,8096,lang.getString("DisconnectNetorkPlayerIndexConfirmed",languageList[i]).c_str(),factionIndex+1,settings->getNetworkPlayerName(factionIndex).c_str());
}
else {
snprintf(szMsg,8096,"Notice - Admin is warning to disconnect player #%d - %s!",factionIndex+1,settings->getNetworkPlayerName(factionIndex).c_str());
@ -4529,12 +4529,12 @@ void Game::keyDown(SDL_KeyboardEvent key) {
float currentVolume = gameMusic->getVolume();
if(currentVolume > 0) {
gameMusic->setVolume(0);
console.addLine(lang.get("GameMusic") + " " + lang.get("Off"));
console.addLine(lang.getString("GameMusic") + " " + lang.getString("Off"));
}
else {
//If the config says zero, use the default music volume
gameMusic->setVolume(configVolume ? configVolume : 0.9);
console.addLine(lang.get("GameMusic"));
console.addLine(lang.getString("GameMusic"));
}
}
}
@ -4569,14 +4569,14 @@ void Game::keyDown(SDL_KeyboardEvent key) {
if(gameCamera.getState()==GameCamera::sFree)
{
gameCamera.setState(GameCamera::sGame);
string stateString= gameCamera.getState()==GameCamera::sGame? lang.get("GameCamera"): lang.get("FreeCamera");
console.addLine(lang.get("CameraModeSet")+" "+ stateString);
string stateString= gameCamera.getState()==GameCamera::sGame? lang.getString("GameCamera"): lang.getString("FreeCamera");
console.addLine(lang.getString("CameraModeSet")+" "+ stateString);
}
else if(gameCamera.getState()==GameCamera::sGame)
{
gameCamera.setState(GameCamera::sFree);
string stateString= gameCamera.getState()==GameCamera::sGame? lang.get("GameCamera"): lang.get("FreeCamera");
console.addLine(lang.get("CameraModeSet")+" "+ stateString);
string stateString= gameCamera.getState()==GameCamera::sGame? lang.getString("GameCamera"): lang.getString("FreeCamera");
console.addLine(lang.getString("CameraModeSet")+" "+ stateString);
}
//else ignore!
}
@ -5761,7 +5761,7 @@ void Game::incSpeed() {
else {
this->speed++;
}
console.addLine(lang.get("GameSpeedSet")+" "+((this->speed == 0)?lang.get("Slow") : (this->speed == 1)?lang.get("Normal"):"x"+intToStr(this->speed)));
console.addLine(lang.getString("GameSpeedSet")+" "+((this->speed == 0)?lang.getString("Slow") : (this->speed == 1)?lang.getString("Normal"):"x"+intToStr(this->speed)));
}
}
@ -5769,7 +5769,7 @@ void Game::decSpeed() {
Lang &lang= Lang::getInstance();
if(this->speed > 0) {
this->speed--;
console.addLine(lang.get("GameSpeedSet")+" "+((this->speed == 0)?lang.get("Slow") : (this->speed == 1)?lang.get("Normal"):"x"+intToStr(this->speed)));
console.addLine(lang.getString("GameSpeedSet")+" "+((this->speed == 0)?lang.getString("Slow") : (this->speed == 1)?lang.getString("Normal"):"x"+intToStr(this->speed)));
}
}
@ -5801,7 +5801,7 @@ void Game::setPaused(bool value,bool forceAllowPauseStateChange,bool clearCaches
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("JoinPlayerToCurrentGameLaunch",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("JoinPlayerToCurrentGameLaunch",languageList[i]).c_str(), slot->getName().c_str());
snprintf(szMsg,8096,lang.getString("JoinPlayerToCurrentGameLaunch",languageList[i]).c_str(), slot->getName().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is about to join the game, please wait...",slot->getName().c_str());
@ -5824,7 +5824,7 @@ void Game::setPaused(bool value,bool forceAllowPauseStateChange,bool clearCaches
Lang &lang= Lang::getInstance();
if(value == false) {
console.addLine(lang.get("GameResumed"));
console.addLine(lang.getString("GameResumed"));
paused= false;
pausedForJoinGame = false;
pausedBeforeJoinGame = false;
@ -5855,7 +5855,7 @@ void Game::setPaused(bool value,bool forceAllowPauseStateChange,bool clearCaches
commander.setPauseNetworkCommands(false);
}
else {
console.addLine(lang.get("GamePaused"));
console.addLine(lang.getString("GamePaused"));
if(joinNetworkGame == true) {
pausedBeforeJoinGame = paused;
@ -5921,10 +5921,10 @@ void Game::showLoseMessageBox() {
NetworkManager &networkManager= NetworkManager::getInstance();
if(networkManager.isNetworkGame() == true && networkManager.getNetworkRole() == nrServer) {
showMessageBox(lang.get("YouLose")+" "+lang.get("ExitGameServer?"), lang.get("BattleOver"), false);
showMessageBox(lang.getString("YouLose")+" "+lang.getString("ExitGameServer?"), lang.getString("BattleOver"), false);
}
else {
showMessageBox(lang.get("YouLose")+" "+lang.get("ExitGameMenu?"), lang.get("BattleOver"), false);
showMessageBox(lang.getString("YouLose")+" "+lang.getString("ExitGameMenu?"), lang.getString("BattleOver"), false);
}
}
@ -5932,10 +5932,10 @@ void Game::showWinMessageBox() {
Lang &lang= Lang::getInstance();
if(this->masterserverMode == true || world.getThisFaction()->getPersonalityType() == fpt_Observer) {
showMessageBox(lang.get("GameOver")+" "+lang.get("ExitGameMenu?"), lang.get("BattleOver"), false);
showMessageBox(lang.getString("GameOver")+" "+lang.getString("ExitGameMenu?"), lang.getString("BattleOver"), false);
}
else {
showMessageBox(lang.get("YouWin")+" "+lang.get("ExitGameMenu?"), lang.get("BattleOver"), false);
showMessageBox(lang.getString("YouWin")+" "+lang.getString("ExitGameMenu?"), lang.getString("BattleOver"), false);
}
}
@ -6113,7 +6113,7 @@ void Game::saveGame(){
string file = this->saveGame(GameConstants::saveGameFilePattern);
char szBuf[8096]="";
Lang &lang= Lang::getInstance();
snprintf(szBuf,8096,lang.get("GameSaved","",true).c_str(),file.c_str());
snprintf(szBuf,8096,lang.getString("GameSaved","",true).c_str(),file.c_str());
console.addLine(szBuf);
Config &config= Config::getInstance();
@ -6389,7 +6389,7 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
string gameVer = versionNode->getAttribute("version")->getValue();
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
throw megaglest_runtime_error(szBuf,true);
}
@ -6450,7 +6450,7 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
string gameVer = versionNode->getAttribute("version")->getValue();
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
throw megaglest_runtime_error(szBuf,true);
}

View File

@ -403,7 +403,7 @@ void ScriptManager::init(World* world, GameCamera *gameCamera, const XmlNode *ro
// luaScript.endCall();
//setup message box
messageBox.init( Lang::getInstance().get("Ok") );
messageBox.init( Lang::getInstance().getString("Ok") );
messageBox.setEnabled(false);
messageBox.setAutoWordWrap(false);

View File

@ -45,35 +45,35 @@ string PlayerStats::getStats() const {
else {
switch(control) {
case ctCpuEasy:
controlString= lang.get("CpuEasy");
controlString= lang.getString("CpuEasy");
break;
case ctCpu:
controlString= lang.get("Cpu");
controlString= lang.getString("Cpu");
break;
case ctCpuUltra:
controlString= lang.get("CpuUltra");
controlString= lang.getString("CpuUltra");
break;
case ctCpuMega:
controlString= lang.get("CpuMega");
controlString= lang.getString("CpuMega");
break;
case ctNetwork:
controlString= lang.get("Network");
controlString= lang.getString("Network");
break;
case ctHuman:
controlString= lang.get("Human");
controlString= lang.getString("Human");
break;
case ctNetworkCpuEasy:
controlString= lang.get("NetworkCpuEasy");
controlString= lang.getString("NetworkCpuEasy");
break;
case ctNetworkCpu:
controlString= lang.get("NetworkCpu");
controlString= lang.getString("NetworkCpu");
break;
case ctNetworkCpuUltra:
controlString= lang.get("NetworkCpuUltra");
controlString= lang.getString("NetworkCpuUltra");
break;
case ctNetworkCpuMega:
controlString= lang.get("NetworkCpuMega");
controlString= lang.getString("NetworkCpuMega");
break;
default:

View File

@ -179,7 +179,7 @@ void CoreData::load() {
}
//const string dir = data_path + "data/core";
Logger::getInstance().add(Lang::getInstance().get("LogScreenCoreDataLoading","",true));
Logger::getInstance().add(Lang::getInstance().getString("LogScreenCoreDataLoading","",true));
Renderer &renderer= Renderer::getInstance();
@ -687,13 +687,13 @@ void CoreData::loadFonts() {
//printf("Checking if langfile has custom FontDisplayPostfix\n");
if(lang.hasString("FontDisplayPrefix") == true) {
displayFontNamePrefix = lang.get("FontDisplayPrefix");
displayFontNamePrefix = lang.getString("FontDisplayPrefix");
}
if(lang.hasString("FontDisplayPostfix") == true) {
displayFontNamePostfix = lang.get("FontDisplayPostfix");
displayFontNamePostfix = lang.getString("FontDisplayPostfix");
}
if(lang.hasString("FontDisplayBaseSize") == true) {
displayFontSize = computeFontSize(strToInt(lang.get("FontDisplayBaseSize")));
displayFontSize = computeFontSize(strToInt(lang.getString("FontDisplayBaseSize")));
}
//printf("displayFontNamePostfix [%s]\n",displayFontNamePostfix.c_str());
@ -732,13 +732,13 @@ void CoreData::loadFonts() {
int displayFontNameSmallSize = computeFontSize(config.getInt("FontDisplaySmallBaseSize"));
if(lang.hasString("FontDisplayPrefix") == true) {
displayFontNameSmallPrefix = lang.get("FontDisplayPrefix");
displayFontNameSmallPrefix = lang.getString("FontDisplayPrefix");
}
if(lang.hasString("FontDisplayPostfix") == true) {
displayFontNameSmallPostfix = lang.get("FontDisplayPostfix");
displayFontNameSmallPostfix = lang.getString("FontDisplayPostfix");
}
if(lang.hasString("FontDisplaySmallBaseSize") == true) {
displayFontNameSmallSize = computeFontSize(strToInt(lang.get("FontDisplaySmallBaseSize")));
displayFontNameSmallSize = computeFontSize(strToInt(lang.getString("FontDisplaySmallBaseSize")));
}
string displayFontNameSmall = displayFontNameSmallPrefix + intToStr(displayFontNameSmallSize) + displayFontNameSmallPostfix;
@ -775,13 +775,13 @@ void CoreData::loadFonts() {
//printf("#1 menuFontNameNormalSize = %d\n",menuFontNameNormalSize);
if(lang.hasString("FontMenuNormalPrefix") == true) {
menuFontNameNormalPrefix = lang.get("FontMenuNormalPrefix");
menuFontNameNormalPrefix = lang.getString("FontMenuNormalPrefix");
}
if(lang.hasString("FontMenuNormalPostfix") == true) {
menuFontNameNormalPostfix = lang.get("FontMenuNormalPostfix");
menuFontNameNormalPostfix = lang.getString("FontMenuNormalPostfix");
}
if(lang.hasString("FontMenuNormalBaseSize") == true) {
menuFontNameNormalSize = computeFontSize(strToInt(lang.get("FontMenuNormalBaseSize")));
menuFontNameNormalSize = computeFontSize(strToInt(lang.getString("FontMenuNormalBaseSize")));
//printf("#2 menuFontNameNormalSize = %d\n",menuFontNameNormalSize);
}
@ -820,13 +820,13 @@ void CoreData::loadFonts() {
int menuFontNameBigSize = computeFontSize(config.getInt("FontMenuBigBaseSize"));
if(lang.hasString("FontMenuBigPrefix") == true) {
menuFontNameBigPrefix = lang.get("FontMenuBigPrefix");
menuFontNameBigPrefix = lang.getString("FontMenuBigPrefix");
}
if(lang.hasString("FontMenuBigPostfix") == true) {
menuFontNameBigPostfix = lang.get("FontMenuBigPostfix");
menuFontNameBigPostfix = lang.getString("FontMenuBigPostfix");
}
if(lang.hasString("FontMenuBigBaseSize") == true) {
menuFontNameBigSize = computeFontSize(strToInt(lang.get("FontMenuBigBaseSize")));
menuFontNameBigSize = computeFontSize(strToInt(lang.getString("FontMenuBigBaseSize")));
}
string menuFontNameBig= menuFontNameBigPrefix+intToStr(menuFontNameBigSize)+menuFontNameBigPostfix;
@ -862,13 +862,13 @@ void CoreData::loadFonts() {
int menuFontNameVeryBigSize = computeFontSize(config.getInt("FontMenuVeryBigBaseSize"));
if(lang.hasString("FontMenuBigPrefix") == true) {
menuFontNameVeryBigPrefix = lang.get("FontMenuBigPrefix");
menuFontNameVeryBigPrefix = lang.getString("FontMenuBigPrefix");
}
if(lang.hasString("FontMenuBigPostfix") == true) {
menuFontNameVeryBigPostfix = lang.get("FontMenuBigPostfix");
menuFontNameVeryBigPostfix = lang.getString("FontMenuBigPostfix");
}
if(lang.hasString("FontMenuVeryBigBaseSize") == true) {
menuFontNameVeryBigSize = computeFontSize(strToInt(lang.get("FontMenuVeryBigBaseSize")));
menuFontNameVeryBigSize = computeFontSize(strToInt(lang.getString("FontMenuVeryBigBaseSize")));
}
string menuFontNameVeryBig= menuFontNameVeryBigPrefix + intToStr(menuFontNameVeryBigSize) + menuFontNameVeryBigPostfix;
@ -907,13 +907,13 @@ void CoreData::loadFonts() {
int consoleFontNameSize = computeFontSize(config.getInt("FontConsoleBaseSize"));
if(lang.hasString("FontConsolePrefix") == true) {
consoleFontNamePrefix = lang.get("FontConsolePrefix");
consoleFontNamePrefix = lang.getString("FontConsolePrefix");
}
if(lang.hasString("FontConsolePostfix") == true) {
consoleFontNamePostfix = lang.get("FontConsolePostfix");
consoleFontNamePostfix = lang.getString("FontConsolePostfix");
}
if(lang.hasString("FontConsoleBaseSize") == true) {
consoleFontNameSize = computeFontSize(strToInt(lang.get("FontConsoleBaseSize")));
consoleFontNameSize = computeFontSize(strToInt(lang.getString("FontConsoleBaseSize")));
}
string consoleFontName= consoleFontNamePrefix + intToStr(consoleFontNameSize) + consoleFontNamePostfix;

View File

@ -56,131 +56,123 @@ string Lang::getDefaultLanguage() const {
return DEFAULT_LANGUAGE;
}
void Lang::loadStrings(string uselanguage, bool loadFonts,
void Lang::loadGameStrings(string uselanguage, bool loadFonts,
bool fallbackToDefault) {
if(uselanguage.length() == 2 || (uselanguage.length() == 5 && uselanguage[2] == '-')) {
uselanguage = getLanguageFile(uselanguage);
}
bool languageChanged = (uselanguage != this->language);
this->language= uselanguage;
loadStrings(uselanguage, strings, true, fallbackToDefault);
loadGameStringProperties(uselanguage, gameStringsMainLanguage, true, fallbackToDefault);
if(languageChanged == true) {
Font::resetToDefaults();
Lang &lang = Lang::getInstance();
if( lang.hasString("FONT_BASE_SIZE")) {
Font::baseSize = strToInt(lang.get("FONT_BASE_SIZE"));
Font::baseSize = strToInt(lang.getString("FONT_BASE_SIZE"));
}
if( lang.hasString("FONT_SCALE_SIZE")) {
Font::scaleFontValue = strToFloat(lang.get("FONT_SCALE_SIZE"));
Font::scaleFontValue = strToFloat(lang.getString("FONT_SCALE_SIZE"));
}
if( lang.hasString("FONT_SCALE_CENTERH_FACTOR")) {
Font::scaleFontValueCenterHFactor = strToFloat(lang.get("FONT_SCALE_CENTERH_FACTOR"));
Font::scaleFontValueCenterHFactor = strToFloat(lang.getString("FONT_SCALE_CENTERH_FACTOR"));
}
if( lang.hasString("FONT_CHARCOUNT")) {
// 256 for English
// 30000 for Chinese
Font::charCount = strToInt(lang.get("FONT_CHARCOUNT"));
Font::charCount = strToInt(lang.getString("FONT_CHARCOUNT"));
}
if( lang.hasString("FONT_TYPENAME")) {
Font::fontTypeName = lang.get("FONT_TYPENAME");
Font::fontTypeName = lang.getString("FONT_TYPENAME");
}
if( lang.hasString("FONT_CHARSET")) {
// Example values:
// DEFAULT_CHARSET (English) = 1
// GB2312_CHARSET (Chinese) = 134
Shared::Platform::charSet = strToInt(lang.get("FONT_CHARSET"));
Shared::Platform::charSet = strToInt(lang.getString("FONT_CHARSET"));
}
if( lang.hasString("FONT_MULTIBYTE")) {
Font::fontIsMultibyte = strToBool(lang.get("FONT_MULTIBYTE"));
Font::fontIsMultibyte = strToBool(lang.getString("FONT_MULTIBYTE"));
}
if( lang.hasString("FONT_RIGHTTOLEFT")) {
Font::fontIsRightToLeft = strToBool(lang.get("FONT_RIGHTTOLEFT"));
Font::fontIsRightToLeft = strToBool(lang.getString("FONT_RIGHTTOLEFT"));
}
if( lang.hasString("MEGAGLEST_FONT")) {
//setenv("MEGAGLEST_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
#if defined(WIN32)
string newEnvValue = "MEGAGLEST_FONT=" + lang.get("MEGAGLEST_FONT");
string newEnvValue = "MEGAGLEST_FONT=" + lang.getString("MEGAGLEST_FONT");
_putenv(newEnvValue.c_str());
#else
setenv("MEGAGLEST_FONT",lang.get("MEGAGLEST_FONT").c_str(),0);
setenv("MEGAGLEST_FONT",lang.getString("MEGAGLEST_FONT").c_str(),0);
#endif
}
if( lang.hasString("MEGAGLEST_FONT_FAMILY")) {
#if defined(WIN32)
string newEnvValue = "MEGAGLEST_FONT_FAMILY=" + lang.get("MEGAGLEST_FONT_FAMILY");
string newEnvValue = "MEGAGLEST_FONT_FAMILY=" + lang.getString("MEGAGLEST_FONT_FAMILY");
_putenv(newEnvValue.c_str());
#else
setenv("MEGAGLEST_FONT_FAMILY",lang.get("MEGAGLEST_FONT_FAMILY").c_str(),0);
setenv("MEGAGLEST_FONT_FAMILY",lang.getString("MEGAGLEST_FONT_FAMILY").c_str(),0);
#endif
}
// if( lang.hasString("FONT_YOFFSET_FACTOR")) {
// FontMetrics::DEFAULT_Y_OFFSET_FACTOR = strToFloat(lang.get("FONT_YOFFSET_FACTOR"));
// }
#if defined(WIN32)
// Win32 overrides for fonts (just in case they must be different)
if( lang.hasString("FONT_BASE_SIZE_WINDOWS")) {
// 256 for English
// 30000 for Chinese
Font::baseSize = strToInt(lang.get("FONT_BASE_SIZE_WINDOWS"));
Font::baseSize = strToInt(lang.getString("FONT_BASE_SIZE_WINDOWS"));
}
if( lang.hasString("FONT_SCALE_SIZE_WINDOWS")) {
Font::scaleFontValue = strToFloat(lang.get("FONT_SCALE_SIZE_WINDOWS"));
Font::scaleFontValue = strToFloat(lang.getString("FONT_SCALE_SIZE_WINDOWS"));
}
if( lang.hasString("FONT_SCALE_CENTERH_FACTOR_WINDOWS")) {
Font::scaleFontValueCenterHFactor = strToFloat(lang.get("FONT_SCALE_CENTERH_FACTOR_WINDOWS"));
Font::scaleFontValueCenterHFactor = strToFloat(lang.getString("FONT_SCALE_CENTERH_FACTOR_WINDOWS"));
}
if( lang.hasString("FONT_HEIGHT_TEXT_WINDOWS")) {
Font::langHeightText = lang.get("FONT_HEIGHT_TEXT_WINDOWS",Font::langHeightText.c_str());
Font::langHeightText = lang.getString("FONT_HEIGHT_TEXT_WINDOWS",Font::langHeightText.c_str());
}
if( lang.hasString("FONT_CHARCOUNT_WINDOWS")) {
// 256 for English
// 30000 for Chinese
Font::charCount = strToInt(lang.get("FONT_CHARCOUNT_WINDOWS"));
Font::charCount = strToInt(lang.getString("FONT_CHARCOUNT_WINDOWS"));
}
if( lang.hasString("FONT_TYPENAME_WINDOWS")) {
Font::fontTypeName = lang.get("FONT_TYPENAME_WINDOWS");
Font::fontTypeName = lang.getString("FONT_TYPENAME_WINDOWS");
}
if( lang.hasString("FONT_CHARSET_WINDOWS")) {
// Example values:
// DEFAULT_CHARSET (English) = 1
// GB2312_CHARSET (Chinese) = 134
Shared::Platform::charSet = strToInt(lang.get("FONT_CHARSET_WINDOWS"));
Shared::Platform::charSet = strToInt(lang.getString("FONT_CHARSET_WINDOWS"));
}
if( lang.hasString("FONT_MULTIBYTE_WINDOWS")) {
Font::fontIsMultibyte = strToBool(lang.get("FONT_MULTIBYTE_WINDOWS"));
Font::fontIsMultibyte = strToBool(lang.getString("FONT_MULTIBYTE_WINDOWS"));
}
if( lang.hasString("FONT_RIGHTTOLEFT_WINDOWS")) {
Font::fontIsRightToLeft = strToBool(lang.get("FONT_RIGHTTOLEFT_WINDOWS"));
Font::fontIsRightToLeft = strToBool(lang.getString("FONT_RIGHTTOLEFT_WINDOWS"));
}
if( lang.hasString("MEGAGLEST_FONT_WINDOWS")) {
//setenv("MEGAGLEST_FONT","/usr/share/fonts/truetype/ttf-japanese-gothic.ttf",0); // Japanese
string newEnvValue = "MEGAGLEST_FONT=" + lang.get("MEGAGLEST_FONT_WINDOWS");
string newEnvValue = "MEGAGLEST_FONT=" + lang.getString("MEGAGLEST_FONT_WINDOWS");
_putenv(newEnvValue.c_str());
}
// if( lang.hasString("FONT_YOFFSET_FACTOR_WINDOWS")) {
// FontMetrics::DEFAULT_Y_OFFSET_FACTOR = strToFloat(lang.get("FONT_YOFFSET_FACTOR_WINDOWS"));
// }
// end win32
#endif
if( lang.hasString("ALLOWED_SPECIAL_KEYS","",false)) {
string allowedKeys = lang.get("ALLOWED_SPECIAL_KEYS");
string allowedKeys = lang.getString("ALLOWED_SPECIAL_KEYS");
Window::addAllowedKeys(allowedKeys);
}
else {
@ -194,7 +186,7 @@ void Lang::loadStrings(string uselanguage, bool loadFonts,
}
}
void Lang::loadStrings(string uselanguage, Properties &properties, bool fileMustExist,
void Lang::loadGameStringProperties(string uselanguage, Properties &properties, bool fileMustExist,
bool fallbackToDefault) {
properties.clear();
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
@ -396,23 +388,23 @@ bool Lang::hasString(const string &s, string uselanguage, bool fallbackToDefault
try {
if(uselanguage != "") {
//printf("#a fallbackToDefault = %d [%s] uselanguage [%s] DEFAULT_LANGUAGE [%s] this->language [%s]\n",fallbackToDefault,s.c_str(),uselanguage.c_str(),DEFAULT_LANGUAGE,this->language.c_str());
if(otherLanguageStrings.find(uselanguage) == otherLanguageStrings.end()) {
loadStrings(uselanguage, otherLanguageStrings[uselanguage], false);
if(gameStringsOtherLanguages.find(uselanguage) == gameStringsOtherLanguages.end()) {
loadGameStringProperties(uselanguage, gameStringsOtherLanguages[uselanguage], false);
}
//string result2 = otherLanguageStrings[uselanguage].getString(s);
otherLanguageStrings[uselanguage].getString(s);
gameStringsOtherLanguages[uselanguage].getString(s);
//printf("#b result2 [%s]\n",result2.c_str());
result = true;
}
else {
//string result2 = strings.getString(s);
strings.getString(s);
gameStringsMainLanguage.getString(s);
result = true;
}
}
catch(exception &ex) {
if(strings.getpath() != "") {
if(gameStringsMainLanguage.getpath() != "") {
if(SystemFlags::VERBOSE_MODE_ENABLED) SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s] for uselanguage [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what(),uselanguage.c_str());
}
@ -435,29 +427,29 @@ string Lang::parseResult(const string &key, const string &value) {
if(value != "$USE_DEFAULT_LANGUAGE_VALUE") {
return value;
}
string result = Lang::get(key, DEFAULT_LANGUAGE);
string result = Lang::getString(key, DEFAULT_LANGUAGE);
return result;
}
string Lang::get(const string &s, string uselanguage, bool fallbackToDefault) {
string Lang::getString(const string &s, string uselanguage, bool fallbackToDefault) {
try {
string result = "";
if(uselanguage != "") {
if(otherLanguageStrings.find(uselanguage) == otherLanguageStrings.end()) {
loadStrings(uselanguage, otherLanguageStrings[uselanguage], false);
if(gameStringsOtherLanguages.find(uselanguage) == gameStringsOtherLanguages.end()) {
loadGameStringProperties(uselanguage, gameStringsOtherLanguages[uselanguage], false);
}
result = otherLanguageStrings[uselanguage].getString(s);
result = gameStringsOtherLanguages[uselanguage].getString(s);
replaceAll(result, "\\n", "\n");
}
else {
result = strings.getString(s);
result = gameStringsMainLanguage.getString(s);
replaceAll(result, "\\n", "\n");
}
return parseResult(s, result);;
}
catch(exception &ex) {
if(strings.getpath() != "") {
if(gameStringsMainLanguage.getpath() != "") {
if(fallbackToDefault == false || SystemFlags::VERBOSE_MODE_ENABLED) {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
if(SystemFlags::VERBOSE_MODE_ENABLED) SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s] uselanguage [%s] text [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what(),uselanguage.c_str(),s.c_str());
@ -469,7 +461,7 @@ string Lang::get(const string &s, string uselanguage, bool fallbackToDefault) {
//if(fallbackToDefault == true && uselanguage != DEFAULT_LANGUAGE && this->language != DEFAULT_LANGUAGE) {
if( uselanguage != DEFAULT_LANGUAGE && this->language != DEFAULT_LANGUAGE) {
return get(s, DEFAULT_LANGUAGE, false);
return getString(s, DEFAULT_LANGUAGE, false);
}
return "???" + s + "???";

View File

@ -35,21 +35,23 @@ private:
string language;
bool is_utf8_language;
Properties strings;
Properties gameStringsMainLanguage;
std::map<string,Properties> gameStringsOtherLanguages;
Properties scenarioStrings;
Properties techTreeStrings;
Properties techTreeStringsDefault;
Properties tilesetStrings;
Properties tilesetStringsDefault;
std::map<string,Properties> otherLanguageStrings;
string techNameLoaded;
bool allowNativeLanguageTechtree;
private:
Lang();
void loadStrings(string language, Properties &properties, bool fileMustExist,bool fallbackToDefault=false);
void loadGameStringProperties(string language, Properties &properties, bool fileMustExist,bool fallbackToDefault=false);
bool fileMatchesISO630Code(string uselanguage, string testLanguageFile);
string getNativeLanguageName(string uselanguage, string testLanguageFile);
@ -61,15 +63,17 @@ public:
bool getAllowNativeLanguageTechtree() const { return allowNativeLanguageTechtree; }
void setAllowNativeLanguageTechtree(bool value) { allowNativeLanguageTechtree = value; }
void loadStrings(string uselanguage, bool loadFonts=true, bool fallbackToDefault=false);
void loadGameStrings(string uselanguage, bool loadFonts=true, bool fallbackToDefault=false);
void loadScenarioStrings(string scenarioDir, string scenarioName, bool isTutorial);
void loadTechTreeStrings(string techTree, bool forceLoad=false);
void loadTilesetStrings(string tileset);
string get(const string &s,string uselanguage="", bool fallbackToDefault=false);
string getString(const string &s,string uselanguage="", bool fallbackToDefault=false);
bool hasString(const string &s, string uselanguage="", bool fallbackToDefault=false);
string getScenarioString(const string &s);
bool hasScenarioString(const string &s);
string getTechTreeString(const string &s, const char *defaultValue=NULL);
string getTilesetString(const string &s, const char *defaultValue=NULL);

View File

@ -1903,7 +1903,7 @@ void Renderer::renderConsoleLine3D(int lineIndex, int xPosition, int yPosition,
playerName = lineInfo->originalPlayerName;
}
if(playerName == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME) {
playerName = lang.get("SystemUser");
playerName = lang.getString("SystemUser");
}
//printf("playerName [%s], line [%s]\n",playerName.c_str(),line.c_str());
@ -1911,7 +1911,7 @@ void Renderer::renderConsoleLine3D(int lineIndex, int xPosition, int yPosition,
//string headerLine = playerName + ": ";
string headerLine = playerName;
if(lineInfo->teamMode == true) {
headerLine += " (" + lang.get("Team") + ")";
headerLine += " (" + lang.getString("Team") + ")";
}
headerLine += ": ";
@ -1938,7 +1938,7 @@ void Renderer::renderConsoleLine3D(int lineIndex, int xPosition, int yPosition,
//string headerLine = playerName + ": ";
string headerLine = playerName;
if(lineInfo->teamMode == true) {
headerLine += " (" + lang.get("Team") + ")";
headerLine += " (" + lang.getString("Team") + ")";
}
headerLine += ": ";
@ -2015,7 +2015,7 @@ void Renderer::renderConsoleLine(int lineIndex, int xPosition, int yPosition, in
//string headerLine = playerName + ": ";
string headerLine = playerName;
if(lineInfo->teamMode == true) {
headerLine += " (" + lang.get("Team") + ")";
headerLine += " (" + lang.getString("Team") + ")";
}
headerLine += ": ";
@ -2040,7 +2040,7 @@ void Renderer::renderConsoleLine(int lineIndex, int xPosition, int yPosition, in
//string headerLine = playerName + ": ";
string headerLine = playerName;
if(lineInfo->teamMode == true) {
headerLine += " (" + lang.get("Team") + ")";
headerLine += " (" + lang.getString("Team") + ")";
}
headerLine += ": ";
@ -2163,16 +2163,16 @@ void Renderer::renderChatManager(const ChatManager *chatManager) {
string text="";
if(chatManager->isInCustomInputMode() == true) {
text += lang.get("CellHint");
text += lang.getString("CellHint");
}
else if(chatManager->getInMenu()) {
text += lang.get("Chat");
text += lang.getString("Chat");
}
else if(chatManager->getTeamMode()) {
text += lang.get("Team");
text += lang.getString("Team");
}
else {
text += lang.get("All");
text += lang.getString("All");
}
text += ": " + chatManager->getText() + "_";
@ -2202,7 +2202,7 @@ void Renderer::renderChatManager(const ChatManager *chatManager) {
else
{
if (chatManager->getInMenu()) {
string text = ">> "+lang.get("PressEnterToChat")+" <<";
string text = ">> "+lang.getString("PressEnterToChat")+" <<";
fontColor = Vec4f(0.5f, 0.5f, 0.5f, 0.5f);
if(renderText3DEnabled == true) {
@ -2238,7 +2238,7 @@ void Renderer::renderClock() {
Lang &lang= Lang::getInstance();
char szBuf[200]="";
snprintf(szBuf,200,"%s %.2d:%.2d",lang.get("GameTime","",true).c_str(),hours,minutes);
snprintf(szBuf,200,"%s %.2d:%.2d",lang.getString("GameTime","",true).c_str(),hours,minutes);
if(str != "") {
str += " ";
}
@ -2253,7 +2253,7 @@ void Renderer::renderClock() {
Lang &lang= Lang::getInstance();
char szBuf[200]="";
snprintf(szBuf,200,"%s %s",lang.get("LocalTime","",true).c_str(),szBuf2);
snprintf(szBuf,200,"%s %s",lang.getString("LocalTime","",true).c_str(),szBuf2);
if(str != "") {
str += " ";
}
@ -7107,22 +7107,22 @@ string Renderer::getGlInfo(){
Lang &lang= Lang::getInstance();
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
infoStr+= lang.get("OpenGlInfo")+":\n";
infoStr+= " "+lang.get("OpenGlVersion")+": ";
infoStr+= lang.getString("OpenGlInfo")+":\n";
infoStr+= " "+lang.getString("OpenGlVersion")+": ";
infoStr+= string((getGlVersion() != NULL ? getGlVersion() : "?"))+"\n";
infoStr+= " "+lang.get("OpenGlRenderer")+": ";
infoStr+= " "+lang.getString("OpenGlRenderer")+": ";
infoStr+= string((getGlVersion() != NULL ? getGlVersion() : "?"))+"\n";
infoStr+= " "+lang.get("OpenGlVendor")+": ";
infoStr+= " "+lang.getString("OpenGlVendor")+": ";
infoStr+= string((getGlVendor() != NULL ? getGlVendor() : "?"))+"\n";
infoStr+= " "+lang.get("OpenGlMaxLights")+": ";
infoStr+= " "+lang.getString("OpenGlMaxLights")+": ";
infoStr+= intToStr(getGlMaxLights())+"\n";
infoStr+= " "+lang.get("OpenGlMaxTextureSize")+": ";
infoStr+= " "+lang.getString("OpenGlMaxTextureSize")+": ";
infoStr+= intToStr(getGlMaxTextureSize())+"\n";
infoStr+= " "+lang.get("OpenGlMaxTextureUnits")+": ";
infoStr+= " "+lang.getString("OpenGlMaxTextureUnits")+": ";
infoStr+= intToStr(getGlMaxTextureUnits())+"\n";
infoStr+= " "+lang.get("OpenGlModelviewStack")+": ";
infoStr+= " "+lang.getString("OpenGlModelviewStack")+": ";
infoStr+= intToStr(getGlModelviewMatrixStackDepth())+"\n";
infoStr+= " "+lang.get("OpenGlProjectionStack")+": ";
infoStr+= " "+lang.getString("OpenGlProjectionStack")+": ";
infoStr+= intToStr(getGlProjectionMatrixStackDepth())+"\n";
}
return infoStr;
@ -7134,7 +7134,7 @@ string Renderer::getGlMoreInfo(){
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
//gl extensions
infoStr+= lang.get("OpenGlExtensions")+":\n ";
infoStr+= lang.getString("OpenGlExtensions")+":\n ";
string extensions= getGlExtensions();
int charCount= 0;
@ -7149,7 +7149,7 @@ string Renderer::getGlMoreInfo(){
//platform extensions
infoStr+= "\n\n";
infoStr+= lang.get("OpenGlPlatformExtensions")+":\n ";
infoStr+= lang.getString("OpenGlPlatformExtensions")+":\n ";
charCount= 0;
string platformExtensions= getGlPlatformExtensions();
@ -9435,7 +9435,7 @@ void Renderer::renderVideoLoading(int progressPercent) {
setupRenderForVideo();
Lang &lang= Lang::getInstance();
string textToRender = lang.get("PleaseWait");
string textToRender = lang.getString("PleaseWait");
const Metrics &metrics= Metrics::getInstance();
static Chrono cycle(true);

View File

@ -731,10 +731,10 @@ void Gui::computeInfoString(int posDisplay){
if(posDisplay!=invalidPos && selection.isCommandable()){
if(!selectingBuilding){
if(posDisplay==cancelPos){
display.setInfoText(lang.get("Cancel"));
display.setInfoText(lang.getString("Cancel"));
}
else if(posDisplay==meetingPointPos){
display.setInfoText(lang.get("MeetingPoint"));
display.setInfoText(lang.getString("MeetingPoint"));
}
else{
//uniform selection
@ -751,10 +751,10 @@ void Gui::computeInfoString(int posDisplay){
string text="";
const UpgradeCommandType *uct= static_cast<const UpgradeCommandType*>(ct);
if(unit->getFaction()->getUpgradeManager()->isUpgrading(uct->getProducedUpgrade())){
text=lang.get("Upgrading")+"\n\n";
text=lang.getString("Upgrading")+"\n\n";
}
else if(unit->getFaction()->getUpgradeManager()->isUpgraded(uct->getProducedUpgrade())){
text=lang.get("AlreadyUpgraded")+"\n\n";
text=lang.getString("AlreadyUpgraded")+"\n\n";
}
display.setInfoText(text+ct->getReqDesc(game->showTranslatedTechTree()));
}
@ -770,14 +770,14 @@ void Gui::computeInfoString(int posDisplay){
const UnitType *ut= selection.getFrontUnit()->getType();
CommandClass cc= display.getCommandClass(posDisplay);
if(cc!=ccNull){
display.setInfoText(lang.get("CommonCommand") + ": " + ut->getFirstCtOfClass(cc)->toString(true));
display.setInfoText(lang.getString("CommonCommand") + ": " + ut->getFirstCtOfClass(cc)->toString(true));
}
}
}
}
else{
if(posDisplay==cancelPos){
display.setInfoText(lang.get("Return"));
display.setInfoText(lang.getString("Return"));
}
else{
if(activeCommandType!=NULL && activeCommandType->getClass()==ccBuild){
@ -801,7 +801,7 @@ void Gui::computeDisplay(){
if(selection.isEmpty() && selectedResourceObject != NULL && selectedResourceObject->getResource() != NULL) {
Resource *r = selectedResourceObject->getResource();
display.setTitle(r->getType()->getName(game->showTranslatedTechTree()));
display.setText(lang.get("Amount")+ ": "+intToStr(r->getAmount())+" / "+intToStr(r->getType()->getDefResPerPatch()));
display.setText(lang.getString("Amount")+ ": "+intToStr(r->getAmount())+" / "+intToStr(r->getType()->getDefResPerPatch()));
//display.setProgressBar(r->);
display.setUpImage(0, r->getType()->getImage());
}

View File

@ -65,10 +65,10 @@ BattleEnd::BattleEnd(Program *program, const Stats *stats,ProgramState *originSt
int buttonWidth = 125;
int xLocation = (metrics.getVirtualW() / 2) - (buttonWidth / 2);
buttonExit.init(xLocation, 80, buttonWidth);
buttonExit.setText(lang.get("Exit"));
buttonExit.setText(lang.getString("Exit"));
//mesage box
mainMessageBox.init(lang.get("Yes"), lang.get("No"));
mainMessageBox.init(lang.getString("Yes"), lang.getString("No"));
mainMessageBox.setEnabled(false);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
@ -82,8 +82,8 @@ BattleEnd::BattleEnd(Program *program, const Stats *stats,ProgramState *originSt
void BattleEnd::reloadUI() {
Lang &lang= Lang::getInstance();
buttonExit.setText(lang.get("Exit"));
mainMessageBox.init(lang.get("Yes"), lang.get("No"));
buttonExit.setText(lang.getString("Exit"));
mainMessageBox.init(lang.getString("Yes"), lang.getString("No"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -266,11 +266,11 @@ void BattleEnd::initBackgroundMusic() {
if(stats.getTeam(stats.getThisFactionIndex()) != GameConstants::maxPlayers -1 + fpt_Observer) {
if(stats.getVictory(stats.getThisFactionIndex())){
//header += lang.get("Victory");
//header += lang.getString("Victory");
music = getBattleEndMusic(true);
}
else{
//header += lang.get("Defeat");
//header += lang.getString("Defeat");
music = getBattleEndMusic(false);
}
@ -301,7 +301,7 @@ void BattleEnd::initBackgroundVideo() {
if(stats.getTeam(stats.getThisFactionIndex()) != GameConstants::maxPlayers -1 + fpt_Observer) {
if(stats.getVictory(stats.getThisFactionIndex())){
//header += lang.get("Victory");
//header += lang.getString("Victory");
//videoFile = CoreData::getInstance().getBattleEndVideoFilename(true);
//videoFileFallback = CoreData::getInstance().getBattleEndVideoFilenameFallback(true);
@ -310,7 +310,7 @@ void BattleEnd::initBackgroundVideo() {
videoFileFallback = wonVideos.second;
}
else{
//header += lang.get("Defeat");
//header += lang.getString("Defeat");
//videoFile = CoreData::getInstance().getBattleEndVideoFilename(false);
//videoFileFallback = CoreData::getInstance().getBattleEndVideoFilenameFallback(false);
std::pair<string,string> lostVideos = getBattleEndVideo(false);
@ -555,35 +555,35 @@ void BattleEnd::render() {
else {
switch(stats.getControl(i)) {
case ctCpuEasy:
controlString= lang.get("CpuEasy");
controlString= lang.getString("CpuEasy");
break;
case ctCpu:
controlString= lang.get("Cpu");
controlString= lang.getString("Cpu");
break;
case ctCpuUltra:
controlString= lang.get("CpuUltra");
controlString= lang.getString("CpuUltra");
break;
case ctCpuMega:
controlString= lang.get("CpuMega");
controlString= lang.getString("CpuMega");
break;
case ctNetwork:
controlString= lang.get("Network");
controlString= lang.getString("Network");
break;
case ctHuman:
controlString= lang.get("Human");
controlString= lang.getString("Human");
break;
case ctNetworkCpuEasy:
controlString= lang.get("NetworkCpuEasy");
controlString= lang.getString("NetworkCpuEasy");
break;
case ctNetworkCpu:
controlString= lang.get("NetworkCpu");
controlString= lang.getString("NetworkCpu");
break;
case ctNetworkCpuUltra:
controlString= lang.get("NetworkCpuUltra");
controlString= lang.getString("NetworkCpuUltra");
break;
case ctNetworkCpuMega:
controlString= lang.get("NetworkCpuMega");
controlString= lang.getString("NetworkCpuMega");
break;
default:
@ -597,7 +597,7 @@ void BattleEnd::render() {
controlString += "\nx " + floatToStr(stats.getResourceMultiplier(i),1);
}
else if(stats.getPlayerLeftBeforeEnd(i)==true){
controlString += "\n" +lang.get("CpuUltra")+"\nx "+floatToStr(stats.getResourceMultiplier(i),1);
controlString += "\n" +lang.getString("CpuUltra")+"\nx "+floatToStr(stats.getResourceMultiplier(i),1);
}
if(score == bestScore && stats.getVictory(i)) {
@ -616,7 +616,7 @@ void BattleEnd::render() {
textRenderer->render(textToRender.c_str(), textX, bm+400, false, &color);
}
else {
textRenderer->render((lang.get("Player") + " " + intToStr(i+1)).c_str(), textX, bm+400,false, &color);
textRenderer->render((lang.getString("Player") + " " + intToStr(i+1)).c_str(), textX, bm+400,false, &color);
}
Vec3f highliteColor = Vec3f(WHITE.x,WHITE.y,WHITE.z);
@ -627,14 +627,14 @@ void BattleEnd::render() {
}
if(stats.getPersonalityType(i) == fpt_Observer) {
textRenderer->render(lang.get("GameOver").c_str(), textX, bm+360);
textRenderer->render(lang.getString("GameOver").c_str(), textX, bm+360);
}
else {
if(stats.getVictory(i)) {
textRenderer->render(stats.getVictory(i)? lang.get("Victory").c_str(): lang.get("Defeat").c_str(), textX, bm+360, false, &highliteColor);
textRenderer->render(stats.getVictory(i)? lang.getString("Victory").c_str(): lang.getString("Defeat").c_str(), textX, bm+360, false, &highliteColor);
}
else {
textRenderer->render(stats.getVictory(i)? lang.get("Victory").c_str(): lang.get("Defeat").c_str(), textX, bm+360);
textRenderer->render(stats.getVictory(i)? lang.getString("Victory").c_str(): lang.getString("Defeat").c_str(), textX, bm+360);
}
}
@ -680,17 +680,17 @@ void BattleEnd::render() {
}
}
textRenderer->render("\n"+(lang.get("LeftAt")), lm, bm+400);
textRenderer->render(lang.get("Result"), lm, bm+360);
textRenderer->render(lang.get("Control"), lm, bm+320);
textRenderer->render(lang.get("Faction"), lm, bm+280);
textRenderer->render(lang.get("Team"), lm, bm+240);
textRenderer->render(lang.get("Kills"), lm, bm+200);
textRenderer->render(lang.get("EnemyKills"), lm, bm+180);
textRenderer->render(lang.get("Deaths"), lm, bm+160);
textRenderer->render(lang.get("UnitsProduced"), lm, bm+120);
textRenderer->render(lang.get("ResourcesHarvested"), lm, bm+80);
textRenderer->render(lang.get("Score"), lm, bm+20);
textRenderer->render("\n"+(lang.getString("LeftAt")), lm, bm+400);
textRenderer->render(lang.getString("Result"), lm, bm+360);
textRenderer->render(lang.getString("Control"), lm, bm+320);
textRenderer->render(lang.getString("Faction"), lm, bm+280);
textRenderer->render(lang.getString("Team"), lm, bm+240);
textRenderer->render(lang.getString("Kills"), lm, bm+200);
textRenderer->render(lang.getString("EnemyKills"), lm, bm+180);
textRenderer->render(lang.getString("Deaths"), lm, bm+160);
textRenderer->render(lang.getString("UnitsProduced"), lm, bm+120);
textRenderer->render(lang.getString("ResourcesHarvested"), lm, bm+80);
textRenderer->render(lang.getString("Score"), lm, bm+20);
textRenderer->end();
@ -705,10 +705,10 @@ void BattleEnd::render() {
if(stats.getTeam(stats.getThisFactionIndex()) != GameConstants::maxPlayers -1 + fpt_Observer) {
if(stats.getVictory(stats.getThisFactionIndex())){
header += lang.get("Victory");
header += lang.getString("Victory");
}
else{
header += lang.get("Defeat");
header += lang.getString("Defeat");
}
}
else {
@ -717,15 +717,15 @@ void BattleEnd::render() {
textRenderer->render(header, lm+250, bm+550);
//GameConstants::updateFps
//string header2 = lang.get("GameDurationTime","",true) + " " + floatToStr(stats.getWorldTimeElapsed() / 24.0,2);
//string header2 = lang.getString("GameDurationTime","",true) + " " + floatToStr(stats.getWorldTimeElapsed() / 24.0,2);
string header2 = lang.get("GameDurationTime","",true) + ": " + getTimeString(stats.getFramesToCalculatePlaytime());
string header2 = lang.getString("GameDurationTime","",true) + ": " + getTimeString(stats.getFramesToCalculatePlaytime());
textRenderer->render(header2, lm+250, bm+530);
header2 = lang.get("GameMaxConcurrentUnitCount") + ": " + intToStr(stats.getMaxConcurrentUnitCount());
header2 = lang.getString("GameMaxConcurrentUnitCount") + ": " + intToStr(stats.getMaxConcurrentUnitCount());
textRenderer->render(header2, lm+250, bm+510);
header2 = lang.get("GameTotalEndGameConcurrentUnitCount") + ": " + intToStr(stats.getTotalEndGameConcurrentUnitCount());
header2 = lang.getString("GameTotalEndGameConcurrentUnitCount") + ": " + intToStr(stats.getTotalEndGameConcurrentUnitCount());
textRenderer->render(header2, lm+250, bm+490);
textRenderer->end();
@ -767,7 +767,7 @@ void BattleEnd::keyDown(SDL_KeyboardEvent key){
}
else {
Lang &lang= Lang::getInstance();
showMessageBox(lang.get("ExitGameMenu?"), "", true);
showMessageBox(lang.getString("ExitGameMenu?"), "", true);
}
}
else if(isKeyPressed(SDLK_RETURN,key) && mainMessageBox.getEnabled()) {

View File

@ -270,14 +270,14 @@ Intro::Intro(Program *program):
string lineText = "";
if(lang.hasString(introTagName,"",true) == true) {
lineText = lang.get(introTagName,"",true);
lineText = lang.getString(introTagName,"",true);
}
string showStartTime = "IntroStartMilliseconds" + intToStr(i);
int displayTime = appear;
if(lang.hasString(showStartTime,"",true) == true) {
displayTime = strToInt(lang.get(showStartTime,"",true));
displayTime = strToInt(lang.getString(showStartTime,"",true));
}
else {
if(i == 1) {
@ -298,7 +298,7 @@ Intro::Intro(Program *program):
string introTagTextureWidthName = "IntroTextureWidth" + intToStr(i);
string introTagTextureHeightName = "IntroTextureHeight" + intToStr(i);
lineText = lang.get(introTagTextureName,"",true);
lineText = lang.getString(introTagTextureName,"",true);
Texture2D *logoTexture= renderer.newTexture2D(rsGlobal);
if(logoTexture) {
logoTexture->setMipmap(false);
@ -313,7 +313,7 @@ Intro::Intro(Program *program):
textureWidth = logoTexture->getTextureWidth();
}
if(lang.hasString(introTagTextureWidthName,"",true) == true) {
textureWidth = strToInt(lang.get(introTagTextureWidthName,"",true));
textureWidth = strToInt(lang.getString(introTagTextureWidthName,"",true));
}
int textureHeight = 128;
@ -321,7 +321,7 @@ Intro::Intro(Program *program):
textureHeight = logoTexture->getTextureHeight();
}
if(lang.hasString(introTagTextureHeightName,"",true) == true) {
textureHeight = strToInt(lang.get(introTagTextureHeightName,"",true));
textureHeight = strToInt(lang.getString(introTagTextureHeightName,"",true));
}
texts.push_back(new Text(logoTexture, Vec2i(w/2-(textureWidth/2), h/2-(textureHeight/2)), Vec2i(textureWidth, textureHeight), displayTime));
@ -334,7 +334,7 @@ Intro::Intro(Program *program):
int textX = -1;
if(lang.hasString(introTagTextXName,"",true) == true) {
string value = lang.get(introTagTextXName,"",true);
string value = lang.getString(introTagTextXName,"",true);
if(value.length() > 0 &&
(value[0] == '+' || value[0] == '-')) {
textX = w/2 + strToInt(value);
@ -346,7 +346,7 @@ Intro::Intro(Program *program):
int textY = -1;
if(lang.hasString(introTagTextYName,"",true) == true) {
string value = lang.get(introTagTextYName,"",true);
string value = lang.getString(introTagTextYName,"",true);
if(value.length() > 0 &&
(value[0] == '+' || value[0] == '-')) {
textY = h/2 + strToInt(value);
@ -360,7 +360,7 @@ Intro::Intro(Program *program):
Font3D *font3d = coreData.getMenuFontVeryBig3D();
if(lang.hasString(introTagTextFontTypeName,"",true) == true) {
string value =lang.get(introTagTextFontTypeName,"",true);
string value =lang.getString(introTagTextFontTypeName,"",true);
if(value == "displaynormal") {
font = coreData.getDisplayFont();
font3d = coreData.getDisplayFont3D();
@ -396,7 +396,7 @@ Intro::Intro(Program *program):
}
modelShowTime = disappear *(displayItemNumber);
if(lang.hasString("IntroModelStartMilliseconds","",true) == true) {
modelShowTime = strToInt(lang.get("IntroModelStartMilliseconds","",true));
modelShowTime = strToInt(lang.getString("IntroModelStartMilliseconds","",true));
}
else {
modelShowTime = disappear *(displayItemNumber);
@ -495,7 +495,7 @@ Intro::Intro(Program *program):
int textureStartTime = disappear * displayItemNumber;
if(lang.hasString("IntroTextureStartMilliseconds","",true) == true) {
textureStartTime = strToInt(lang.get("IntroTextureStartMilliseconds","",true));
textureStartTime = strToInt(lang.getString("IntroTextureStartMilliseconds","",true));
}
texts.push_back(new Text(tex, texPlacement, Vec2i(tex->getTextureWidth(), tex->getTextureHeight()), textureStartTime +(showMiscTime*(i+1))));

View File

@ -1053,12 +1053,12 @@ void MainWindow::showLanguages() {
menuItems.push_back(testLanguage);
}
}
menuItems.push_back(lang.get("Exit"));
menuItems.push_back(lang.getString("Exit"));
cancelLanguageSelection = menuItems.size()-1;
popupMenu.setW(100);
popupMenu.setH(100);
popupMenu.init(lang.get("GameMenuTitle"),menuItems);
popupMenu.init(lang.getString("GameMenuTitle"),menuItems);
popupMenu.setEnabled(true);
popupMenu.setVisible(true);
}
@ -1108,9 +1108,9 @@ void MainWindow::toggleLanguage(string language) {
}
}
if(newLanguageSelected != currentLanguage) {
lang.loadStrings(newLanguageSelected);
lang.loadGameStrings(newLanguageSelected);
program->reloadUI();
program->consoleAddLine(lang.get("Language") + " " + newLanguageSelected);
program->consoleAddLine(lang.getString("Language") + " " + newLanguageSelected);
}
}
@ -1237,8 +1237,8 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
if(f == NULL) {
Lang &lang= Lang::getInstance();
char szBuf[8096]="";
if(lang.get("ScreenshotSavedTo").length() > 0 && lang.get("ScreenshotSavedTo")[0] != '?') {
snprintf(szBuf,8096,lang.get("ScreenshotSavedTo").c_str(),path.c_str());
if(lang.getString("ScreenshotSavedTo").length() > 0 && lang.getString("ScreenshotSavedTo")[0] != '?') {
snprintf(szBuf,8096,lang.getString("ScreenshotSavedTo").c_str(),path.c_str());
}
else {
snprintf(szBuf,8096,"Screenshot will be saved to: %s",path.c_str());
@ -4287,7 +4287,7 @@ int glestMain(int argc, char** argv) {
}
Renderer &renderer= Renderer::getInstance();
lang.loadStrings(language,false, true);
lang.loadGameStrings(language,false, true);
if( lang.hasString("FONT_HEIGHT_TEXT")) {
Shared::Graphics::Font::langHeightText = config.getString("FONT_HEIGHT_TEXT",Shared::Graphics::Font::langHeightText.c_str());

View File

@ -188,7 +188,7 @@ Program::Program() {
//mesage box
Lang &lang= Lang::getInstance();
msgBox.init(lang.get("Ok"));
msgBox.init(lang.getString("Ok"));
msgBox.setEnabled(false);
}
@ -611,7 +611,7 @@ void Program::setState(ProgramState *programStateNew, bool cleanupOldState) {
//mesage box
Lang &lang= Lang::getInstance();
msgBox.init(lang.get("Ok"));
msgBox.init(lang.getString("Ok"));
msgBox.setEnabled(msgBoxEnabled);
fpsTimer.init(1, maxTimes);

View File

@ -51,7 +51,7 @@ MenuStateAbout::MenuStateAbout(Program *program, MainMenu *mainMenu) :
//init
buttonReturn.registerGraphicComponent(containerName, "buttonReturn");
buttonReturn.init(460, 100, 125);
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
labelAdditionalCredits.registerGraphicComponent(containerName, "labelAdditionalCredits");
labelAdditionalCredits.init(500, 700);
@ -146,7 +146,7 @@ void MenuStateAbout::reloadUI() {
adjustModelText = true;
string additionalCredits= loadAdditionalCredits();
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
labelAdditionalCredits.setText(additionalCredits);
//if(additionalCredits == "") {

View File

@ -42,7 +42,7 @@ namespace Glest{ namespace Game{
static const double REPROMPT_DOWNLOAD_SECONDS = 7;
//static const string ITEM_MISSING = "***missing***";
// above replaced with Lang::getInstance().get("DataMissing","",true)
// above replaced with Lang::getInstance().getString("DataMissing","",true)
const int HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS = 4;
static const char *HEADLESS_SAVED_GAME_FILENAME = "lastHeadlessGameSettings.mgg";
@ -124,12 +124,12 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
Lang &lang= Lang::getInstance();
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
ftpMessageBox.registerGraphicComponent(containerName,"ftpMessageBox");
ftpMessageBox.init(lang.get("ModCenter"),lang.get("GameHost"));
ftpMessageBox.addButton(lang.get("NoDownload"));
ftpMessageBox.init(lang.getString("ModCenter"),lang.getString("GameHost"));
ftpMessageBox.addButton(lang.getString("NoDownload"));
ftpMessageBox.setEnabled(false);
NetworkManager &networkManager= NetworkManager::getInstance();
@ -178,20 +178,20 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
int xoffset=70;
labelFogOfWar.registerGraphicComponent(containerName,"labelFogOfWar");
labelFogOfWar.init(xoffset+100, aHeadPos, 130);
labelFogOfWar.setText(lang.get("FogOfWar"));
labelFogOfWar.setText(lang.getString("FogOfWar"));
listBoxFogOfWar.registerGraphicComponent(containerName,"listBoxFogOfWar");
listBoxFogOfWar.init(xoffset+100, aPos, 130);
listBoxFogOfWar.pushBackItem(lang.get("Enabled"));
listBoxFogOfWar.pushBackItem(lang.get("Explored"));
listBoxFogOfWar.pushBackItem(lang.get("Disabled"));
listBoxFogOfWar.pushBackItem(lang.getString("Enabled"));
listBoxFogOfWar.pushBackItem(lang.getString("Explored"));
listBoxFogOfWar.pushBackItem(lang.getString("Disabled"));
listBoxFogOfWar.setSelectedItemIndex(0);
listBoxFogOfWar.setEditable(false);
labelAllowObservers.registerGraphicComponent(containerName,"labelAllowObservers");
labelAllowObservers.init(xoffset+310, aHeadPos, 80);
labelAllowObservers.setText(lang.get("AllowObservers"));
labelAllowObservers.setText(lang.getString("AllowObservers"));
checkBoxAllowObservers.registerGraphicComponent(containerName,"checkBoxAllowObservers");
checkBoxAllowObservers.init(xoffset+310, aPos);
@ -204,7 +204,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelFallbackCpuMultiplier.registerGraphicComponent(containerName,"labelFallbackCpuMultiplier");
labelFallbackCpuMultiplier.init(xoffset+460, aHeadPos, 80);
labelFallbackCpuMultiplier.setText(lang.get("FallbackCpuMultiplier"));
labelFallbackCpuMultiplier.setText(lang.getString("FallbackCpuMultiplier"));
listBoxFallbackCpuMultiplier.registerGraphicComponent(containerName,"listBoxFallbackCpuMultiplier");
listBoxFallbackCpuMultiplier.init(xoffset+460, aPos, 80);
@ -215,7 +215,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
// Allow Switch Team Mode
labelEnableSwitchTeamMode.registerGraphicComponent(containerName,"labelEnableSwitchTeamMode");
labelEnableSwitchTeamMode.init(xoffset+310, aHeadPos+45, 80);
labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode"));
labelEnableSwitchTeamMode.setText(lang.getString("EnableSwitchTeamMode"));
checkBoxEnableSwitchTeamMode.registerGraphicComponent(containerName,"checkBoxEnableSwitchTeamMode");
checkBoxEnableSwitchTeamMode.init(xoffset+310, aPos+45);
@ -224,7 +224,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelAISwitchTeamAcceptPercent.registerGraphicComponent(containerName,"labelAISwitchTeamAcceptPercent");
labelAISwitchTeamAcceptPercent.init(xoffset+460, aHeadPos+45, 80);
labelAISwitchTeamAcceptPercent.setText(lang.get("AISwitchTeamAcceptPercent"));
labelAISwitchTeamAcceptPercent.setText(lang.getString("AISwitchTeamAcceptPercent"));
listBoxAISwitchTeamAcceptPercent.registerGraphicComponent(containerName,"listBoxAISwitchTeamAcceptPercent");
listBoxAISwitchTeamAcceptPercent.init(xoffset+460, aPos+45, 80);
@ -237,16 +237,16 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
//create
buttonCancelDownloads.registerGraphicComponent(containerName,"buttonCancelDownloads");
buttonCancelDownloads.init(xoffset+620, 180, 150);
buttonCancelDownloads.setText(lang.get("CancelDownloads"));
buttonCancelDownloads.setText(lang.getString("CancelDownloads"));
listBoxPlayerStatus.registerGraphicComponent(containerName,"listBoxPlayerStatus");
nonAdminPlayerStatusX = xoffset+460;
listBoxPlayerStatus.init(nonAdminPlayerStatusX, 180, 150);
listBoxPlayerStatus.setTextColor(Vec3f(1.0f,0.f,0.f));
listBoxPlayerStatus.setLighted(true);
playerStatuses.push_back(lang.get("PlayerStatusSetup"));
playerStatuses.push_back(lang.get("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.get("PlayerStatusReady"));
playerStatuses.push_back(lang.getString("PlayerStatusSetup"));
playerStatuses.push_back(lang.getString("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerStatuses);
// Network Frame Period
@ -264,7 +264,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelMap.registerGraphicComponent(containerName,"labelMap");
labelMap.init(xoffset+100, mapHeadPos);
labelMap.setText(lang.get("Map"));
labelMap.setText(lang.getString("Map"));
//tileset listBox
listBoxTileset.registerGraphicComponent(containerName,"listBoxTileset");
@ -273,7 +273,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelTileset.registerGraphicComponent(containerName,"labelTileset");
labelTileset.init(xoffset+460, mapHeadPos);
labelTileset.setText(lang.get("Tileset"));
labelTileset.setText(lang.getString("Tileset"));
//tech Tree listBox
@ -284,11 +284,11 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelTechTree.registerGraphicComponent(containerName,"labelTechTree");
labelTechTree.init(xoffset+620, mapHeadPos);
labelTechTree.setText(lang.get("TechTree"));
labelTechTree.setText(lang.getString("TechTree"));
labelAllowNativeLanguageTechtree.registerGraphicComponent(containerName,"labelAllowNativeLanguageTechtree");
labelAllowNativeLanguageTechtree.init(xoffset+620, mapHeadPos-45);
labelAllowNativeLanguageTechtree.setText(lang.get("AllowNativeLanguageTechtree"));
labelAllowNativeLanguageTechtree.setText(lang.getString("AllowNativeLanguageTechtree"));
checkBoxAllowNativeLanguageTechtree.registerGraphicComponent(containerName,"checkBoxAllowNativeLanguageTechtree");
checkBoxAllowNativeLanguageTechtree.init(xoffset+620, mapHeadPos-65);
@ -341,18 +341,18 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelControl.registerGraphicComponent(containerName,"labelControl");
labelControl.init(xoffset+170, setupPos, GraphicListBox::defW, GraphicListBox::defH, true);
labelControl.setText(lang.get("Control"));
labelControl.setText(lang.getString("Control"));
labelRMultiplier.registerGraphicComponent(containerName,"labelRMultiplier");
labelRMultiplier.init(xoffset+310, setupPos, GraphicListBox::defW, GraphicListBox::defH, true);
labelFaction.registerGraphicComponent(containerName,"labelFaction");
labelFaction.init(xoffset+390, setupPos, GraphicListBox::defW, GraphicListBox::defH, true);
labelFaction.setText(lang.get("Faction"));
labelFaction.setText(lang.getString("Faction"));
labelTeam.registerGraphicComponent(containerName,"labelTeam");
labelTeam.init(xoffset+650, setupPos, 60, GraphicListBox::defH, true);
labelTeam.setText(lang.get("Team"));
labelTeam.setText(lang.getString("Team"));
labelControl.setFont(CoreData::getInstance().getMenuFontBig());
labelControl.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -362,23 +362,23 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelTeam.setFont3D(CoreData::getInstance().getMenuFontBig3D());
//texts
buttonDisconnect.setText(lang.get("Return"));
buttonDisconnect.setText(lang.getString("Return"));
controlItems.push_back(lang.get("Closed"));
controlItems.push_back(lang.get("CpuEasy"));
controlItems.push_back(lang.get("Cpu"));
controlItems.push_back(lang.get("CpuUltra"));
controlItems.push_back(lang.get("CpuMega"));
controlItems.push_back(lang.get("Network"));
controlItems.push_back(lang.get("NetworkUnassigned"));
controlItems.push_back(lang.get("Human"));
controlItems.push_back(lang.getString("Closed"));
controlItems.push_back(lang.getString("CpuEasy"));
controlItems.push_back(lang.getString("Cpu"));
controlItems.push_back(lang.getString("CpuUltra"));
controlItems.push_back(lang.getString("CpuMega"));
controlItems.push_back(lang.getString("Network"));
controlItems.push_back(lang.getString("NetworkUnassigned"));
controlItems.push_back(lang.getString("Human"));
if(config.getBool("EnableNetworkCpu","false") == true) {
controlItems.push_back(lang.get("NetworkCpuEasy"));
controlItems.push_back(lang.get("NetworkCpu"));
controlItems.push_back(lang.get("NetworkCpuUltra"));
controlItems.push_back(lang.get("NetworkCpuMega"));
controlItems.push_back(lang.getString("NetworkCpuEasy"));
controlItems.push_back(lang.getString("NetworkCpu"));
controlItems.push_back(lang.getString("NetworkCpuUltra"));
controlItems.push_back(lang.getString("NetworkCpuMega"));
}
for(int i = 1; i <= GameConstants::maxPlayers; ++i) {
@ -421,7 +421,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
buttonPlayNow.registerGraphicComponent(containerName,"buttonPlayNow");
buttonPlayNow.init(220, 180, 125);
buttonPlayNow.setText(lang.get("PlayNow"));
buttonPlayNow.setText(lang.getString("PlayNow"));
buttonPlayNow.setVisible(false);
buttonDisconnect.registerGraphicComponent(containerName,"buttonDisconnect");
@ -429,12 +429,12 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
buttonRestoreLastSettings.registerGraphicComponent(containerName,"buttonRestoreLastSettings");
buttonRestoreLastSettings.init(480, 180, 220);
buttonRestoreLastSettings.setText(lang.get("ReloadLastGameSettings"));
buttonRestoreLastSettings.setText(lang.getString("ReloadLastGameSettings"));
// write hint to console:
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
console.addLine(lang.get("ToSwitchOffMusicPress") + " - \"" + configKeys.getString("ToggleMusic") + "\"");
console.addLine(lang.getString("ToSwitchOffMusicPress") + " - \"" + configKeys.getString("ToggleMusic") + "\"");
chatManager.init(&console, -1,true);
GraphicComponent::applyAllCustomProperties(containerName);
@ -449,7 +449,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
int scenarioY=140;
labelScenario.registerGraphicComponent(containerName,"labelScenario");
labelScenario.init(scenarioX, scenarioY);
labelScenario.setText(lang.get("Scenario"));
labelScenario.setText(lang.getString("Scenario"));
listBoxScenario.registerGraphicComponent(containerName,"listBoxScenario");
listBoxScenario.init(scenarioX, scenarioY-30,190);
checkBoxScenario.registerGraphicComponent(containerName,"checkBoxScenario");
@ -579,7 +579,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("JoinPlayerToCurrentGameWelcome",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("JoinPlayerToCurrentGameWelcome",languageList[i]).c_str(),getHumanPlayerName().c_str());
snprintf(szMsg,8096,lang.getString("JoinPlayerToCurrentGameWelcome",languageList[i]).c_str(),getHumanPlayerName().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s has connected to the game and would like to join.",getHumanPlayerName().c_str());
@ -600,9 +600,9 @@ void MenuStateConnectedGame::reloadUI() {
Lang &lang= Lang::getInstance();
console.resetFonts();
mainMessageBox.init(lang.get("Ok"));
ftpMessageBox.init(lang.get("ModCenter"),lang.get("GameHost"));
ftpMessageBox.addButton(lang.get("NoDownload"));
mainMessageBox.init(lang.getString("Ok"));
ftpMessageBox.init(lang.getString("ModCenter"),lang.getString("GameHost"));
ftpMessageBox.addButton(lang.getString("NoDownload"));
labelInfo.setFont(CoreData::getInstance().getMenuFontBig());
labelInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -610,22 +610,22 @@ void MenuStateConnectedGame::reloadUI() {
labelDataSynchInfo.setFont(CoreData::getInstance().getMenuFontBig());
labelDataSynchInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D());
buttonCancelDownloads.setText(lang.get("CancelDownloads"));
buttonCancelDownloads.setText(lang.getString("CancelDownloads"));
labelFogOfWar.setText(lang.get("FogOfWar"));
labelFogOfWar.setText(lang.getString("FogOfWar"));
vector<string> fowItems;
fowItems.push_back(lang.get("Enabled"));
fowItems.push_back(lang.get("Explored"));
fowItems.push_back(lang.get("Disabled"));
fowItems.push_back(lang.getString("Enabled"));
fowItems.push_back(lang.getString("Explored"));
fowItems.push_back(lang.getString("Disabled"));
listBoxFogOfWar.setItems(fowItems);
labelAllowObservers.setText(lang.get("AllowObservers"));
labelFallbackCpuMultiplier.setText(lang.get("FallbackCpuMultiplier"));
labelAllowObservers.setText(lang.getString("AllowObservers"));
labelFallbackCpuMultiplier.setText(lang.getString("FallbackCpuMultiplier"));
labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode"));
labelEnableSwitchTeamMode.setText(lang.getString("EnableSwitchTeamMode"));
labelAISwitchTeamAcceptPercent.setText(lang.get("AISwitchTeamAcceptPercent"));
labelAISwitchTeamAcceptPercent.setText(lang.getString("AISwitchTeamAcceptPercent"));
vector<string> aiswitchteamModeItems;
for(int i = 0; i <= 100; i = i + 10) {
@ -639,25 +639,25 @@ void MenuStateConnectedGame::reloadUI() {
}
listBoxFallbackCpuMultiplier.setItems(rMultiplier);
labelMap.setText(lang.get("Map"));
labelMap.setText(lang.getString("Map"));
labelTileset.setText(lang.get("Tileset"));
labelTileset.setText(lang.getString("Tileset"));
labelTechTree.setText(lang.get("TechTree"));
labelTechTree.setText(lang.getString("TechTree"));
vector<string> playerstatusItems;
playerstatusItems.push_back(lang.get("PlayerStatusSetup"));
playerstatusItems.push_back(lang.get("PlayerStatusBeRightBack"));
playerstatusItems.push_back(lang.get("PlayerStatusReady"));
playerstatusItems.push_back(lang.getString("PlayerStatusSetup"));
playerstatusItems.push_back(lang.getString("PlayerStatusBeRightBack"));
playerstatusItems.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerstatusItems);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
labelControl.setText(lang.get("Control"));
labelControl.setText(lang.getString("Control"));
labelFaction.setText(lang.get("Faction"));
labelFaction.setText(lang.getString("Faction"));
labelTeam.setText(lang.get("Team"));
labelTeam.setText(lang.getString("Team"));
labelControl.setFont(CoreData::getInstance().getMenuFontBig());
labelControl.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -667,23 +667,23 @@ void MenuStateConnectedGame::reloadUI() {
labelTeam.setFont3D(CoreData::getInstance().getMenuFontBig3D());
//texts
buttonDisconnect.setText(lang.get("Return"));
buttonDisconnect.setText(lang.getString("Return"));
vector<string> controlItems;
controlItems.push_back(lang.get("Closed"));
controlItems.push_back(lang.get("CpuEasy"));
controlItems.push_back(lang.get("Cpu"));
controlItems.push_back(lang.get("CpuUltra"));
controlItems.push_back(lang.get("CpuMega"));
controlItems.push_back(lang.get("Network"));
controlItems.push_back(lang.get("NetworkUnassigned"));
controlItems.push_back(lang.get("Human"));
controlItems.push_back(lang.getString("Closed"));
controlItems.push_back(lang.getString("CpuEasy"));
controlItems.push_back(lang.getString("Cpu"));
controlItems.push_back(lang.getString("CpuUltra"));
controlItems.push_back(lang.getString("CpuMega"));
controlItems.push_back(lang.getString("Network"));
controlItems.push_back(lang.getString("NetworkUnassigned"));
controlItems.push_back(lang.getString("Human"));
if(config.getBool("EnableNetworkCpu","false") == true) {
controlItems.push_back(lang.get("NetworkCpuEasy"));
controlItems.push_back(lang.get("NetworkCpu"));
controlItems.push_back(lang.get("NetworkCpuUltra"));
controlItems.push_back(lang.get("NetworkCpuMega"));
controlItems.push_back(lang.getString("NetworkCpuEasy"));
controlItems.push_back(lang.getString("NetworkCpu"));
controlItems.push_back(lang.getString("NetworkCpuUltra"));
controlItems.push_back(lang.getString("NetworkCpuMega"));
}
for(int i=0; i < GameConstants::maxPlayers; ++i) {
@ -692,12 +692,12 @@ void MenuStateConnectedGame::reloadUI() {
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
labelScenario.setText(lang.get("Scenario"));
labelScenario.setText(lang.getString("Scenario"));
labelAllowNativeLanguageTechtree.setText(lang.get("AllowNativeLanguageTechtree"));
labelAllowNativeLanguageTechtree.setText(lang.getString("AllowNativeLanguageTechtree"));
buttonPlayNow.setText(lang.get("PlayNow"));
buttonRestoreLastSettings.setText(lang.get("ReloadLastGameSettings"));
buttonPlayNow.setText(lang.getString("PlayNow"));
buttonRestoreLastSettings.setText(lang.getString("ReloadLastGameSettings"));
chatManager.init(&console, -1,true);
@ -717,7 +717,7 @@ void MenuStateConnectedGame::disconnectFromServer() {
Lang &lang= Lang::getInstance();
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sQuitText = lang.get("QuitGame",languageList[i]);
string sQuitText = lang.getString("QuitGame",languageList[i]);
clientInterface->sendTextMessage(sQuitText,-1,false,languageList[i]);
}
sleep(1);
@ -959,7 +959,7 @@ void MenuStateConnectedGame::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#1 ") + szBuf,true);
}
@ -978,7 +978,7 @@ void MenuStateConnectedGame::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#2 ") + szBuf,true);
}
@ -993,7 +993,7 @@ void MenuStateConnectedGame::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#3 ") + szBuf,true);
}
@ -1003,14 +1003,14 @@ void MenuStateConnectedGame::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#4 ") + szBuf,true);
}
}
SystemFlags::cleanupHTTP(&handle);
}
else {
console.addLine(lang.get("MasterServerMissing"),true);
console.addLine(lang.getString("MasterServerMissing"),true);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
@ -1154,7 +1154,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingMapNowDownloading",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingMapNowDownloading",languageList[i]).c_str(),getHumanPlayerName().c_str(),getMissingMapFromFTPServer.c_str());
snprintf(szMsg,8096,lang.getString("DataMissingMapNowDownloading",languageList[i]).c_str(),getHumanPlayerName().c_str(),getMissingMapFromFTPServer.c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is attempting to download the map: %s",getHumanPlayerName().c_str(),getMissingMapFromFTPServer.c_str());
@ -1189,7 +1189,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTilesetNowDownloading",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTilesetNowDownloading",languageList[i]).c_str(),getHumanPlayerName().c_str(),getMissingTilesetFromFTPServer.c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTilesetNowDownloading",languageList[i]).c_str(),getHumanPlayerName().c_str(),getMissingTilesetFromFTPServer.c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is attempting to download the tileset: %s",getHumanPlayerName().c_str(),getMissingTilesetFromFTPServer.c_str());
@ -1224,7 +1224,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTechtreeNowDownloading",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTechtreeNowDownloading",languageList[i]).c_str(),getHumanPlayerName().c_str(),getMissingTechtreeFromFTPServer.c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTechtreeNowDownloading",languageList[i]).c_str(),getHumanPlayerName().c_str(),getMissingTechtreeFromFTPServer.c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is attempting to download the techtree: %s",getHumanPlayerName().c_str(),getMissingTechtreeFromFTPServer.c_str());
@ -1370,7 +1370,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("CancelDownloadsMsg",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("CancelDownloadsMsg",languageList[i]).c_str(),getHumanPlayerName().c_str());
snprintf(szMsg,8096,lang.getString("CancelDownloadsMsg",languageList[i]).c_str(),getHumanPlayerName().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s cancelled all file downloads.",getHumanPlayerName().c_str());
@ -1840,7 +1840,7 @@ void MenuStateConnectedGame::PlayNow(bool saveGame) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("JoinPlayerToCurrentGameLaunch",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("JoinPlayerToCurrentGameLaunch",languageList[i]).c_str(),getHumanPlayerName().c_str());
snprintf(szMsg,8096,lang.getString("JoinPlayerToCurrentGameLaunch",languageList[i]).c_str(),getHumanPlayerName().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is about to join the game, please wait...",getHumanPlayerName().c_str());
@ -1980,7 +1980,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingMap=Player",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingMap=Player",languageList[i]).c_str(),getHumanPlayerName().c_str(),listBoxMap.getSelectedItem().c_str());
snprintf(szMsg,8096,lang.getString("DataMissingMap=Player",languageList[i]).c_str(),getHumanPlayerName().c_str(),listBoxMap.getSelectedItem().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is missing the map: %s",getHumanPlayerName().c_str(),listBoxMap.getSelectedItem().c_str());
@ -2003,7 +2003,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTileset=Player",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTileset=Player",languageList[i]).c_str(),getHumanPlayerName().c_str(),listBoxTileset.getSelectedItem().c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTileset=Player",languageList[i]).c_str(),getHumanPlayerName().c_str(),listBoxTileset.getSelectedItem().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is missing the tileset: %s",getHumanPlayerName().c_str(),listBoxTileset.getSelectedItem().c_str());
@ -2023,7 +2023,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTechtree=Player",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTechtree=Player",languageList[i]).c_str(),getHumanPlayerName().c_str(),listBoxTechTree.getSelectedItem().c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTechtree=Player",languageList[i]).c_str(),getHumanPlayerName().c_str(),listBoxTechTree.getSelectedItem().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is missing the techtree: %s",getHumanPlayerName().c_str(),listBoxTechTree.getSelectedItem().c_str());
@ -2117,7 +2117,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, playername is AI (blank)\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i);
Lang &lang= Lang::getInstance();
gameSettings->setNetworkPlayerName(slotIndex, lang.get("AI") + intToStr(AIPlayerCount));
gameSettings->setNetworkPlayerName(slotIndex, lang.getString("AI") + intToStr(AIPlayerCount));
labelPlayerNames[i].setText("");
}
@ -2576,7 +2576,7 @@ void MenuStateConnectedGame::render() {
int yLocation = buttonCancelDownloads.getY() - 20;
for(std::map<string,pair<int,string> >::iterator iterMap = fileFTPProgressList.begin();
iterMap != fileFTPProgressList.end(); ++iterMap) {
string progressLabelPrefix = lang.get("ModDownloading") + " " + iterMap->first + " ";
string progressLabelPrefix = lang.getString("ModDownloading") + " " + iterMap->first + " ";
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nRendering file progress with the following prefix [%s]\n",progressLabelPrefix.c_str());
if(Renderer::renderText3DEnabled) {
@ -2648,9 +2648,9 @@ void MenuStateConnectedGame::update() {
Lang &lang= Lang::getInstance();
ClientInterface *clientInterface= NetworkManager::getInstance().getClientInterface();
string newLabelConnectionInfo = lang.get("WaitingHost");
string newLabelConnectionInfo = lang.getString("WaitingHost");
if(clientInterface != NULL && clientInterface->getJoinGameInProgress() == true) {
newLabelConnectionInfo = lang.get("MGGameStatus2");
newLabelConnectionInfo = lang.getString("MGGameStatus2");
}
// Test progress bar
//MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
@ -2708,7 +2708,7 @@ void MenuStateConnectedGame::update() {
Lang &lang= Lang::getInstance();
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
for(unsigned int i = 0; i < languageList.size(); ++i) {
clientInterface->sendTextMessage(lang.get("ConnectionTimedOut",languageList[i]),-1,false,languageList[i]);
clientInterface->sendTextMessage(lang.getString("ConnectionTimedOut",languageList[i]),-1,false,languageList[i]);
sleep(1);
clientInterface->close();
}
@ -2726,10 +2726,10 @@ void MenuStateConnectedGame::update() {
//update status label
if(clientInterface != NULL && clientInterface->isConnected()) {
buttonDisconnect.setText(lang.get("Disconnect"));
buttonDisconnect.setText(lang.getString("Disconnect"));
if(clientInterface->getAllowDownloadDataSynch() == false) {
string label = lang.get("ConnectedToServer");
string label = lang.getString("ConnectedToServer");
if(clientInterface->getServerName().empty() == false) {
label = label + " " + clientInterface->getServerName();
@ -2776,7 +2776,7 @@ void MenuStateConnectedGame::update() {
if(techCRC != 0 && techCRC != gameSettings->getTechCRC() &&
listBoxTechTree.getSelectedItemIndex() >= 0 &&
listBoxTechTree.getSelectedItem() != Lang::getInstance().get("DataMissing","",true)) {
listBoxTechTree.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
time_t now = time(NULL);
time_t lastUpdateDate = getFolderTreeContentsCheckSumRecursivelyLastGenerated(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml");
@ -2800,7 +2800,7 @@ void MenuStateConnectedGame::update() {
string factionName = factionFiles[factionIdx];
if(factionName != GameConstants::RANDOMFACTION_SLOTNAME &&
factionName != GameConstants::OBSERVER_SLOTNAME &&
factionName != Lang::getInstance().get("DataMissing","",true)) {
factionName != Lang::getInstance().getString("DataMissing","",true)) {
uint32 factionCRC = 0;
time_t now = time(NULL);
@ -2862,21 +2862,21 @@ void MenuStateConnectedGame::update() {
if(dataSynchMismatch == true) {
//printf("Data not synched: lmap %u rmap: %u ltile: %d rtile: %u ltech: %u rtech: %u\n",mapCRC,gameSettings->getMapCRC(),tilesetCRC,gameSettings->getTilesetCRC(),techCRC,gameSettings->getTechCRC());
string labelSynch = lang.get("DataNotSynchedTitle");
string labelSynch = lang.getString("DataNotSynchedTitle");
if(mapCRC != 0 && mapCRC != gameSettings->getMapCRC() &&
listBoxMap.getSelectedItemIndex() >= 0 &&
listBoxMap.getSelectedItem() != Lang::getInstance().get("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.get("Map");
listBoxMap.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.getString("Map");
if(updateDataSynchDetailText == true &&
lastMapDataSynchError != lang.get("DataNotSynchedMap") + " " + listBoxMap.getSelectedItem()) {
lastMapDataSynchError = lang.get("DataNotSynchedMap") + " " + listBoxMap.getSelectedItem();
lastMapDataSynchError != lang.getString("DataNotSynchedMap") + " " + listBoxMap.getSelectedItem()) {
lastMapDataSynchError = lang.getString("DataNotSynchedMap") + " " + listBoxMap.getSelectedItem();
Lang &lang= Lang::getInstance();
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
for(unsigned int i = 0; i < languageList.size(); ++i) {
string msg = lang.get("DataNotSynchedMap",languageList[i]) + " " + listBoxMap.getSelectedItem();
string msg = lang.getString("DataNotSynchedMap",languageList[i]) + " " + listBoxMap.getSelectedItem();
bool localEcho = lang.isLanguageLocal(languageList[i]);
clientInterface->sendTextMessage(msg,-1,localEcho,languageList[i]);
}
@ -2885,16 +2885,16 @@ void MenuStateConnectedGame::update() {
if(tilesetCRC != 0 && tilesetCRC != gameSettings->getTilesetCRC() &&
listBoxTileset.getSelectedItemIndex() >= 0 &&
listBoxTileset.getSelectedItem() != Lang::getInstance().get("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.get("Tileset");
listBoxTileset.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.getString("Tileset");
if(updateDataSynchDetailText == true &&
lastTileDataSynchError != lang.get("DataNotSynchedTileset") + " " + listBoxTileset.getSelectedItem()) {
lastTileDataSynchError = lang.get("DataNotSynchedTileset") + " " + listBoxTileset.getSelectedItem();
lastTileDataSynchError != lang.getString("DataNotSynchedTileset") + " " + listBoxTileset.getSelectedItem()) {
lastTileDataSynchError = lang.getString("DataNotSynchedTileset") + " " + listBoxTileset.getSelectedItem();
Lang &lang= Lang::getInstance();
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
for(unsigned int i = 0; i < languageList.size(); ++i) {
string msg = lang.get("DataNotSynchedTileset",languageList[i]) + " " + listBoxTileset.getSelectedItem();
string msg = lang.getString("DataNotSynchedTileset",languageList[i]) + " " + listBoxTileset.getSelectedItem();
bool localEcho = lang.isLanguageLocal(languageList[i]);
clientInterface->sendTextMessage(msg,-1,localEcho,languageList[i]);
}
@ -2903,16 +2903,16 @@ void MenuStateConnectedGame::update() {
if(techCRC != 0 && techCRC != gameSettings->getTechCRC() &&
listBoxTechTree.getSelectedItemIndex() >= 0 &&
listBoxTechTree.getSelectedItem() != Lang::getInstance().get("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.get("TechTree");
listBoxTechTree.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.getString("TechTree");
if(updateDataSynchDetailText == true &&
lastTechtreeDataSynchError != lang.get("DataNotSynchedTechtree") + " " + listBoxTechTree.getSelectedItem()) {
lastTechtreeDataSynchError = lang.get("DataNotSynchedTechtree") + " " + listBoxTechTree.getSelectedItem();
lastTechtreeDataSynchError != lang.getString("DataNotSynchedTechtree") + " " + listBoxTechTree.getSelectedItem()) {
lastTechtreeDataSynchError = lang.getString("DataNotSynchedTechtree") + " " + listBoxTechTree.getSelectedItem();
Lang &lang= Lang::getInstance();
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
for(unsigned int i = 0; i < languageList.size(); ++i) {
string msg = lang.get("DataNotSynchedTechtree",languageList[i]) + " " + listBoxTechTree.getSelectedItem();
string msg = lang.getString("DataNotSynchedTechtree",languageList[i]) + " " + listBoxTechTree.getSelectedItem();
bool localEcho = lang.isLanguageLocal(languageList[i]);
clientInterface->sendTextMessage(msg,-1,localEcho,languageList[i]);
}
@ -2943,7 +2943,7 @@ void MenuStateConnectedGame::update() {
if(mismatchedFactionText == "") {
mismatchedFactionText = "The following factions are mismatched: ";
if(lang.hasString("MismatchedFactions",languageList[i]) == true) {
mismatchedFactionText = lang.get("MismatchedFactions",languageList[i]);
mismatchedFactionText = lang.getString("MismatchedFactions",languageList[i]);
}
mismatchedFactionText += " ["+ intToStr(factionCRCList.size()) + "][" + intToStr(serverFactionCRCList.size()) + "] - ";
@ -2966,7 +2966,7 @@ void MenuStateConnectedGame::update() {
if(mismatchedFactionText == "") {
mismatchedFactionText = "The following factions are mismatched: ";
if(lang.hasString("MismatchedFactions",languageList[i]) == true) {
mismatchedFactionText = lang.get("MismatchedFactions",languageList[i]);
mismatchedFactionText = lang.getString("MismatchedFactions",languageList[i]);
}
mismatchedFactionText += " ["+ intToStr(factionCRCList.size()) + "][" + intToStr(serverFactionCRCList.size()) + "] - ";
@ -2976,7 +2976,7 @@ void MenuStateConnectedGame::update() {
}
if(lang.hasString("MismatchedFactionsMissing",languageList[i]) == true) {
mismatchedFactionText += serverFaction.first + " " + lang.get("MismatchedFactionsMissing",languageList[i]);
mismatchedFactionText += serverFaction.first + " " + lang.getString("MismatchedFactionsMissing",languageList[i]);
}
else {
mismatchedFactionText += serverFaction.first + " (missing)";
@ -3006,7 +3006,7 @@ void MenuStateConnectedGame::update() {
if(mismatchedFactionText == "") {
mismatchedFactionText = "The following factions are mismatched: ";
if(lang.hasString("MismatchedFactions",languageList[i]) == true) {
mismatchedFactionText = lang.get("MismatchedFactions",languageList[i]);
mismatchedFactionText = lang.getString("MismatchedFactions",languageList[i]);
}
mismatchedFactionText += " ["+ intToStr(factionCRCList.size()) + "][" + intToStr(serverFactionCRCList.size()) + "] - ";
@ -3016,7 +3016,7 @@ void MenuStateConnectedGame::update() {
}
if(lang.hasString("MismatchedFactionsExtra",languageList[i]) == true) {
mismatchedFactionText += clientFaction.first + " " + lang.get("MismatchedFactionsExtra",languageList[i]);
mismatchedFactionText += clientFaction.first + " " + lang.getString("MismatchedFactionsExtra",languageList[i]);
}
else {
mismatchedFactionText += clientFaction.first + " (extra)";
@ -3109,7 +3109,7 @@ void MenuStateConnectedGame::update() {
labelStatus.setText(label);
}
else {
string label = lang.get("ConnectedToServer");
string label = lang.getString("ConnectedToServer");
if(!clientInterface->getServerName().empty()) {
label = label + " " + clientInterface->getServerName();
@ -3389,7 +3389,7 @@ bool MenuStateConnectedGame::loadFactions(const GameSettings *gameSettings, bool
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] (2)There are no factions for the tech tree [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,gameSettings->getTech().c_str());
}
results.push_back(Lang::getInstance().get("DataMissing","",true));
results.push_back(Lang::getInstance().getString("DataMissing","",true));
factionFiles = results;
vector<string> translatedFactionNames;
for(int i= 0; i < factionFiles.size(); ++i) {
@ -3416,7 +3416,7 @@ bool MenuStateConnectedGame::loadFactions(const GameSettings *gameSettings, bool
char szMsg[8096]="";
if(lang.hasString("DataMissingTechtree",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTechtree",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTechtree",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is missing the techtree: %s",getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
@ -3536,20 +3536,20 @@ void MenuStateConnectedGame::keyDown(SDL_KeyboardEvent key) {
float currentVolume = CoreData::getInstance().getMenuMusic()->getVolume();
if(currentVolume > 0) {
CoreData::getInstance().getMenuMusic()->setVolume(0.f);
console.addLine(lang.get("GameMusic") + " " + lang.get("Off"));
console.addLine(lang.getString("GameMusic") + " " + lang.getString("Off"));
}
else {
CoreData::getInstance().getMenuMusic()->setVolume(configVolume);
//If the config says zero, use the default music volume
//gameMusic->setVolume(configVolume ? configVolume : 0.9);
console.addLine(lang.get("GameMusic"));
console.addLine(lang.getString("GameMusic"));
}
}
//else if(key == configKeys.getCharKey("SaveGUILayout")) {
else if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
bool saved = GraphicComponent::saveAllCustomProperties(containerName);
Lang &lang= Lang::getInstance();
console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}
}
@ -3652,7 +3652,7 @@ bool MenuStateConnectedGame::loadMapInfo(string file, MapInfo *mapInfo, bool loa
lastMissingMap = file;
Lang &lang= Lang::getInstance();
if(MapPreview::loadMapInfo(file, mapInfo, lang.get("MaxPlayers"),lang.get("Size"),true) == true) {
if(MapPreview::loadMapInfo(file, mapInfo, lang.getString("MaxPlayers"),lang.getString("Size"),true) == true) {
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
labelPlayers[i].setVisible(i+1 <= mapInfo->players);
labelPlayerNames[i].setVisible(i+1 <= mapInfo->players);
@ -3677,7 +3677,7 @@ bool MenuStateConnectedGame::loadMapInfo(string file, MapInfo *mapInfo, bool loa
}
else {
cleanupMapPreviewTexture();
mapInfo->desc = Lang::getInstance().get("DataMissing","",true);
mapInfo->desc = Lang::getInstance().getString("DataMissing","",true);
NetworkManager &networkManager= NetworkManager::getInstance();
ClientInterface* clientInterface= networkManager.getClientInterface();
@ -3694,7 +3694,7 @@ bool MenuStateConnectedGame::loadMapInfo(string file, MapInfo *mapInfo, bool loa
char szMsg[8096]="";
if(lang.hasString("DataMissingMap",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingMap",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
snprintf(szMsg,8096,lang.getString("DataMissingMap",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is missing the map: %s",getHumanPlayerName().c_str(),gameSettings->getMap().c_str());
@ -3818,7 +3818,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("FileDownloadProgress",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("FileDownloadProgress",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),fileProgress);
snprintf(szMsg,8096,lang.getString("FileDownloadProgress",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),fileProgress);
}
else {
snprintf(szMsg,8096,"Player: %s download progress for [%s] is %d %%",getHumanPlayerName().c_str(),itemName.c_str(),fileProgress);
@ -3842,7 +3842,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingExtractDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingExtractDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
snprintf(szMsg,8096,lang.getString("DataMissingExtractDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
}
else {
snprintf(szMsg,8096,"Please wait, player: %s is extracting: %s",getHumanPlayerName().c_str(),itemName.c_str());
@ -3893,7 +3893,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingMapSuccessDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingMapSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
snprintf(szMsg,8096,lang.getString("DataMissingMapSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
}
else {
snprintf(szMsg,8096,"Player: %s SUCCESSFULLY downloaded the map: %s",getHumanPlayerName().c_str(),itemName.c_str());
@ -3913,7 +3913,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingMapFailDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingMapFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
snprintf(szMsg,8096,lang.getString("DataMissingMapFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
}
else {
snprintf(szMsg,8096,"Player: %s FAILED to download the map: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
@ -3922,7 +3922,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
if(result.first == ftp_crt_HOST_NOT_ACCEPTING) {
if(lang.hasString("HostNotAcceptingDataConnections",languageList[i]) == true) {
clientInterface->sendTextMessage(lang.get("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
clientInterface->sendTextMessage(lang.getString("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
else {
clientInterface->sendTextMessage("*Warning* the host is not accepting data connections.",-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
@ -3953,7 +3953,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTilesetSuccessDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTilesetSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTilesetSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
}
else {
snprintf(szMsg,8096,"Player: %s SUCCESSFULLY downloaded the tileset: %s",getHumanPlayerName().c_str(),itemName.c_str());
@ -4006,7 +4006,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTilesetFailDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTilesetFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
snprintf(szMsg,8096,lang.getString("DataMissingTilesetFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
}
else {
snprintf(szMsg,8096,"Player: %s FAILED to download the tileset: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
@ -4015,7 +4015,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
if(result.first == ftp_crt_HOST_NOT_ACCEPTING) {
if(lang.hasString("HostNotAcceptingDataConnections",languageList[i]) == true) {
clientInterface->sendTextMessage(lang.get("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
clientInterface->sendTextMessage(lang.getString("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
else {
clientInterface->sendTextMessage("*Warning* the host is not accepting data connections.",-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
@ -4046,7 +4046,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTechtreeSuccessDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTechtreeSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTechtreeSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
}
else {
snprintf(szMsg,8096,"Player: %s SUCCESSFULLY downloaded the techtree: %s",getHumanPlayerName().c_str(),itemName.c_str());
@ -4100,7 +4100,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("DataMissingTechtreeFailDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTechtreeFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
snprintf(szMsg,8096,lang.getString("DataMissingTechtreeFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
}
else {
snprintf(szMsg,8096,"Player: %s FAILED to download the techtree: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
@ -4109,7 +4109,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
if(result.first == ftp_crt_HOST_NOT_ACCEPTING) {
if(lang.hasString("HostNotAcceptingDataConnections",languageList[i]) == true) {
clientInterface->sendTextMessage(lang.get("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
clientInterface->sendTextMessage(lang.getString("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
else {
clientInterface->sendTextMessage("*Warning* the host is not accepting data connections.",-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
@ -4151,7 +4151,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("JoinPlayerToCurrentGameSuccessDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("JoinPlayerToCurrentGameSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
snprintf(szMsg,8096,lang.getString("JoinPlayerToCurrentGameSuccessDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str());
}
else {
snprintf(szMsg,8096,"Player: %s SUCCESSFULLY downloaded the saved game: %s",getHumanPlayerName().c_str(),itemName.c_str());
@ -4193,7 +4193,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
for(unsigned int i = 0; i < languageList.size(); ++i) {
char szMsg[8096]="";
if(lang.hasString("JoinPlayerToCurrentGameFailDownload",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("JoinPlayerToCurrentGameFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
snprintf(szMsg,8096,lang.getString("JoinPlayerToCurrentGameFailDownload",languageList[i]).c_str(),getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
}
else {
snprintf(szMsg,8096,"Player: %s FAILED to download the saved game: [%s] using CURL version [%s]",getHumanPlayerName().c_str(),itemName.c_str(),curlVersion->version);
@ -4202,7 +4202,7 @@ void MenuStateConnectedGame::FTPClient_CallbackEvent(string itemName,
if(result.first == ftp_crt_HOST_NOT_ACCEPTING) {
if(lang.hasString("HostNotAcceptingDataConnections",languageList[i]) == true) {
clientInterface->sendTextMessage(lang.get("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
clientInterface->sendTextMessage(lang.getString("HostNotAcceptingDataConnections",languageList[i]),-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
}
else {
clientInterface->sendTextMessage("*Warning* the host is not accepting data connections.",-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
@ -4290,23 +4290,23 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
Lang &lang= Lang::getInstance();
char szBuf[8096]="";
snprintf(szBuf,8096,"%s %s ?",lang.get("DownloadMissingTilesetQuestion").c_str(),gameSettings->getTileset().c_str());
snprintf(szBuf,8096,"%s %s ?",lang.getString("DownloadMissingTilesetQuestion").c_str(),gameSettings->getTileset().c_str());
// Is the item in the mod center?
if(tilesetCacheList.find(getMissingMapFromFTPServer) == tilesetCacheList.end()) {
ftpMessageBox.init(lang.get("Yes"),lang.get("NoDownload"));
ftpMessageBox.init(lang.getString("Yes"),lang.getString("NoDownload"));
}
else {
ftpMessageBox.init(lang.get("ModCenter"),lang.get("GameHost"));
ftpMessageBox.addButton(lang.get("NoDownload"));
ftpMessageBox.init(lang.getString("ModCenter"),lang.getString("GameHost"));
ftpMessageBox.addButton(lang.getString("NoDownload"));
}
ftpMissingDataType = ftpmsg_MissingTileset;
showFTPMessageBox(szBuf, lang.get("Question"), false);
showFTPMessageBox(szBuf, lang.getString("Question"), false);
}
}
tilesets.push_back(Lang::getInstance().get("DataMissing","",true));
tilesets.push_back(Lang::getInstance().getString("DataMissing","",true));
NetworkManager &networkManager= NetworkManager::getInstance();
ClientInterface* clientInterface= networkManager.getClientInterface();
@ -4323,7 +4323,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
char szMsg[8096]="";
if(lang.hasString("DataMissingTileset",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTileset",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getTileset().c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTileset",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getTileset().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is missing the tileset: %s",getHumanPlayerName().c_str(),gameSettings->getTileset().c_str());
@ -4333,7 +4333,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
}
listBoxTileset.setItems(tilesets);
listBoxTileset.setSelectedItem(Lang::getInstance().get("DataMissing","",true));
listBoxTileset.setSelectedItem(Lang::getInstance().getString("DataMissing","",true));
}
}
@ -4361,23 +4361,23 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
Lang &lang= Lang::getInstance();
char szBuf[8096]="";
snprintf(szBuf,8096,"%s %s ?",lang.get("DownloadMissingTechtreeQuestion").c_str(),gameSettings->getTech().c_str());
snprintf(szBuf,8096,"%s %s ?",lang.getString("DownloadMissingTechtreeQuestion").c_str(),gameSettings->getTech().c_str());
// Is the item in the mod center?
if(techCacheList.find(getMissingTechtreeFromFTPServer) == techCacheList.end()) {
ftpMessageBox.init(lang.get("Yes"),lang.get("NoDownload"));
ftpMessageBox.init(lang.getString("Yes"),lang.getString("NoDownload"));
}
else {
ftpMessageBox.init(lang.get("ModCenter"),lang.get("GameHost"));
ftpMessageBox.addButton(lang.get("NoDownload"));
ftpMessageBox.init(lang.getString("ModCenter"),lang.getString("GameHost"));
ftpMessageBox.addButton(lang.getString("NoDownload"));
}
ftpMissingDataType = ftpmsg_MissingTechtree;
showFTPMessageBox(szBuf, lang.get("Question"), false);
showFTPMessageBox(szBuf, lang.getString("Question"), false);
}
}
techtree.push_back(Lang::getInstance().get("DataMissing","",true));
techtree.push_back(Lang::getInstance().getString("DataMissing","",true));
NetworkManager &networkManager= NetworkManager::getInstance();
ClientInterface* clientInterface= networkManager.getClientInterface();
@ -4394,7 +4394,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
char szMsg[8096]="";
if(lang.hasString("DataMissingTechtree",languageList[i]) == true) {
snprintf(szMsg,8096,lang.get("DataMissingTechtree",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
snprintf(szMsg,8096,lang.getString("DataMissingTechtree",languageList[i]).c_str(),getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
}
else {
snprintf(szMsg,8096,"Player: %s is missing the techtree: %s",getHumanPlayerName().c_str(),gameSettings->getTech().c_str());
@ -4409,7 +4409,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
translatedTechs.push_back(txTech);
}
listBoxTechTree.setItems(techtree,translatedTechs);
listBoxTechTree.setSelectedItem(Lang::getInstance().get("DataMissing","",true));
listBoxTechTree.setSelectedItem(Lang::getInstance().getString("DataMissing","",true));
}
}
@ -4452,23 +4452,23 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
Lang &lang= Lang::getInstance();
char szBuf[8096]="";
snprintf(szBuf,8096,"%s %s ?",lang.get("DownloadMissingMapQuestion").c_str(),currentMap.c_str());
snprintf(szBuf,8096,"%s %s ?",lang.getString("DownloadMissingMapQuestion").c_str(),currentMap.c_str());
// Is the item in the mod center?
if(mapCacheList.find(getMissingTechtreeFromFTPServer) == mapCacheList.end()) {
ftpMessageBox.init(lang.get("Yes"),lang.get("NoDownload"));
ftpMessageBox.init(lang.getString("Yes"),lang.getString("NoDownload"));
}
else {
ftpMessageBox.init(lang.get("ModCenter"),lang.get("GameHost"));
ftpMessageBox.addButton(lang.get("NoDownload"));
ftpMessageBox.init(lang.getString("ModCenter"),lang.getString("GameHost"));
ftpMessageBox.addButton(lang.getString("NoDownload"));
}
ftpMissingDataType = ftpmsg_MissingMap;
showFTPMessageBox(szBuf, lang.get("Question"), false);
showFTPMessageBox(szBuf, lang.getString("Question"), false);
}
}
maps.push_back(Lang::getInstance().get("DataMissing","",true));
mapFile = Lang::getInstance().get("DataMissing","",true);
maps.push_back(Lang::getInstance().getString("DataMissing","",true));
mapFile = Lang::getInstance().getString("DataMissing","",true);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = " MG_SIZE_T_SPECIFIER ", maps.size() = " MG_SIZE_T_SPECIFIER ", getCurrentMapFile() [%s] mapFile [%s]\n",

View File

@ -125,7 +125,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
this->dirList = Config::getInstance().getPathListForType(ptScenarios);
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -206,7 +206,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
}
string serverPort=config.getString("PortServer", intToStr(GameConstants::serverPort).c_str());
string externalPort=config.getString("PortExternal", serverPort.c_str());
labelLocalIP.setText(lang.get("LanIP") + ipText + " ( "+serverPort+" / "+externalPort+" )");
labelLocalIP.setText(lang.getString("LanIP") + ipText + " ( "+serverPort+" / "+externalPort+" )");
ServerSocket::setExternalPort(strToInt(externalPort));
if(EndsWith(glestVersionString, "-dev") == false){
@ -220,7 +220,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
// MapFilter
labelMapFilter.registerGraphicComponent(containerName,"labelMapFilter");
labelMapFilter.init(xoffset+310, mapHeadPos);
labelMapFilter.setText(lang.get("MapFilter")+":");
labelMapFilter.setText(lang.getString("MapFilter")+":");
listBoxMapFilter.registerGraphicComponent(containerName,"listBoxMapFilter");
listBoxMapFilter.init(xoffset+310, mapPos, 80);
@ -233,7 +233,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
// Map
labelMap.registerGraphicComponent(containerName,"labelMap");
labelMap.init(xoffset+100, mapHeadPos);
labelMap.setText(lang.get("Map")+":");
labelMap.setText(lang.getString("Map")+":");
//map listBox
listBoxMap.registerGraphicComponent(containerName,"listBoxMap");
@ -249,7 +249,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelTileset.registerGraphicComponent(containerName,"labelTileset");
labelTileset.init(xoffset+460, mapHeadPos);
labelTileset.setText(lang.get("Tileset"));
labelTileset.setText(lang.getString("Tileset"));
//tileset listBox
listBoxTileset.registerGraphicComponent(containerName,"listBoxTileset");
@ -270,25 +270,25 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelTechTree.registerGraphicComponent(containerName,"labelTechTree");
labelTechTree.init(xoffset+650, mapHeadPos);
labelTechTree.setText(lang.get("TechTree"));
labelTechTree.setText(lang.getString("TechTree"));
// fog - o - war
// @350 ? 300 ?
labelFogOfWar.registerGraphicComponent(containerName,"labelFogOfWar");
labelFogOfWar.init(xoffset+100, aHeadPos, 130);
labelFogOfWar.setText(lang.get("FogOfWar"));
labelFogOfWar.setText(lang.getString("FogOfWar"));
listBoxFogOfWar.registerGraphicComponent(containerName,"listBoxFogOfWar");
listBoxFogOfWar.init(xoffset+100, aPos, 130);
listBoxFogOfWar.pushBackItem(lang.get("Enabled"));
listBoxFogOfWar.pushBackItem(lang.get("Explored"));
listBoxFogOfWar.pushBackItem(lang.get("Disabled"));
listBoxFogOfWar.pushBackItem(lang.getString("Enabled"));
listBoxFogOfWar.pushBackItem(lang.getString("Explored"));
listBoxFogOfWar.pushBackItem(lang.getString("Disabled"));
listBoxFogOfWar.setSelectedItemIndex(0);
// Allow Observers
labelAllowObservers.registerGraphicComponent(containerName,"labelAllowObservers");
labelAllowObservers.init(xoffset+310, aHeadPos, 80);
labelAllowObservers.setText(lang.get("AllowObservers"));
labelAllowObservers.setText(lang.getString("AllowObservers"));
checkBoxAllowObservers.registerGraphicComponent(containerName,"checkBoxAllowObservers");
checkBoxAllowObservers.init(xoffset+310, aPos);
@ -301,7 +301,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelFallbackCpuMultiplier.registerGraphicComponent(containerName,"labelFallbackCpuMultiplier");
labelFallbackCpuMultiplier.init(xoffset+460, aHeadPos, 80);
labelFallbackCpuMultiplier.setText(lang.get("FallbackCpuMultiplier"));
labelFallbackCpuMultiplier.setText(lang.getString("FallbackCpuMultiplier"));
listBoxFallbackCpuMultiplier.registerGraphicComponent(containerName,"listBoxFallbackCpuMultiplier");
listBoxFallbackCpuMultiplier.init(xoffset+460, aPos, 80);
@ -311,7 +311,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
// Allow Switch Team Mode
labelEnableSwitchTeamMode.registerGraphicComponent(containerName,"labelEnableSwitchTeamMode");
labelEnableSwitchTeamMode.init(xoffset+310, aHeadPos+45, 80);
labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode"));
labelEnableSwitchTeamMode.setText(lang.getString("EnableSwitchTeamMode"));
checkBoxEnableSwitchTeamMode.registerGraphicComponent(containerName,"checkBoxEnableSwitchTeamMode");
checkBoxEnableSwitchTeamMode.init(xoffset+310, aPos+45);
@ -319,7 +319,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelAISwitchTeamAcceptPercent.registerGraphicComponent(containerName,"labelAISwitchTeamAcceptPercent");
labelAISwitchTeamAcceptPercent.init(xoffset+460, aHeadPos+45, 80);
labelAISwitchTeamAcceptPercent.setText(lang.get("AISwitchTeamAcceptPercent"));
labelAISwitchTeamAcceptPercent.setText(lang.getString("AISwitchTeamAcceptPercent"));
listBoxAISwitchTeamAcceptPercent.registerGraphicComponent(containerName,"listBoxAISwitchTeamAcceptPercent");
listBoxAISwitchTeamAcceptPercent.init(xoffset+460, aPos+45, 80);
@ -330,7 +330,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelAllowNativeLanguageTechtree.registerGraphicComponent(containerName,"labelAllowNativeLanguageTechtree");
labelAllowNativeLanguageTechtree.init(xoffset+650, mapHeadPos-50);
labelAllowNativeLanguageTechtree.setText(lang.get("AllowNativeLanguageTechtree"));
labelAllowNativeLanguageTechtree.setText(lang.getString("AllowNativeLanguageTechtree"));
checkBoxAllowNativeLanguageTechtree.registerGraphicComponent(containerName,"checkBoxAllowNativeLanguageTechtree");
checkBoxAllowNativeLanguageTechtree.init(xoffset+650, mapHeadPos-70);
@ -340,9 +340,9 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
listBoxPlayerStatus.registerGraphicComponent(containerName,"listBoxPlayerStatus");
listBoxPlayerStatus.init(810, buttony, 150);
vector<string> playerStatuses;
playerStatuses.push_back(lang.get("PlayerStatusSetup"));
playerStatuses.push_back(lang.get("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.get("PlayerStatusReady"));
playerStatuses.push_back(lang.getString("PlayerStatusSetup"));
playerStatuses.push_back(lang.getString("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerStatuses);
listBoxPlayerStatus.setSelectedItemIndex(2,true);
listBoxPlayerStatus.setTextColor(Vec3f(0.0f,1.0f,0.0f));
@ -354,7 +354,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
int scenarioY=140;
labelScenario.registerGraphicComponent(containerName,"labelScenario");
labelScenario.init(scenarioX, scenarioY);
labelScenario.setText(lang.get("Scenario"));
labelScenario.setText(lang.getString("Scenario"));
listBoxScenario.registerGraphicComponent(containerName,"listBoxScenario");
listBoxScenario.init(scenarioX, scenarioY-30,190);
checkBoxScenario.registerGraphicComponent(containerName,"checkBoxScenario");
@ -407,7 +407,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
// Advanced Options
labelAdvanced.registerGraphicComponent(containerName,"labelAdvanced");
labelAdvanced.init(810, 80, 80);
labelAdvanced.setText(lang.get("AdvancedGameOptions"));
labelAdvanced.setText(lang.getString("AdvancedGameOptions"));
checkBoxAdvanced.registerGraphicComponent(containerName,"checkBoxAdvanced");
checkBoxAdvanced.init(810, 80-labelOffset);
@ -419,7 +419,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelPublishServer.registerGraphicComponent(containerName,"labelPublishServer");
labelPublishServer.init(50, networkHeadPos, 100);
labelPublishServer.setText(lang.get("PublishServer"));
labelPublishServer.setText(lang.getString("PublishServer"));
checkBoxPublishServer.registerGraphicComponent(containerName,"checkBoxPublishServer");
checkBoxPublishServer.init(50, networkPos);
@ -449,7 +449,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
bool allowInProgressJoin = Config::getInstance().getBool("EnableJoinInProgressGame","false");
labelAllowInGameJoinPlayer.registerGraphicComponent(containerName,"labelAllowInGameJoinPlayer");
labelAllowInGameJoinPlayer.init(xoffset+410, 670, 80);
labelAllowInGameJoinPlayer.setText(lang.get("AllowInGameJoinPlayer"));
labelAllowInGameJoinPlayer.setText(lang.getString("AllowInGameJoinPlayer"));
labelAllowInGameJoinPlayer.setVisible(allowInProgressJoin);
checkBoxAllowInGameJoinPlayer.registerGraphicComponent(containerName,"checkBoxAllowInGameJoinPlayer");
@ -462,7 +462,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
// Network Pause for lagged clients
labelNetworkPauseGameForLaggedClients.registerGraphicComponent(containerName,"labelNetworkPauseGameForLaggedClients");
labelNetworkPauseGameForLaggedClients.init(labelAllowInGameJoinPlayer.getX(), networkHeadPos, 80);
labelNetworkPauseGameForLaggedClients.setText(lang.get("NetworkPauseGameForLaggedClients"));
labelNetworkPauseGameForLaggedClients.setText(lang.getString("NetworkPauseGameForLaggedClients"));
checkBoxNetworkPauseGameForLaggedClients.registerGraphicComponent(containerName,"checkBoxNetworkPauseGameForLaggedClients");
checkBoxNetworkPauseGameForLaggedClients.init(checkBoxAllowInGameJoinPlayer.getX(), networkHeadPos);
@ -489,7 +489,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
buttonBlockPlayers[i].registerGraphicComponent(containerName,"buttonBlockPlayers" + intToStr(i));
//buttonBlockPlayers[i].init(xoffset+355, setupPos-30-i*rowHeight, 70);
buttonBlockPlayers[i].init(xoffset+210, setupPos-30-i*rowHeight, 70);
buttonBlockPlayers[i].setText(lang.get("BlockPlayer"));
buttonBlockPlayers[i].setText(lang.getString("BlockPlayer"));
buttonBlockPlayers[i].setFont(CoreData::getInstance().getDisplayFontSmall());
buttonBlockPlayers[i].setFont3D(CoreData::getInstance().getDisplayFontSmall3D());
@ -514,18 +514,18 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelControl.registerGraphicComponent(containerName,"labelControl");
labelControl.init(xoffset+170, setupPos, GraphicListBox::defW, GraphicListBox::defH, true);
labelControl.setText(lang.get("Control"));
labelControl.setText(lang.getString("Control"));
labelRMultiplier.registerGraphicComponent(containerName,"labelRMultiplier");
labelRMultiplier.init(xoffset+310, setupPos, GraphicListBox::defW, GraphicListBox::defH, true);
labelFaction.registerGraphicComponent(containerName,"labelFaction");
labelFaction.init(xoffset+390, setupPos, GraphicListBox::defW, GraphicListBox::defH, true);
labelFaction.setText(lang.get("Faction"));
labelFaction.setText(lang.getString("Faction"));
labelTeam.registerGraphicComponent(containerName,"labelTeam");
labelTeam.init(xoffset+650, setupPos, 50, GraphicListBox::defH, true);
labelTeam.setText(lang.get("Team"));
labelTeam.setText(lang.getString("Team"));
labelControl.setFont(CoreData::getInstance().getMenuFontBig());
labelControl.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -539,26 +539,26 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
//xoffset=100;
//texts
buttonClearBlockedPlayers.setText(lang.get("BlockPlayerClear"));
buttonReturn.setText(lang.get("Return"));
buttonPlayNow.setText(lang.get("PlayNow"));
buttonRestoreLastSettings.setText(lang.get("ReloadLastGameSettings"));
buttonClearBlockedPlayers.setText(lang.getString("BlockPlayerClear"));
buttonReturn.setText(lang.getString("Return"));
buttonPlayNow.setText(lang.getString("PlayNow"));
buttonRestoreLastSettings.setText(lang.getString("ReloadLastGameSettings"));
vector<string> controlItems;
controlItems.push_back(lang.get("Closed"));
controlItems.push_back(lang.get("CpuEasy"));
controlItems.push_back(lang.get("Cpu"));
controlItems.push_back(lang.get("CpuUltra"));
controlItems.push_back(lang.get("CpuMega"));
controlItems.push_back(lang.get("Network"));
controlItems.push_back(lang.get("NetworkUnassigned"));
controlItems.push_back(lang.get("Human"));
controlItems.push_back(lang.getString("Closed"));
controlItems.push_back(lang.getString("CpuEasy"));
controlItems.push_back(lang.getString("Cpu"));
controlItems.push_back(lang.getString("CpuUltra"));
controlItems.push_back(lang.getString("CpuMega"));
controlItems.push_back(lang.getString("Network"));
controlItems.push_back(lang.getString("NetworkUnassigned"));
controlItems.push_back(lang.getString("Human"));
if(config.getBool("EnableNetworkCpu","false") == true) {
controlItems.push_back(lang.get("NetworkCpuEasy"));
controlItems.push_back(lang.get("NetworkCpu"));
controlItems.push_back(lang.get("NetworkCpuUltra"));
controlItems.push_back(lang.get("NetworkCpuMega"));
controlItems.push_back(lang.getString("NetworkCpuEasy"));
controlItems.push_back(lang.getString("NetworkCpu"));
controlItems.push_back(lang.getString("NetworkCpuUltra"));
controlItems.push_back(lang.getString("NetworkCpuMega"));
}
vector<string> teamItems;
@ -582,7 +582,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelPlayerStatus[i].setH(16);
labelPlayerStatus[i].setW(12);
//labelPlayers[i].setText(lang.get("Player")+" "+intToStr(i));
//labelPlayers[i].setText(lang.getString("Player")+" "+intToStr(i));
labelPlayers[i].setText(intToStr(i+1));
labelPlayerNames[i].setText("*");
labelPlayerNames[i].setMaxEditWidth(16);
@ -647,7 +647,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
// write hint to console:
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
console.addLine(lang.get("ToSwitchOffMusicPress") + " - \"" + configKeys.getString("ToggleMusic") + "\"");
console.addLine(lang.getString("ToSwitchOffMusicPress") + " - \"" + configKeys.getString("ToggleMusic") + "\"");
chatManager.init(&console, -1,true);
@ -684,7 +684,7 @@ void MenuStateCustomGame::reloadUI() {
Config &config = Config::getInstance();
console.resetFonts();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
if(EndsWith(glestVersionString, "-dev") == false){
@ -711,42 +711,42 @@ void MenuStateCustomGame::reloadUI() {
string serverPort=config.getString("PortServer", intToStr(GameConstants::serverPort).c_str());
string externalPort=config.getString("PortExternal", serverPort.c_str());
labelLocalIP.setText(lang.get("LanIP") + ipText + " ( "+serverPort+" / "+externalPort+" )");
labelLocalIP.setText(lang.getString("LanIP") + ipText + " ( "+serverPort+" / "+externalPort+" )");
labelMap.setText(lang.get("Map")+":");
labelMap.setText(lang.getString("Map")+":");
labelMapFilter.setText(lang.get("MapFilter")+":");
labelMapFilter.setText(lang.getString("MapFilter")+":");
labelTileset.setText(lang.get("Tileset"));
labelTileset.setText(lang.getString("Tileset"));
labelTechTree.setText(lang.get("TechTree"));
labelTechTree.setText(lang.getString("TechTree"));
labelAllowNativeLanguageTechtree.setText(lang.get("AllowNativeLanguageTechtree"));
labelAllowNativeLanguageTechtree.setText(lang.getString("AllowNativeLanguageTechtree"));
labelFogOfWar.setText(lang.get("FogOfWar"));
labelFogOfWar.setText(lang.getString("FogOfWar"));
std::vector<std::string> listBoxData;
listBoxData.push_back(lang.get("Enabled"));
listBoxData.push_back(lang.get("Explored"));
listBoxData.push_back(lang.get("Disabled"));
listBoxData.push_back(lang.getString("Enabled"));
listBoxData.push_back(lang.getString("Explored"));
listBoxData.push_back(lang.getString("Disabled"));
listBoxFogOfWar.setItems(listBoxData);
// Allow Observers
labelAllowObservers.setText(lang.get("AllowObservers"));
labelAllowObservers.setText(lang.getString("AllowObservers"));
// Allow Switch Team Mode
labelEnableSwitchTeamMode.setText(lang.get("EnableSwitchTeamMode"));
labelEnableSwitchTeamMode.setText(lang.getString("EnableSwitchTeamMode"));
labelAllowInGameJoinPlayer.setText(lang.get("AllowInGameJoinPlayer"));
labelAllowInGameJoinPlayer.setText(lang.getString("AllowInGameJoinPlayer"));
labelAISwitchTeamAcceptPercent.setText(lang.get("AISwitchTeamAcceptPercent"));
labelAISwitchTeamAcceptPercent.setText(lang.getString("AISwitchTeamAcceptPercent"));
listBoxData.clear();
// Advanced Options
labelAdvanced.setText(lang.get("AdvancedGameOptions"));
labelAdvanced.setText(lang.getString("AdvancedGameOptions"));
labelPublishServer.setText(lang.get("PublishServer"));
labelPublishServer.setText(lang.getString("PublishServer"));
labelGameName.setFont(CoreData::getInstance().getMenuFontBig());
labelGameName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -757,17 +757,17 @@ void MenuStateCustomGame::reloadUI() {
labelGameName.setText("headless ("+defaultPlayerName+")");
}
labelNetworkPauseGameForLaggedClients.setText(lang.get("NetworkPauseGameForLaggedClients"));
labelNetworkPauseGameForLaggedClients.setText(lang.getString("NetworkPauseGameForLaggedClients"));
for(int i=0; i < GameConstants::maxPlayers; ++i) {
buttonBlockPlayers[i].setText(lang.get("BlockPlayer"));
buttonBlockPlayers[i].setText(lang.getString("BlockPlayer"));
}
labelControl.setText(lang.get("Control"));
labelControl.setText(lang.getString("Control"));
labelFaction.setText(lang.get("Faction"));
labelFaction.setText(lang.getString("Faction"));
labelTeam.setText(lang.get("Team"));
labelTeam.setText(lang.getString("Team"));
labelControl.setFont(CoreData::getInstance().getMenuFontBig());
labelControl.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -779,26 +779,26 @@ void MenuStateCustomGame::reloadUI() {
labelTeam.setFont3D(CoreData::getInstance().getMenuFontBig3D());
//texts
buttonClearBlockedPlayers.setText(lang.get("BlockPlayerClear"));
buttonReturn.setText(lang.get("Return"));
buttonPlayNow.setText(lang.get("PlayNow"));
buttonRestoreLastSettings.setText(lang.get("ReloadLastGameSettings"));
buttonClearBlockedPlayers.setText(lang.getString("BlockPlayerClear"));
buttonReturn.setText(lang.getString("Return"));
buttonPlayNow.setText(lang.getString("PlayNow"));
buttonRestoreLastSettings.setText(lang.getString("ReloadLastGameSettings"));
vector<string> controlItems;
controlItems.push_back(lang.get("Closed"));
controlItems.push_back(lang.get("CpuEasy"));
controlItems.push_back(lang.get("Cpu"));
controlItems.push_back(lang.get("CpuUltra"));
controlItems.push_back(lang.get("CpuMega"));
controlItems.push_back(lang.get("Network"));
controlItems.push_back(lang.get("NetworkUnassigned"));
controlItems.push_back(lang.get("Human"));
controlItems.push_back(lang.getString("Closed"));
controlItems.push_back(lang.getString("CpuEasy"));
controlItems.push_back(lang.getString("Cpu"));
controlItems.push_back(lang.getString("CpuUltra"));
controlItems.push_back(lang.getString("CpuMega"));
controlItems.push_back(lang.getString("Network"));
controlItems.push_back(lang.getString("NetworkUnassigned"));
controlItems.push_back(lang.getString("Human"));
if(config.getBool("EnableNetworkCpu","false") == true) {
controlItems.push_back(lang.get("NetworkCpuEasy"));
controlItems.push_back(lang.get("NetworkCpu"));
controlItems.push_back(lang.get("NetworkCpuUltra"));
controlItems.push_back(lang.get("NetworkCpuMega"));
controlItems.push_back(lang.getString("NetworkCpuEasy"));
controlItems.push_back(lang.getString("NetworkCpu"));
controlItems.push_back(lang.getString("NetworkCpuUltra"));
controlItems.push_back(lang.getString("NetworkCpuMega"));
}
for(int i=0; i < GameConstants::maxPlayers; ++i) {
@ -807,22 +807,22 @@ void MenuStateCustomGame::reloadUI() {
listBoxControls[i].setItems(controlItems);
}
labelFallbackCpuMultiplier.setText(lang.get("FallbackCpuMultiplier"));
labelFallbackCpuMultiplier.setText(lang.getString("FallbackCpuMultiplier"));
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
vector<string> playerStatuses;
playerStatuses.push_back(lang.get("PlayerStatusSetup"));
playerStatuses.push_back(lang.get("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.get("PlayerStatusReady"));
playerStatuses.push_back(lang.getString("PlayerStatusSetup"));
playerStatuses.push_back(lang.getString("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerStatuses);
labelScenario.setText(lang.get("Scenario"));
labelScenario.setText(lang.getString("Scenario"));
// write hint to console:
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
console.addLine(lang.get("ToSwitchOffMusicPress") + " - \"" + configKeys.getString("ToggleMusic") + "\"");
console.addLine(lang.getString("ToSwitchOffMusicPress") + " - \"" + configKeys.getString("ToggleMusic") + "\"");
chatManager.init(&console, -1,true);
@ -1333,7 +1333,7 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) {
for(unsigned int j = 0; j < languageList.size(); ++j) {
char szMsg[8096]="";
if(lang.hasString("BlockPlayerServerMsg",languageList[j]) == true) {
snprintf(szMsg,8096,lang.get("BlockPlayerServerMsg",languageList[j]).c_str(),serverInterface->getSlot(i)->getIpAddress().c_str());
snprintf(szMsg,8096,lang.getString("BlockPlayerServerMsg",languageList[j]).c_str(),serverInterface->getSlot(i)->getIpAddress().c_str());
}
else {
snprintf(szMsg,8096,"The server has temporarily blocked IP Address [%s] from this game.",serverInterface->getSlot(i)->getIpAddress().c_str());
@ -1639,7 +1639,7 @@ void MenuStateCustomGame::PlayNow(bool saveGame) {
Lang &lang= Lang::getInstance();
char szMsg[8096]="";
if(lang.hasString("NetworkSlotUnassignedErrorUI") == true) {
strcpy(szMsg,lang.get("NetworkSlotUnassignedErrorUI").c_str());
strcpy(szMsg,lang.getString("NetworkSlotUnassignedErrorUI").c_str());
}
else {
strcpy(szMsg,"Cannot start game.\nSome player(s) are not in a network game slot!");
@ -1651,7 +1651,7 @@ void MenuStateCustomGame::PlayNow(bool saveGame) {
for(unsigned int j = 0; j < languageList.size(); ++j) {
char szMsg[8096]="";
if(lang.hasString("NetworkSlotUnassignedError",languageList[j]) == true) {
strcpy(szMsg,lang.get("NetworkSlotUnassignedError").c_str());
strcpy(szMsg,lang.getString("NetworkSlotUnassignedError").c_str());
}
else {
strcpy(szMsg,"Cannot start game, some player(s) are not in a network game slot!");
@ -1704,13 +1704,13 @@ void MenuStateCustomGame::PlayNow(bool saveGame) {
Lang &lang= Lang::getInstance();
char szMsg[1024]="";
strcpy(szMsg,lang.get("NetworkSlotNoHumanErrorUI","",true).c_str());
strcpy(szMsg,lang.getString("NetworkSlotNoHumanErrorUI","",true).c_str());
showMessageBox(szMsg, "", false);
const vector<string> languageList = serverInterface->getGameSettings()->getUniqueNetworkPlayerLanguages();
for(unsigned int j = 0; j < languageList.size(); ++j) {
char szMsg[1024]="";
strcpy(szMsg,lang.get("NetworkSlotNoHumanError","",true).c_str());
strcpy(szMsg,lang.getString("NetworkSlotNoHumanError","",true).c_str());
serverInterface->sendTextMessage(szMsg,-1, true,languageList[j]);
}
@ -2113,7 +2113,7 @@ void MenuStateCustomGame::switchSetupForSlots(SwitchSetupRequest **switchSetupRe
if(switchSetupRequests[i]->getSelectedFactionName() != "" &&
(slot != NULL && switchSetupRequests[i]->getSelectedFactionName() !=
Lang::getInstance().get("DataMissing",slot->getNetworkPlayerLanguage(),true))) {
Lang::getInstance().getString("DataMissing",slot->getNetworkPlayerLanguage(),true))) {
listBoxFactions[newFactionIdx].setSelectedItem(switchSetupRequests[i]->getSelectedFactionName());
}
if(switchSetupRequests[i]->getToTeam() != -1) {
@ -2150,7 +2150,7 @@ void MenuStateCustomGame::switchSetupForSlots(SwitchSetupRequest **switchSetupRe
if(switchSetupRequests[i]->getSelectedFactionName() != "" &&
(slot != NULL && switchSetupRequests[i]->getSelectedFactionName() !=
Lang::getInstance().get("DataMissing",slot->getNetworkPlayerLanguage(),true))) {
Lang::getInstance().getString("DataMissing",slot->getNetworkPlayerLanguage(),true))) {
listBoxFactions[i].setSelectedItem(switchSetupRequests[i]->getSelectedFactionName());
}
if(switchSetupRequests[i]->getToTeam() != -1) {
@ -2260,19 +2260,19 @@ void MenuStateCustomGame::update() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
if(EndsWith(masterServererErrorToShow, "wrong router setup") == true) {
masterServererErrorToShow=lang.get("WrongRouterSetup");
masterServererErrorToShow=lang.getString("WrongRouterSetup");
}
Lang &lang= Lang::getInstance();
string publishText = " (disabling publish)";
if(lang.hasString("PublishDisabled") == true) {
publishText = lang.get("PublishDisabled");
publishText = lang.getString("PublishDisabled");
}
masterServererErrorToShow += publishText;
showMasterserverError=false;
mainMessageBoxState=1;
showMessageBox( masterServererErrorToShow, lang.get("ErrorFromMasterserver"), false);
showMessageBox( masterServererErrorToShow, lang.getString("ErrorFromMasterserver"), false);
if(this->headlessServerMode == false) {
checkBoxPublishServer.setValue(false);
@ -3327,7 +3327,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, playername is AI (blank)\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i);
Lang &lang= Lang::getInstance();
gameSettings->setNetworkPlayerName(slotIndex, lang.get("AI") + intToStr(AIPlayerCount));
gameSettings->setNetworkPlayerName(slotIndex, lang.getString("AI") + intToStr(AIPlayerCount));
labelPlayerNames[i].setText("");
}
if (listBoxControls[i].getSelectedItemIndex() == ctHuman) {
@ -3661,7 +3661,7 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin
//printf("In [%s::%s line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
checkBoxAllowObservers.setValue(gameSettings.getAllowObservers() == true ? true : false);
//listBoxEnableObserverMode.setSelectedItem(gameSettings.getEnableObserverModeAtEndGame() == true ? lang.get("Yes") : lang.get("No"));
//listBoxEnableObserverMode.setSelectedItem(gameSettings.getEnableObserverModeAtEndGame() == true ? lang.getString("Yes") : lang.getString("No"));
checkBoxEnableSwitchTeamMode.setValue((gameSettings.getFlagTypes1() & ft1_allow_team_switching) == ft1_allow_team_switching ? true : false);
listBoxAISwitchTeamAcceptPercent.setSelectedItem(intToStr(gameSettings.getAiAcceptSwitchTeamPercentChance()));
@ -3677,9 +3677,9 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin
//listBoxPathFinderType.setSelectedItemIndex(gameSettings.getPathFinderType());
//listBoxEnableServerControlledAI.setSelectedItem(gameSettings.getEnableServerControlledAI() == true ? lang.get("Yes") : lang.get("No"));
//listBoxEnableServerControlledAI.setSelectedItem(gameSettings.getEnableServerControlledAI() == true ? lang.getString("Yes") : lang.getString("No"));
//labelNetworkFramePeriod.setText(lang.get("NetworkFramePeriod"));
//labelNetworkFramePeriod.setText(lang.getString("NetworkFramePeriod"));
//listBoxNetworkFramePeriod.setSelectedItem(intToStr(gameSettings.getNetworkFramePeriod()/10*10));
@ -3800,7 +3800,7 @@ bool MenuStateCustomGame::hasNetworkGameSettings() {
void MenuStateCustomGame::loadMapInfo(string file, MapInfo *mapInfo, bool loadMapPreview) {
try {
Lang &lang= Lang::getInstance();
if(MapPreview::loadMapInfo(file, mapInfo, lang.get("MaxPlayers"),lang.get("Size"),true) == true) {
if(MapPreview::loadMapInfo(file, mapInfo, lang.getString("MaxPlayers"),lang.getString("Size"),true) == true) {
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
if(serverInterface->getSlot(i) != NULL &&
@ -3962,7 +3962,7 @@ void MenuStateCustomGame::updateNetworkSlots() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
showGeneralError=true;
if(serverInterface->isPortBound() == false) {
generalErrorToShow = Lang::getInstance().get("ErrorBindingPort") + " : " + intToStr(serverInterface->getBindPort());
generalErrorToShow = Lang::getInstance().getString("ErrorBindingPort") + " : " + intToStr(serverInterface->getBindPort());
}
else {
generalErrorToShow = ex.what();
@ -4049,20 +4049,20 @@ void MenuStateCustomGame::keyDown(SDL_KeyboardEvent key) {
float currentVolume = CoreData::getInstance().getMenuMusic()->getVolume();
if(currentVolume > 0) {
CoreData::getInstance().getMenuMusic()->setVolume(0.f);
console.addLine(lang.get("GameMusic") + " " + lang.get("Off"));
console.addLine(lang.getString("GameMusic") + " " + lang.getString("Off"));
}
else {
CoreData::getInstance().getMenuMusic()->setVolume(configVolume);
//If the config says zero, use the default music volume
//gameMusic->setVolume(configVolume ? configVolume : 0.9);
console.addLine(lang.get("GameMusic"));
console.addLine(lang.getString("GameMusic"));
}
}
//else if(key == configKeys.getCharKey("SaveGUILayout")) {
else if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
bool saved = GraphicComponent::saveAllCustomProperties(containerName);
Lang &lang= Lang::getInstance();
console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}
}

View File

@ -34,7 +34,7 @@ MenuStateGraphicInfo::MenuStateGraphicInfo(Program *program, MainMenu *mainMenu)
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(100, 540, 125);
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
labelInfo.registerGraphicComponent(containerName,"labelInfo");
labelInfo.init(0, 730);
@ -81,7 +81,7 @@ void MenuStateGraphicInfo::reloadUI() {
Lang &lang= Lang::getInstance();
console.resetFonts();
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
labelMoreInfo.setFont(CoreData::getInstance().getDisplayFontSmall());
labelMoreInfo.setFont3D(CoreData::getInstance().getDisplayFontSmall3D());
@ -150,7 +150,7 @@ void MenuStateGraphicInfo::keyDown(SDL_KeyboardEvent key) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}

View File

@ -90,37 +90,37 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
//buttons
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(300, 300, 125);
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
buttonConnect.registerGraphicComponent(containerName,"buttonConnect");
buttonConnect.init(450, 300, 125);
buttonConnect.setText(lang.get("Connect"));
buttonConnect.setText(lang.getString("Connect"));
buttonCreateGame.registerGraphicComponent(containerName,"buttonCreateGame");
buttonCreateGame.init(450, 250, 125);
buttonCreateGame.setText(lang.get("HostGame"));
buttonCreateGame.setText(lang.getString("HostGame"));
buttonAutoFindServers.registerGraphicComponent(containerName,"buttonAutoFindServers");
buttonAutoFindServers.init(595, 300, 225);
buttonAutoFindServers.setText(lang.get("FindLANGames"));
buttonAutoFindServers.setText(lang.getString("FindLANGames"));
buttonAutoFindServers.setEnabled(true);
//server type label
labelServerType.registerGraphicComponent(containerName,"labelServerType");
labelServerType.init(330, 490);
labelServerType.setText(lang.get("ServerType") + ":");
labelServerType.setText(lang.getString("ServerType") + ":");
//server type list box
listBoxServerType.registerGraphicComponent(containerName,"listBoxServerType");
listBoxServerType.init(465, 490);
listBoxServerType.pushBackItem(lang.get("ServerTypeNew"));
listBoxServerType.pushBackItem(lang.get("ServerTypePrevious"));
listBoxServerType.pushBackItem(lang.get("ServerTypeFound"));
listBoxServerType.pushBackItem(lang.getString("ServerTypeNew"));
listBoxServerType.pushBackItem(lang.getString("ServerTypePrevious"));
listBoxServerType.pushBackItem(lang.getString("ServerTypeFound"));
//server label
labelServer.registerGraphicComponent(containerName,"labelServer");
labelServer.init(330, 460);
labelServer.setText(lang.get("Server") + ": ");
labelServer.setText(lang.getString("Server") + ": ");
//server listbox
listBoxServers.registerGraphicComponent(containerName,"listBoxServers");
@ -143,7 +143,7 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
// server port
labelServerPortLabel.registerGraphicComponent(containerName,"labelServerPortLabel");
labelServerPortLabel.init(330,430);
labelServerPortLabel.setText(lang.get("ServerPort"));
labelServerPortLabel.setText(lang.getString("ServerPort"));
labelServerPort.registerGraphicComponent(containerName,"labelServerPort");
labelServerPort.init(465,430);
@ -216,21 +216,21 @@ void MenuStateJoinGame::reloadUI() {
console.resetFonts();
buttonReturn.setText(lang.get("Return"));
buttonConnect.setText(lang.get("Connect"));
buttonCreateGame.setText(lang.get("HostGame"));
buttonAutoFindServers.setText(lang.get("FindLANGames"));
labelServerType.setText(lang.get("ServerType") + ":");
buttonReturn.setText(lang.getString("Return"));
buttonConnect.setText(lang.getString("Connect"));
buttonCreateGame.setText(lang.getString("HostGame"));
buttonAutoFindServers.setText(lang.getString("FindLANGames"));
labelServerType.setText(lang.getString("ServerType") + ":");
std::vector<string> listboxData;
listboxData.push_back(lang.get("ServerTypeNew"));
listboxData.push_back(lang.get("ServerTypePrevious"));
listboxData.push_back(lang.get("ServerTypeFound"));
listboxData.push_back(lang.getString("ServerTypeNew"));
listboxData.push_back(lang.getString("ServerTypePrevious"));
listboxData.push_back(lang.getString("ServerTypeFound"));
listBoxServerType.setItems(listboxData);
labelServer.setText(lang.get("Server") + ": ");
labelServer.setText(lang.getString("Server") + ": ");
labelServerPortLabel.setText(lang.get("ServerPort"));
labelServerPortLabel.setText(lang.getString("ServerPort"));
string host = labelServerIp.getText();
int portNumber = config.getInt("PortServer",intToStr(GameConstants::serverPort).c_str());
@ -488,11 +488,11 @@ void MenuStateJoinGame::update()
//update status label
if(clientInterface->isConnected())
{
buttonConnect.setText(lang.get("Disconnect"));
buttonConnect.setText(lang.getString("Disconnect"));
if(clientInterface->getAllowDownloadDataSynch() == false)
{
string label = lang.get("ConnectedToServer");
string label = lang.getString("ConnectedToServer");
if(!clientInterface->getServerName().empty())
{
@ -524,7 +524,7 @@ void MenuStateJoinGame::update()
}
else
{
string label = lang.get("ConnectedToServer");
string label = lang.getString("ConnectedToServer");
if(!clientInterface->getServerName().empty())
{
@ -558,8 +558,8 @@ void MenuStateJoinGame::update()
}
else
{
buttonConnect.setText(lang.get("Connect"));
string connectedStatus = lang.get("NotConnected");
buttonConnect.setText(lang.getString("Connect"));
string connectedStatus = lang.getString("NotConnected");
if(buttonAutoFindServers.getEnabled() == false) {
connectedStatus += " - searching for servers, please wait...";
}
@ -582,7 +582,7 @@ void MenuStateJoinGame::update()
//intro
if(clientInterface->getIntroDone()) {
labelInfo.setText(lang.get("WaitingHost"));
labelInfo.setText(lang.getString("WaitingHost"));
string host = labelServerIp.getText();
std::vector<std::string> hostPartsList;
@ -653,7 +653,7 @@ void MenuStateJoinGame::keyDown(SDL_KeyboardEvent key) {
else if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
bool saved = GraphicComponent::saveAllCustomProperties(containerName);
Lang &lang= Lang::getInstance();
console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}
else {
@ -668,7 +668,7 @@ void MenuStateJoinGame::keyDown(SDL_KeyboardEvent key) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
bool saved = GraphicComponent::saveAllCustomProperties(containerName);
Lang &lang= Lang::getInstance();
console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}
}

View File

@ -57,46 +57,46 @@ MenuStateKeysetup::MenuStateKeysetup(Program *program, MainMenu *mainMenu,
buttonAudioSection.init(0, 720,tabButtonWidth,tabButtonHeight);
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
// Video Section
buttonVideoSection.registerGraphicComponent(containerName,"labelVideoSection");
buttonVideoSection.init(200, 720,tabButtonWidth,tabButtonHeight);
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
//currentLine-=lineOffset;
//MiscSection
buttonMiscSection.registerGraphicComponent(containerName,"labelMiscSection");
buttonMiscSection.init(400, 720,tabButtonWidth,tabButtonHeight);
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
//NetworkSettings
buttonNetworkSettings.registerGraphicComponent(containerName,"labelNetworkSettingsSection");
buttonNetworkSettings.init(600, 720,tabButtonWidth,tabButtonHeight);
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
//KeyboardSetup
buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup");
buttonKeyboardSetup.init(800, 700,tabButtonWidth,tabButtonHeight+20);
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
}
// header
labelTitle.registerGraphicComponent(containerName,"labelTitle");
labelTitle.init(360,670);
labelTitle.setFont(CoreData::getInstance().getMenuFontBig());
labelTitle.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelTitle.setText(lang.get("Keyboardsetup"));
labelTitle.setText(lang.getString("Keyboardsetup"));
labelTestTitle.registerGraphicComponent(containerName,"labelTestTitle");
labelTestTitle.init(50,170);
labelTestTitle.setFont(CoreData::getInstance().getMenuFontBig());
labelTestTitle.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelTestTitle.setText(lang.get("KeyboardsetupTest"));
labelTestTitle.setText(lang.getString("KeyboardsetupTest"));
labelTestValue.registerGraphicComponent(containerName,"labelTestValue");
labelTestValue.init(50,140);
@ -106,7 +106,7 @@ MenuStateKeysetup::MenuStateKeysetup(Program *program, MainMenu *mainMenu,
// mainMassegeBox
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -120,15 +120,15 @@ MenuStateKeysetup::MenuStateKeysetup(Program *program, MainMenu *mainMenu,
// buttons
buttonOk.registerGraphicComponent(containerName,"buttonOk");
buttonOk.init(200, buttonRowPos, 100);
buttonOk.setText(lang.get("Save"));
buttonOk.setText(lang.getString("Save"));
buttonDefaults.registerGraphicComponent(containerName,"buttonDefaults");
buttonDefaults.init(310, buttonRowPos, 100);
buttonDefaults.setText(lang.get("Defaults"));
buttonDefaults.setText(lang.getString("Defaults"));
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(420, buttonRowPos, 100);
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
keyButtonsLineHeight=30;
keyButtonsHeight=25;
@ -207,23 +207,23 @@ void MenuStateKeysetup::reloadUI() {
console.resetFonts();
labelTitle.setFont(CoreData::getInstance().getMenuFontBig());
labelTitle.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelTitle.setText(lang.get("Keyboardsetup"));
labelTitle.setText(lang.getString("Keyboardsetup"));
labelTestTitle.setFont(CoreData::getInstance().getMenuFontBig());
labelTestTitle.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelTestTitle.setText(lang.get("KeyboardsetupTest"));
labelTestTitle.setText(lang.getString("KeyboardsetupTest"));
labelTestValue.setFont(CoreData::getInstance().getMenuFontBig());
labelTestValue.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelTestValue.setText("");
// mainMassegeBox
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
buttonDefaults.setText(lang.get("Defaults"));
buttonDefaults.setText(lang.getString("Defaults"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -329,7 +329,7 @@ void MenuStateKeysetup::mouseClick(int x, int y, MouseButton mouseButton){
}
Lang &lang= Lang::getInstance();
console.addLine(lang.get("SettingsSaved"));
console.addLine(lang.getString("SettingsSaved"));
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
else if ( keyScrollBar.getElementCount() != 0) {

View File

@ -73,25 +73,25 @@ MenuStateLoadGame::MenuStateLoadGame(Program *program, MainMenu *mainMenu):
headerLabel.init(400, 730);
headerLabel.setFont(CoreData::getInstance().getMenuFontBig());
headerLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
headerLabel.setText(lang.get("LoadGameMenu"));
headerLabel.setText(lang.getString("LoadGameMenu"));
noSavedGamesLabel.registerGraphicComponent(containerName,"noSavedGamesLabel");
noSavedGamesLabel.init(20, 400);
noSavedGamesLabel.setFont(CoreData::getInstance().getMenuFontBig());
noSavedGamesLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
noSavedGamesLabel.setText(lang.get("NoSavedGames"));
noSavedGamesLabel.setText(lang.getString("NoSavedGames"));
savedGamesLabel.registerGraphicComponent(containerName,"savedGamesLabel");
savedGamesLabel.init(120, slotLinesYBase+slotsLineHeight+10);
savedGamesLabel.setFont(CoreData::getInstance().getMenuFontBig());
savedGamesLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
savedGamesLabel.setText(lang.get("SavedGames"));
savedGamesLabel.setText(lang.getString("SavedGames"));
infoHeaderLabel.registerGraphicComponent(containerName,"infoHeaderLabel");
infoHeaderLabel.init(650, slotLinesYBase+slotsLineHeight+10);
infoHeaderLabel.setFont(CoreData::getInstance().getMenuFontBig());
infoHeaderLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
infoHeaderLabel.setText(lang.get("SavegameInfo"));
infoHeaderLabel.setText(lang.getString("SavegameInfo"));
infoTextLabel.registerGraphicComponent(containerName,"infoTextLabel");
infoTextLabel.init(550, 350);
@ -102,15 +102,15 @@ MenuStateLoadGame::MenuStateLoadGame(Program *program, MainMenu *mainMenu):
abortButton.registerGraphicComponent(containerName,"abortButton");
abortButton.init(xPos, yPos, buttonWidth);
abortButton.setText(lang.get("Abort"));
abortButton.setText(lang.getString("Abort"));
xPos+=buttonWidth+xSpacing;
loadButton.registerGraphicComponent(containerName,"loadButton");
loadButton.init(xPos, yPos, buttonWidth);
loadButton.setText(lang.get("LoadGame"));
loadButton.setText(lang.getString("LoadGame"));
xPos+=buttonWidth+xSpacing;
deleteButton.registerGraphicComponent(containerName,"deleteButton");
deleteButton.init(xPos, yPos, buttonWidth);
deleteButton.setText(lang.get("Delete"));
deleteButton.setText(lang.getString("Delete"));
slotsScrollBar.init(500-20,slotLinesYBase-slotsLineHeight*(slotsToRender-1),false,slotWidth,20);
slotsScrollBar.setLength(slotsLineHeight*slotsToRender);
@ -122,7 +122,7 @@ MenuStateLoadGame::MenuStateLoadGame(Program *program, MainMenu *mainMenu):
slotsScrollBar.setElementCount(filenames.size());
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
mainMessageBox.setEnabled(false);
GraphicComponent::applyAllCustomProperties(containerName);
@ -183,11 +183,11 @@ void MenuStateLoadGame::listFiles() {
void MenuStateLoadGame::reloadUI() {
Lang &lang= Lang::getInstance();
abortButton.setText(lang.get("Abort"));
deleteButton.setText(lang.get("Delete"));
loadButton.setText(lang.get("LoadGame"));
abortButton.setText(lang.getString("Abort"));
deleteButton.setText(lang.getString("Delete"));
loadButton.setText(lang.getString("LoadGame"));
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -204,7 +204,7 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
}
}
if(abortButton.mouseClick(x, y)) {
@ -224,7 +224,7 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
Lang &lang= Lang::getInstance();
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("LoadGameDeletingFile","",true).c_str(),filename.c_str());
snprintf(szBuf,8096,lang.getString("LoadGameDeletingFile","",true).c_str(),filename.c_str());
console.addLineOnly(szBuf);
for(int i = 0; i < slots.size(); i++) {
@ -258,14 +258,14 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
Lang &lang= Lang::getInstance();
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("LoadGameLoadingFile","",true).c_str(),filename.c_str());
snprintf(szBuf,8096,lang.getString("LoadGameLoadingFile","",true).c_str(),filename.c_str());
console.addLineOnly(szBuf);
try {
Game::loadGame(filename,program,false);
}
catch(const megaglest_runtime_error &ex) {
showMessageBox(ex.what(), lang.get("Notice"), true);
showMessageBox(ex.what(), lang.getString("Notice"), true);
}
return;
}
@ -314,7 +314,7 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
string gameVer = versionNode->getAttribute("version")->getValue();
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
infoTextLabel.setText(szBuf);
}
else {
@ -324,7 +324,7 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
//LoadSavedGameInfo=Map: %s\nTileset: %s\nTech: %s\nScenario: %s\n# players: %d\nFaction: %s
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("LoadSavedGameInfo").c_str(),
snprintf(szBuf,8096,lang.getString("LoadSavedGameInfo").c_str(),
newGameSettings.getMap().c_str(),
newGameSettings.getTileset().c_str(),
newGameSettings.getTech().c_str(),
@ -442,7 +442,7 @@ void MenuStateLoadGame::keyDown(SDL_KeyboardEvent key) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}

View File

@ -95,7 +95,7 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
announcementLoaded=false;
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -120,10 +120,10 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
labelTitle.init(330, serverLinesYBase+40);
labelTitle.setFont(CoreData::getInstance().getMenuFontBig());
labelTitle.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelTitle.setText(lang.get("AvailableServers"));
labelTitle.setText(lang.getString("AvailableServers"));
if(Config::getInstance().getString("Masterserver","") == "") {
labelTitle.setText("*** " + lang.get("AvailableServers"));
labelTitle.setText("*** " + lang.getString("AvailableServers"));
}
// bottom
@ -139,70 +139,70 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
//i+=10;
glestVersionLabel.registerGraphicComponent(containerName,"glestVersionLabel");
glestVersionLabel.init(i,startOffset-lineOffset);
glestVersionLabel.setText(lang.get("MGVersion"));
glestVersionLabel.setText(lang.getString("MGVersion"));
i+=70;
platformLabel.registerGraphicComponent(containerName,"platformLabel");
platformLabel.init(i,startOffset-lineOffset);
platformLabel.setText(lang.get("MGPlatform"));
platformLabel.setText(lang.getString("MGPlatform"));
// i+=50;
// binaryCompileDateLabel.registerGraphicComponent(containerName,"binaryCompileDateLabel");
// binaryCompileDateLabel.init(i,startOffset-lineOffset);
// binaryCompileDateLabel.setText(lang.get("MGBuildDateTime"));
// binaryCompileDateLabel.setText(lang.getString("MGBuildDateTime"));
//game info:
i+=130;
serverTitleLabel.registerGraphicComponent(containerName,"serverTitleLabel");
serverTitleLabel.init(i,startOffset-lineOffset);
serverTitleLabel.setText(lang.get("MGGameTitle"));
serverTitleLabel.setText(lang.getString("MGGameTitle"));
i+=150;
countryLabel.registerGraphicComponent(containerName,"countryLabel");
countryLabel.init(i,startOffset-lineOffset);
countryLabel.setText(lang.get("MGGameCountry"));
countryLabel.setText(lang.getString("MGGameCountry"));
i+=65;
// ipAddressLabel.registerGraphicComponent(containerName,"ipAddressLabel");
// ipAddressLabel.init(i,startOffset-lineOffset);
// ipAddressLabel.setText(lang.get("MGGameIP"));
// ipAddressLabel.setText(lang.getString("MGGameIP"));
// i+=100;
//game setup info:
techLabel.registerGraphicComponent(containerName,"techLabel");
techLabel.init(i,startOffset-lineOffset);
techLabel.setText(lang.get("TechTree"));
techLabel.setText(lang.getString("TechTree"));
i+=120;
mapLabel.registerGraphicComponent(containerName,"mapLabel");
mapLabel.init(i,startOffset-lineOffset);
mapLabel.setText(lang.get("Map"));
mapLabel.setText(lang.getString("Map"));
i+=120;
// tilesetLabel.registerGraphicComponent(containerName,"tilesetLabel");
// tilesetLabel.init(i,startOffset-lineOffset);
// tilesetLabel.setText(lang.get("Tileset"));
// tilesetLabel.setText(lang.getString("Tileset"));
// i+=100;
activeSlotsLabel.registerGraphicComponent(containerName,"activeSlotsLabel");
activeSlotsLabel.init(i,startOffset-lineOffset);
activeSlotsLabel.setText(lang.get("MGGameSlots"));
activeSlotsLabel.setText(lang.getString("MGGameSlots"));
i+=50;
externalConnectPort.registerGraphicComponent(containerName,"externalConnectPort");
externalConnectPort.init(i,startOffset-lineOffset);
externalConnectPort.setText(lang.get("Port"));
externalConnectPort.setText(lang.getString("Port"));
i+=60;
statusLabel.registerGraphicComponent(containerName,"statusLabel");
statusLabel.init(i,startOffset-lineOffset);
statusLabel.setText(lang.get("MGGameStatus"));
statusLabel.setText(lang.getString("MGGameStatus"));
i+=130;
selectButton.registerGraphicComponent(containerName,"selectButton");
selectButton.init(i, startOffset-lineOffset);
selectButton.setText(lang.get("MGJoinGameSlots"));
selectButton.setText(lang.getString("MGJoinGameSlots"));
// Titles for current games - END
@ -215,17 +215,17 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
buttonRefresh.registerGraphicComponent(containerName,"buttonRefresh");
buttonRefresh.init(550, buttonPos, 150);
buttonRefresh.setText(lang.get("RefreshList"));
buttonReturn.setText(lang.get("Return"));
buttonCreateGame.setText(lang.get("HostGame"));
labelAutoRefresh.setText(lang.get("AutoRefreshRate"));
buttonRefresh.setText(lang.getString("RefreshList"));
buttonReturn.setText(lang.getString("Return"));
buttonCreateGame.setText(lang.getString("HostGame"));
labelAutoRefresh.setText(lang.getString("AutoRefreshRate"));
labelAutoRefresh.registerGraphicComponent(containerName,"labelAutoRefresh");
labelAutoRefresh.init(800,buttonPos+30);
listBoxAutoRefresh.registerGraphicComponent(containerName,"listBoxAutoRefresh");
listBoxAutoRefresh.init(800,buttonPos);
listBoxAutoRefresh.pushBackItem(lang.get("Off"));
listBoxAutoRefresh.pushBackItem(lang.getString("Off"));
listBoxAutoRefresh.pushBackItem("10 s");
listBoxAutoRefresh.pushBackItem("20 s");
listBoxAutoRefresh.pushBackItem("30 s");
@ -234,7 +234,7 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
ircOnlinePeopleLabel.registerGraphicComponent(containerName,"ircOnlinePeopleLabel");
ircOnlinePeopleLabel.init(userButtonsXBase,userButtonsYBase+userButtonsLineHeight);
ircOnlinePeopleLabel.setText(lang.get("IRCPeopleOnline"));
ircOnlinePeopleLabel.setText(lang.getString("IRCPeopleOnline"));
ircOnlinePeopleStatusLabel.registerGraphicComponent(containerName,"ircOnlinePeopleStatusLabel");
ircOnlinePeopleStatusLabel.init(userButtonsXBase,userButtonsYBase+userButtonsLineHeight-20);
@ -245,7 +245,7 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
NetworkManager::getInstance().end();
NetworkManager::getInstance().init(nrClient);
//console.addLine(lang.get("ToSwitchOffMusicPress")+" - \""+configKeys.getCharKey("ToggleMusic")+"\"");
//console.addLine(lang.getString("ToSwitchOffMusicPress")+" - \""+configKeys.getCharKey("ToggleMusic")+"\"");
GraphicComponent::applyAllCustomProperties(containerName);
@ -339,7 +339,7 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen
}
if(netPlayerName=="newbie"){
showMessageBox(lang.get("PlayerNameNotSetPrompt"),lang.get("PlayerNameNotSetTitle"),false);
showMessageBox(lang.getString("PlayerNameNotSetPrompt"),lang.getString("PlayerNameNotSetTitle"),false);
}
//showMessageBox("Go back and set your name in the game options!\n\nAt the moment you are just called >>newbie<< !","Player name not set!",false);
@ -353,7 +353,7 @@ void MenuStateMasterserver::reloadUI() {
consoleIRC.setFont(CoreData::getInstance().getMenuFontNormal());
consoleIRC.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
announcementLabel.setFont(CoreData::getInstance().getMenuFontBig());
announcementLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -363,40 +363,40 @@ void MenuStateMasterserver::reloadUI() {
labelTitle.setFont(CoreData::getInstance().getMenuFontBig());
labelTitle.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelTitle.setText(lang.get("AvailableServers"));
labelTitle.setText(lang.getString("AvailableServers"));
if(Config::getInstance().getString("Masterserver","") == "") {
labelTitle.setText("*** " + lang.get("AvailableServers"));
labelTitle.setText("*** " + lang.getString("AvailableServers"));
}
glestVersionLabel.setText(lang.get("MGVersion"));
glestVersionLabel.setText(lang.getString("MGVersion"));
platformLabel.setText(lang.get("MGPlatform"));
platformLabel.setText(lang.getString("MGPlatform"));
serverTitleLabel.setText(lang.get("MGGameTitle"));
serverTitleLabel.setText(lang.getString("MGGameTitle"));
countryLabel.setText(lang.get("MGGameCountry"));
countryLabel.setText(lang.getString("MGGameCountry"));
techLabel.setText(lang.get("TechTree"));
techLabel.setText(lang.getString("TechTree"));
mapLabel.setText(lang.get("Map"));
mapLabel.setText(lang.getString("Map"));
activeSlotsLabel.setText(lang.get("MGGameSlots"));
activeSlotsLabel.setText(lang.getString("MGGameSlots"));
externalConnectPort.setText(lang.get("Port"));
externalConnectPort.setText(lang.getString("Port"));
statusLabel.setText(lang.get("MGGameStatus"));
statusLabel.setText(lang.getString("MGGameStatus"));
selectButton.setText(lang.get("MGJoinGameSlots"));
selectButton.setText(lang.getString("MGJoinGameSlots"));
// Titles for current games - END
buttonRefresh.setText(lang.get("RefreshList"));
buttonReturn.setText(lang.get("Return"));
buttonCreateGame.setText(lang.get("HostGame"));
labelAutoRefresh.setText(lang.get("AutoRefreshRate"));
buttonRefresh.setText(lang.getString("RefreshList"));
buttonReturn.setText(lang.getString("Return"));
buttonCreateGame.setText(lang.getString("HostGame"));
labelAutoRefresh.setText(lang.getString("AutoRefreshRate"));
ircOnlinePeopleLabel.setText(lang.get("IRCPeopleOnline"));
ircOnlinePeopleLabel.setText(lang.getString("IRCPeopleOnline"));
chatManager.setFont(CoreData::getInstance().getMenuFontNormal());
chatManager.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
@ -747,8 +747,8 @@ void MenuStateMasterserver::render(){
else {
const Vec4f titleLabelColor = RED;
if(ircOnlinePeopleStatusLabel.getText() != lang.get("Connecting")) {
ircOnlinePeopleStatusLabel.setText(lang.get("Connecting"));
if(ircOnlinePeopleStatusLabel.getText() != lang.getString("Connecting")) {
ircOnlinePeopleStatusLabel.setText(lang.getString("Connecting"));
}
renderer.renderLabel(&ircOnlinePeopleLabel,&titleLabelColor);
@ -987,7 +987,7 @@ void MenuStateMasterserver::simpleTask(BaseThread *callingThread) {
consoleIRC.addLine("---------------------------------------------");
// write hint to console:
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
consoleIRC.addLine(Lang::getInstance().get("ToSwitchOffMusicPress")+" - \""+configKeys.getString("ToggleMusic")+"\"");
consoleIRC.addLine(Lang::getInstance().getString("ToSwitchOffMusicPress")+" - \""+configKeys.getString("ToggleMusic")+"\"");
announcementLoaded=true;
}
@ -1047,10 +1047,10 @@ void MenuStateMasterserver::rebuildServerLines(const string &serverInfo) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("--------------> server [%s] serverEntities.size() = " MG_SIZE_T_SPECIFIER " MIN_FIELDS_EXPECTED = %d\n",server.c_str(),serverEntities.size(),MIN_FIELDS_EXPECTED);
if(serverEntities.size() >= MIN_FIELDS_EXPECTED) {
labelTitle.setText(lang.get("AvailableServers"));
labelTitle.setText(lang.getString("AvailableServers"));
if(Config::getInstance().getString("Masterserver","") == "") {
labelTitle.setText("*** " + lang.get("AvailableServers"));
labelTitle.setText("*** " + lang.getString("AvailableServers"));
}
MasterServerInfo *masterServerInfo=new MasterServerInfo();
@ -1092,7 +1092,7 @@ void MenuStateMasterserver::rebuildServerLines(const string &serverInfo) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
Lang &lang= Lang::getInstance();
labelTitle.setText("*** " + lang.get("AvailableServers") + "[" + intToStr(serverEntities.size()) + "][" + intToStr(MIN_FIELDS_EXPECTED) + "] [" + serverInfo + "]");
labelTitle.setText("*** " + lang.getString("AvailableServers") + "[" + intToStr(serverEntities.size()) + "][" + intToStr(MIN_FIELDS_EXPECTED) + "] [" + serverInfo + "]");
if(masterserverParseErrorShown == false) {
masterserverParseErrorShown = true;
@ -1108,7 +1108,7 @@ void MenuStateMasterserver::rebuildServerLines(const string &serverInfo) {
}
catch(const exception &ex) {
labelTitle.setText("*** " + lang.get("AvailableServers") + " [" + ex.what() + "]");
labelTitle.setText("*** " + lang.getString("AvailableServers") + " [" + ex.what() + "]");
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line %d] error during Internet game status update: [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what());
}
@ -1135,7 +1135,7 @@ bool MenuStateMasterserver::connectToServer(string ipString, int port) {
mainMessageBoxState=1;
Lang &lang= Lang::getInstance();
showMessageBox(lang.get("CouldNotConnect"), lang.get("ConnectionFailed"), false);
showMessageBox(lang.getString("CouldNotConnect"), lang.getString("ConnectionFailed"), false);
return false;
//if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] connection failed\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__);
@ -1210,20 +1210,20 @@ void MenuStateMasterserver::keyDown(SDL_KeyboardEvent key) {
float currentVolume = CoreData::getInstance().getMenuMusic()->getVolume();
if(currentVolume > 0) {
CoreData::getInstance().getMenuMusic()->setVolume(0.f);
consoleIRC.addLine(lang.get("GameMusic") + " " + lang.get("Off"));
consoleIRC.addLine(lang.getString("GameMusic") + " " + lang.getString("Off"));
}
else {
CoreData::getInstance().getMenuMusic()->setVolume(configVolume);
//If the config says zero, use the default music volume
//gameMusic->setVolume(configVolume ? configVolume : 0.9);
consoleIRC.addLine(lang.get("GameMusic"));
consoleIRC.addLine(lang.getString("GameMusic"));
}
}
//else if(key == configKeys.getCharKey("SaveGUILayout")) {
else if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
bool saved = GraphicComponent::saveAllCustomProperties(containerName);
Lang &lang= Lang::getInstance();
consoleIRC.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
consoleIRC.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}
}

View File

@ -98,31 +98,31 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) :
techInfoXPos = 10;
keyTechScrollBarTitle1.registerGraphicComponent(containerName,"keyTechScrollBarTitle1");
keyTechScrollBarTitle1.init(techInfoXPos,scrollListsYPos + 25,labelWidth,20);
keyTechScrollBarTitle1.setText(lang.get("TechTitle1"));
keyTechScrollBarTitle1.setText(lang.getString("TechTitle1"));
keyTechScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyTechScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
keyTechScrollBarTitle2.registerGraphicComponent(containerName,"keyTechScrollBarTitle2");
keyTechScrollBarTitle2.init(techInfoXPos + 200,scrollListsYPos + 25,labelWidth,20);
keyTechScrollBarTitle2.setText(lang.get("TechTitle2"));
keyTechScrollBarTitle2.setText(lang.getString("TechTitle2"));
keyTechScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontNormal());
keyTechScrollBarTitle2.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
mapInfoXPos = 270;
keyMapScrollBarTitle1.registerGraphicComponent(containerName,"keyMapScrollBarTitle1");
keyMapScrollBarTitle1.init(mapInfoXPos,scrollListsYPos + 25,labelWidth,20);
keyMapScrollBarTitle1.setText(lang.get("MapTitle1"));
keyMapScrollBarTitle1.setText(lang.getString("MapTitle1"));
keyMapScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyMapScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
keyMapScrollBarTitle2.registerGraphicComponent(containerName,"keyMapScrollBarTitle2");
keyMapScrollBarTitle2.init(mapInfoXPos + 200,scrollListsYPos + 25,labelWidth,20);
keyMapScrollBarTitle2.setText(lang.get("MapTitle2"));
keyMapScrollBarTitle2.setText(lang.getString("MapTitle2"));
keyMapScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontNormal());
keyMapScrollBarTitle2.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
tilesetInfoXPos = 530;
keyTilesetScrollBarTitle1.registerGraphicComponent(containerName,"keyTilesetScrollBarTitle1");
keyTilesetScrollBarTitle1.init(tilesetInfoXPos,scrollListsYPos + 25,labelWidth,20);
keyTilesetScrollBarTitle1.setText(lang.get("TilesetTitle1"));
keyTilesetScrollBarTitle1.setText(lang.getString("TilesetTitle1"));
keyTilesetScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyTilesetScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -130,13 +130,13 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) :
scenarioInfoXPos = 760;
keyScenarioScrollBarTitle1.registerGraphicComponent(containerName,"keyScenarioScrollBarTitle1");
keyScenarioScrollBarTitle1.init(scenarioInfoXPos,scrollListsYPos + 25,labelWidth,20);
keyScenarioScrollBarTitle1.setText(lang.get("ScenarioTitle1"));
keyScenarioScrollBarTitle1.setText(lang.getString("ScenarioTitle1"));
keyScenarioScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyScenarioScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
mainMessageBoxState = ftpmsg_None;
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
mainMessageBox.setEnabled(false);
lineHorizontal.init(0,installButtonYPos-60);
@ -157,7 +157,7 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) :
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(800, returnLineY - 30, 125);
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
lineVerticalReturn.init(buttonReturn.getX() - 10, returnLineY-80, 5, 81);
lineVerticalReturn.setHorizontal(false);
@ -168,7 +168,7 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) :
int legendButtonY= buttonLineDownY-30;
buttonInstalled.registerGraphicComponent(containerName,"buttonInstalled");
buttonInstalled.init(techInfoXPos, legendButtonY, 200);
buttonInstalled.setText(lang.get("ModInstalled"));
buttonInstalled.setText(lang.getString("ModInstalled"));
buttonInstalled.setUseCustomTexture(true);
buttonInstalled.setCustomTexture(CoreData::getInstance().getOnServerInstalledTexture());
buttonInstalled.setEnabled(false);
@ -177,48 +177,48 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) :
buttonAvailable.init(tilesetInfoXPos, legendButtonY, 200);
buttonAvailable.setUseCustomTexture(true);
buttonAvailable.setCustomTexture(CoreData::getInstance().getOnServerTexture());
buttonAvailable.setText(lang.get("ModAvailable"));
buttonAvailable.setText(lang.getString("ModAvailable"));
buttonOnlyLocal.registerGraphicComponent(containerName,"buttonOnlyLocal");
buttonOnlyLocal.init(mapInfoXPos, legendButtonY, 200);
buttonOnlyLocal.setUseCustomTexture(true);
buttonOnlyLocal.setCustomTexture(CoreData::getInstance().getNotOnServerTexture());
buttonOnlyLocal.setText(lang.get("ModOnlyLocal"));
buttonOnlyLocal.setText(lang.getString("ModOnlyLocal"));
buttonConflict.registerGraphicComponent(containerName,"buttonConflict");
buttonConflict.init(scenarioInfoXPos, legendButtonY, 200);
buttonConflict.setUseCustomTexture(true);
buttonConflict.setCustomTexture(CoreData::getInstance().getOnServerDifferentTexture());
buttonConflict.setText(lang.get("ModHasConflict"));
buttonConflict.setText(lang.getString("ModHasConflict"));
buttonInstallTech.registerGraphicComponent(containerName,"buttonInstallTech");
buttonInstallTech.init(techInfoXPos + 40, buttonLineUpY, 125);
buttonInstallTech.setText(lang.get("Install"));
buttonInstallTech.setText(lang.getString("Install"));
buttonRemoveTech.registerGraphicComponent(containerName,"buttonRemoveTech");
buttonRemoveTech.init(techInfoXPos + 40, buttonLineDownY, 125);
buttonRemoveTech.setText(lang.get("Remove"));
buttonRemoveTech.setText(lang.getString("Remove"));
buttonInstallTileset.registerGraphicComponent(containerName,"buttonInstallTileset");
buttonInstallTileset.init(tilesetInfoXPos + 20, buttonLineUpY, 125);
buttonInstallTileset.setText(lang.get("Install"));
buttonInstallTileset.setText(lang.getString("Install"));
buttonRemoveTileset.registerGraphicComponent(containerName,"buttonRemoveTileset");
buttonRemoveTileset.init(tilesetInfoXPos + 20, buttonLineDownY, 125);
buttonRemoveTileset.setText(lang.get("Remove"));
buttonRemoveTileset.setText(lang.getString("Remove"));
buttonInstallMap.registerGraphicComponent(containerName,"buttonInstallMap");
buttonInstallMap.init(mapInfoXPos + 40, buttonLineUpY, 125);
buttonInstallMap.setText(lang.get("Install"));
buttonInstallMap.setText(lang.getString("Install"));
buttonRemoveMap.registerGraphicComponent(containerName,"buttonRemoveMap");
buttonRemoveMap.init(mapInfoXPos + 40, buttonLineDownY, 125);
buttonRemoveMap.setText(lang.get("Remove"));
buttonRemoveMap.setText(lang.getString("Remove"));
buttonInstallScenario.registerGraphicComponent(containerName,"buttonInstallScenario");
buttonInstallScenario.init(scenarioInfoXPos + 20, buttonLineUpY, 125);
buttonInstallScenario.setText(lang.get("Install"));
buttonInstallScenario.setText(lang.getString("Install"));
buttonRemoveScenario.registerGraphicComponent(containerName,"buttonRemoveScenario");
buttonRemoveScenario.init(scenarioInfoXPos + 20, buttonLineDownY, 125);
buttonRemoveScenario.setText(lang.get("Remove"));
buttonRemoveScenario.setText(lang.getString("Remove"));
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
@ -337,21 +337,21 @@ void MenuStateMods::reloadUI() {
Lang &lang= Lang::getInstance();
console.resetFonts();
keyTechScrollBarTitle1.setText(lang.get("TechTitle1"));
keyTechScrollBarTitle1.setText(lang.getString("TechTitle1"));
keyTechScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyTechScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
keyTechScrollBarTitle2.setText(lang.get("TechTitle2"));
keyTechScrollBarTitle2.setText(lang.getString("TechTitle2"));
keyTechScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontNormal());
keyTechScrollBarTitle2.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
keyMapScrollBarTitle1.setText(lang.get("MapTitle1"));
keyMapScrollBarTitle1.setText(lang.getString("MapTitle1"));
keyMapScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyMapScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
keyMapScrollBarTitle2.setText(lang.get("MapTitle2"));
keyMapScrollBarTitle2.setText(lang.getString("MapTitle2"));
keyMapScrollBarTitle2.setFont(CoreData::getInstance().getMenuFontNormal());
keyMapScrollBarTitle2.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
keyTilesetScrollBarTitle1.setText(lang.get("TilesetTitle1"));
keyTilesetScrollBarTitle1.setText(lang.getString("TilesetTitle1"));
keyTilesetScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyTilesetScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -359,35 +359,35 @@ void MenuStateMods::reloadUI() {
pleaseWaitLabel.setFont(CoreData::getInstance().getMenuFontBig());
pleaseWaitLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
keyScenarioScrollBarTitle1.setText(lang.get("ScenarioTitle1"));
keyScenarioScrollBarTitle1.setText(lang.getString("ScenarioTitle1"));
keyScenarioScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig());
keyScenarioScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontBig3D());
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
modDescrLabel.setText("description is empty");
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
buttonInstalled.setText(lang.get("ModInstalled"));
buttonInstalled.setText(lang.getString("ModInstalled"));
buttonAvailable.setText(lang.get("ModAvailable"));
buttonAvailable.setText(lang.getString("ModAvailable"));
buttonOnlyLocal.setText(lang.get("ModOnlyLocal"));
buttonOnlyLocal.setText(lang.getString("ModOnlyLocal"));
buttonConflict.setText(lang.get("ModHasConflict"));
buttonConflict.setText(lang.getString("ModHasConflict"));
buttonInstallTech.setText(lang.get("Install"));
buttonRemoveTech.setText(lang.get("Remove"));
buttonInstallTech.setText(lang.getString("Install"));
buttonRemoveTech.setText(lang.getString("Remove"));
buttonInstallTileset.setText(lang.get("Install"));
buttonRemoveTileset.setText(lang.get("Remove"));
buttonInstallTileset.setText(lang.getString("Install"));
buttonRemoveTileset.setText(lang.getString("Remove"));
buttonInstallMap.setText(lang.get("Install"));
buttonRemoveMap.setText(lang.get("Remove"));
buttonInstallMap.setText(lang.getString("Install"));
buttonRemoveMap.setText(lang.getString("Remove"));
buttonInstallScenario.setText(lang.get("Install"));
buttonRemoveScenario.setText(lang.get("Remove"));
buttonInstallScenario.setText(lang.getString("Install"));
buttonRemoveScenario.setText(lang.getString("Remove"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -412,8 +412,8 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
bool findArchive = executeShellCommand(fileArchiveExtractCommand,expectedResult);
if(findArchive == false) {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModRequires7z"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModRequires7z"), lang.getString("Notice"), true);
}
std::string techsMetaData = "";
@ -446,7 +446,7 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#1 ") + szBuf,true);
}
@ -465,7 +465,7 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#2 ") + szBuf,true);
}
@ -480,7 +480,7 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#3 ") + szBuf,true);
}
@ -490,14 +490,14 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) {
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModErrorGettingServerData").c_str(),curlError.c_str());
snprintf(szBuf,8096,lang.getString("ModErrorGettingServerData").c_str(),curlError.c_str());
console.addLine(string("#4 ") + szBuf,true);
}
}
SystemFlags::cleanupHTTP(&handle);
}
else {
console.addLine(lang.get("MasterServerMissing"),true);
console.addLine(lang.getString("MasterServerMissing"),true);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
@ -822,7 +822,7 @@ MapInfo MenuStateMods::loadMapInfo(string file) {
try{
Lang &lang= Lang::getInstance();
// Not painting properly so this is on hold
MapPreview::loadMapInfo(file, &mapInfo, lang.get("MaxPlayers"),lang.get("Size"),true);
MapPreview::loadMapInfo(file, &mapInfo, lang.getString("MaxPlayers"),lang.getString("Size"),true);
}
catch(exception &e) {
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s] loading map [%s]\n",__FILE__,__FUNCTION__,__LINE__,e.what(),file.c_str());
@ -1250,10 +1250,10 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
if(fileFTPProgressList.empty() == false) {
mainMessageBoxState = ftpmsg_Quit;
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadInProgressCancelQuestion").c_str(),fileFTPProgressList.size());
showMessageBox(szBuf, lang.get("Question"), true);
snprintf(szBuf,8096,lang.getString("ModDownloadInProgressCancelQuestion").c_str(),fileFTPProgressList.size());
showMessageBox(szBuf, lang.getString("Question"), true);
}
else {
cleanUp();
@ -1266,7 +1266,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
if(mainMessageBox.mouseClick(x, y, button)) {
soundRenderer.playFx(coreData.getClickSoundA());
mainMessageBox.setEnabled(false);
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
if(button == 0) {
if(mainMessageBoxState == ftpmsg_Quit) {
mainMessageBoxState = ftpmsg_None;
@ -1540,17 +1540,17 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] local CRC [%u]\n",__FILE__,__FUNCTION__,__LINE__,getFolderTreeContentsCheckSumRecursively(itemPath, ".xml", NULL));
mainMessageBoxState = ftpmsg_ReplaceTechtree;
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModLocalRemoteMismatch").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModLocalRemoteMismatch").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModTechAlreadyInstalled").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModTechAlreadyInstalled").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
mapCRCUpdateList[itemPath] = true;
}
@ -1570,8 +1570,8 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModSelectTechToInstall"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModSelectTechToInstall"), lang.getString("Notice"), true);
}
}
else if(buttonRemoveTech.mouseClick(x, y) && buttonRemoveTech.getEnabled()) {
@ -1582,23 +1582,23 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
mainMessageBoxState = ftpmsg_GetTechtree;
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModRemoveTechConfirm").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.get("Question"), true);
snprintf(szBuf,8096,lang.getString("ModRemoveTechConfirm").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.getString("Question"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModCannotRemoveTechNotInstalled").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModCannotRemoveTechNotInstalled").c_str(),selectedTechName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.get("ModSelectTechToRemove"), lang.get("Notice"), true);
showMessageBox(lang.getString("ModSelectTechToRemove"), lang.getString("Notice"), true);
}
}
@ -1621,17 +1621,17 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] local CRC [%u] [%s]\n",__FILE__,__FUNCTION__,__LINE__,getFolderTreeContentsCheckSumRecursively(itemPath, ".xml", NULL),itemPath.c_str());
mainMessageBoxState = ftpmsg_ReplaceTileset;
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModLocalRemoteMismatch").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModLocalRemoteMismatch").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModTilesetAlreadyInstalled").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModTilesetAlreadyInstalled").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
}
}
@ -1650,8 +1650,8 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModSelectTilesetToInstall"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModSelectTilesetToInstall"), lang.getString("Notice"), true);
}
}
else if(buttonRemoveTileset.mouseClick(x, y) && buttonRemoveTileset.getEnabled()) {
@ -1662,22 +1662,22 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
mainMessageBoxState = ftpmsg_GetTileset;
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModRemoveTilesetConfirm").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.get("Question"), true);
snprintf(szBuf,8096,lang.getString("ModRemoveTilesetConfirm").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.getString("Question"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModCannotRemoveTilesetNotInstalled").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModCannotRemoveTilesetNotInstalled").c_str(),selectedTilesetName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModSelectTilesetToRemove"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModSelectTilesetToRemove"), lang.getString("Notice"), true);
}
}
@ -1691,17 +1691,17 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
ModInfo &modInfo = mapCacheList[selectedMapName];
if( modInfo.crc != modInfo.localCRC ) {
mainMessageBoxState = ftpmsg_ReplaceMap;
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModLocalRemoteMismatch").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModLocalRemoteMismatch").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModMapAlreadyInstalled").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModMapAlreadyInstalled").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
}
}
@ -1720,8 +1720,8 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModSelectMapToInstall"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModSelectMapToInstall"), lang.getString("Notice"), true);
}
}
else if(buttonRemoveMap.mouseClick(x, y) && buttonRemoveMap.getEnabled()) {
@ -1732,22 +1732,22 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
mainMessageBoxState = ftpmsg_GetMap;
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModRemoveMapConfirm").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.get("Question"), true);
snprintf(szBuf,8096,lang.getString("ModRemoveMapConfirm").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.getString("Question"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModCannotRemoveMapNotInstalled").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModCannotRemoveMapNotInstalled").c_str(),selectedMapName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModSelectMapToRemove"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModSelectMapToRemove"), lang.getString("Notice"), true);
}
}
@ -1770,17 +1770,17 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] local CRC [%u]\n",__FILE__,__FUNCTION__,__LINE__,getFolderTreeContentsCheckSumRecursively(itemPath, "", NULL));
mainMessageBoxState = ftpmsg_ReplaceScenario;
mainMessageBox.init(lang.get("Yes"),lang.get("No"),450);
mainMessageBox.init(lang.getString("Yes"),lang.getString("No"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModLocalRemoteMismatch").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModLocalRemoteMismatch").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModScenarioAlreadyInstalled").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModScenarioAlreadyInstalled").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
}
}
@ -1801,8 +1801,8 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModSelectScenarioToInstall"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModSelectScenarioToInstall"), lang.getString("Notice"), true);
}
}
else if(buttonRemoveScenario.mouseClick(x, y) && buttonRemoveScenario.getEnabled()) {
@ -1813,22 +1813,22 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) {
mainMessageBoxState = ftpmsg_GetScenario;
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModRemoveScenarioConfirm").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.get("Question"), true);
snprintf(szBuf,8096,lang.getString("ModRemoveScenarioConfirm").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.getString("Question"), true);
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
mainMessageBox.init(lang.getString("Ok"),450);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModCannotRemoveScenarioNotInstalled").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.get("Notice"), true);
snprintf(szBuf,8096,lang.getString("ModCannotRemoveScenarioNotInstalled").c_str(),selectedScenarioName.c_str());
showMessageBox(szBuf, lang.getString("Notice"), true);
}
}
else {
mainMessageBoxState = ftpmsg_None;
mainMessageBox.init(lang.get("Ok"),450);
showMessageBox(lang.get("ModSelectScenarioToRemove"), lang.get("Notice"), true);
mainMessageBox.init(lang.getString("Ok"),450);
showMessageBox(lang.getString("ModSelectScenarioToRemove"), lang.getString("Notice"), true);
}
}
@ -1980,7 +1980,7 @@ void MenuStateMods::showLocalDescription(string name) {
cleanupPreviewTexture();
validMapPreview=false;
cleanupMapPreviewTexture();
modDescrLabel.setText(lang.get("ModOnlyLocal")+":\n'"+name+"'");
modDescrLabel.setText(lang.getString("ModOnlyLocal")+":\n'"+name+"'");
}
void MenuStateMods::loadMapPreview(string mapName) {
@ -2361,7 +2361,7 @@ void MenuStateMods::render() {
for(std::map<string,pair<int,string> >::iterator iterMap = fileFTPProgressList.begin();
iterMap != fileFTPProgressList.end(); ++iterMap) {
string progressLabelPrefix = lang.get("ModDownloading") + " " + extractFileFromDirectoryPath(iterMap->first) + " ";
string progressLabelPrefix = lang.getString("ModDownloading") + " " + extractFileFromDirectoryPath(iterMap->first) + " ";
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nRendering file progress with the following prefix [%s]\n",progressLabelPrefix.c_str());
if(Renderer::renderText3DEnabled) {
@ -2401,10 +2401,10 @@ void MenuStateMods::render() {
{
Lang &lang= Lang::getInstance();
if(modMenuState== mmst_Loading){
pleaseWaitLabel.setText(lang.get("GettingModlistFromMasterserver"));
pleaseWaitLabel.setText(lang.getString("GettingModlistFromMasterserver"));
}
else if(modMenuState== mmst_CalculatingCRC){
pleaseWaitLabel.setText(lang.get("PleaseWaitCalculatingCRC"));
pleaseWaitLabel.setText(lang.getString("PleaseWaitCalculatingCRC"));
}
oldMenuState=modMenuState;
}
@ -2578,7 +2578,7 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
if(userdata == NULL) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("DataMissingExtractDownloadMod").c_str(),itemName.c_str());
snprintf(szBuf,8096,lang.getString("DataMissingExtractDownloadMod").c_str(),itemName.c_str());
//printf("%s\n",szBuf);
console.addLine(szBuf,true);
}
@ -2618,14 +2618,14 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
if(result.first == ftp_crt_SUCCESS) {
refreshMaps();
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadMapSuccess").c_str(),itemName.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadMapSuccess").c_str(),itemName.c_str());
console.addLine(szBuf,true);
}
else {
curl_version_info_data *curlVersion= curl_version_info(CURLVERSION_NOW);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadMapFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadMapFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
console.addLine(szBuf,true);
}
}
@ -2645,7 +2645,7 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
refreshTilesets();
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadTilesetSuccess").c_str(),itemName.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadTilesetSuccess").c_str(),itemName.c_str());
console.addLine(szBuf,true);
// END
}
@ -2653,7 +2653,7 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
curl_version_info_data *curlVersion= curl_version_info(CURLVERSION_NOW);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadTilesetFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadTilesetFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
console.addLine(szBuf,true);
}
}
@ -2672,7 +2672,7 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
if(result.first == ftp_crt_SUCCESS) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadTechSuccess").c_str(),itemName.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadTechSuccess").c_str(),itemName.c_str());
console.addLine(szBuf,true);
// START
@ -2698,7 +2698,7 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
curl_version_info_data *curlVersion= curl_version_info(CURLVERSION_NOW);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadTechFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadTechFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
console.addLine(szBuf,true);
}
}
@ -2716,7 +2716,7 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
if(result.first == ftp_crt_SUCCESS) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadScenarioSuccess").c_str(),itemName.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadScenarioSuccess").c_str(),itemName.c_str());
console.addLine(szBuf,true);
// START
@ -2744,7 +2744,7 @@ void MenuStateMods::FTPClient_CallbackEvent(string itemName,
curl_version_info_data *curlVersion= curl_version_info(CURLVERSION_NOW);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.get("ModDownloadScenarioFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
snprintf(szBuf,8096,lang.getString("ModDownloadScenarioFail").c_str(),itemName.c_str(),curlVersion->version,result.second.c_str());
console.addLine(szBuf,true);
}
}

View File

@ -60,12 +60,12 @@ MenuStateNewGame::MenuStateNewGame(Program *program, MainMenu *mainMenu):
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(425, yPos, buttonWidth);
buttonCustomGame.setText(lang.get("CustomGame"));
buttonScenario.setText(lang.get("Scenario"));
buttonJoinGame.setText(lang.get("JoinGame"));
buttonMasterserverGame.setText(lang.get("JoinInternetGame"));
buttonTutorial.setText(lang.get("Tutorial"));
buttonReturn.setText(lang.get("Return"));
buttonCustomGame.setText(lang.getString("CustomGame"));
buttonScenario.setText(lang.getString("Scenario"));
buttonJoinGame.setText(lang.getString("JoinGame"));
buttonMasterserverGame.setText(lang.getString("JoinInternetGame"));
buttonTutorial.setText(lang.getString("Tutorial"));
buttonReturn.setText(lang.getString("Return"));
GraphicComponent::applyAllCustomProperties(containerName);
@ -75,12 +75,12 @@ MenuStateNewGame::MenuStateNewGame(Program *program, MainMenu *mainMenu):
void MenuStateNewGame::reloadUI() {
Lang &lang= Lang::getInstance();
buttonCustomGame.setText(lang.get("CustomGame"));
buttonScenario.setText(lang.get("Scenario"));
buttonJoinGame.setText(lang.get("JoinGame"));
buttonMasterserverGame.setText(lang.get("JoinInternetGame"));
buttonTutorial.setText(lang.get("Tutorial"));
buttonReturn.setText(lang.get("Return"));
buttonCustomGame.setText(lang.getString("CustomGame"));
buttonScenario.setText(lang.getString("Scenario"));
buttonJoinGame.setText(lang.getString("JoinGame"));
buttonMasterserverGame.setText(lang.getString("JoinInternetGame"));
buttonTutorial.setText(lang.getString("Tutorial"));
buttonReturn.setText(lang.getString("Return"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -155,7 +155,7 @@ void MenuStateNewGame::keyDown(SDL_KeyboardEvent key) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}

View File

@ -62,7 +62,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
int tabButtonHeight=30;
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -70,33 +70,33 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
buttonAudioSection.init(0, 720,tabButtonWidth,tabButtonHeight);
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
// Video Section
buttonVideoSection.registerGraphicComponent(containerName,"labelVideoSection");
buttonVideoSection.init(200, 720,tabButtonWidth,tabButtonHeight);
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
//currentLine-=lineOffset;
//MiscSection
buttonMiscSection.registerGraphicComponent(containerName,"labelMiscSection");
buttonMiscSection.init(400, 700,tabButtonWidth,tabButtonHeight+20);
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
//NetworkSettings
buttonNetworkSettings.registerGraphicComponent(containerName,"labelNetworkSettingsSection");
buttonNetworkSettings.init(600, 720,tabButtonWidth,tabButtonHeight);
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
//KeyboardSetup
buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup");
buttonKeyboardSetup.init(800, 720,tabButtonWidth,tabButtonHeight);
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
int currentLine=650; // reset line pos
int currentLabelStart=leftLabelStart; // set to right side
@ -105,7 +105,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
//lang
labelLang.registerGraphicComponent(containerName,"labelLang");
labelLang.init(currentLabelStart, currentLine);
labelLang.setText(lang.get("Language"));
labelLang.setText(lang.getString("Language"));
listBoxLang.registerGraphicComponent(containerName,"listBoxLang");
listBoxLang.init(currentColumnStart, currentLine, 320);
@ -145,7 +145,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
//playerName
labelPlayerNameLabel.registerGraphicComponent(containerName,"labelPlayerNameLabel");
labelPlayerNameLabel.init(currentLabelStart,currentLine);
labelPlayerNameLabel.setText(lang.get("Playername"));
labelPlayerNameLabel.setText(lang.getString("Playername"));
labelPlayerName.registerGraphicComponent(containerName,"labelPlayerName");
labelPlayerName.init(currentColumnStart,currentLine);
@ -160,7 +160,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
//FontSizeAdjustment
labelFontSizeAdjustment.registerGraphicComponent(containerName,"labelFontSizeAdjustment");
labelFontSizeAdjustment.init(currentLabelStart,currentLine);
labelFontSizeAdjustment.setText(lang.get("FontSizeAdjustment"));
labelFontSizeAdjustment.setText(lang.getString("FontSizeAdjustment"));
listFontSizeAdjustment.registerGraphicComponent(containerName,"listFontSizeAdjustment");
listFontSizeAdjustment.init(currentColumnStart, currentLine, 80);
@ -173,7 +173,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
// Screenshot type flag
labelScreenShotType.registerGraphicComponent(containerName,"labelScreenShotType");
labelScreenShotType.init(currentLabelStart ,currentLine);
labelScreenShotType.setText(lang.get("ScreenShotFileType"));
labelScreenShotType.setText(lang.getString("ScreenShotFileType"));
listBoxScreenShotType.registerGraphicComponent(containerName,"listBoxScreenShotType");
listBoxScreenShotType.init(currentColumnStart ,currentLine, 80 );
@ -187,7 +187,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
labelDisableScreenshotConsoleText.registerGraphicComponent(containerName,"lavelDisableScreenshotConsoleText");
labelDisableScreenshotConsoleText.init(currentLabelStart ,currentLine);
labelDisableScreenshotConsoleText.setText(lang.get("ScreenShotConsoleText"));
labelDisableScreenshotConsoleText.setText(lang.getString("ScreenShotConsoleText"));
checkBoxDisableScreenshotConsoleText.registerGraphicComponent(containerName,"checkBoxDisableScreenshotConsoleText");
checkBoxDisableScreenshotConsoleText.init(currentColumnStart ,currentLine );
@ -197,7 +197,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
labelMouseMoveScrollsWorld.registerGraphicComponent(containerName,"labelMouseMoveScrollsWorld");
labelMouseMoveScrollsWorld.init(currentLabelStart ,currentLine);
labelMouseMoveScrollsWorld.setText(lang.get("MouseScrollsWorld"));
labelMouseMoveScrollsWorld.setText(lang.getString("MouseScrollsWorld"));
checkBoxMouseMoveScrollsWorld.registerGraphicComponent(containerName,"checkBoxMouseMoveScrollsWorld");
checkBoxMouseMoveScrollsWorld.init(currentColumnStart ,currentLine );
@ -206,7 +206,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
labelVisibleHud.registerGraphicComponent(containerName,"lavelVisibleHud");
labelVisibleHud.init(currentLabelStart ,currentLine);
labelVisibleHud.setText(lang.get("VisibleHUD"));
labelVisibleHud.setText(lang.getString("VisibleHUD"));
checkBoxVisibleHud.registerGraphicComponent(containerName,"checkBoxVisibleHud");
checkBoxVisibleHud.init(currentColumnStart ,currentLine );
@ -216,7 +216,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
labelChatStaysActive.registerGraphicComponent(containerName,"labelChatStaysActive");
labelChatStaysActive.init(currentLabelStart ,currentLine);
labelChatStaysActive.setText(lang.get("ChatStaysActive"));
labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
checkBoxChatStaysActive.registerGraphicComponent(containerName,"checkBoxChatStaysActive");
checkBoxChatStaysActive.init(currentColumnStart ,currentLine );
@ -226,7 +226,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
labelTimeDisplay.registerGraphicComponent(containerName,"labelTimeDisplay");
labelTimeDisplay.init(currentLabelStart ,currentLine);
labelTimeDisplay.setText(lang.get("TimeDisplay"));
labelTimeDisplay.setText(lang.getString("TimeDisplay"));
checkBoxTimeDisplay.registerGraphicComponent(containerName,"checkBoxTimeDisplay");
checkBoxTimeDisplay.init(currentColumnStart ,currentLine );
@ -236,14 +236,14 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
labelLuaDisableSecuritySandbox.registerGraphicComponent(containerName,"labelLuaDisableSecuritySandbox");
labelLuaDisableSecuritySandbox.init(currentLabelStart ,currentLine);
labelLuaDisableSecuritySandbox.setText(lang.get("LuaDisableSecuritySandbox"));
labelLuaDisableSecuritySandbox.setText(lang.getString("LuaDisableSecuritySandbox"));
checkBoxLuaDisableSecuritySandbox.registerGraphicComponent(containerName,"checkBoxLuaDisableSecuritySandbox");
checkBoxLuaDisableSecuritySandbox.init(currentColumnStart ,currentLine );
checkBoxLuaDisableSecuritySandbox.setValue(config.getBool("DisableLuaSandbox","false"));
luaMessageBox.registerGraphicComponent(containerName,"luaMessageBox");
luaMessageBox.init(lang.get("Yes"),lang.get("No"));
luaMessageBox.init(lang.getString("Yes"),lang.getString("No"));
luaMessageBox.setEnabled(false);
luaMessageBoxState=0;
@ -254,17 +254,17 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
// buttons
buttonOk.registerGraphicComponent(containerName,"buttonOk");
buttonOk.init(buttonStartPos, buttonRowPos, 100);
buttonOk.setText(lang.get("Save"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.registerGraphicComponent(containerName,"buttonAbort");
buttonReturn.init(buttonStartPos+110, buttonRowPos, 100);
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
// Transifex related UI
currentLine-=lineOffset*4;
labelCustomTranslation.registerGraphicComponent(containerName,"labelCustomTranslation");
labelCustomTranslation.init(currentLabelStart ,currentLine);
labelCustomTranslation.setText(lang.get("CustomTranslation"));
labelCustomTranslation.setText(lang.getString("CustomTranslation"));
checkBoxCustomTranslation.registerGraphicComponent(containerName,"checkBoxCustomTranslation");
checkBoxCustomTranslation.init(currentColumnStart ,currentLine );
@ -273,15 +273,15 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
labelTransifexUserLabel.registerGraphicComponent(containerName,"labelTransifexUserLabel");
labelTransifexUserLabel.init(currentLabelStart,currentLine);
labelTransifexUserLabel.setText(lang.get("TransifexUserName"));
labelTransifexUserLabel.setText(lang.getString("TransifexUserName"));
labelTransifexPwdLabel.registerGraphicComponent(containerName,"labelTransifexPwdLabel");
labelTransifexPwdLabel.init(currentLabelStart + 250 ,currentLine);
labelTransifexPwdLabel.setText(lang.get("TransifexPwd"));
labelTransifexPwdLabel.setText(lang.getString("TransifexPwd"));
labelTransifexI18NLabel.registerGraphicComponent(containerName,"labelTransifexI18NLabel");
labelTransifexI18NLabel.init(currentLabelStart + 500 ,currentLine);
labelTransifexI18NLabel.setText(lang.get("TransifexI18N"));
labelTransifexI18NLabel.setText(lang.getString("TransifexI18N"));
currentLine-=lineOffset;
@ -310,11 +310,11 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
buttonGetNewLanguageFiles.registerGraphicComponent(containerName,"buttonGetNewLanguageFiles");
buttonGetNewLanguageFiles.init(currentLabelStart+20, currentLine, 200);
buttonGetNewLanguageFiles.setText(lang.get("TransifexGetLanguageFiles"));
buttonGetNewLanguageFiles.setText(lang.getString("TransifexGetLanguageFiles"));
buttonDeleteNewLanguageFiles.registerGraphicComponent(containerName,"buttonDeleteNewLanguageFiles");
buttonDeleteNewLanguageFiles.init(currentLabelStart + 250, currentLine, 200);
buttonDeleteNewLanguageFiles.setText(lang.get("TransifexDeleteLanguageFiles"));
buttonDeleteNewLanguageFiles.setText(lang.getString("TransifexDeleteLanguageFiles"));
setupTransifexUI();
@ -331,60 +331,60 @@ void MenuStateOptions::reloadUI() {
console.resetFonts();
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
mainMessageBox.init(lang.get("Ok"));
luaMessageBox.init(lang.get("Yes"),lang.get("No"));
mainMessageBox.init(lang.getString("Ok"));
luaMessageBox.init(lang.getString("Yes"),lang.getString("No"));
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
labelVisibleHud.setText(lang.get("VisibleHUD"));
labelChatStaysActive.setText(lang.get("ChatStaysActive"));
labelTimeDisplay.setText(lang.get("TimeDisplay"));
labelVisibleHud.setText(lang.getString("VisibleHUD"));
labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
labelTimeDisplay.setText(lang.getString("TimeDisplay"));
labelLuaDisableSecuritySandbox.setText(lang.get("LuaDisableSecuritySandbox"));
labelLuaDisableSecuritySandbox.setText(lang.getString("LuaDisableSecuritySandbox"));
labelLang.setText(lang.get("Language"));
labelLang.setText(lang.getString("Language"));
labelPlayerNameLabel.setText(lang.get("Playername"));
labelPlayerNameLabel.setText(lang.getString("Playername"));
labelPlayerName.setFont(CoreData::getInstance().getMenuFontBig());
labelPlayerName.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelFontSizeAdjustment.setText(lang.get("FontSizeAdjustment"));
labelFontSizeAdjustment.setText(lang.getString("FontSizeAdjustment"));
labelScreenShotType.setText(lang.get("ScreenShotFileType"));
labelScreenShotType.setText(lang.getString("ScreenShotFileType"));
labelDisableScreenshotConsoleText.setText(lang.get("ScreenShotConsoleText"));
labelDisableScreenshotConsoleText.setText(lang.getString("ScreenShotConsoleText"));
labelMouseMoveScrollsWorld.setText(lang.get("MouseScrollsWorld"));
labelMouseMoveScrollsWorld.setText(lang.getString("MouseScrollsWorld"));
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
labelCustomTranslation.setText(lang.get("CustomTranslation"));
buttonGetNewLanguageFiles.setText(lang.get("TransifexGetLanguageFiles"));
buttonDeleteNewLanguageFiles.setText(lang.get("TransifexDeleteLanguageFiles"));
labelTransifexUserLabel.setText(lang.get("TransifexUserName"));
labelTransifexPwdLabel.setText(lang.get("TransifexPwd"));
labelTransifexI18NLabel.setText(lang.get("TransifexI18N"));
labelCustomTranslation.setText(lang.getString("CustomTranslation"));
buttonGetNewLanguageFiles.setText(lang.getString("TransifexGetLanguageFiles"));
buttonDeleteNewLanguageFiles.setText(lang.getString("TransifexDeleteLanguageFiles"));
labelTransifexUserLabel.setText(lang.getString("TransifexUserName"));
labelTransifexPwdLabel.setText(lang.getString("TransifexPwd"));
labelTransifexI18NLabel.setText(lang.getString("TransifexI18N"));
}
void MenuStateOptions::setupTransifexUI() {
@ -445,14 +445,14 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
saveConfig();
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMenu->setState(new MenuStateRoot(program, mainMenu));
}
else {
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
}
}
else {
@ -461,7 +461,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
}
}
}
@ -485,7 +485,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
luaMessageBoxState=1;
Lang &lang= Lang::getInstance();
showLuaMessageBox(lang.get("LuaDisableSecuritySandboxWarning"), lang.get("Question"), false);
showLuaMessageBox(lang.getString("LuaDisableSecuritySandboxWarning"), lang.getString("Question"), false);
}
}
else if(buttonOk.mouseClick(x, y)){
@ -496,7 +496,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
if(currentFontSizeAdjustment != selectedFontSizeAdjustment){
mainMessageBoxState=1;
Lang &lang= Lang::getInstance();
showMessageBox(lang.get("RestartNeeded"), lang.get("FontSizeAdjustmentChanged"), false);
showMessageBox(lang.getString("RestartNeeded"), lang.getString("FontSizeAdjustmentChanged"), false);
return;
}
@ -679,13 +679,13 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
}
if(lang.isLanguageLocal(toLower(language)) == true) {
lang.loadStrings(toLower(language));
lang.loadGameStrings(toLower(language));
}
if(foundFilesToDelete == true) {
mainMessageBoxState=0;
Lang &lang= Lang::getInstance();
showMessageBox(lang.get("TransifexDeleteSuccess"), lang.get("Notice"), false);
showMessageBox(lang.getString("TransifexDeleteSuccess"), lang.getString("Notice"), false);
}
}
}
@ -873,14 +873,14 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
if(reloadLanguage == true && langName != "") {
Lang &lang= Lang::getInstance();
if(lang.isLanguageLocal(toLower(langName)) == true) {
lang.loadStrings(toLower(langName));
lang.loadGameStrings(toLower(langName));
}
}
if(gotDownloads == true) {
mainMessageBoxState=0;
Lang &lang= Lang::getInstance();
showMessageBox(lang.get("TransifexDownloadSuccess") + "\n" + langName, lang.get("Notice"), false);
showMessageBox(lang.getString("TransifexDownloadSuccess") + "\n" + langName, lang.getString("Notice"), false);
}
}
return;
@ -968,7 +968,7 @@ void MenuStateOptions::keyPress(SDL_KeyboardEvent c) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),c) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}
}
@ -1051,7 +1051,7 @@ void MenuStateOptions::saveConfig(){
std::advance(iterMap, listBoxLang.getSelectedItemIndex());
config.setString("Lang", iterMap->first);
lang.loadStrings(config.getString("Lang"));
lang.loadGameStrings(config.getString("Lang"));
config.setString("FontSizeAdjustment", listFontSizeAdjustment.getSelectedItem());
config.setString("ScreenShotFileType", listBoxScreenShotType.getSelectedItem());
@ -1069,7 +1069,7 @@ void MenuStateOptions::saveConfig(){
LuaScript::setDisableSandbox(true);
}
Renderer::getInstance().loadConfig();
console.addLine(lang.get("SettingsSaved"));
console.addLine(lang.getString("SettingsSaved"));
}
void MenuStateOptions::setActiveInputLable(GraphicLabel *newLable) {

View File

@ -64,7 +64,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
int tabButtonHeight=30;
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -72,33 +72,33 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
buttonAudioSection.init(0, 720,tabButtonWidth,tabButtonHeight);
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
// Video Section
buttonVideoSection.registerGraphicComponent(containerName,"labelVideoSection");
buttonVideoSection.init(200, 700,tabButtonWidth,tabButtonHeight+20);
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
//currentLine-=lineOffset;
//MiscSection
buttonMiscSection.registerGraphicComponent(containerName,"labelMiscSection");
buttonMiscSection.init(400, 720,tabButtonWidth,tabButtonHeight);
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
//NetworkSettings
buttonNetworkSettings.registerGraphicComponent(containerName,"labelNetworkSettingsSection");
buttonNetworkSettings.init(600, 720,tabButtonWidth,tabButtonHeight);
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
//KeyboardSetup
buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup");
buttonKeyboardSetup.init(800, 720,tabButtonWidth,tabButtonHeight);
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
int currentLine=650; // reset line pos
int currentLabelStart=leftLabelStart; // set to right side
@ -107,7 +107,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//resolution
labelScreenModes.registerGraphicComponent(containerName,"labelScreenModes");
labelScreenModes.init(currentLabelStart, currentLine);
labelScreenModes.setText(lang.get("Resolution"));
labelScreenModes.setText(lang.getString("Resolution"));
listBoxScreenModes.registerGraphicComponent(containerName,"listBoxScreenModes");
listBoxScreenModes.init(currentColumnStart, currentLine, 200);
@ -135,14 +135,14 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
checkBoxFullscreenWindowed.registerGraphicComponent(containerName,"checkBoxFullscreenWindowed");
checkBoxFullscreenWindowed.init(currentColumnStart, currentLine);
labelFullscreenWindowed.setText(lang.get("Windowed"));
labelFullscreenWindowed.setText(lang.getString("Windowed"));
checkBoxFullscreenWindowed.setValue(config.getBool("Windowed"));
currentLine-=lineOffset;
//gammaCorrection
labelGammaCorrection.registerGraphicComponent(containerName,"labelGammaCorrection");
labelGammaCorrection.init(currentLabelStart, currentLine);
labelGammaCorrection.setText(lang.get("GammaCorrection"));
labelGammaCorrection.setText(lang.getString("GammaCorrection"));
listBoxGammaCorrection.registerGraphicComponent(containerName,"listBoxGammaCorrection");
listBoxGammaCorrection.init(currentColumnStart, currentLine, 200);
@ -158,7 +158,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//filter
labelFilter.registerGraphicComponent(containerName,"labelFilter");
labelFilter.init(currentLabelStart, currentLine);
labelFilter.setText(lang.get("Filter"));
labelFilter.setText(lang.getString("Filter"));
listBoxFilter.registerGraphicComponent(containerName,"listBoxFilter");
listBoxFilter.init(currentColumnStart, currentLine, 200);
@ -170,7 +170,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//selectionType
labelSelectionType.registerGraphicComponent(containerName,"labelSelectionType");
labelSelectionType.init(currentLabelStart, currentLine);
labelSelectionType.setText(lang.get("SelectionType"));
labelSelectionType.setText(lang.getString("SelectionType"));
listBoxSelectionType.registerGraphicComponent(containerName,"listBoxSelectionType");
listBoxSelectionType.init(currentColumnStart, currentLine, 200);
@ -190,12 +190,12 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//shadows
labelShadows.registerGraphicComponent(containerName,"labelShadows");
labelShadows.init(currentLabelStart, currentLine);
labelShadows.setText(lang.get("Shadows"));
labelShadows.setText(lang.getString("Shadows"));
listBoxShadows.registerGraphicComponent(containerName,"listBoxShadows");
listBoxShadows.init(currentColumnStart, currentLine, 200);
for(int i= 0; i<Renderer::sCount; ++i){
listBoxShadows.pushBackItem(lang.get(Renderer::shadowsToStr(static_cast<Renderer::Shadows>(i))));
listBoxShadows.pushBackItem(lang.getString(Renderer::shadowsToStr(static_cast<Renderer::Shadows>(i))));
}
string str= config.getString("Shadows");
listBoxShadows.setSelectedItemIndex(clamp(Renderer::strToShadows(str), 0, Renderer::sCount-1));
@ -204,7 +204,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//shadows
labelShadowTextureSize.registerGraphicComponent(containerName,"labelShadowTextureSize");
labelShadowTextureSize.init(currentLabelStart, currentLine);
labelShadowTextureSize.setText(lang.get("ShadowTextureSize"));
labelShadowTextureSize.setText(lang.getString("ShadowTextureSize"));
listBoxShadowTextureSize.registerGraphicComponent(containerName,"listBoxShadowTextureSize");
listBoxShadowTextureSize.init(currentColumnStart, currentLine, 200);
@ -218,7 +218,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//shadows
labelShadowIntensity.registerGraphicComponent(containerName,"labelShadowIntensity");
labelShadowIntensity.init(currentLabelStart, currentLine);
labelShadowIntensity.setText(lang.get("ShadowIntensity"));
labelShadowIntensity.setText(lang.getString("ShadowIntensity"));
listBoxShadowIntensity.registerGraphicComponent(containerName,"listBoxShadowIntensity");
listBoxShadowIntensity.init(currentColumnStart, currentLine, 200);
@ -237,14 +237,14 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
checkBoxTextures3D.registerGraphicComponent(containerName,"checkBoxTextures3D");
checkBoxTextures3D.init(currentColumnStart, currentLine);
labelTextures3D.setText(lang.get("Textures3D"));
labelTextures3D.setText(lang.getString("Textures3D"));
checkBoxTextures3D.setValue(config.getBool("Textures3D"));
currentLine-=lineOffset;
//lights
labelLights.registerGraphicComponent(containerName,"labelLights");
labelLights.init(currentLabelStart, currentLine);
labelLights.setText(lang.get("MaxLights"));
labelLights.setText(lang.getString("MaxLights"));
listBoxLights.registerGraphicComponent(containerName,"listBoxLights");
listBoxLights.init(currentColumnStart, currentLine, 80);
@ -257,7 +257,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//unit particles
labelUnitParticles.registerGraphicComponent(containerName,"labelUnitParticles");
labelUnitParticles.init(currentLabelStart,currentLine);
labelUnitParticles.setText(lang.get("ShowUnitParticles"));
labelUnitParticles.setText(lang.getString("ShowUnitParticles"));
checkBoxUnitParticles.registerGraphicComponent(containerName,"checkBoxUnitParticles");
checkBoxUnitParticles.init(currentColumnStart,currentLine);
@ -267,7 +267,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//tileset particles
labelTilesetParticles.registerGraphicComponent(containerName,"labelTilesetParticles");
labelTilesetParticles.init(currentLabelStart,currentLine);
labelTilesetParticles.setText(lang.get("ShowTilesetParticles"));
labelTilesetParticles.setText(lang.getString("ShowTilesetParticles"));
checkBoxTilesetParticles.registerGraphicComponent(containerName,"checkBoxTilesetParticles");
checkBoxTilesetParticles.init(currentColumnStart,currentLine);
@ -277,7 +277,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//animated tileset objects
labelAnimatedTilesetObjects.registerGraphicComponent(containerName,"labelAnimatedTilesetObjects");
labelAnimatedTilesetObjects.init(currentLabelStart,currentLine);
labelAnimatedTilesetObjects.setText(lang.get("AnimatedTilesetObjects"));
labelAnimatedTilesetObjects.setText(lang.getString("AnimatedTilesetObjects"));
listBoxAnimatedTilesetObjects.registerGraphicComponent(containerName,"listBoxAnimatedTilesetObjects");
listBoxAnimatedTilesetObjects.init(currentColumnStart, currentLine, 80);
@ -296,7 +296,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
//unit particles
labelMapPreview.registerGraphicComponent(containerName,"labelMapPreview");
labelMapPreview.init(currentLabelStart,currentLine);
labelMapPreview.setText(lang.get("ShowMapPreview"));
labelMapPreview.setText(lang.getString("ShowMapPreview"));
checkBoxMapPreview.registerGraphicComponent(containerName,"checkBoxMapPreview");
checkBoxMapPreview.init(currentColumnStart,currentLine);
@ -306,7 +306,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
// Texture Compression flag
labelEnableTextureCompression.registerGraphicComponent(containerName,"labelEnableTextureCompression");
labelEnableTextureCompression.init(currentLabelStart ,currentLine);
labelEnableTextureCompression.setText(lang.get("EnableTextureCompression"));
labelEnableTextureCompression.setText(lang.getString("EnableTextureCompression"));
checkBoxEnableTextureCompression.registerGraphicComponent(containerName,"checkBoxEnableTextureCompression");
checkBoxEnableTextureCompression.init(currentColumnStart ,currentLine );
@ -315,7 +315,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
labelRainEffect.registerGraphicComponent(containerName,"labelRainEffect");
labelRainEffect.init(currentLabelStart ,currentLine);
labelRainEffect.setText(lang.get("RainEffectMenuGame"));
labelRainEffect.setText(lang.getString("RainEffectMenuGame"));
checkBoxRainEffectMenu.registerGraphicComponent(containerName,"checkBoxRainEffectMenu");
checkBoxRainEffectMenu.init(currentColumnStart ,currentLine );
@ -332,7 +332,7 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
labelVideos.registerGraphicComponent(containerName,"labelVideos");
labelVideos.init(currentLabelStart ,currentLine);
labelVideos.setText(lang.get("EnableVideos"));
labelVideos.setText(lang.getString("EnableVideos"));
checkBoxVideos.registerGraphicComponent(containerName,"checkBoxVideos");
checkBoxVideos.init(currentColumnStart ,currentLine );
@ -346,17 +346,17 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
// buttons
buttonOk.registerGraphicComponent(containerName,"buttonOk");
buttonOk.init(buttonStartPos, buttonRowPos, 100);
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
buttonReturn.registerGraphicComponent(containerName,"buttonAbort");
buttonReturn.init(buttonStartPos+110, buttonRowPos, 100);
buttonAutoConfig.setText(lang.get("AutoConfig"));
buttonAutoConfig.setText(lang.getString("AutoConfig"));
buttonAutoConfig.registerGraphicComponent(containerName,"buttonAutoConfig");
buttonAutoConfig.init(buttonStartPos+250, buttonRowPos, 125);
buttonVideoInfo.setText(lang.get("VideoInfo"));
buttonVideoInfo.setText(lang.getString("VideoInfo"));
buttonVideoInfo.registerGraphicComponent(containerName,"buttonVideoInfo");
buttonVideoInfo.init(buttonStartPos+385, buttonRowPos, 125); // was 620
@ -372,23 +372,23 @@ void MenuStateOptionsGraphics::reloadUI() {
Lang &lang= Lang::getInstance();
console.resetFonts();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
std::vector<string> listboxData;
listboxData.push_back("None");
@ -398,10 +398,10 @@ void MenuStateOptionsGraphics::reloadUI() {
// listboxData.push_back("DirectSound8");
//#endif
labelScreenModes.setText(lang.get("Resolution"));
labelScreenModes.setText(lang.getString("Resolution"));
labelFullscreenWindowed.setText(lang.get("Windowed"));
labelFilter.setText(lang.get("Filter"));
labelFullscreenWindowed.setText(lang.getString("Windowed"));
labelFilter.setText(lang.getString("Filter"));
listboxData.clear();
listboxData.push_back("Bilinear");
@ -422,41 +422,41 @@ void MenuStateOptionsGraphics::reloadUI() {
listBoxShadowIntensity.setItems(listboxData);
labelShadows.setText(lang.get("Shadows"));
labelShadowTextureSize.setText(lang.get("ShadowTextureSize"));
labelShadows.setText(lang.getString("Shadows"));
labelShadowTextureSize.setText(lang.getString("ShadowTextureSize"));
listboxData.clear();
for(int i= 0; i<Renderer::sCount; ++i){
listboxData.push_back(lang.get(Renderer::shadowsToStr(static_cast<Renderer::Shadows>(i))));
listboxData.push_back(lang.getString(Renderer::shadowsToStr(static_cast<Renderer::Shadows>(i))));
}
listBoxShadows.setItems(listboxData);
labelTextures3D.setText(lang.get("Textures3D"));
labelTextures3D.setText(lang.getString("Textures3D"));
labelLights.setText(lang.get("MaxLights"));
labelLights.setText(lang.getString("MaxLights"));
labelUnitParticles.setText(lang.get("ShowUnitParticles"));
labelUnitParticles.setText(lang.getString("ShowUnitParticles"));
labelTilesetParticles.setText(lang.get("ShowTilesetParticles"));
labelAnimatedTilesetObjects.setText(lang.get("AnimatedTilesetObjects"));
labelTilesetParticles.setText(lang.getString("ShowTilesetParticles"));
labelAnimatedTilesetObjects.setText(lang.getString("AnimatedTilesetObjects"));
labelMapPreview.setText(lang.get("ShowMapPreview"));
labelMapPreview.setText(lang.getString("ShowMapPreview"));
labelEnableTextureCompression.setText(lang.get("EnableTextureCompression"));
labelEnableTextureCompression.setText(lang.getString("EnableTextureCompression"));
labelRainEffect.setText(lang.get("RainEffect"));
labelRainEffect.setText(lang.getString("RainEffect"));
labelVideos.setText(lang.get("EnableVideos"));
labelVideos.setText(lang.getString("EnableVideos"));
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
buttonAutoConfig.setText(lang.get("AutoConfig"));
buttonAutoConfig.setText(lang.getString("AutoConfig"));
buttonVideoInfo.setText(lang.get("VideoInfo"));
buttonVideoInfo.setText(lang.getString("VideoInfo"));
labelSelectionType.setText(lang.get("SelectionType"));
labelSelectionType.setText(lang.getString("SelectionType"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -513,7 +513,7 @@ void MenuStateOptionsGraphics::update(){
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
revertScreenMode();
}
@ -522,7 +522,7 @@ void MenuStateOptionsGraphics::update(){
Lang &lang= Lang::getInstance();
int timeToShow=waitTime- time(NULL) + screenModeChangedTimer;
// show timer in button
mainMessageBox.getButton(0)->setText(lang.get("Ok")+" ("+intToStr(timeToShow)+")");
mainMessageBox.getButton(0)->setText(lang.getString("Ok")+" ("+intToStr(timeToShow)+")");
}
}
}
@ -547,14 +547,14 @@ void MenuStateOptionsGraphics::mouseClick(int x, int y, MouseButton mouseButton)
saveConfig();
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
//mainMenu->setState(new MenuStateOptions(program, mainMenu));
}
else {
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
}
}
else {
@ -563,7 +563,7 @@ void MenuStateOptionsGraphics::mouseClick(int x, int y, MouseButton mouseButton)
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
revertScreenMode();
}
@ -606,10 +606,10 @@ void MenuStateOptionsGraphics::mouseClick(int x, int y, MouseButton mouseButton)
this->mainMenu->init();
mainMessageBoxState=1;
mainMessageBox.init(lang.get("Ok"),lang.get("Cancel"));
mainMessageBox.init(lang.getString("Ok"),lang.getString("Cancel"));
screenModeChangedTimer= time(NULL);
//showMessageBox(lang.get("RestartNeeded"), lang.get("ResolutionChanged"), false);
showMessageBox(lang.get("ResolutionChanged"), lang.get("Notice"), false);
//showMessageBox(lang.getString("RestartNeeded"), lang.getString("ResolutionChanged"), false);
showMessageBox(lang.getString("ResolutionChanged"), lang.getString("Notice"), false);
//No saveConfig() here! this is done by the messageBox
return;
}
@ -770,7 +770,7 @@ void MenuStateOptionsGraphics::keyPress(SDL_KeyboardEvent c) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),c) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
// }
}
@ -916,7 +916,7 @@ void MenuStateOptionsGraphics::saveConfig(){
}
Renderer::getInstance().loadConfig();
console.addLine(lang.get("SettingsSaved"));
console.addLine(lang.getString("SettingsSaved"));
}
//void MenuStateOptionsGraphics::setActiveInputLable(GraphicLabel *newLable) {

View File

@ -60,7 +60,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
int tabButtonHeight=30;
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -68,33 +68,33 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
buttonAudioSection.init(0, 720,tabButtonWidth,tabButtonHeight);
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
// Video Section
buttonVideoSection.registerGraphicComponent(containerName,"labelVideoSection");
buttonVideoSection.init(200, 720,tabButtonWidth,tabButtonHeight);
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
//currentLine-=lineOffset;
//MiscSection
buttonMiscSection.registerGraphicComponent(containerName,"labelMiscSection");
buttonMiscSection.init(400, 720,tabButtonWidth,tabButtonHeight);
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
//NetworkSettings
buttonNetworkSettings.registerGraphicComponent(containerName,"labelNetworkSettingsSection");
buttonNetworkSettings.init(600, 700,tabButtonWidth,tabButtonHeight+20);
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
//KeyboardSetup
buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup");
buttonKeyboardSetup.init(800, 720,tabButtonWidth,tabButtonHeight);
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
int currentLine=650; // reset line pos
int currentLabelStart=leftLabelStart; // set to right side
@ -104,7 +104,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
// external server port
labelPublishServerExternalPort.registerGraphicComponent(containerName,"labelPublishServerExternalPort");
labelPublishServerExternalPort.init(currentLabelStart, currentLine, 150);
labelPublishServerExternalPort.setText(lang.get("PublishServerExternalPort"));
labelPublishServerExternalPort.setText(lang.getString("PublishServerExternalPort"));
labelExternalPort.init(currentColumnStart,currentLine);
string extPort= config.getString("PortExternal","not set");
@ -120,7 +120,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
// server port
labelServerPortLabel.registerGraphicComponent(containerName,"labelServerPortLabel");
labelServerPortLabel.init(currentLabelStart,currentLine);
labelServerPortLabel.setText(lang.get("ServerPort"));
labelServerPortLabel.setText(lang.getString("ServerPort"));
listBoxServerPort.registerGraphicComponent(containerName,"listBoxPublishServerExternalPort");
listBoxServerPort.init(currentColumnStart, currentLine, 170);
@ -145,7 +145,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
currentLine-=lineOffset;
labelFTPServerPortLabel.registerGraphicComponent(containerName,"labelFTPServerPortLabel");
labelFTPServerPortLabel.init(currentLabelStart ,currentLine );
labelFTPServerPortLabel.setText(lang.get("FTPServerPort"));
labelFTPServerPortLabel.setText(lang.getString("FTPServerPort"));
int FTPPort = config.getInt("FTPServerPort",intToStr(ServerSocket::getFTPServerPort()).c_str());
labelFTPServerPort.registerGraphicComponent(containerName,"labelFTPServerPort");
@ -154,7 +154,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
currentLine-=lineOffset;
labelFTPServerDataPortsLabel.registerGraphicComponent(containerName,"labelFTPServerDataPortsLabel");
labelFTPServerDataPortsLabel.init(currentLabelStart ,currentLine );
labelFTPServerDataPortsLabel.setText(lang.get("FTPServerDataPort"));
labelFTPServerDataPortsLabel.setText(lang.getString("FTPServerDataPort"));
char szBuf[8096]="";
snprintf(szBuf,8096,"%d - %d",FTPPort + 1, FTPPort + GameConstants::maxPlayers);
@ -165,7 +165,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
currentLine-=lineOffset;
labelEnableFTPServer.registerGraphicComponent(containerName,"labelEnableFTPServer");
labelEnableFTPServer.init(currentLabelStart ,currentLine);
labelEnableFTPServer.setText(lang.get("EnableFTPServer"));
labelEnableFTPServer.setText(lang.getString("EnableFTPServer"));
checkBoxEnableFTPServer.registerGraphicComponent(containerName,"checkBoxEnableFTPServer");
checkBoxEnableFTPServer.init(currentColumnStart ,currentLine );
@ -174,7 +174,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
// FTP Config - start
labelEnableFTP.registerGraphicComponent(containerName,"labelEnableFTP");
labelEnableFTP.init(currentLabelStart ,currentLine);
labelEnableFTP.setText(lang.get("EnableFTP"));
labelEnableFTP.setText(lang.getString("EnableFTP"));
checkBoxEnableFTP.registerGraphicComponent(containerName,"checkBoxEnableFTP");
checkBoxEnableFTP.init(currentColumnStart ,currentLine );
@ -183,7 +183,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
labelEnableFTPServerInternetTilesetXfer.registerGraphicComponent(containerName,"labelEnableFTPServerInternetTilesetXfer");
labelEnableFTPServerInternetTilesetXfer.init(currentLabelStart ,currentLine );
labelEnableFTPServerInternetTilesetXfer.setText(lang.get("EnableFTPServerInternetTilesetXfer"));
labelEnableFTPServerInternetTilesetXfer.setText(lang.getString("EnableFTPServerInternetTilesetXfer"));
checkBoxEnableFTPServerInternetTilesetXfer.registerGraphicComponent(containerName,"checkBoxEnableFTPServerInternetTilesetXfer");
checkBoxEnableFTPServerInternetTilesetXfer.init(currentColumnStart ,currentLine );
@ -193,7 +193,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
labelEnableFTPServerInternetTechtreeXfer.registerGraphicComponent(containerName,"labelEnableFTPServerInternetTechtreeXfer");
labelEnableFTPServerInternetTechtreeXfer.init(currentLabelStart ,currentLine );
labelEnableFTPServerInternetTechtreeXfer.setText(lang.get("EnableFTPServerInternetTechtreeXfer"));
labelEnableFTPServerInternetTechtreeXfer.setText(lang.getString("EnableFTPServerInternetTechtreeXfer"));
checkBoxEnableFTPServerInternetTechtreeXfer.registerGraphicComponent(containerName,"checkBoxEnableFTPServerInternetTechtreeXfer");
checkBoxEnableFTPServerInternetTechtreeXfer.init(currentColumnStart ,currentLine );
@ -207,7 +207,7 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
// Privacy flag
labelEnablePrivacy.registerGraphicComponent(containerName,"labelEnablePrivacy");
labelEnablePrivacy.init(currentLabelStart ,currentLine);
labelEnablePrivacy.setText(lang.get("PrivacyPlease"));
labelEnablePrivacy.setText(lang.getString("PrivacyPlease"));
checkBoxEnablePrivacy.registerGraphicComponent(containerName,"checkBoxEnablePrivacy");
checkBoxEnablePrivacy.init(currentColumnStart ,currentLine );
@ -218,8 +218,8 @@ MenuStateOptionsNetwork::MenuStateOptionsNetwork(Program *program, MainMenu *mai
// buttons
buttonOk.registerGraphicComponent(containerName,"buttonOk");
buttonOk.init(buttonStartPos, buttonRowPos, 100);
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
buttonReturn.registerGraphicComponent(containerName,"buttonAbort");
buttonReturn.init(buttonStartPos+110, buttonRowPos, 100);
@ -236,23 +236,23 @@ void MenuStateOptionsNetwork::reloadUI() {
Lang &lang= Lang::getInstance();
console.resetFonts();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
std::vector<string> listboxData;
listboxData.push_back("None");
@ -273,30 +273,30 @@ void MenuStateOptionsNetwork::reloadUI() {
}
listboxData.clear();
for(int i= 0; i<Renderer::sCount; ++i){
listboxData.push_back(lang.get(Renderer::shadowsToStr(static_cast<Renderer::Shadows>(i))));
listboxData.push_back(lang.getString(Renderer::shadowsToStr(static_cast<Renderer::Shadows>(i))));
}
labelServerPortLabel.setText(lang.get("ServerPort"));
labelServerPortLabel.setText(lang.getString("ServerPort"));
labelPublishServerExternalPort.setText(lang.get("PublishServerExternalPort"));
labelPublishServerExternalPort.setText(lang.getString("PublishServerExternalPort"));
labelEnableFTP.setText(lang.get("EnableFTP"));
labelEnableFTP.setText(lang.getString("EnableFTP"));
labelEnableFTPServer.setText(lang.get("EnableFTPServer"));
labelEnableFTPServer.setText(lang.getString("EnableFTPServer"));
labelFTPServerPortLabel.setText(lang.get("FTPServerPort"));
labelFTPServerPortLabel.setText(lang.getString("FTPServerPort"));
labelFTPServerDataPortsLabel.setText(lang.get("FTPServerDataPort"));
labelFTPServerDataPortsLabel.setText(lang.getString("FTPServerDataPort"));
labelEnableFTPServerInternetTilesetXfer.setText(lang.get("EnableFTPServerInternetTilesetXfer"));
labelEnableFTPServerInternetTilesetXfer.setText(lang.getString("EnableFTPServerInternetTilesetXfer"));
labelEnableFTPServerInternetTechtreeXfer.setText(lang.get("EnableFTPServerInternetTechtreeXfer"));
labelEnableFTPServerInternetTechtreeXfer.setText(lang.getString("EnableFTPServerInternetTechtreeXfer"));
labelEnablePrivacy.setText(lang.get("PrivacyPlease"));
labelEnablePrivacy.setText(lang.getString("PrivacyPlease"));
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -334,14 +334,14 @@ void MenuStateOptionsNetwork::mouseClick(int x, int y, MouseButton mouseButton){
saveConfig();
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMenu->setState(new MenuStateOptions(program, mainMenu));
}
else {
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
}
}
@ -457,7 +457,7 @@ void MenuStateOptionsNetwork::keyPress(SDL_KeyboardEvent c) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),c) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
// }
}
@ -514,7 +514,7 @@ void MenuStateOptionsNetwork::saveConfig(){
setActiveInputLable(NULL);
lang.loadStrings(config.getString("Lang"));
lang.loadGameStrings(config.getString("Lang"));
config.setString("PortServer", listBoxServerPort.getSelectedItem());
config.setInt("FTPServerPort",config.getInt("PortServer")+1);
@ -541,7 +541,7 @@ void MenuStateOptionsNetwork::saveConfig(){
}
Renderer::getInstance().loadConfig();
console.addLine(lang.get("SettingsSaved"));
console.addLine(lang.getString("SettingsSaved"));
}
void MenuStateOptionsNetwork::setActiveInputLable(GraphicLabel *newLable) {

View File

@ -60,7 +60,7 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen
int tabButtonHeight=30;
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -68,33 +68,33 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen
buttonAudioSection.init(0, 700,tabButtonWidth,tabButtonHeight+20);
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
// Video Section
buttonVideoSection.registerGraphicComponent(containerName,"labelVideoSection");
buttonVideoSection.init(200, 720,tabButtonWidth,tabButtonHeight);
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
//currentLine-=lineOffset;
//MiscSection
buttonMiscSection.registerGraphicComponent(containerName,"labelMiscSection");
buttonMiscSection.init(400, 720,tabButtonWidth,tabButtonHeight);
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
//NetworkSettings
buttonNetworkSettings.registerGraphicComponent(containerName,"labelNetworkSettingsSection");
buttonNetworkSettings.init(600, 720,tabButtonWidth,tabButtonHeight);
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
//KeyboardSetup
buttonKeyboardSetup.registerGraphicComponent(containerName,"buttonKeyboardSetup");
buttonKeyboardSetup.init(800, 720,tabButtonWidth,tabButtonHeight);
buttonKeyboardSetup.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonKeyboardSetup.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonKeyboardSetup.setText(lang.get("Keyboardsetup"));
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
int currentLine=650; // reset line pos
int currentLabelStart=leftLabelStart; // set to right side
@ -103,7 +103,7 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen
//soundboxes
labelSoundFactory.registerGraphicComponent(containerName,"labelSoundFactory");
labelSoundFactory.init(currentLabelStart, currentLine);
labelSoundFactory.setText(lang.get("SoundAndMusic"));
labelSoundFactory.setText(lang.getString("SoundAndMusic"));
listBoxSoundFactory.registerGraphicComponent(containerName,"listBoxSoundFactory");
listBoxSoundFactory.init(currentColumnStart, currentLine, 100);
@ -119,7 +119,7 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen
labelVolumeFx.registerGraphicComponent(containerName,"labelVolumeFx");
labelVolumeFx.init(currentLabelStart, currentLine);
labelVolumeFx.setText(lang.get("FxVolume"));
labelVolumeFx.setText(lang.getString("FxVolume"));
listBoxVolumeFx.registerGraphicComponent(containerName,"listBoxVolumeFx");
listBoxVolumeFx.init(currentColumnStart, currentLine, 80);
@ -130,7 +130,7 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen
listBoxVolumeAmbient.registerGraphicComponent(containerName,"listBoxVolumeAmbient");
listBoxVolumeAmbient.init(currentColumnStart, currentLine, 80);
labelVolumeAmbient.setText(lang.get("AmbientVolume"));
labelVolumeAmbient.setText(lang.getString("AmbientVolume"));
currentLine-=lineOffset;
labelVolumeMusic.registerGraphicComponent(containerName,"labelVolumeMusic");
@ -138,7 +138,7 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen
listBoxVolumeMusic.registerGraphicComponent(containerName,"listBoxVolumeMusic");
listBoxVolumeMusic.init(currentColumnStart, currentLine, 80);
labelVolumeMusic.setText(lang.get("MusicVolume"));
labelVolumeMusic.setText(lang.getString("MusicVolume"));
//currentLine-=lineOffset;
for(int i=0; i<=100; i+=5){
@ -166,8 +166,8 @@ MenuStateOptionsSound::MenuStateOptionsSound(Program *program, MainMenu *mainMen
// buttons
buttonOk.registerGraphicComponent(containerName,"buttonOk");
buttonOk.init(buttonStartPos, buttonRowPos, 100);
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
buttonReturn.registerGraphicComponent(containerName,"buttonAbort");
buttonReturn.init(buttonStartPos+110, buttonRowPos, 100);
@ -184,25 +184,25 @@ void MenuStateOptionsSound::reloadUI() {
Lang &lang= Lang::getInstance();
console.resetFonts();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
buttonAudioSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonAudioSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonAudioSection.setText(lang.get("Audio"));
buttonAudioSection.setText(lang.getString("Audio"));
buttonVideoSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonVideoSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonVideoSection.setText(lang.get("Video"));
buttonVideoSection.setText(lang.getString("Video"));
buttonMiscSection.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonMiscSection.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonMiscSection.setText(lang.get("Misc"));
buttonMiscSection.setText(lang.getString("Misc"));
buttonNetworkSettings.setFont(CoreData::getInstance().getMenuFontVeryBig());
buttonNetworkSettings.setFont3D(CoreData::getInstance().getMenuFontVeryBig3D());
buttonNetworkSettings.setText(lang.get("Network"));
buttonNetworkSettings.setText(lang.getString("Network"));
labelSoundFactory.setText(lang.get("SoundAndMusic"));
labelSoundFactory.setText(lang.getString("SoundAndMusic"));
std::vector<string> listboxData;
listboxData.push_back("None");
@ -214,16 +214,16 @@ void MenuStateOptionsSound::reloadUI() {
listBoxSoundFactory.setItems(listboxData);
labelVolumeFx.setText(lang.get("FxVolume"));
labelVolumeFx.setText(lang.getString("FxVolume"));
labelVolumeAmbient.setText(lang.get("AmbientVolume"));
labelVolumeMusic.setText(lang.get("MusicVolume"));
labelVolumeAmbient.setText(lang.getString("AmbientVolume"));
labelVolumeMusic.setText(lang.getString("MusicVolume"));
listboxData.clear();
buttonOk.setText(lang.get("Save"));
buttonReturn.setText(lang.get("Return"));
buttonOk.setText(lang.getString("Save"));
buttonReturn.setText(lang.getString("Return"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}
@ -263,14 +263,14 @@ void MenuStateOptionsSound::mouseClick(int x, int y, MouseButton mouseButton){
saveConfig();
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMenu->setState(new MenuStateOptions(program, mainMenu));
}
else {
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
}
}
else {
@ -279,7 +279,7 @@ void MenuStateOptionsSound::mouseClick(int x, int y, MouseButton mouseButton){
mainMessageBox.setEnabled(false);
Lang &lang= Lang::getInstance();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
this->mainMenu->init();
@ -383,7 +383,7 @@ void MenuStateOptionsSound::keyPress(SDL_KeyboardEvent c) {
if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),c) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
// }
}
@ -452,7 +452,7 @@ void MenuStateOptionsSound::saveConfig(){
}
Renderer::getInstance().loadConfig();
console.addLine(lang.get("SettingsSaved"));
console.addLine(lang.getString("SettingsSaved"));
}
void MenuStateOptionsSound::setActiveInputLable(GraphicLabel *newLable) {

View File

@ -71,20 +71,20 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
buttonExit.registerGraphicComponent(containerName,"buttonExit");
buttonExit.init(425, yPos, 150);
buttonNewGame.setText(lang.get("NewGame"));
buttonLoadGame.setText(lang.get("LoadGame"));
buttonMods.setText(lang.get("Mods"));
buttonOptions.setText(lang.get("Options"));
buttonAbout.setText(lang.get("About"));
buttonExit.setText(lang.get("Exit"));
buttonNewGame.setText(lang.getString("NewGame"));
buttonLoadGame.setText(lang.getString("LoadGame"));
buttonMods.setText(lang.getString("Mods"));
buttonOptions.setText(lang.getString("Options"));
buttonAbout.setText(lang.getString("About"));
buttonExit.setText(lang.getString("Exit"));
//mesage box
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Yes"), lang.get("No"));
mainMessageBox.init(lang.getString("Yes"), lang.getString("No"));
mainMessageBox.setEnabled(false);
errorMessageBox.registerGraphicComponent(containerName,"errorMessageBox");
errorMessageBox.init(lang.get("Ok"));
errorMessageBox.init(lang.getString("Ok"));
errorMessageBox.setEnabled(false);
//PopupMenu popupMenu;
@ -113,15 +113,15 @@ void MenuStateRoot::reloadUI() {
labelVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]");
}
buttonNewGame.setText(lang.get("NewGame"));
buttonLoadGame.setText(lang.get("LoadGame"));
buttonMods.setText(lang.get("Mods"));
buttonOptions.setText(lang.get("Options"));
buttonAbout.setText(lang.get("About"));
buttonExit.setText(lang.get("Exit"));
buttonNewGame.setText(lang.getString("NewGame"));
buttonLoadGame.setText(lang.getString("LoadGame"));
buttonMods.setText(lang.getString("Mods"));
buttonOptions.setText(lang.getString("Options"));
buttonAbout.setText(lang.getString("About"));
buttonExit.setText(lang.getString("Exit"));
mainMessageBox.init(lang.get("Yes"), lang.get("No"));
errorMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Yes"), lang.getString("No"));
errorMessageBox.init(lang.getString("Ok"));
console.resetFonts();
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
@ -319,7 +319,7 @@ void MenuStateRoot::keyDown(SDL_KeyboardEvent key) {
//if(key == configKeys.getCharKey("ExitKey")) {
if(isKeyPressed(configKeys.getSDLKey("ExitKey"),key) == true) {
Lang &lang= Lang::getInstance();
showMessageBox(lang.get("ExitGame?"), "", true);
showMessageBox(lang.getString("ExitGame?"), "", true);
}
//else if(mainMessageBox.getEnabled() == true && key == vkReturn) {
else if(mainMessageBox.getEnabled() == true && isKeyPressed(SDLK_RETURN,key) == true) {
@ -339,7 +339,7 @@ void MenuStateRoot::keyDown(SDL_KeyboardEvent key) {
else if(isKeyPressed(configKeys.getSDLKey("SaveGUILayout"),key) == true) {
GraphicComponent::saveAllCustomProperties(containerName);
//Lang &lang= Lang::getInstance();
//console.addLine(lang.get("GUILayoutSaved") + " [" + (saved ? lang.get("Yes") : lang.get("No"))+ "]");
//console.addLine(lang.getString("GUILayoutSaved") + " [" + (saved ? lang.getString("Yes") : lang.getString("No"))+ "]");
}
}

View File

@ -59,7 +59,7 @@ MenuStateScenario::MenuStateScenario(Program *program, MainMenu *mainMenu,
}
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -73,11 +73,11 @@ MenuStateScenario::MenuStateScenario(Program *program, MainMenu *mainMenu,
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(buttonStartX, buttonStartY, 125);
buttonReturn.setText(lang.get("Return"));
buttonReturn.setText(lang.getString("Return"));
buttonPlayNow.registerGraphicComponent(containerName,"buttonPlayNow");
buttonPlayNow.init(buttonStartX+150, buttonStartY, 125);
buttonPlayNow.setText(lang.get("PlayNow"));
buttonPlayNow.setText(lang.getString("PlayNow"));
int startY=700;
int startX=50;
@ -99,10 +99,10 @@ MenuStateScenario::MenuStateScenario(Program *program, MainMenu *mainMenu,
labelInfo.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
if(this->isTutorialMode == true) {
labelScenario.setText(lang.get("Tutorial"));
labelScenario.setText(lang.getString("Tutorial"));
}
else {
labelScenario.setText(lang.get("Scenario"));
labelScenario.setText(lang.getString("Scenario"));
}
//scenario listbox
@ -169,17 +169,17 @@ void MenuStateScenario::reloadUI() {
Lang &lang= Lang::getInstance();
console.resetFonts();
mainMessageBox.init(lang.get("Ok"));
mainMessageBox.init(lang.getString("Ok"));
labelInfo.setFont(CoreData::getInstance().getMenuFontNormal());
labelInfo.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
labelScenarioName.setFont(CoreData::getInstance().getMenuFontNormal());
labelScenarioName.setFont3D(CoreData::getInstance().getMenuFontNormal3D());
buttonReturn.setText(lang.get("Return"));
buttonPlayNow.setText(lang.get("PlayNow"));
buttonReturn.setText(lang.getString("Return"));
buttonPlayNow.setText(lang.getString("PlayNow"));
labelScenario.setText(lang.get("Scenario"));
labelScenario.setText(lang.getString("Scenario"));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}

View File

@ -111,7 +111,7 @@ ServerLine::ServerLine(MasterServerInfo *mServerInfo, int lineIndex, int baseY,
wrongVersionLabel.init(i, baseY - lineOffset);
wrongVersionLabel.setTextColor(Vec3f(1.0f,0.0f,0.0f));
wrongVersionLabel.setText(lang.get("IncompatibleVersion"));
wrongVersionLabel.setText(lang.getString("IncompatibleVersion"));
//game setup info:
techLabel.init(i, baseY - lineOffset);
@ -141,7 +141,7 @@ ServerLine::ServerLine(MasterServerInfo *mServerInfo, int lineIndex, int baseY,
i+= 60;
status.init(i, baseY - lineOffset);
status.setTextColor(color);
status.setText(lang.get("MGGameStatus" + intToStr(masterServerInfo.getStatus())));
status.setText(lang.getString("MGGameStatus" + intToStr(masterServerInfo.getStatus())));
i+= 130;
selectButton.init(i, baseY - lineOffset, 30);
@ -165,7 +165,7 @@ void ServerLine::reloadUI() {
country.setText(masterServerInfo.getCountry());
wrongVersionLabel.setText(lang.get("IncompatibleVersion"));
wrongVersionLabel.setText(lang.getString("IncompatibleVersion"));
techLabel.setText(masterServerInfo.getTech());
@ -175,7 +175,7 @@ void ServerLine::reloadUI() {
externalConnectPort.setText(intToStr(masterServerInfo.getExternalConnectPort()));
status.setText(lang.get("MGGameStatus" + intToStr(masterServerInfo.getStatus())));
status.setText(lang.getString("MGGameStatus" + intToStr(masterServerInfo.getStatus())));
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
}

View File

@ -289,7 +289,7 @@ ClientInterface::~ClientInterface() {
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sQuitText = "has chosen to leave the game!";
if(lang.hasString("PlayerLeftGame",languageList[i]) == true) {
sQuitText = lang.get("PlayerLeftGame",languageList[i]);
sQuitText = lang.getString("PlayerLeftGame",languageList[i]);
}
if(clientSocket != NULL && clientSocket->isConnected() == true) {
@ -400,7 +400,7 @@ void ClientInterface::reset() {
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sQuitText = "has chosen to leave the game!";
if(lang.hasString("PlayerLeftGame",languageList[i]) == true) {
sQuitText = lang.get("PlayerLeftGame",languageList[i]);
sQuitText = lang.getString("PlayerLeftGame",languageList[i]);
}
sendTextMessage(sQuitText,-1,false,languageList[i]);
}
@ -419,7 +419,7 @@ void ClientInterface::update() {
Lang &lang= Lang::getInstance();
char szBuf1[8096]="";
string statusTextFormat= lang.get("PlayerDisconnected");
string statusTextFormat= lang.getString("PlayerDisconnected");
snprintf(szBuf1,8096,statusTextFormat.c_str(),playerNameStr.c_str());
//string sErr = "Disconnected from server during intro handshake.";
@ -1586,7 +1586,7 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
if(receiveMessage(&networkMessageQuit)) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
DisplayErrorMessage(lang.get("GameCancelledByUser"));
DisplayErrorMessage(lang.getString("GameCancelledByUser"));
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
@ -1617,7 +1617,7 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sErr = "Timeout waiting for server";
if(lang.hasString("TimeoutWaitingForServer",languageList[i]) == true) {
sErr = lang.get("TimeoutWaitingForServer",languageList[i]);
sErr = lang.getString("TimeoutWaitingForServer",languageList[i]);
}
bool echoLocal = lang.isLanguageLocal(lang.getLanguage());
sendTextMessage(sErr,-1,echoLocal,languageList[i]);
@ -1644,7 +1644,7 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
char szBuf[8096]="";
string updateTextFormat = "Waiting for network: %lld seconds elapsed (maximum wait time: %d seconds)";
if(lang.hasString("NetworkGameClientLoadStatus") == true) {
updateTextFormat = lang.get("NetworkGameClientLoadStatus");
updateTextFormat = lang.getString("NetworkGameClientLoadStatus");
}
string waitForHosts = "";
@ -1714,14 +1714,14 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
}
if(waitForHosts == "") {
waitForHosts = lang.get("Server");
waitForHosts = lang.getString("Server");
}
snprintf(szBuf,8096,updateTextFormat.c_str(),(long long int)lastMillisCheck,int(readyWaitTimeout / 1000));
char szBuf1[8096]="";
string statusTextFormat = "Waiting for players: %s";
if(lang.hasString("NetworkGameStatusWaiting") == true) {
statusTextFormat = lang.get("NetworkGameStatusWaiting");
statusTextFormat = lang.getString("NetworkGameStatusWaiting");
}
snprintf(szBuf1,8096,statusTextFormat.c_str(),waitForHosts.c_str());
@ -1766,27 +1766,27 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sErr = "Checksum error, you don't have the same data as the server";
if(lang.hasString("CheckSumGameLoadError",languageList[i]) == true) {
sErr = lang.get("CheckSumGameLoadError",languageList[i]);
sErr = lang.getString("CheckSumGameLoadError",languageList[i]);
}
bool echoLocal = lang.isLanguageLocal(lang.getLanguage());
sendTextMessage(sErr,-1,echoLocal,languageList[i]);
string playerNameStr = "Player with error is: " + getHumanPlayerName();
if(lang.hasString("CheckSumGameLoadPlayer",languageList[i]) == true) {
playerNameStr = lang.get("CheckSumGameLoadPlayer",languageList[i]) + " " + getHumanPlayerName();
playerNameStr = lang.getString("CheckSumGameLoadPlayer",languageList[i]) + " " + getHumanPlayerName();
}
sendTextMessage(playerNameStr,-1,echoLocal,languageList[i]);
string sErr1 = "Client Checksum: " + intToStr(checksum->getSum());
if(lang.hasString("CheckSumGameLoadClient",languageList[i]) == true) {
sErr1 = lang.get("CheckSumGameLoadClient",languageList[i]) + " " + intToStr(checksum->getSum());
sErr1 = lang.getString("CheckSumGameLoadClient",languageList[i]) + " " + intToStr(checksum->getSum());
}
sendTextMessage(sErr1,-1,echoLocal,languageList[i]);
string sErr2 = "Server Checksum: " + intToStr(networkMessageReady.getChecksum());
if(lang.hasString("CheckSumGameLoadServer",languageList[i]) == true) {
sErr2 = lang.get("CheckSumGameLoadServer",languageList[i]) + " " + intToStr(networkMessageReady.getChecksum());
sErr2 = lang.getString("CheckSumGameLoadServer",languageList[i]) + " " + intToStr(networkMessageReady.getChecksum());
}
sendTextMessage(sErr2,-1,echoLocal,languageList[i]);
@ -1846,7 +1846,7 @@ void ClientInterface::waitUntilReady(Checksum* checksum) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sText = "Player: %s is joining the game now.";
if(lang.hasString("JoinPlayerToCurrentGameLaunchDone",languageList[i]) == true) {
sText = lang.get("JoinPlayerToCurrentGameLaunchDone",languageList[i]);
sText = lang.getString("JoinPlayerToCurrentGameLaunchDone",languageList[i]);
}
if(clientSocket != NULL && clientSocket->isConnected() == true) {
@ -1924,7 +1924,7 @@ void ClientInterface::sendPingMessage(int32 pingFrequency, int64 pingTime) {
}
string ClientInterface::getNetworkStatus() {
std::string label = Lang::getInstance().get("Server") + ": " + serverName;
std::string label = Lang::getInstance().getString("Server") + ": " + serverName;
//float pingTime = getThreadedPingMS(getServerIpAddress().c_str());
char szBuf[8096]="";
snprintf(szBuf,8096,"%s",label.c_str());
@ -1979,7 +1979,7 @@ NetworkMessageType ClientInterface::waitForMessage(int waitMicroseconds)
for(unsigned int i = 0; i < languageList.size(); ++i) {
string msg = "Timeout waiting for message.";
if(lang.hasString("TimeoutWaitingForMessage",languageList[i]) == true) {
msg = lang.get("TimeoutWaitingForMessage",languageList[i]);
msg = lang.getString("TimeoutWaitingForMessage",languageList[i]);
}
sendTextMessage(msg,-1, lang.isLanguageLocal(languageList[i]),languageList[i]);
@ -2032,7 +2032,7 @@ void ClientInterface::quitGame(bool userManuallyQuit)
for(unsigned int i = 0; i < languageList.size(); ++i) {
string msg = "has chosen to leave the game!";
if(lang.hasString("PlayerLeftGame",languageList[i]) == true) {
msg = lang.get("PlayerLeftGame",languageList[i]);
msg = lang.getString("PlayerLeftGame",languageList[i]);
}
sendTextMessage(msg,-1, lang.isLanguageLocal(languageList[i]),languageList[i]);

View File

@ -1087,7 +1087,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
char szBuf[4096]="";
string msgTemplate = "You must have have at least %d player(s) connected to start this game!";
if(lang.hasString("HeadlessAdminRequiresMorePlayers",languageList[i]) == true) {
msgTemplate = lang.get("HeadlessAdminRequiresMorePlayers",languageList[i]);
msgTemplate = lang.getString("HeadlessAdminRequiresMorePlayers",languageList[i]);
}
#ifdef WIN32
_snprintf(szBuf,4095,msgTemplate.c_str(),minHeadLessPlayersRequired);

View File

@ -459,7 +459,7 @@ void ServerInterface::removeSlot(int playerIndex, int lockedSlotIndex) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
string msgTemplate = "Player %s, disconnected from the game.";
if(lang.hasString("PlayerDisconnected",languageList[i]) == true) {
msgTemplate = lang.get("PlayerDisconnected",languageList[i]);
msgTemplate = lang.getString("PlayerDisconnected",languageList[i]);
}
#ifdef WIN32
_snprintf(szBuf,4095,msgTemplate.c_str(),slot->getName().c_str());
@ -689,14 +689,14 @@ std::pair<bool,bool> ServerInterface::clientLagCheck(ConnectionSlot *connectionS
string msgTemplate = "DROPPING %s, exceeded max allowed LAG count of %f [time = %f], clientLag = %f [%f], disconnecting client.";
if(lang.hasString("ClientLagDropping") == true) {
msgTemplate = lang.get("ClientLagDropping",languageList[i]);
msgTemplate = lang.getString("ClientLagDropping",languageList[i]);
}
if(gameSettings.getNetworkPauseGameForLaggedClients() == true &&
((maxFrameCountLagAllowedEver <= 0 || clientLagCount <= maxFrameCountLagAllowedEver) &&
(maxClientLagTimeAllowedEver <= 0 || clientLagTime <= maxClientLagTimeAllowedEver))) {
msgTemplate = "PAUSING GAME TEMPORARILY for %s, exceeded max allowed LAG count of %f [time = %f], clientLag = %f [%f], waiting for client to catch up...";
if(lang.hasString("ClientLagPausing") == true) {
msgTemplate = lang.get("ClientLagPausing",languageList[i]);
msgTemplate = lang.getString("ClientLagPausing",languageList[i]);
}
}
#ifdef WIN32
@ -742,7 +742,7 @@ std::pair<bool,bool> ServerInterface::clientLagCheck(ConnectionSlot *connectionS
string msgTemplate = "LAG WARNING for %s, may exceed max allowed LAG count of %f [time = %f], clientLag = %f [%f], WARNING...";
if(lang.hasString("ClientLagWarning") == true) {
msgTemplate = lang.get("ClientLagWarning",languageList[i]);
msgTemplate = lang.getString("ClientLagWarning",languageList[i]);
}
#ifdef WIN32
@ -1884,7 +1884,7 @@ void ServerInterface::waitUntilReady(Checksum *checksum) {
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sErr = "Timeout waiting for clients.";
if(lang.hasString("TimeoutWaitingForClients") == true) {
sErr = lang.get("TimeoutWaitingForClients",languageList[i]);
sErr = lang.getString("TimeoutWaitingForClients",languageList[i]);
}
bool localEcho = lang.isLanguageLocal(languageList[i]);
sendTextMessage(sErr,-1, localEcho, languageList[i]);
@ -1909,14 +1909,14 @@ void ServerInterface::waitUntilReady(Checksum *checksum) {
}
char szBuf[8096]="";
string updateTextFormat = lang.get("NetworkGameServerLoadStatus");
string updateTextFormat = lang.getString("NetworkGameServerLoadStatus");
if(updateTextFormat == "" || updateTextFormat[0] == '?') {
updateTextFormat = "Waiting for network: %lld seconds elapsed (maximum wait time: %d seconds)";
}
snprintf(szBuf,8096,updateTextFormat.c_str(),(long long int)(chrono.getMillis() / 1000),int(readyWaitTimeout / 1000));
char szBuf1[8096]="";
string statusTextFormat = lang.get("NetworkGameStatusWaiting");
string statusTextFormat = lang.getString("NetworkGameStatusWaiting");
if(statusTextFormat == "" || statusTextFormat[0] == '?') {
statusTextFormat = "Waiting for players: %s";
}
@ -2005,7 +2005,7 @@ void ServerInterface::waitUntilReady(Checksum *checksum) {
Lang &lang= Lang::getInstance();
const vector<string> languageList = this->gameSettings.getUniqueNetworkPlayerLanguages();
for(unsigned int i = 0; i < languageList.size(); ++i) {
string sErr = lang.get("GameCancelledByUser",languageList[i]);
string sErr = lang.getString("GameCancelledByUser",languageList[i]);
bool localEcho = lang.isLanguageLocal(languageList[i]);
sendTextMessage(sErr,-1, localEcho,languageList[i]);
if(localEcho == true) {
@ -2185,7 +2185,7 @@ string ServerInterface::getNetworkStatus() {
}
}
else {
str+= lang.get("NotConnected");
str+= lang.getString("NotConnected");
}
str+= '\n';

View File

@ -3143,7 +3143,7 @@ string Unit::getDescExtension(bool translatedValue) const{
for(unsigned int i= 0; i < min((size_t) maxQueuedCommandDisplayCount, commands.size()); ++i){
const CommandType *ct= (*it)->getCommandType();
if(i == 0){
str+= "\n" + lang.get("OrdersOnQueue") + ": ";
str+= "\n" + lang.getString("OrdersOnQueue") + ": ";
}
str+= "\n#" + intToStr(i + 1) + " " + ct->getName(translatedValue);
++it;
@ -3162,12 +3162,12 @@ string Unit::getDesc(bool translatedValue) const {
//maxUnitCount
if(type->getMaxUnitCount()>0){
str += lang.get("MaxUnitCount")+ ": " + intToStr(faction->getCountForMaxUnitCount(type)) + "/" + intToStr(type->getMaxUnitCount());
str += lang.getString("MaxUnitCount")+ ": " + intToStr(faction->getCountForMaxUnitCount(type)) + "/" + intToStr(type->getMaxUnitCount());
}
str += "\n"+lang.get("Hp")+ ": " + intToStr(hp) + "/" + intToStr(type->getTotalMaxHp(&totalUpgrade));
str += "\n"+lang.getString("Hp")+ ": " + intToStr(hp) + "/" + intToStr(type->getTotalMaxHp(&totalUpgrade));
if(type->getHpRegeneration() != 0 || totalUpgrade.getMaxHpRegeneration() != 0) {
str+= " (" + lang.get("Regeneration") + ": " + intToStr(type->getHpRegeneration());
str+= " (" + lang.getString("Regeneration") + ": " + intToStr(type->getHpRegeneration());
if(totalUpgrade.getMaxHpRegeneration() != 0) {
str+= "+" + intToStr(totalUpgrade.getMaxHpRegeneration());
}
@ -3176,10 +3176,10 @@ string Unit::getDesc(bool translatedValue) const {
//ep
if(getType()->getMaxEp()!=0){
str+= "\n" + lang.get("Ep")+ ": " + intToStr(ep) + "/" + intToStr(type->getTotalMaxEp(&totalUpgrade));
str+= "\n" + lang.getString("Ep")+ ": " + intToStr(ep) + "/" + intToStr(type->getTotalMaxEp(&totalUpgrade));
}
if(type->getEpRegeneration() != 0 || totalUpgrade.getMaxEpRegeneration() != 0) {
str+= " (" + lang.get("Regeneration") + ": " + intToStr(type->getEpRegeneration());
str+= " (" + lang.getString("Regeneration") + ": " + intToStr(type->getEpRegeneration());
if(totalUpgrade.getMaxEpRegeneration() != 0) {
str += "+" + intToStr(totalUpgrade.getMaxEpRegeneration());
}
@ -3187,14 +3187,14 @@ string Unit::getDesc(bool translatedValue) const {
}
//armor
str+= "\n" + lang.get("Armor")+ ": " + intToStr(getType()->getArmor());
str+= "\n" + lang.getString("Armor")+ ": " + intToStr(getType()->getArmor());
if(totalUpgrade.getArmor()!=0){
str+="+"+intToStr(totalUpgrade.getArmor());
}
str+= " ("+getType()->getArmorType()->getName(translatedValue)+")";
//sight
str+="\n"+ lang.get("Sight")+ ": " + intToStr(getType()->getSight());
str+="\n"+ lang.getString("Sight")+ ": " + intToStr(getType()->getSight());
if(totalUpgrade.getSight()!=0){
str+="+"+intToStr(totalUpgrade.getSight());
}
@ -3202,7 +3202,7 @@ string Unit::getDesc(bool translatedValue) const {
//kills
const Level *nextLevel= getNextLevel();
if(enemyKills > 0 || nextLevel != NULL) {
str+= "\n" + lang.get("Kills") +": " + intToStr(enemyKills);
str+= "\n" + lang.getString("Kills") +": " + intToStr(enemyKills);
if(nextLevel != NULL) {
str+= " (" + nextLevel->getName(translatedValue) + ": " + intToStr(nextLevel->getKills()) + ")";
}
@ -3212,7 +3212,7 @@ string Unit::getDesc(bool translatedValue) const {
//load
if(loadCount!=0){
str+= "\n" + lang.get("Load")+ ": " + intToStr(loadCount) +" " + loadType->getName(translatedValue);
str+= "\n" + lang.getString("Load")+ ": " + intToStr(loadCount) +" " + loadType->getName(translatedValue);
}
//consumable production
@ -3220,7 +3220,7 @@ string Unit::getDesc(bool translatedValue) const {
const Resource *r= getType()->getCost(i);
if(r->getType()->getClass() == rcConsumable) {
str+= "\n";
str+= r->getAmount() < 0 ? lang.get("Produce")+": ": lang.get("Consume")+": ";
str+= r->getAmount() < 0 ? lang.getString("Produce")+": ": lang.getString("Consume")+": ";
str+= intToStr(abs(r->getAmount())) + " " + r->getType()->getName(translatedValue);
}
}
@ -3229,7 +3229,7 @@ string Unit::getDesc(bool translatedValue) const {
if(commands.empty() == false) {
str+= "\n" + commands.front()->getCommandType()->getName(translatedValue);
if(commands.size() > 1) {
str+= "\n" + lang.get("OrdersOnQueue") + ": " + intToStr(commands.size());
str+= "\n" + lang.getString("OrdersOnQueue") + ": " + intToStr(commands.size());
}
}
else{
@ -3237,7 +3237,7 @@ string Unit::getDesc(bool translatedValue) const {
if(getType()->getStoredResourceCount() > 0) {
for(int i = 0; i < getType()->getStoredResourceCount(); ++i) {
const Resource *r= getType()->getStoredResource(i);
str+= "\n" + lang.get("Store") + ": ";
str+= "\n" + lang.getString("Store") + ": ";
str+= intToStr(r->getAmount()) + " " + r->getType()->getName(translatedValue);
}
}
@ -3549,7 +3549,7 @@ std::pair<CommandResult,string> Unit::checkCommand(Command *command) const {
result.first = crFailReqs;
Lang &lang= Lang::getInstance();
result.second = " - " + lang.get("Reqs") + " : " + produced->getUnitAndUpgradeReqDesc(false,this->showTranslatedTechTree());
result.second = " - " + lang.getString("Reqs") + " : " + produced->getUnitAndUpgradeReqDesc(false,this->showTranslatedTechTree());
return result;
}
@ -3559,7 +3559,7 @@ std::pair<CommandResult,string> Unit::checkCommand(Command *command) const {
//printf("In [%s::%s Line: %d] command = %p\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,command);
result.first = crFailRes;
Lang &lang= Lang::getInstance();
result.second = " - " + lang.get("Reqs") + " : " + produced->getResourceReqDesc(false,this->showTranslatedTechTree());
result.second = " - " + lang.getString("Reqs") + " : " + produced->getResourceReqDesc(false,this->showTranslatedTechTree());
return result;
}
}
@ -3579,7 +3579,7 @@ std::pair<CommandResult,string> Unit::checkCommand(Command *command) const {
//printf("In [%s::%s Line: %d] command = %p\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,command);
result.first = crFailReqs;
Lang &lang= Lang::getInstance();
result.second = " - " + lang.get("Reqs") + " : " + builtUnit->getUnitAndUpgradeReqDesc(false,this->showTranslatedTechTree());
result.second = " - " + lang.getString("Reqs") + " : " + builtUnit->getUnitAndUpgradeReqDesc(false,this->showTranslatedTechTree());
return result;
}
if(faction->checkCosts(builtUnit,NULL) == false) {
@ -3587,7 +3587,7 @@ std::pair<CommandResult,string> Unit::checkCommand(Command *command) const {
//printf("In [%s::%s Line: %d] command = %p\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,command);
result.first = crFailRes;
Lang &lang= Lang::getInstance();
result.second = " - " + lang.get("Reqs") + " : " + builtUnit->getResourceReqDesc(false,this->showTranslatedTechTree());
result.second = " - " + lang.getString("Reqs") + " : " + builtUnit->getResourceReqDesc(false,this->showTranslatedTechTree());
return result;
}
}

View File

@ -122,11 +122,11 @@ string StopCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool translate
Lang &lang= Lang::getInstance();
str= getName(translatedValue)+"\n";
str+= lang.get("ReactionSpeed",(translatedValue == true ? "" : "english")) + ": " + intToStr(stopSkillType->getSpeed())+"\n";
str+= lang.getString("ReactionSpeed",(translatedValue == true ? "" : "english")) + ": " + intToStr(stopSkillType->getSpeed())+"\n";
if(stopSkillType->getEpCost() != 0)
str += lang.get("EpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(stopSkillType->getEpCost())+"\n";
str += lang.getString("EpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(stopSkillType->getEpCost())+"\n";
if(stopSkillType->getHpCost() != 0)
str+= lang.get("HpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(stopSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(stopSkillType->getHpCost())+"\n";
str+=stopSkillType->getBoostDesc(translatedValue);
return str;
}
@ -136,7 +136,7 @@ string StopCommandType::toString(bool translatedValue) const{
return "Stop";
}
Lang &lang= Lang::getInstance();
return lang.get("Stop");
return lang.getString("Stop");
}
void StopCommandType::load(int id, const XmlNode *n, const string &dir,
@ -181,16 +181,16 @@ string MoveCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool translate
Lang &lang= Lang::getInstance();
str=getName(translatedValue)+"\n";
str+= lang.get("WalkSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(moveSkillType->getSpeed());
str+= lang.getString("WalkSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(moveSkillType->getSpeed());
if(totalUpgrade->getMoveSpeed(moveSkillType) != 0) {
str+= "+" + intToStr(totalUpgrade->getMoveSpeed(moveSkillType));
}
str+="\n";
if(moveSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(moveSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(moveSkillType->getEpCost())+"\n";
}
if(moveSkillType->getHpCost()!=0) {
str+= lang.get("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(moveSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(moveSkillType->getHpCost())+"\n";
}
str+=moveSkillType->getBoostDesc(translatedValue);
return str;
@ -201,7 +201,7 @@ string MoveCommandType::toString(bool translatedValue) const{
return "Move";
}
Lang &lang= Lang::getInstance();
return lang.get("Move");
return lang.getString("Move");
}
// =====================================================
@ -241,14 +241,14 @@ string AttackCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transla
str=getName(translatedValue)+"\n";
if(attackSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(attackSkillType->getEpCost()) + "\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(attackSkillType->getEpCost()) + "\n";
}
if(attackSkillType->getHpCost()!=0){
str+= lang.get("HpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(attackSkillType->getHpCost()) + "\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english")) + ": " + intToStr(attackSkillType->getHpCost()) + "\n";
}
//attack strength
str+= lang.get("AttackStrenght",(translatedValue == true ? "" : "english"))+": ";
str+= lang.getString("AttackStrenght",(translatedValue == true ? "" : "english"))+": ";
str+= intToStr(attackSkillType->getAttackStrength()-attackSkillType->getAttackVar());
str+= "...";
str+= intToStr(attackSkillType->getAttackStrength()+attackSkillType->getAttackVar());
@ -260,18 +260,18 @@ string AttackCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transla
//splash radius
if(attackSkillType->getSplashRadius()!=0){
str+= lang.get("SplashRadius",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getSplashRadius())+"\n";
str+= lang.getString("SplashRadius",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getSplashRadius())+"\n";
}
//attack distance
str+= lang.get("AttackDistance",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getAttackRange());
str+= lang.getString("AttackDistance",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getAttackRange());
if(totalUpgrade->getAttackRange(attackSkillType) != 0) {
str+= "+"+intToStr(totalUpgrade->getAttackRange(attackSkillType) != 0);
}
str+="\n";
//attack fields
str+= lang.get("Fields") + ": ";
str+= lang.getString("Fields") + ": ";
for(int i= 0; i < fieldCount; i++){
Field field = static_cast<Field>(i);
if( attackSkillType->getAttackField(field) )
@ -282,13 +282,13 @@ string AttackCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transla
str+="\n";
//movement speed
str+= lang.get("WalkSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(moveSkillType->getSpeed()) ;
str+= lang.getString("WalkSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(moveSkillType->getSpeed()) ;
if(totalUpgrade->getMoveSpeed(moveSkillType) != 0) {
str+= "+"+intToStr(totalUpgrade->getMoveSpeed(moveSkillType));
}
str+="\n";
str+= lang.get("AttackSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(attackSkillType->getSpeed()) +"\n";
str+= lang.getString("AttackSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(attackSkillType->getSpeed()) +"\n";
str+=attackSkillType->getBoostDesc(translatedValue);
return str;
}
@ -298,7 +298,7 @@ string AttackCommandType::toString(bool translatedValue) const{
return "Attack";
}
Lang &lang= Lang::getInstance();
return lang.get("Attack");
return lang.getString("Attack");
}
@ -338,14 +338,14 @@ string AttackStoppedCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool
str=getName(translatedValue)+"\n";
if(attackSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getEpCost())+"\n";
}
if(attackSkillType->getHpCost()!=0){
str+= lang.get("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getHpCost())+"\n";
}
//attack strength
str+= lang.get("AttackStrenght",(translatedValue == true ? "" : "english"))+": ";
str+= lang.getString("AttackStrenght",(translatedValue == true ? "" : "english"))+": ";
str+= intToStr(attackSkillType->getAttackStrength()-attackSkillType->getAttackVar());
str+="...";
str+= intToStr(attackSkillType->getAttackStrength()+attackSkillType->getAttackVar());
@ -356,18 +356,18 @@ string AttackStoppedCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool
//splash radius
if(attackSkillType->getSplashRadius()!=0){
str+= lang.get("SplashRadius",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getSplashRadius())+"\n";
str+= lang.getString("SplashRadius",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getSplashRadius())+"\n";
}
//attack distance
str+= lang.get("AttackDistance",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getAttackRange());
str+= lang.getString("AttackDistance",(translatedValue == true ? "" : "english"))+": "+intToStr(attackSkillType->getAttackRange());
if(totalUpgrade->getAttackRange(attackSkillType) != 0) {
str+= "+"+intToStr(totalUpgrade->getAttackRange(attackSkillType) != 0);
}
str+="\n";
//attack fields
str+= lang.get("Fields",(translatedValue == true ? "" : "english")) + ": ";
str+= lang.getString("Fields",(translatedValue == true ? "" : "english")) + ": ";
for(int i= 0; i < fieldCount; i++){
Field field = static_cast<Field>(i);
if( attackSkillType->getAttackField(field) )
@ -385,7 +385,7 @@ string AttackStoppedCommandType::toString(bool translatedValue) const {
return "AttackStopped";
}
Lang &lang= Lang::getInstance();
return lang.get("AttackStopped");
return lang.getString("AttackStopped");
}
@ -475,12 +475,12 @@ string BuildCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool translat
Lang &lang= Lang::getInstance();
str=getName(translatedValue)+"\n";
str+= lang.get("BuildSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(buildSkillType->getSpeed())+"\n";
str+= lang.getString("BuildSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(buildSkillType->getSpeed())+"\n";
if(buildSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(buildSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(buildSkillType->getEpCost())+"\n";
}
if(buildSkillType->getHpCost()!=0){
str+= lang.get("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(buildSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(buildSkillType->getHpCost())+"\n";
}
str+=buildSkillType->getBoostDesc(translatedValue);
return str;
@ -491,7 +491,7 @@ string BuildCommandType::toString(bool translatedValue) const{
return "Build";
}
Lang &lang= Lang::getInstance();
return lang.get("Build");
return lang.getString("Build");
}
// =====================================================
@ -552,16 +552,16 @@ string HarvestCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transl
string str;
str=getName(translatedValue)+"\n";
str+= lang.get("HarvestSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(harvestSkillType->getSpeed()/hitsPerUnit)+"\n";
str+= lang.get("MaxLoad",(translatedValue == true ? "" : "english"))+": "+ intToStr(maxLoad)+"\n";
str+= lang.get("LoadedSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(moveLoadedSkillType->getSpeed())+"\n";
str+= lang.getString("HarvestSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(harvestSkillType->getSpeed()/hitsPerUnit)+"\n";
str+= lang.getString("MaxLoad",(translatedValue == true ? "" : "english"))+": "+ intToStr(maxLoad)+"\n";
str+= lang.getString("LoadedSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(moveLoadedSkillType->getSpeed())+"\n";
if(harvestSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(harvestSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(harvestSkillType->getEpCost())+"\n";
}
if(harvestSkillType->getHpCost()!=0){
str+= lang.get("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(harvestSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(harvestSkillType->getHpCost())+"\n";
}
str+=lang.get("Resources",(translatedValue == true ? "" : "english"))+":\n";
str+=lang.getString("Resources",(translatedValue == true ? "" : "english"))+":\n";
for(int i=0; i<getHarvestedResourceCount(); ++i){
str+= getHarvestedResource(i)->getName(translatedValue)+"\n";
}
@ -574,7 +574,7 @@ string HarvestCommandType::toString(bool translatedValue) const{
return "Harvest";
}
Lang &lang= Lang::getInstance();
return lang.get("Harvest");
return lang.getString("Harvest");
}
bool HarvestCommandType::canHarvest(const ResourceType *resourceType) const{
@ -614,7 +614,7 @@ string HarvestEmergencyReturnCommandType::toString(bool translatedValue) const{
return "HarvestEmergencyReturn";
}
Lang &lang= Lang::getInstance();
return lang.get("Harvest");
return lang.getString("Harvest");
}
// =====================================================
@ -667,14 +667,14 @@ string RepairCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transla
string str;
str=getName(translatedValue)+"\n";
str+= lang.get("RepairSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(repairSkillType->getSpeed())+"\n";
str+= lang.getString("RepairSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(repairSkillType->getSpeed())+"\n";
if(repairSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(repairSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(repairSkillType->getEpCost())+"\n";
}
if(repairSkillType->getHpCost()!=0){
str+= lang.get("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(repairSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(repairSkillType->getHpCost())+"\n";
}
str+="\n"+lang.get("CanRepair",(translatedValue == true ? "" : "english"))+":\n";
str+="\n"+lang.getString("CanRepair",(translatedValue == true ? "" : "english"))+":\n";
for(int i=0; i<repairableUnits.size(); ++i){
str+= (static_cast<const UnitType*>(repairableUnits[i]))->getName(translatedValue)+"\n";
}
@ -687,7 +687,7 @@ string RepairCommandType::toString(bool translatedValue) const{
return "Repair";
}
Lang &lang= Lang::getInstance();
return lang.get("Repair");
return lang.getString("Repair");
}
//get
@ -738,7 +738,7 @@ string ProduceCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transl
Lang &lang= Lang::getInstance();
//prod speed
str+= lang.get("ProductionSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(produceSkillType->getSpeed());
str+= lang.getString("ProductionSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(produceSkillType->getSpeed());
if(totalUpgrade->getProdSpeed(produceSkillType)!=0){
str+="+" + intToStr(totalUpgrade->getProdSpeed(produceSkillType));
}
@ -746,10 +746,10 @@ string ProduceCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transl
//mpcost
if(produceSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(produceSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(produceSkillType->getEpCost())+"\n";
}
if(produceSkillType->getHpCost()!=0){
str+= lang.get("hpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(produceSkillType->getHpCost())+"\n";
str+= lang.getString("hpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(produceSkillType->getHpCost())+"\n";
}
str+= "\n" + getProducedUnit()->getReqDesc(translatedValue);
str+=produceSkillType->getBoostDesc(translatedValue);
@ -761,7 +761,7 @@ string ProduceCommandType::toString(bool translatedValue) const{
return "Produce";
}
Lang &lang= Lang::getInstance();
return lang.get("Produce");
return lang.getString("Produce");
}
string ProduceCommandType::getReqDesc(bool translatedValue) const{
@ -808,11 +808,11 @@ string UpgradeCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transl
Lang &lang= Lang::getInstance();
str=getName(translatedValue)+"\n";
str+= lang.get("UpgradeSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(upgradeSkillType->getSpeed())+"\n";
str+= lang.getString("UpgradeSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(upgradeSkillType->getSpeed())+"\n";
if(upgradeSkillType->getEpCost()!=0)
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(upgradeSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(upgradeSkillType->getEpCost())+"\n";
if(upgradeSkillType->getHpCost()!=0)
str+= lang.get("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(upgradeSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(upgradeSkillType->getHpCost())+"\n";
str+= "\n"+getProducedUpgrade()->getReqDesc(translatedValue);
str+=upgradeSkillType->getBoostDesc(translatedValue);
return str;
@ -823,7 +823,7 @@ string UpgradeCommandType::toString(bool translatedValue) const{
return "Upgrade";
}
Lang &lang= Lang::getInstance();
return lang.get("Upgrade");
return lang.getString("Upgrade");
}
string UpgradeCommandType::getReqDesc(bool translatedValue) const{
@ -889,19 +889,19 @@ string MorphCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool translat
Lang &lang= Lang::getInstance();
//prod speed
str+= lang.get("MorphSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(morphSkillType->getSpeed())+"\n";
str+= lang.getString("MorphSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(morphSkillType->getSpeed())+"\n";
//mpcost
if(morphSkillType->getEpCost()!=0){
str+= lang.get("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(morphSkillType->getEpCost())+"\n";
str+= lang.getString("EpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(morphSkillType->getEpCost())+"\n";
}
if(morphSkillType->getHpCost()!=0){
str+= lang.get("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(morphSkillType->getHpCost())+"\n";
str+= lang.getString("HpCost",(translatedValue == true ? "" : "english"))+": "+intToStr(morphSkillType->getHpCost())+"\n";
}
//discount
if(discount!=0){
str+= lang.get("Discount",(translatedValue == true ? "" : "english"))+": "+intToStr(discount)+"%\n";
str+= lang.getString("Discount",(translatedValue == true ? "" : "english"))+": "+intToStr(discount)+"%\n";
}
str+= "\n"+getProduced()->getReqDesc(ignoreResourceRequirements,translatedValue);
@ -916,7 +916,7 @@ string MorphCommandType::toString(bool translatedValue) const{
return "Morph";
}
Lang &lang= Lang::getInstance();
return lang.get("Morph");
return lang.getString("Morph");
}
string MorphCommandType::getReqDesc(bool translatedValue) const{
@ -963,7 +963,7 @@ string SwitchTeamCommandType::toString(bool translatedValue) const{
return "SwitchTeam";
}
Lang &lang= Lang::getInstance();
return lang.get("SwitchTeam");
return lang.getString("SwitchTeam");
}
// =====================================================

View File

@ -78,7 +78,7 @@ string RequirableType::getReqDesc(bool translatedValue) const{
string str= getName(translatedValue);
if(anyReqs){
return str + " " + Lang::getInstance().get("Reqs",(translatedValue == true ? "" : "english")) + ":\n" + reqString;
return str + " " + Lang::getInstance().getString("Reqs",(translatedValue == true ? "" : "english")) + ":\n" + reqString;
}
else{
return str;
@ -176,7 +176,7 @@ string ProducibleType::getUnitAndUpgradeReqDesc(bool lineBreaks, bool translated
}
string ProducibleType::getReqDesc(bool ignoreResourceRequirements, bool translatedValue) const {
string str= getName(translatedValue) + " " + Lang::getInstance().get("Reqs",(translatedValue == true ? "" : "english")) + ":\n";
string str= getName(translatedValue) + " " + Lang::getInstance().getString("Reqs",(translatedValue == true ? "" : "english")) + ":\n";
if(ignoreResourceRequirements == false) {
str+= getResourceReqDesc(true,translatedValue);
}

View File

@ -116,7 +116,7 @@ void FactionType::load(const string &factionName, const TechTree *techTree, Chec
}
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingFactionType","",true).c_str(),formatString(this->getName()).c_str());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingFactionType","",true).c_str(),formatString(this->getName()).c_str());
Logger::getInstance().add(szBuf, true);
if(personalityType == fpt_Normal) {

View File

@ -71,7 +71,7 @@ void ResourceType::load(const string &dir, Checksum* checksum, Checksum *techtre
name= lastDir(dir);
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingResourceType","",true).c_str(),formatString(getName(true)).c_str());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingResourceType","",true).c_str(),formatString(getName(true)).c_str());
Logger::getInstance().add(szBuf, true);
string currentPath = dir;

View File

@ -156,37 +156,37 @@ string AttackBoost::getDesc(bool translatedValue) const{
string indent=" ";
if(enabled) {
if(boostUnitList.empty() == false) {
str+= "\n"+ lang.get("Effects")+":\n";
str+= "\n"+ lang.getString("Effects")+":\n";
}
str += indent+lang.get("effectRadius") + ": " + intToStr(radius) +"\n";
str += indent+lang.getString("effectRadius") + ": " + intToStr(radius) +"\n";
if(allowMultipleBoosts==false) {
string allowIt=lang.get("No");
string allowIt=lang.getString("No");
if(allowMultipleBoosts==true)
allowIt=lang.get("False");
str += indent+lang.get("allowMultiBoost") + ": " + allowIt +"\n";
allowIt=lang.getString("False");
str += indent+lang.getString("allowMultiBoost") + ": " + allowIt +"\n";
}
str+=boostUpgrade.getDesc(translatedValue);
if(targetType==abtAlly)
{
str+= lang.get("AffectedUnitsFromTeam") +":\n";
str+= lang.getString("AffectedUnitsFromTeam") +":\n";
}
else if(targetType==abtFoe)
{
str+= lang.get("AffectedUnitsFromFoe") +":\n";
str+= lang.getString("AffectedUnitsFromFoe") +":\n";
}
else if(targetType==abtFaction)
{
str+= lang.get("AffectedUnitsFromYourFaction") +":\n";
str+= lang.getString("AffectedUnitsFromYourFaction") +":\n";
}
else if(targetType==abtUnitTypes)
{
str+= lang.get("AffectedUnitsFromAll") +":\n";
str+= lang.getString("AffectedUnitsFromAll") +":\n";
}
else if(targetType==abtAll)
{
str+= lang.get("AffectedUnitsFromAll") +":\n";
str+= lang.getString("AffectedUnitsFromAll") +":\n";
}
if(boostUnitList.empty() == false) {
@ -196,7 +196,7 @@ string AttackBoost::getDesc(bool translatedValue) const{
}
else
{
str+= lang.get("All")+"\n";
str+= lang.getString("All")+"\n";
}
return str;
@ -617,7 +617,7 @@ string SkillType::fieldToStr(Field field) {
switch(field) {
case fLand:
if(lang.hasString("FieldLand") == true) {
fieldName = lang.get("FieldLand");
fieldName = lang.getString("FieldLand");
}
else {
fieldName = "Land";
@ -627,7 +627,7 @@ string SkillType::fieldToStr(Field field) {
case fAir:
if(lang.hasString("FieldAir") == true) {
fieldName = lang.get("FieldAir");
fieldName = lang.getString("FieldAir");
}
else {
fieldName = "Air";
@ -690,7 +690,7 @@ string StopSkillType::toString(bool translatedValue) const{
if(translatedValue == false) {
return "Stop";
}
return Lang::getInstance().get("Stop");
return Lang::getInstance().getString("Stop");
}
// =====================================================
@ -706,7 +706,7 @@ string MoveSkillType::toString(bool translatedValue) const{
return "Move";
}
return Lang::getInstance().get("Move");
return Lang::getInstance().getString("Move");
}
int MoveSkillType::getTotalSpeed(const TotalUpgrade *totalUpgrade) const{
@ -862,7 +862,7 @@ string AttackSkillType::toString(bool translatedValue) const{
return "Attack";
}
return Lang::getInstance().get("Attack");
return Lang::getInstance().getString("Attack");
}
//get totals
@ -937,7 +937,7 @@ string BuildSkillType::toString(bool translatedValue) const{
return "Build";
}
return Lang::getInstance().get("Build");
return Lang::getInstance().getString("Build");
}
// =====================================================
@ -953,7 +953,7 @@ string HarvestSkillType::toString(bool translatedValue) const{
return "Harvest";
}
return Lang::getInstance().get("Harvest");
return Lang::getInstance().getString("Harvest");
}
// =====================================================
@ -969,7 +969,7 @@ string RepairSkillType::toString(bool translatedValue) const{
return "Repair";
}
return Lang::getInstance().get("Repair");
return Lang::getInstance().getString("Repair");
}
// =====================================================
@ -1001,7 +1001,7 @@ string ProduceSkillType::toString(bool translatedValue) const{
return "Produce";
}
return Lang::getInstance().get("Produce");
return Lang::getInstance().getString("Produce");
}
int ProduceSkillType::getTotalSpeed(const TotalUpgrade *totalUpgrade) const{
@ -1045,7 +1045,7 @@ string UpgradeSkillType::toString(bool translatedValue) const{
return "Upgrade";
}
return Lang::getInstance().get("Upgrade");
return Lang::getInstance().getString("Upgrade");
}
int UpgradeSkillType::getTotalSpeed(const TotalUpgrade *totalUpgrade) const{

View File

@ -149,7 +149,7 @@ void TechTree::load(const string &dir, set<string> &factions, Checksum* checksum
lang.loadTechTreeStrings(name, true);
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingTechtree","",true).c_str(),formatString(getName(true)).c_str());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingTechtree","",true).c_str(),formatString(getName(true)).c_str());
Logger::getInstance().add(szBuf, true);
vector<string> filenames;
@ -263,8 +263,8 @@ void TechTree::load(const string &dir, set<string> &factions, Checksum* checksum
string factionName = *it;
char szBuf[8096]="";
snprintf(szBuf,8096,"%s %s [%d / %d] - %s",Lang::getInstance().get("Loading").c_str(),
Lang::getInstance().get("Faction").c_str(),
snprintf(szBuf,8096,"%s %s [%d / %d] - %s",Lang::getInstance().getString("Loading").c_str(),
Lang::getInstance().getString("Faction").c_str(),
i+1,
(int)factions.size(),
formatString(this->getTranslatedFactionName(name,factionName)).c_str());
@ -300,7 +300,7 @@ void TechTree::load(const string &dir, set<string> &factions, Checksum* checksum
TechTree::~TechTree() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingTechtree","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingTechtree","",true), true);
resourceTypes.clear();
factionTypes.clear();
armorTypes.clear();

View File

@ -181,7 +181,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, const
//Lang &lang= Lang::getInstance();
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingUnitType","",true).c_str(),formatString(this->getName(true)).c_str());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingUnitType","",true).c_str(),formatString(this->getName(true)).c_str());
Logger::getInstance().add(szBuf, true);
//file load
@ -613,7 +613,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, const
const XmlNode *skillsNode= unitNode->getChild("skills");
skillTypes.resize(skillsNode->getChildCount());
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingUnitTypeSkills","",true).c_str(),formatString(this->getName(true)).c_str(),skillTypes.size());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingUnitTypeSkills","",true).c_str(),formatString(this->getName(true)).c_str(),skillTypes.size());
Logger::getInstance().add(szBuf, true);
for(int i = 0; i < skillTypes.size(); ++i) {
@ -1037,12 +1037,12 @@ string UnitType::getReqDesc(bool translatedValue) const{
checkItemInVault(&(this->maxUnitCount),this->maxUnitCount);
if(getMaxUnitCount() > 0) {
resultTxt += "\n" + lang.get("MaxUnitCount") + " " + intToStr(getMaxUnitCount());
resultTxt += "\n" + lang.getString("MaxUnitCount") + " " + intToStr(getMaxUnitCount());
}
if(resultTxt == "")
return ProducibleType::getReqDesc(translatedValue);
else
return ProducibleType::getReqDesc(translatedValue)+"\n" + lang.get("Limits") + " " + resultTxt;
return ProducibleType::getReqDesc(translatedValue)+"\n" + lang.getString("Limits") + " " + resultTxt;
}
string UnitType::getName(bool translatedValue) const {

View File

@ -250,10 +250,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
if(maxHp != 0) {
if(maxHpIsMultiplier) {
str += indent+lang.get("Hp",(translatedValue == true ? "" : "english")) + " *" + intToStr(maxHp);
str += indent+lang.getString("Hp",(translatedValue == true ? "" : "english")) + " *" + intToStr(maxHp);
}
else {
str += indent+lang.get("Hp",(translatedValue == true ? "" : "english")) + " +" + intToStr(maxHp);
str += indent+lang.getString("Hp",(translatedValue == true ? "" : "english")) + " +" + intToStr(maxHp);
}
if(maxHpRegeneration != 0) {
@ -266,10 +266,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
str += "\n";
}
if(sightIsMultiplier) {
str+= indent+lang.get("Sight",(translatedValue == true ? "" : "english")) + " *" + intToStr(sight);
str+= indent+lang.getString("Sight",(translatedValue == true ? "" : "english")) + " *" + intToStr(sight);
}
else {
str+= indent+lang.get("Sight",(translatedValue == true ? "" : "english")) + " +" + intToStr(sight);
str+= indent+lang.getString("Sight",(translatedValue == true ? "" : "english")) + " +" + intToStr(sight);
}
}
if(maxEp != 0) {
@ -278,10 +278,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
}
if(maxEpIsMultiplier) {
str+= indent+lang.get("Ep",(translatedValue == true ? "" : "english")) + " *" + intToStr(maxEp);
str+= indent+lang.getString("Ep",(translatedValue == true ? "" : "english")) + " *" + intToStr(maxEp);
}
else {
str+= indent+lang.get("Ep",(translatedValue == true ? "" : "english")) + " +" + intToStr(maxEp);
str+= indent+lang.getString("Ep",(translatedValue == true ? "" : "english")) + " +" + intToStr(maxEp);
}
if(maxEpRegeneration != 0) {
str += " [" + intToStr(maxEpRegeneration) + "]";
@ -293,10 +293,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
}
if(attackStrengthIsMultiplier) {
str+= indent+lang.get("AttackStrenght",(translatedValue == true ? "" : "english")) + " *" + intToStr(attackStrength);
str+= indent+lang.getString("AttackStrenght",(translatedValue == true ? "" : "english")) + " *" + intToStr(attackStrength);
}
else {
str+= indent+lang.get("AttackStrenght",(translatedValue == true ? "" : "english")) + " +" + intToStr(attackStrength);
str+= indent+lang.getString("AttackStrenght",(translatedValue == true ? "" : "english")) + " +" + intToStr(attackStrength);
}
}
if(attackRange != 0) {
@ -305,10 +305,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
}
if(attackRangeIsMultiplier) {
str+= indent+lang.get("AttackDistance",(translatedValue == true ? "" : "english")) + " *" + intToStr(attackRange);
str+= indent+lang.getString("AttackDistance",(translatedValue == true ? "" : "english")) + " *" + intToStr(attackRange);
}
else {
str+= indent+lang.get("AttackDistance",(translatedValue == true ? "" : "english")) + " +" + intToStr(attackRange);
str+= indent+lang.getString("AttackDistance",(translatedValue == true ? "" : "english")) + " +" + intToStr(attackRange);
}
}
if(armor != 0) {
@ -317,10 +317,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
}
if(armorIsMultiplier) {
str+= indent+lang.get("Armor",(translatedValue == true ? "" : "english")) + " *" + intToStr(armor);
str+= indent+lang.getString("Armor",(translatedValue == true ? "" : "english")) + " *" + intToStr(armor);
}
else {
str+= indent+lang.get("Armor",(translatedValue == true ? "" : "english")) + " +" + intToStr(armor);
str+= indent+lang.getString("Armor",(translatedValue == true ? "" : "english")) + " +" + intToStr(armor);
}
}
if(moveSpeed != 0) {
@ -329,10 +329,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
}
if(moveSpeedIsMultiplier) {
str+= indent+lang.get("WalkSpeed",(translatedValue == true ? "" : "english")) + " *" + intToStr(moveSpeed);
str+= indent+lang.getString("WalkSpeed",(translatedValue == true ? "" : "english")) + " *" + intToStr(moveSpeed);
}
else {
str+= indent+lang.get("WalkSpeed",(translatedValue == true ? "" : "english")) + " +" + intToStr(moveSpeed);
str+= indent+lang.getString("WalkSpeed",(translatedValue == true ? "" : "english")) + " +" + intToStr(moveSpeed);
}
}
if(prodSpeed != 0) {
@ -341,10 +341,10 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
}
if(prodSpeedIsMultiplier) {
str+= indent+lang.get("ProductionSpeed",(translatedValue == true ? "" : "english")) + " *" + intToStr(prodSpeed);
str+= indent+lang.getString("ProductionSpeed",(translatedValue == true ? "" : "english")) + " *" + intToStr(prodSpeed);
}
else {
str+= indent+lang.get("ProductionSpeed",(translatedValue == true ? "" : "english")) + " +" + intToStr(prodSpeed);
str+= indent+lang.getString("ProductionSpeed",(translatedValue == true ? "" : "english")) + " +" + intToStr(prodSpeed);
}
}
if(str != "") {
@ -567,11 +567,11 @@ string UpgradeType::getReqDesc(bool translatedValue) const{
string str= ProducibleType::getReqDesc(translatedValue);
string indent=" ";
if(getEffectCount()>0){
str+= "\n"+ lang.get("Upgrades",(translatedValue == true ? "" : "english"))+"\n";
str+= "\n"+ lang.getString("Upgrades",(translatedValue == true ? "" : "english"))+"\n";
}
str+=UpgradeTypeBase::getDesc(translatedValue);
if(getEffectCount()>0){
str+= lang.get("AffectedUnits",(translatedValue == true ? "" : "english"))+"\n";
str+= lang.getString("AffectedUnits",(translatedValue == true ? "" : "english"))+"\n";
for(int i=0; i<getEffectCount(); ++i){
str+= indent+getEffect(i)->getName(translatedValue)+"\n";
}
@ -589,7 +589,7 @@ void UpgradeType::load(const string &dir, const TechTree *techTree,
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingUpgradeType","",true).c_str(),formatString(this->getName(true)).c_str());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingUpgradeType","",true).c_str(),formatString(this->getName(true)).c_str());
Logger::getInstance().add(szBuf, true);
string currentPath = dir;

View File

@ -305,7 +305,7 @@ Map::Map() {
}
Map::~Map() {
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingMapCells","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingMapCells","",true), true);
delete [] cells;
cells = NULL;
@ -317,7 +317,7 @@ Map::~Map() {
void Map::end(){
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingMap","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingMap","",true), true);
//read heightmap
for(int j = 0; j < surfaceH; ++j) {
for(int i = 0; i < surfaceW; ++i) {
@ -513,7 +513,7 @@ Checksum Map::load(const string &path, TechTree *techTree, Tileset *tileset) {
}
void Map::init(Tileset *tileset) {
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingMap","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingMap","",true), true);
maxMapHeight=0.0f;
smoothSurface(tileset);
computeNormals();

View File

@ -113,7 +113,7 @@ void Minimap::init(int w, int h, const World *world, bool fogOfWar) {
}
Minimap::~Minimap() {
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingMiniMap","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingMiniMap","",true), true);
delete fowPixmap0;
fowPixmap0=NULL;
delete fowPixmap0Copy;

View File

@ -51,7 +51,7 @@ Checksum Scenario::load(const string &path) {
string name= cutLastExt(lastDir(path));
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingScenario","",true).c_str(),formatString(name).c_str());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingScenario","",true).c_str(),formatString(name).c_str());
Logger::getInstance().add(szBuf, true);
bool isTutorial = Scenario::isGameTutorial(path);
@ -327,7 +327,7 @@ void Scenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo, bool is
}
//add player info
scenarioInfo->desc= lang.get("PlayerFaction") + ": ";
scenarioInfo->desc= lang.getString("PlayerFaction") + ": ";
for(int i=0; i<GameConstants::maxPlayers; ++i) {
if(scenarioInfo->factionControls[i] == ctHuman) {
scenarioInfo->desc+= formatString(scenarioInfo->factionTypeNames[i]);
@ -339,10 +339,10 @@ void Scenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo, bool is
string difficultyString = "Difficulty" + intToStr(scenarioInfo->difficulty);
scenarioInfo->desc+= "\n";
scenarioInfo->desc+= lang.get("Difficulty") + ": " + lang.get(difficultyString) +"\n";
scenarioInfo->desc+= lang.get("Map") + ": " + formatString(scenarioInfo->mapName) + "\n";
scenarioInfo->desc+= lang.get("Tileset") + ": " + formatString(scenarioInfo->tilesetName) + "\n";
scenarioInfo->desc+= lang.get("TechTree") + ": " + formatString(scenarioInfo->techTreeName) + "\n";
scenarioInfo->desc+= lang.getString("Difficulty") + ": " + lang.getString(difficultyString) +"\n";
scenarioInfo->desc+= lang.getString("Map") + ": " + formatString(scenarioInfo->mapName) + "\n";
scenarioInfo->desc+= lang.getString("Tileset") + ": " + formatString(scenarioInfo->tilesetName) + "\n";
scenarioInfo->desc+= lang.getString("TechTree") + ": " + formatString(scenarioInfo->techTreeName) + "\n";
//look for description and append it
@ -353,7 +353,7 @@ void Scenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo, bool is
tmp_description = lang.getScenarioString("DESCRIPTION");
}
if( tmp_description != "") {
scenarioInfo->desc += lang.get("Description") + ": \n" + tmp_description + "\n";
scenarioInfo->desc += lang.getString("Description") + ": \n" + tmp_description + "\n";
}
scenarioInfo->namei18n = "";
@ -426,35 +426,35 @@ string Scenario::controllerTypeToStr(const ControlType &ct) {
Lang &lang= Lang::getInstance();
switch(ct) {
case ctCpuEasy:
controlString= lang.get("CpuEasy");
controlString= lang.getString("CpuEasy");
break;
case ctCpu:
controlString= lang.get("Cpu");
controlString= lang.getString("Cpu");
break;
case ctCpuUltra:
controlString= lang.get("CpuUltra");
controlString= lang.getString("CpuUltra");
break;
case ctCpuMega:
controlString= lang.get("CpuMega");
controlString= lang.getString("CpuMega");
break;
case ctNetwork:
controlString= lang.get("Network");
controlString= lang.getString("Network");
break;
case ctHuman:
controlString= lang.get("Human");
controlString= lang.getString("Human");
break;
case ctNetworkCpuEasy:
controlString= lang.get("NetworkCpuEasy");
controlString= lang.getString("NetworkCpuEasy");
break;
case ctNetworkCpu:
controlString= lang.get("NetworkCpu");
controlString= lang.getString("NetworkCpu");
break;
case ctNetworkCpuUltra:
controlString= lang.get("NetworkCpuUltra");
controlString= lang.getString("NetworkCpuUltra");
break;
case ctNetworkCpuMega:
controlString= lang.get("NetworkCpuMega");
controlString= lang.getString("NetworkCpuMega");
break;
default:

View File

@ -164,7 +164,7 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck
try {
char szBuf[8096]="";
snprintf(szBuf,8096,Lang::getInstance().get("LogScreenGameLoadingTileset","",true).c_str(),formatString(name).c_str());
snprintf(szBuf,8096,Lang::getInstance().getString("LogScreenGameLoadingTileset","",true).c_str(),formatString(name).c_str());
Logger::getInstance().add(szBuf, true);
Renderer &renderer= Renderer::getInstance();
@ -500,7 +500,7 @@ Tileset::~Tileset() {
surfPixmaps[i].clear();
}
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingTileset","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingTileset","",true), true);
}
const Pixmap2D *Tileset::getSurfPixmap(int type, int var) const{

View File

@ -152,7 +152,7 @@ World::~World() {
void World::endScenario() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingWorld","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingWorld","",true), true);
animatedTilesetObjectPosListLoaded = false;
@ -171,7 +171,7 @@ void World::endScenario() {
void World::end(){
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameUnLoadingWorld","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameUnLoadingWorld","",true), true);
animatedTilesetObjectPosListLoaded = false;
@ -1892,7 +1892,7 @@ int World::getUnitCountOfType(int factionIndex, const string &typeName) {
void World::initCells(bool fogOfWar) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameLoadingStateCells","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameLoadingStateCells","",true), true);
for(int i=0; i< map.getSurfaceW(); ++i) {
for(int j=0; j< map.getSurfaceH(); ++j) {
@ -1960,7 +1960,7 @@ void World::initSplattedTextures() {
//creates each faction looking at each faction name contained in GameSettings
void World::initFactionTypes(GameSettings *gs) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameLoadingFactionTypes","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameLoadingFactionTypes","",true), true);
if(gs == NULL) {
throw megaglest_runtime_error("gs == NULL");
@ -2092,14 +2092,14 @@ void World::initMinimap() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
minimap.init(map.getW(), map.getH(), this, game->getGameSettings()->getFogOfWar());
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameLoadingMinimapSurface","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameLoadingMinimapSurface","",true), true);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
void World::initUnitsForScenario() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameLoadingGenerateGameElements","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameLoadingGenerateGameElements","",true), true);
//put starting units
for(int i = 0; i < getFactionCount(); ++i) {
@ -2166,7 +2166,7 @@ void World::placeUnitAtLocation(const Vec2i &location, int radius, Unit *unit, b
//place units randomly aroud start location
void World::initUnits() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
Logger::getInstance().add(Lang::getInstance().get("LogScreenGameLoadingGenerateGameElements","",true), true);
Logger::getInstance().add(Lang::getInstance().getString("LogScreenGameLoadingGenerateGameElements","",true), true);
bool gotError = false;
bool skipStackTrace = false;