From c2c9cc00444ea7d4c0e6fd99e36d74fccd6f6659 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Thu, 11 Nov 2010 21:41:13 +0000 Subject: [PATCH] endgame stats screen shows multiplier now for CPU players you cannot switch unvisible resource multiplier any more --- source/glest_game/game/stats.h | 4 ++++ source/glest_game/main/battle_end.cpp | 4 ++++ source/glest_game/menu/menu_state_custom_game.cpp | 8 +++++--- source/glest_game/world/world.cpp | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/source/glest_game/game/stats.h b/source/glest_game/game/stats.h index 0fc549ae..b828a5ac 100644 --- a/source/glest_game/game/stats.h +++ b/source/glest_game/game/stats.h @@ -29,6 +29,7 @@ class PlayerStats { public: PlayerStats() { control = ctClosed; + resourceMultiplier=1.0f; factionTypeName = ""; personalityType = fpt_Normal; teamIndex = 0; @@ -42,6 +43,7 @@ public: } ControlType control; + float resourceMultiplier; string factionTypeName; FactionPersonalityType personalityType; int teamIndex; @@ -83,6 +85,7 @@ public: const string &getFactionTypeName(int factionIndex) const {return playerStats[factionIndex].factionTypeName;} FactionPersonalityType getPersonalityType(int factionIndex) const { return playerStats[factionIndex].personalityType;} ControlType getControl(int factionIndex) const {return playerStats[factionIndex].control;} + float getResourceMultiplier(int factionIndex) const {return playerStats[factionIndex].resourceMultiplier;} bool getVictory(int factionIndex) const {return playerStats[factionIndex].victory;} int getTeam(int factionIndex) const {return playerStats[factionIndex].teamIndex;} int getKills(int factionIndex) const {return playerStats[factionIndex].kills;} @@ -96,6 +99,7 @@ public: void setFactionTypeName(int playerIndex, const string& factionTypeName) {playerStats[playerIndex].factionTypeName= factionTypeName;} void setPersonalityType(int playerIndex, FactionPersonalityType value) { playerStats[playerIndex].personalityType = value;} void setControl(int playerIndex, ControlType control) {playerStats[playerIndex].control= control;} + void setResourceMultiplier(int playerIndex, float resourceMultiplier) {playerStats[playerIndex].resourceMultiplier= resourceMultiplier;} void setTeam(int playerIndex, int teamIndex) {playerStats[playerIndex].teamIndex= teamIndex;} void setVictorious(int playerIndex); void kill(int killerFactionIndex, int killedFactionIndex); diff --git a/source/glest_game/main/battle_end.cpp b/source/glest_game/main/battle_end.cpp index 5f16441f..468c2e39 100644 --- a/source/glest_game/main/battle_end.cpp +++ b/source/glest_game/main/battle_end.cpp @@ -137,6 +137,10 @@ void BattleEnd::render(){ assert(false); }; } + + if(stats.getControl(i)!=ctHuman && stats.getControl(i)!=ctNetwork ){ + controlString+=" x "+floatToStr(stats.getResourceMultiplier(i),1); + } Vec3f color = stats.getPlayerColor(i); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 75bf9f65..c943c0a7 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -411,7 +411,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b controlItems.push_back(lang.get("Human")); for(int i=0; i<45; ++i){ - rMultiplier.push_back(floatToStr(rMultiplierOffset+0.1f*i)); + rMultiplier.push_back(floatToStr(rMultiplierOffset+0.1f*i,1)); } if(config.getBool("EnableNetworkCpu","false") == true) { @@ -797,8 +797,10 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){ for(int i=0; igetFactionTypeName(i))); stats.setPersonalityType(i, getFaction(i)->getType()->getPersonalityType()); stats.setControl(i, gs->getFactionControl(i)); + stats.setResourceMultiplier(i,gs->getResourceMultiplier(i)); stats.setPlayerName(i,gs->getNetworkPlayerName(i)); stats.setPlayerColor(i,getFaction(i)->getTexture()->getPixmapConst()->getPixel3f(0, 0)); } - + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(factions.size() > 0) {