From 1a8c28cc9377f8ba7cd35d398b3242aa56976614 Mon Sep 17 00:00:00 2001 From: titiger Date: Sun, 21 Dec 2014 13:33:46 +0100 Subject: [PATCH 1/3] Make it more obvious where to join a game in the internet menu Buttons can be set to always lighted(flashing). This is first used in the internet menu. --- source/glest_game/facilities/components.cpp | 1 + source/glest_game/facilities/components.h | 6 ++++-- source/glest_game/menu/server_line.cpp | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/glest_game/facilities/components.cpp b/source/glest_game/facilities/components.cpp index 713ef25a..955f426d 100644 --- a/source/glest_game/facilities/components.cpp +++ b/source/glest_game/facilities/components.cpp @@ -341,6 +341,7 @@ const int GraphicButton::defW= 90; GraphicButton::GraphicButton(std::string containerName, std::string objName) : GraphicComponent(containerName,objName) { lighted = false; + alwaysLighted = false; useCustomTexture = false; customTexture = NULL; } diff --git a/source/glest_game/facilities/components.h b/source/glest_game/facilities/components.h index 7953d645..ef3e5898 100644 --- a/source/glest_game/facilities/components.h +++ b/source/glest_game/facilities/components.h @@ -212,6 +212,7 @@ public: private: bool lighted; + bool alwaysLighted; bool useCustomTexture; Texture *customTexture; @@ -226,9 +227,10 @@ public: void setUseCustomTexture(bool value) { useCustomTexture=value; } void setCustomTexture(Texture *value) { customTexture=value; } - bool getLighted() const {return lighted;} - + bool getLighted() const {return lighted||alwaysLighted;} void setLighted(bool lighted) {this->lighted= lighted;} + bool getAlwaysLighted() const {return alwaysLighted;} + void setAlwaysLighted(bool value) {this->alwaysLighted= value;} virtual bool mouseMove(int x, int y); }; diff --git a/source/glest_game/menu/server_line.cpp b/source/glest_game/menu/server_line.cpp index caeb81af..7b34c817 100644 --- a/source/glest_game/menu/server_line.cpp +++ b/source/glest_game/menu/server_line.cpp @@ -154,6 +154,7 @@ ServerLine::ServerLine(MasterServerInfo *mServerInfo, int lineIndex, int baseY, i+= 130; selectButton.init(i, baseY - lineOffset, 30); selectButton.setText(">"); + selectButton.setAlwaysLighted(true); //printf("glestVersionString [%s] masterServerInfo->getGlestVersion() [%s]\n",glestVersionString.c_str(),masterServerInfo->getGlestVersion().c_str()); compatible= checkVersionComptability(glestVersionString, masterServerInfo.getGlestVersion()); From b50cb7770c194de2d7c0df6a3df1f6d76e6dc85a Mon Sep 17 00:00:00 2001 From: titiger Date: Sun, 21 Dec 2014 13:35:42 +0100 Subject: [PATCH 2/3] Comparison of version numbers allows non integer characters too This is used to check compatibility of saved games typically. Only the leading digits are used as minor version now. --- source/shared_lib/sources/util/util.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/source/shared_lib/sources/util/util.cpp b/source/shared_lib/sources/util/util.cpp index 56c28904..06c1a70e 100644 --- a/source/shared_lib/sources/util/util.cpp +++ b/source/shared_lib/sources/util/util.cpp @@ -819,9 +819,20 @@ int getMajor(string version){ int getMinor(string version){ vector parts=split(version.substr(1),"."); - - if(parts.size()>2 && parts[1] != "" && IsNumeric(parts[1].c_str(),false)) - return strToInt(parts[1]); + if(parts.size()>2 && parts[1] != ""){ + string resultStr=""; + for (int i = 0; i < (int)parts[1].length(); ++i) { + // just add leading numbers + if(IsNumeric((resultStr+parts[1][i]).c_str(),false) ) + resultStr += parts[1][i]; + else + break; + } + if(resultStr=="") + return 0; + else + return strToInt(resultStr); + } else return 0; } From 341d504cd23a95f6d5e6262ab66d77c00fb569c4 Mon Sep 17 00:00:00 2001 From: titiger Date: Sun, 21 Dec 2014 13:48:51 +0100 Subject: [PATCH 3/3] this is the actual data please don't revertit again --- data/glest_game | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/glest_game b/data/glest_game index 19119ebb..b1c0f0cc 160000 --- a/data/glest_game +++ b/data/glest_game @@ -1 +1 @@ -Subproject commit 19119ebb9c7c91d364c8d413194e476aa815000b +Subproject commit b1c0f0cc18cdd2311b581b44e7ae161317438c93