diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index fc9f9db69..4e4af5a2f 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -26,7 +26,7 @@ using namespace Shared::Platform; namespace Glest{ namespace Game{ const string mailString= "contact_game@glest.org"; -const string glestVersionString= "v3.3.5-alpha1"; +const string glestVersionString= "v3.3.5-dev"; string getCrashDumpFileName(){ return "glest" + glestVersionString + ".dmp"; diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 510ec24cb..e63b107e5 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -57,10 +57,16 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b needToSetChangedGameSettings = false; needToRepublishToMasterserver = false; needToBroadcastServerSettings = false; + showMasterserverError = false; + masterServererErrorToShow = "---"; lastSetChangedGameSettings = time(NULL); lastMasterserverPublishing = time(NULL); soundConnectionCount=0; + mainMessageBox.init(lang.get("Ok")); + mainMessageBox.setEnabled(false); + mainMessageBoxState=0; + vector teamItems, controlItems, results; //create @@ -250,8 +256,18 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){ CoreData &coreData= CoreData::getInstance(); SoundRenderer &soundRenderer= SoundRenderer::getInstance(); ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface(); - - if(buttonReturn.mouseClick(x,y)){ + if(mainMessageBox.getEnabled()){ + int button= 1; + if(mainMessageBox.mouseClick(x, y, button)) + { + soundRenderer.playFx(coreData.getClickSoundA()); + if(button==1) + { + mainMessageBox.setEnabled(false); + } + } + } + else if(buttonReturn.mouseClick(x,y)){ SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); soundRenderer.playFx(coreData.getClickSoundA()); @@ -423,7 +439,9 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){ } void MenuStateCustomGame::mouseMove(int x, int y, const MouseState *ms){ - + if (mainMessageBox.getEnabled()) { + mainMessageBox.mouseMove(x, y); + } buttonReturn.mouseMove(x, y); buttonPlayNow.mouseMove(x, y); @@ -444,40 +462,45 @@ void MenuStateCustomGame::render(){ try { Renderer &renderer= Renderer::getInstance(); - int i; - - renderer.renderButton(&buttonReturn); - renderer.renderButton(&buttonPlayNow); - - for(i=0; igetSwitchSetupRequests(); @@ -777,6 +811,13 @@ void MenuStateCustomGame::simpleTask() { printf("the request is:\n%s\n",request.c_str()); std::string serverInfo = SystemFlags::getHTTP(request); + printf("the result is:\n'%s'\n",serverInfo.c_str()); +// uncomment to enable router setup check of this server +// if(serverInfo!="OK") +// { +// showMasterserverError=true; +// masterServererErrorToShow=serverInfo; +// } } if(needToBroadcastServerSettings) { @@ -1027,4 +1068,20 @@ void MenuStateCustomGame::keyPress(char c) chatManager.keyPress(c); } +void MenuStateCustomGame::showMessageBox(const string &text, const string &header, bool toggle){ + if(!toggle){ + mainMessageBox.setEnabled(false); + } + + if(!mainMessageBox.getEnabled()){ + mainMessageBox.setText(text); + mainMessageBox.setHeader(header); + mainMessageBox.setEnabled(true); + } + else{ + mainMessageBox.setEnabled(false); + } +} + + }}//end namespace diff --git a/source/glest_game/menu/menu_state_custom_game.h b/source/glest_game/menu/menu_state_custom_game.h index 06369eaf6..4bf436239 100644 --- a/source/glest_game/menu/menu_state_custom_game.h +++ b/source/glest_game/menu/menu_state_custom_game.h @@ -50,6 +50,10 @@ private: GraphicLabel labelPublishServer; GraphicListBox listBoxPublishServer; + + GraphicMessageBox mainMessageBox; + int mainMessageBoxState; + bool needToSetChangedGameSettings; time_t lastSetChangedGameSettings; @@ -61,7 +65,10 @@ private: bool parentMenuIsMs; bool soundConnectionCount; - + + bool showMasterserverError; + string masterServererErrorToShow; + Console console; ChatManager chatManager; @@ -90,6 +97,7 @@ private: void updateNetworkSlots(); void publishToMasterserver(); void returnToParentMenu(); + void showMessageBox(const string &text, const string &header, bool toggle); }; }}//end namespace diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index 6e28e1319..da8f24fb2 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -134,8 +134,10 @@ MenuStateMasterserver::MenuStateMasterserver(Program *program, MainMenu *mainMen mainMessageBox.init(lang.get("Ok")); mainMessageBox.setEnabled(false); - lastRefreshTimer= time(NULL); mainMessageBoxState=0; + + lastRefreshTimer= time(NULL); + // header labelTitle.init(330, 700);