diff --git a/BUILD.md b/BUILD.md index 9f31c0be6..1874e8dd8 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,10 +1,5 @@ # BUILD.md -The Mac build may need attention. If you are interested in helping us -test that the build completes and the game runs, please post or -subscribe to this ticket: [Current -Status](https://github.com/ZetaGlest/zetaglest-source/issues/25) - * **Getting the code:** * [Set up the repositories locally](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#set-up-the-repositories-locally) * [cloning](https://github.com/ZetaGlest/zetaglest-source/blob/develop/BUILD.md#procedure-for-cloning) diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index 16346f199..859159b82 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -171,9 +171,9 @@ namespace Game { //case 1: return "Built: " + string(__DATE__) + " " + GIT_Rev; switch (i) { case 0: - return GameVersionString; + return GameVersionString + " (build " + GameBuildDateString + ")"; case 1: - return "Network multi-player cross-platform 3D real-time strategy (RTS) game"; + return "Network multiplayer cross-platform 3D real-time strategy (RTS) game"; case 2: return "Copyright 2001-2010 The Glest Team"; case 3: diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 5e3558792..ef282efa3 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -5908,7 +5908,7 @@ namespace Game { if (haveSpecialOutputCommandLineOption == false || hasCommandArgument(argc, argv, GAME_ARGS[GAME_ARG_VERSION]) == true) { - printf("%s\n", GameVersionString.c_str()); + printf("%s (build %s)\n", GameVersionString.c_str(), GameBuildDateString.c_str()); printf("Compiled using: %s platform: %s endianness: %s", getCompilerNameString().c_str(), getPlatformNameString().c_str(), @@ -6266,6 +6266,10 @@ namespace Game { if (config.getBool("DisableLuaSandbox", "false") == true) { LuaScript::setDisableSandbox(true); } +#ifdef _WIN32 + if (config.getBool("ShowConsoleWindows", "false") == false) + ShowWindow(GetConsoleWindow(), SW_HIDE); +#endif if (hasCommandArgument (argc, argv, GAME_ARGS[GAME_ARG_DEBUG_NETWORK_PACKETS]) == true) { diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 046c0bbc7..3574064a4 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -2534,8 +2534,7 @@ namespace Game { getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "%s\n", getCurrentMapFile().c_str()); - switchToNextMapGroup(listBoxMapFilter.getSelectedItemIndex() - - oldListBoxMapfilterIndex); + switchToNextMapGroup((listBoxMapFilter.getSelectedItemIndex() - oldListBoxMapfilterIndex) == 1 ? 1 : -1); if (loadMapInfo (Config::getMapPath(getCurrentMapFile(), "", false), &mapInfo, true) == true) { diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 1f49cf34f..603daf2b9 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -1920,8 +1920,7 @@ namespace Game { () : NULL), string(__FILE__) + "_" + intToStr(__LINE__)); - switchToNextMapGroup(listBoxMapFilter.getSelectedItemIndex() - - oldListBoxMapfilterIndex); + switchToNextMapGroup((listBoxMapFilter.getSelectedItemIndex() - oldListBoxMapfilterIndex) == 1 ? 1 : -1); if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem). enabled) diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index 5f3b6272e..4682e7a4b 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -79,11 +79,10 @@ namespace Game { checkBoxTimeDisplay("Options", "checkBoxTimeDisplay"), labelChatStaysActive("Options", "labelChatStaysActive"), checkBoxChatStaysActive("Options", "checkBoxChatStaysActive"), - labelLuaDisableSecuritySandbox("Options", - "labelLuaDisableSecuritySandbox"), - checkBoxLuaDisableSecuritySandbox("Options", - "checkBoxLuaDisableSecuritySandbox"), - luaMessageBox("Options", "luaMessageBox"), + labelShowDeveloperConsoleOnWindows("Options", + "labelShowDeveloperConsoleOnWindows"), + checkBoxShowDeveloperConsoleOnWindows("Options", + "checkBoxShowDeveloperConsoleOnWindows"), labelCustomTranslation("Options", "labelCustomTranslation"), checkBoxCustomTranslation("Options", "checkBoxCustomTranslation"), buttonGetNewLanguageFiles("Options", "buttonGetNewLanguageFiles"), @@ -379,22 +378,16 @@ namespace Game { currentLine -= lineOffset; - labelLuaDisableSecuritySandbox.init(currentLabelStart, currentLine); - labelLuaDisableSecuritySandbox.setText(lang. - getString - ("LuaDisableSecuritySandbox")); + labelShowDeveloperConsoleOnWindows.init(currentLabelStart, currentLine); + labelShowDeveloperConsoleOnWindows.setText("Show developer console on Windows"); - checkBoxLuaDisableSecuritySandbox.init(currentColumnStart, + checkBoxShowDeveloperConsoleOnWindows.init(currentColumnStart, currentLine); - checkBoxLuaDisableSecuritySandbox.setValue(config. + checkBoxShowDeveloperConsoleOnWindows.setValue(config. getBool - ("DisableLuaSandbox", + ("ShowConsoleWindows", "false")); - luaMessageBox.init(lang.getString("Yes"), lang.getString("No")); - luaMessageBox.setEnabled(false); - luaMessageBoxState = 0; - currentLine -= lineOffset; currentLine -= lineOffset / 2; @@ -486,7 +479,6 @@ namespace Game { Lang & lang = Lang::getInstance(); mainMessageBox.init(lang.getString("Ok")); - luaMessageBox.init(lang.getString("Yes"), lang.getString("No")); buttonAudioSection.setText(lang.getString("Audio")); buttonVideoSection.setText(lang.getString("Video")); @@ -499,9 +491,7 @@ namespace Game { labelChatStaysActive.setText(lang.getString("ChatStaysActive")); labelTimeDisplay.setText(lang.getString("TimeDisplay")); - labelLuaDisableSecuritySandbox.setText(lang. - getString - ("LuaDisableSecuritySandbox")); + labelShowDeveloperConsoleOnWindows.setText("Show developer console on Windows"); labelLang.setText(lang.getString("Language")); labelPlayerNameLabel.setText(lang.getString("Playername")); labelFontSizeAdjustment.setText(lang.getString("FontSizeAdjustment")); @@ -561,22 +551,6 @@ namespace Game { } } - void - MenuStateOptions::showLuaMessageBox(const string & text, - const string & header, bool toggle) { - if (!toggle) { - luaMessageBox.setEnabled(false); - } - - if (!luaMessageBox.getEnabled()) { - luaMessageBox.setText(text); - luaMessageBox.setHeader(header); - luaMessageBox.setEnabled(true); - } else { - luaMessageBox.setEnabled(false); - } - } - void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton) { @@ -614,29 +588,6 @@ namespace Game { } } } - } else if (luaMessageBox.getEnabled()) { - int - button = 0; - if (luaMessageBox.mouseClick(x, y, button)) { - checkBoxLuaDisableSecuritySandbox.setValue(false); - soundRenderer.playFx(coreData.getClickSoundA()); - if (button == 0) { - if (luaMessageBoxState == 1) { - checkBoxLuaDisableSecuritySandbox.setValue(true); - } - } - luaMessageBox.setEnabled(false); - } - } else if (checkBoxLuaDisableSecuritySandbox.mouseClick(x, y)) { - if (checkBoxLuaDisableSecuritySandbox.getValue() == true) { - checkBoxLuaDisableSecuritySandbox.setValue(false); - - luaMessageBoxState = 1; - Lang & lang = Lang::getInstance(); - showLuaMessageBox(lang. - getString("LuaDisableSecuritySandboxWarning"), - lang.getString("Question"), false); - } } else if (buttonOk.mouseClick(x, y)) { soundRenderer.playFx(coreData.getClickSoundA()); @@ -1131,7 +1082,7 @@ namespace Game { listBoxHealthBars.mouseClick(x, y); checkBoxChatStaysActive.mouseClick(x, y); checkBoxTimeDisplay.mouseClick(x, y); - checkBoxLuaDisableSecuritySandbox.mouseClick(x, y); + checkBoxShowDeveloperConsoleOnWindows.mouseClick(x, y); } } @@ -1140,9 +1091,6 @@ namespace Game { if (mainMessageBox.getEnabled()) { mainMessageBox.mouseMove(x, y); } - if (luaMessageBox.getEnabled()) { - luaMessageBox.mouseMove(x, y); - } buttonOk.mouseMove(x, y); buttonReturn.mouseMove(x, y); @@ -1164,7 +1112,7 @@ namespace Game { checkBoxVisibleHud.mouseMove(x, y); checkBoxChatStaysActive.mouseMove(x, y); checkBoxTimeDisplay.mouseMove(x, y); - checkBoxLuaDisableSecuritySandbox.mouseMove(x, y); + checkBoxShowDeveloperConsoleOnWindows.mouseMove(x, y); checkBoxCustomTranslation.mouseMove(x, y); } @@ -1219,8 +1167,6 @@ namespace Game { if (mainMessageBox.getEnabled()) { renderer.renderMessageBox(&mainMessageBox); - } else if (luaMessageBox.getEnabled()) { - renderer.renderMessageBox(&luaMessageBox); } else { renderer.renderButton(&buttonOk); renderer.renderButton(&buttonReturn); @@ -1274,8 +1220,8 @@ namespace Game { renderer.renderLabel(&labelChatStaysActive); renderer.renderLabel(&labelTimeDisplay); - renderer.renderLabel(&labelLuaDisableSecuritySandbox); - renderer.renderCheckBox(&checkBoxLuaDisableSecuritySandbox); + renderer.renderLabel(&labelShowDeveloperConsoleOnWindows); + renderer.renderCheckBox(&checkBoxShowDeveloperConsoleOnWindows); renderer.renderCheckBox(&checkBoxVisibleHud); renderer.renderCheckBox(&checkBoxChatStaysActive); @@ -1349,13 +1295,16 @@ namespace Game { config.setBool("ChatStaysActive", checkBoxChatStaysActive.getValue()); config.setBool("TimeDisplay", checkBoxTimeDisplay.getValue()); - config.setBool("DisableLuaSandbox", - checkBoxLuaDisableSecuritySandbox.getValue()); + config.setBool("ShowConsoleWindows", + checkBoxShowDeveloperConsoleOnWindows.getValue()); config.save(); - if (config.getBool("DisableLuaSandbox", "false") == true) { - LuaScript::setDisableSandbox(true); - } +#ifdef _WIN32 + if (checkBoxShowDeveloperConsoleOnWindows.getValue()) + ShowWindow(GetConsoleWindow(), SW_SHOW); + else + ShowWindow(GetConsoleWindow(), SW_HIDE); +#endif Renderer::getInstance().loadConfig(); console.addLine(lang.getString("SettingsSaved")); } diff --git a/source/glest_game/menu/menu_state_options.h b/source/glest_game/menu/menu_state_options.h index 37a470ffa..89780b0ce 100644 --- a/source/glest_game/menu/menu_state_options.h +++ b/source/glest_game/menu/menu_state_options.h @@ -73,11 +73,8 @@ namespace Game { GraphicLabel labelChatStaysActive; GraphicCheckBox checkBoxChatStaysActive; - GraphicLabel labelLuaDisableSecuritySandbox; - GraphicCheckBox checkBoxLuaDisableSecuritySandbox; - - GraphicMessageBox luaMessageBox; - int luaMessageBoxState; + GraphicLabel labelShowDeveloperConsoleOnWindows; + GraphicCheckBox checkBoxShowDeveloperConsoleOnWindows; map < string, string > languageList; @@ -115,8 +112,6 @@ namespace Game { void setActiveInputLable(GraphicLabel * newLable); void showMessageBox(const string & text, const string & header, bool toggle); - void showLuaMessageBox(const string & text, const string & header, - bool toggle); void setupTransifexUI(); }; diff --git a/source/glest_game/menu/menu_state_options_graphics.cpp b/source/glest_game/menu/menu_state_options_graphics.cpp index 4d25e0f6f..cd5c858e3 100644 --- a/source/glest_game/menu/menu_state_options_graphics.cpp +++ b/source/glest_game/menu/menu_state_options_graphics.cpp @@ -1088,9 +1088,12 @@ namespace Game { config.save(); - if (config.getBool("DisableLuaSandbox", "false") == true) { - LuaScript::setDisableSandbox(true); - } +#ifdef _WIN32 + if (config.getBool("ShowConsoleWindows", "false") == true) + ShowWindow(GetConsoleWindow(), SW_SHOW); + else + ShowWindow(GetConsoleWindow(), SW_HIDE); +#endif Renderer::getInstance().loadConfig(); console.addLine(lang.getString("SettingsSaved")); diff --git a/source/glest_game/menu/menu_state_options_sound.cpp b/source/glest_game/menu/menu_state_options_sound.cpp index 4deb77ff2..d4bf267b5 100644 --- a/source/glest_game/menu/menu_state_options_sound.cpp +++ b/source/glest_game/menu/menu_state_options_sound.cpp @@ -477,9 +477,12 @@ namespace Game { config.save(); - if (config.getBool("DisableLuaSandbox", "false") == true) { - LuaScript::setDisableSandbox(true); - } +#ifdef _WIN32 + if (config.getBool("ShowConsoleWindows", "false") == true) + ShowWindow(GetConsoleWindow(), SW_SHOW); + else + ShowWindow(GetConsoleWindow(), SW_HIDE); +#endif SoundRenderer & soundRenderer = SoundRenderer::getInstance(); soundRenderer.stopAllSounds(); diff --git a/source/shared_lib/include/platform/common/shared_const.h b/source/shared_lib/include/platform/common/shared_const.h index c478230d6..8a5048dab 100644 --- a/source/shared_lib/include/platform/common/shared_const.h +++ b/source/shared_lib/include/platform/common/shared_const.h @@ -26,6 +26,7 @@ namespace Shared { const std::string GameVersionString = GAME_VERSION; + const std::string GameBuildDateString = GAME_BUILD_DATE; const std::string G3DViewerVersionString = G3D_VIEWER_VERSION; const std::string MapEditorVersionString = MAP_EDITOR_VERSION; } //end namespace diff --git a/source/shared_lib/include/versions.h b/source/shared_lib/include/versions.h index e3103a478..ed756091e 100644 --- a/source/shared_lib/include/versions.h +++ b/source/shared_lib/include/versions.h @@ -1,3 +1,4 @@ #define GAME_VERSION "ZetaGlest 1.0" +#define GAME_BUILD_DATE "2601" #define G3D_VIEWER_VERSION "1.0" #define MAP_EDITOR_VERSION "1.0"