Ticket #2118: patch_versiondata.diff

File patch_versiondata.diff, 6.0 KB (added by Itms, 11 years ago)
  • binaries/data/mods/public/gui/pregame/mainmenu.xml

     
    440440
    441441                <!-- PRE-RELEASE WARNING -->
    442442                <object
     443                    name="preReleaseWarning"
    443444                    font="serif-14"
    444445                    type="text"
    445446                    textcolor="white"
    446447                    size="8 8 100%-8 100%-36"
    447448                                        ghost="true"
    448449                >
    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>
    454455                </object>
    455456
    456457                <!-- FUNDRAISER -->
  • binaries/data/mods/public/gui/session/session.xml

     
    615615
    616616        <!-- Displays Alpha name and number -->
    617617        <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>
    619619
    620620        <!-- Displays build date and revision number-->
    621621        <object size="50%-128 0 50%+128 100%-2" name="buildTimeLabel" type="text" style="BuildNameText" ghost="true">
  • source/gui/scripting/ScriptFunctions.cpp

     
    4343#include "ps/UserReport.h"
    4444#include "ps/GameSetup/Atlas.h"
    4545#include "ps/GameSetup/Config.h"
     46#include "ps/GameSetup/VersionData.h"
    4647#include "ps/ConfigDB.h"
    4748#include "tools/atlas/GameInterface/GameLoop.h"
    4849
     
    537538    g_ConfigDB.WriteFile(CFG_USER);
    538539}
    539540
     541unsigned int GetVersionNumber(void* UNUSED(cbdata))
     542{
     543    return g_VersionNumber;
     544}
    540545
     546std::string GetVersionNumberString(void* UNUSED(cbdata))
     547{
     548    return g_VersionNumberString;
     549}
     550
     551std::string GetVersionName(void* UNUSED(cbdata))
     552{
     553    return g_VersionName;
     554}
     555
     556
    541557void SetUserReportEnabled(void* UNUSED(cbdata), bool enabled)
    542558{
    543559    g_UserReporter.SetReportingEnabled(enabled);
     
    721737    scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled");
    722738    scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled");
    723739
     740    // Version data functions
     741    scriptInterface.RegisterFunction<unsigned int, &GetVersionNumber>("GetVersionNumber");
     742    scriptInterface.RegisterFunction<std::string, &GetVersionNumberString>("GetVersionNumberString");
     743    scriptInterface.RegisterFunction<std::string, &GetVersionName>("GetVersionName");
     744
    724745    // Development/debugging functions
    725746    scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate");
    726747    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
     24unsigned int g_VersionNumber = 14;
     25std::string g_VersionNumberString = "XIV";
     26std::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
     21extern unsigned int g_VersionNumber;
     22extern std::string g_VersionNumberString;
     23extern std::string g_VersionName;
     24
     25#endif // INCLUDED_PS_GAMESETUP_VERSIONDATA
     26 No newline at end of file