From c187d4d01426f4de139fd0f5835783e9ab4fb2d1 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 11 Jun 2012 23:50:30 +0000 Subject: [PATCH] - changed disconnected playername to: *AI* - playername --- source/glest_game/game/commander.cpp | 3 ++- source/glest_game/game/game.cpp | 2 +- source/glest_game/menu/menu_state_connected_game.cpp | 3 ++- source/glest_game/menu/menu_state_custom_game.cpp | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index def02002..f1bbbac3 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -831,10 +831,11 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const { int factionIndex = networkCommand->getUnitId(); int playerStatus = networkCommand->getCommandTypeId(); + GameSettings *settings = world->getGameSettingsPtr(); if(playerStatus == 1) { - GameSettings *settings = world->getGameSettingsPtr(); settings->setNetworkPlayerGameStatus(factionIndex,1); } + this->world->getStats()->setPlayerName(factionIndex,settings->getNetworkPlayerName(factionIndex)); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] found nctPlayerStatusChange\n",__FILE__,__FUNCTION__,__LINE__); diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 7ea7b3ce..efe61655 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -839,7 +839,7 @@ void Game::init(bool initForPreviewOnly) { Map *map= world.getMap(); NetworkManager &networkManager= NetworkManager::getInstance(); - GameSettings::playerDisconnectedText = "*" + lang.get("Disconnect") + "* - "; + GameSettings::playerDisconnectedText = "*" + lang.get("AI") + "* "; if(map == NULL) { throw megaglest_runtime_error("map == NULL"); diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 33515db7..6d5d4b9e 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -1503,7 +1503,8 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) { AIPlayerCount++; 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); - gameSettings->setNetworkPlayerName(slotIndex, string("AI") + intToStr(AIPlayerCount)); + Lang &lang= Lang::getInstance(); + gameSettings->setNetworkPlayerName(slotIndex, lang.get("AI") + intToStr(AIPlayerCount)); labelPlayerNames[i].setText(""); } diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index fabd5788..3a8eeb9e 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -3091,7 +3091,8 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force AIPlayerCount++; 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); - gameSettings->setNetworkPlayerName(slotIndex, string("AI") + intToStr(AIPlayerCount)); + Lang &lang= Lang::getInstance(); + gameSettings->setNetworkPlayerName(slotIndex, lang.get("AI") + intToStr(AIPlayerCount)); labelPlayerNames[i].setText(""); }