Ticket #2116: patch_splashscreen.2.diff
File patch_splashscreen.2.diff, 8.2 KB (added by , 11 years ago) |
---|
-
binaries/data/config/default.cfg
20 20 ; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.) 21 21 windowed = false 22 22 23 ; Enable/disable the splashscreen24 splashscreen enable = true23 ; Set the "splashscreen version". By default, it is set to 0 to automatically show up at first launch. 24 splashscreen = 0 25 25 26 26 ; Pause the game on window focus loss (Only applicable to single player mode) 27 27 pauseonfocusloss = true -
binaries/data/mods/public/gui/pregame/mainmenu.xml
440 440 441 441 <!-- PRE-RELEASE WARNING --> 442 442 <object 443 name="preReleaseWarning" 443 444 font="serif-14" 444 445 type="text" 445 446 textcolor="white" 446 447 size="8 8 100%-8 100%-36" 447 448 ghost="true" 448 449 > 449 [font="serif-bold-16"]Alpha XIV: Naukratis<!-- IMPORTANT: remember to update session/session.xml in sync with this -->[/font] 450 451 WARNING: This is an early development version of the game. Many features have not been added yet. 452 453 Get involved at: play0ad.com 450 <action on="Load"> 451 this.caption = "[font=\"serif-bold-16\"]Alpha " + Engine.GetVersionNumberString() + " : " + Engine.GetVersionName() + "[/font]\n\n" + 452 "WARNING: This is an early development version of the game. Many features have not been added yet.\n\n" + 453 "Get involved at: play0ad.com" 454 </action> 454 455 </object> 455 456 456 457 <!-- FUNDRAISER --> -
binaries/data/mods/public/gui/session/session.xml
615 615 616 616 <!-- Displays Alpha name and number --> 617 617 <object size="50%+48 0 100%-226 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true"> 618 ALPHA XIV : Naukratis<!-- IMPORTANT: remember to update pregame/mainmenu.xml in sync with this -->618 <action on="Load">this.caption= "Alpha " + Engine.GetVersionNumberString() + " : " + Engine.GetVersionName()</action> 619 619 620 620 <!-- Displays build date and revision number--> 621 621 <object size="50%-128 0 50%+128 100%-2" name="buildTimeLabel" type="text" style="BuildNameText" ghost="true"> -
binaries/data/mods/public/gui/splashscreen/splashscreen.xml
23 23 <object name="btnOK" type="button" style="StoneButton" tooltip_style="snToolTip" size="24 100%-52 188 100%-24"> 24 24 OK 25 25 <action on="Press"><![CDATA[ 26 Engine.SetSplashScreenEnabled(!getGUIObjectByName("displaySplashScreen").checked); 26 if(getGUIObjectByName("displaySplashScreen").checked) 27 Engine.SetSplashScreenAccordingToVersion(); 27 28 Engine.PopGuiPage(); 28 29 ]]></action> 29 30 </object> -
source/gui/scripting/ScriptFunctions.cpp
43 43 #include "ps/UserReport.h" 44 44 #include "ps/GameSetup/Atlas.h" 45 45 #include "ps/GameSetup/Config.h" 46 #include "ps/GameSetup/VersionData.h" 46 47 #include "ps/ConfigDB.h" 47 48 #include "tools/atlas/GameInterface/GameLoop.h" 48 49 … … 523 524 return g_UserReporter.IsReportingEnabled(); 524 525 } 525 526 527 526 528 bool IsSplashScreenEnabled(void* UNUSED(cbdata)) 527 529 { 528 bool splashScreenEnable = true;529 CFG_GET_VAL("splashscreen enable", Bool, splashScreenEnable);530 return splashScreenEnable;530 unsigned int splashScreenVersion = 0; 531 CFG_GET_VAL("splashscreen", UnsignedInt, splashScreenVersion); 532 return (splashScreenVersion != g_VersionNumber); 531 533 } 532 534 533 void SetSplashScreen Enabled(void* UNUSED(cbdata), bool enabled)535 void SetSplashScreenAccordingToVersion(void* UNUSED(cbdata)) 534 536 { 535 CStr val = (enabled ? "true" : "false");536 g_ConfigDB.CreateValue(CFG_USER, "splashscreen enable")->m_String = val;537 CStr val = CStr::FromUInt(g_VersionNumber); 538 g_ConfigDB.CreateValue(CFG_USER, "splashscreen")->m_String = val; 537 539 g_ConfigDB.WriteFile(CFG_USER); 538 540 } 539 541 540 542 543 unsigned int GetVersionNumber(void* UNUSED(cbdata)) 544 { 545 return g_VersionNumber; 546 } 547 548 std::string GetVersionNumberString(void* UNUSED(cbdata)) 549 { 550 return g_VersionNumberString; 551 } 552 553 std::string GetVersionName(void* UNUSED(cbdata)) 554 { 555 return g_VersionName; 556 } 557 558 541 559 void SetUserReportEnabled(void* UNUSED(cbdata), bool enabled) 542 560 { 543 561 g_UserReporter.SetReportingEnabled(enabled); … … 719 737 720 738 // Splash screen functions 721 739 scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled"); 722 scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled");740 scriptInterface.RegisterFunction<void, &SetSplashScreenAccordingToVersion>("SetSplashScreenAccordingToVersion"); 723 741 742 // Version data functions 743 scriptInterface.RegisterFunction<unsigned int, &GetVersionNumber>("GetVersionNumber"); 744 scriptInterface.RegisterFunction<std::string, &GetVersionNumberString>("GetVersionNumberString"); 745 scriptInterface.RegisterFunction<std::string, &GetVersionName>("GetVersionName"); 746 724 747 // Development/debugging functions 725 748 scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate"); 726 749 scriptInterface.RegisterFunction<float, &GetSimRate>("GetSimRate"); -
source/ps/GameSetup/VersionData.cpp
1 /* Copyright (C) 2013 Wildfire Games. 2 * This file is part of 0 A.D. 3 * 4 * 0 A.D. is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * 0 A.D. is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #include "precompiled.h" 19 20 #include "VersionData.h" 21 22 /* Release version and all version information (such as name and number) shall be gathered in this file*/ 23 24 unsigned int g_VersionNumber = 14; 25 std::string g_VersionNumberString = "XIV"; 26 std::string g_VersionName = "Naukratis"; 27 -
source/ps/GameSetup/VersionData.h
1 /* Copyright (C) 2013 Wildfire Games. 2 * This file is part of 0 A.D. 3 * 4 * 0 A.D. is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * 0 A.D. is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef INCLUDED_PS_GAMESETUP_VERSIONDATA 19 #define INCLUDED_PS_GAMESETUP_VERSIONDATA 20 21 extern unsigned int g_VersionNumber; 22 extern std::string g_VersionNumberString; 23 extern std::string g_VersionName; 24 25 #endif // INCLUDED_PS_GAMESETUP_VERSIONDATA 26 No newline at end of file