- added local mg version label to custom game menu

This commit is contained in:
Mark Vejvoda 2012-05-12 02:21:21 +00:00
parent e38c9b5db0
commit 345b2e670b
3 changed files with 22 additions and 6 deletions

View File

@ -178,8 +178,11 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
int networkPos=networkHeadPos-labelOffset;
int xoffset=10;
labelLocalGameVersion.registerGraphicComponent(containerName,"labelLocalGameVersion");
labelLocalGameVersion.init(10, networkHeadPos+labelOffset);
labelLocalIP.registerGraphicComponent(containerName,"labelLocalIP");
labelLocalIP.init(210, networkHeadPos+labelOffset);
labelLocalIP.init(360, networkHeadPos+labelOffset);
string ipText = "none";
std::vector<std::string> ipList = Socket::getLocalIPAddressList();
@ -198,6 +201,13 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
labelLocalIP.setText(lang.get("LanIP") + ipText + " ( "+serverPort+" / "+externalPort+" )");
ServerSocket::setExternalPort(strToInt(externalPort));
if(EndsWith(glestVersionString, "-dev") == false){
labelLocalGameVersion.setText(glestVersionString);
}
else {
labelLocalGameVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]");
}
xoffset=70;
// MapFilter
labelMapFilter.registerGraphicComponent(containerName,"labelMapFilter");
@ -677,6 +687,14 @@ void MenuStateCustomGame::reloadUI() {
console.resetFonts();
mainMessageBox.init(lang.get("Ok"));
if(EndsWith(glestVersionString, "-dev") == false){
labelLocalGameVersion.setText(glestVersionString);
}
else {
labelLocalGameVersion.setText(glestVersionString + " [" + getCompileDateTime() + ", " + getSVNRevisionString() + "]");
}
vector<string> teamItems, controlItems, results , rMultiplier;
string ipText = "none";
@ -1836,6 +1854,8 @@ void MenuStateCustomGame::render() {
renderer.renderLabel(&labelNetStatus[i]);
}
}
renderer.renderLabel(&labelLocalGameVersion);
renderer.renderLabel(&labelLocalIP);
renderer.renderLabel(&labelMap);

View File

@ -51,6 +51,7 @@ private:
GraphicLabel labelMapInfo;
//GraphicLabel labelEnableObserverMode;
//GraphicLabel labelEnableServerControlledAI;
GraphicLabel labelLocalGameVersion;
GraphicLabel labelLocalIP;
GraphicLabel labelGameName;
GraphicLabel labelGameNameLabel;

View File

@ -2013,11 +2013,6 @@ void Faction::loadGame(const XmlNode *rootNode, int factionIndex,GameSettings *s
// Allies allies;
allies.clear();
// for(unsigned int i = 0; i < allies.size(); ++i) {
// Faction *ally = allies[i];
// XmlNode *allyNode = factionNode->addChild("Ally");
// allyNode->addAttribute("allyFactionIndex",intToStr(ally->getIndex()), mapTagReplacements);
// }
vector<XmlNode *> allyNodeList = factionNode->getChildList("Ally");
for(unsigned int i = 0; i < allyNodeList.size(); ++i) {
XmlNode *allyNode = allyNodeList[i];