From 4269b23c0269df36087cb16c91c0a04119791b07 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Wed, 31 Aug 2011 21:51:46 +0000 Subject: [PATCH] Mod menu tells you a bit more about mod states. Never versions of Mods are NOT indicated yet. Hopefully this is the next step. --- source/glest_game/global/core_data.cpp | 9 ++++ source/glest_game/global/core_data.h | 9 ++++ source/glest_game/menu/menu_state_mods.cpp | 49 +++++++++++++++++++--- 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/source/glest_game/global/core_data.cpp b/source/glest_game/global/core_data.cpp index 86058d192..1c81b5dd5 100644 --- a/source/glest_game/global/core_data.cpp +++ b/source/glest_game/global/core_data.cpp @@ -78,6 +78,15 @@ void CoreData::load() { customTexture= renderer.newTexture2D(rsGlobal); customTexture->getPixmap()->load(dir+"/menu/textures/custom_texture.tga"); + notOnServerTexture= renderer.newTexture2D(rsGlobal); + notOnServerTexture->getPixmap()->load(dir+"/menu/textures/not_on_server.tga"); + onServerDifferentTexture= renderer.newTexture2D(rsGlobal); + onServerDifferentTexture->getPixmap()->load(dir+"/menu/textures/on_server_different.tga"); + onServerTexture= renderer.newTexture2D(rsGlobal); + onServerTexture->getPixmap()->load(dir+"/menu/textures/on_server.tga"); + onServerInstalledTexture= renderer.newTexture2D(rsGlobal); + onServerInstalledTexture->getPixmap()->load(dir+"/menu/textures/on_server_installed.tga"); + logoTexture= renderer.newTexture2D(rsGlobal); logoTexture->setMipmap(false); logoTexture->getPixmap()->load(dir+"/menu/textures/logo.tga"); diff --git a/source/glest_game/global/core_data.h b/source/glest_game/global/core_data.h index c4bfa9f35..9c21d0a9e 100644 --- a/source/glest_game/global/core_data.h +++ b/source/glest_game/global/core_data.h @@ -61,6 +61,11 @@ private: Texture2D *checkBoxTexture; Texture2D *checkedCheckBoxTexture; Texture2D *gameWinnerTexture; + Texture2D *notOnServerTexture; + Texture2D *onServerDifferentTexture; + Texture2D *onServerTexture; + Texture2D *onServerInstalledTexture; + Font2D *displayFont; Font2D *menuFontNormal; @@ -95,6 +100,10 @@ public: Texture2D *getVerticalLineTexture() const {return verticalLineTexture;} Texture2D *getCheckBoxTexture() const {return checkBoxTexture;} Texture2D *getCheckedCheckBoxTexture() const {return checkedCheckBoxTexture;} + Texture2D *getNotOnServerTexture() const {return notOnServerTexture;} + Texture2D *getOnServerDifferentTexture() const {return onServerDifferentTexture;} + Texture2D *getOnServerTexture() const {return onServerTexture;} + Texture2D *getOnServerInstalledTexture() const {return onServerInstalledTexture;} Texture2D *getGameWinnerTexture() const {return gameWinnerTexture;} diff --git a/source/glest_game/menu/menu_state_mods.cpp b/source/glest_game/menu/menu_state_mods.cpp index 3cc782b3b..29951db70 100644 --- a/source/glest_game/menu/menu_state_mods.cpp +++ b/source/glest_game/menu/menu_state_mods.cpp @@ -92,7 +92,7 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) : keyTechScrollBarTitle1.registerGraphicComponent(containerName,"keyTechScrollBarTitle1"); keyTechScrollBarTitle1.init(techInfoXPos,scrollListsYPos + 20,labelWidth,20); keyTechScrollBarTitle1.setText(lang.get("TechTitle1")); - keyTechScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal()); + keyTechScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyTechScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontNormal3D()); keyTechScrollBarTitle2.registerGraphicComponent(containerName,"keyTechScrollBarTitle2"); keyTechScrollBarTitle2.init(techInfoXPos + 200,scrollListsYPos + 20,labelWidth,20); @@ -104,7 +104,7 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) : keyMapScrollBarTitle1.registerGraphicComponent(containerName,"keyMapScrollBarTitle1"); keyMapScrollBarTitle1.init(mapInfoXPos,scrollListsYPos + 20,labelWidth,20); keyMapScrollBarTitle1.setText(lang.get("MapTitle1")); - keyMapScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal()); + keyMapScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyMapScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontNormal3D()); keyMapScrollBarTitle2.registerGraphicComponent(containerName,"keyMapScrollBarTitle2"); keyMapScrollBarTitle2.init(mapInfoXPos + 200,scrollListsYPos + 20,labelWidth,20); @@ -116,14 +116,14 @@ MenuStateMods::MenuStateMods(Program *program, MainMenu *mainMenu) : keyTilesetScrollBarTitle1.registerGraphicComponent(containerName,"keyTilesetScrollBarTitle1"); keyTilesetScrollBarTitle1.init(tilesetInfoXPos,scrollListsYPos + 20,labelWidth,20); keyTilesetScrollBarTitle1.setText(lang.get("TilesetTitle1")); - keyTilesetScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal()); + keyTilesetScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyTilesetScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontNormal3D()); scenarioInfoXPos = 760; keyScenarioScrollBarTitle1.registerGraphicComponent(containerName,"keyScenarioScrollBarTitle1"); keyScenarioScrollBarTitle1.init(scenarioInfoXPos,scrollListsYPos + 20,labelWidth,20); keyScenarioScrollBarTitle1.setText(lang.get("ScenarioTitle1")); - keyScenarioScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontNormal()); + keyScenarioScrollBarTitle1.setFont(CoreData::getInstance().getMenuFontBig()); keyScenarioScrollBarTitle1.setFont3D(CoreData::getInstance().getMenuFontNormal3D()); mainMessageBoxState = ftpmsg_None; @@ -1255,7 +1255,6 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) { Config &config = Config::getInstance(); string itemPath = config.getPathListForType(ptTechs,"")[1] + "/" + selectedTechName + string("/*"); bool forceRefresh = (mapCRCUpdateList.find(itemPath) == mapCRCUpdateList.end()); - if( strToInt(modInfo.crc) != 0 && strToInt(modInfo.crc) != getFolderTreeContentsCheckSumRecursively(itemPath, "", NULL,forceRefresh)) { if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] local CRC [%d]\n",__FILE__,__FUNCTION__,__LINE__,getFolderTreeContentsCheckSumRecursively(itemPath, "", NULL)); @@ -1812,11 +1811,21 @@ void MenuStateMods::render() { else if(alreadyHasTech == true) { Vec4f buttonColor = WHITE; buttonColor.w = 0.75f; + bool remoteHasTech = (techCacheList.find(keyTechButtons[i]->getText()) != techCacheList.end()); + if(remoteHasTech) + { + keyTechButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerInstalledTexture()); + } + else + { + keyTechButtons[i]->setCustomTexture(CoreData::getInstance().getNotOnServerTexture()); + } renderer.renderButton(keyTechButtons[i],&buttonColor); } else { Vec4f fontColor=Vec4f(200.0f/255.0f, 187.0f/255.0f, 190.0f/255.0f, 0.75f); //Vec4f fontColor=Vec4f(1.0f, 0.0f, 0.0f, 0.75f); + keyTechButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerTexture()); renderer.renderButton(keyTechButtons[i],&fontColor); } renderer.renderLabel(labelsTech[i]); @@ -1837,10 +1846,20 @@ void MenuStateMods::render() { else if(alreadyHasTileset == true) { Vec4f buttonColor = WHITE; buttonColor.w = 0.75f; + bool remoteHasTileset= (tilesetCacheList.find(keyTilesetButtons[i]->getText()) != tilesetCacheList.end()); + if(remoteHasTileset) + { + keyTilesetButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerInstalledTexture()); + } + else + { + keyTilesetButtons[i]->setCustomTexture(CoreData::getInstance().getNotOnServerTexture()); + } renderer.renderButton(keyTilesetButtons[i],&buttonColor); } else { Vec4f fontColor=Vec4f(200.0f/255.0f, 187.0f/255.0f, 190.0f/255.0f, 0.75f); + keyTilesetButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerTexture()); renderer.renderButton(keyTilesetButtons[i],&fontColor); } } @@ -1862,10 +1881,20 @@ void MenuStateMods::render() { else if(alreadyHasMap == true) { Vec4f buttonColor = WHITE; buttonColor.w = 0.75f; + bool remoteHasMap = (mapCacheList.find(keyMapButtons[i]->getText()) != mapCacheList.end()); + if(remoteHasMap) + { + keyMapButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerInstalledTexture()); + } + else + { + keyMapButtons[i]->setCustomTexture(CoreData::getInstance().getNotOnServerTexture()); + } renderer.renderButton(keyMapButtons[i],&buttonColor); } else { Vec4f fontColor=Vec4f(200.0f/255.0f, 187.0f/255.0f, 190.0f/255.0f, 0.75f); + keyMapButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerTexture()); renderer.renderButton(keyMapButtons[i],&fontColor); } renderer.renderLabel(labelsMap[i]); @@ -1891,10 +1920,20 @@ void MenuStateMods::render() { else if(alreadyHasScenario == true) { Vec4f buttonColor = WHITE; buttonColor.w = 0.75f; + bool remoteHasScenario= (scenarioCacheList.find(keyScenarioButtons[i]->getText()) != scenarioCacheList.end()); + if(remoteHasScenario) + { + keyScenarioButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerInstalledTexture()); + } + else + { + keyScenarioButtons[i]->setCustomTexture(CoreData::getInstance().getNotOnServerTexture()); + } renderer.renderButton(keyScenarioButtons[i],&buttonColor); } else { Vec4f fontColor=Vec4f(200.0f/255.0f, 187.0f/255.0f, 190.0f/255.0f, 0.75f); + keyScenarioButtons[i]->setCustomTexture(CoreData::getInstance().getOnServerTexture()); renderer.renderButton(keyScenarioButtons[i],&fontColor); } }