Index: ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.js
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.js (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.js (revision 22669)
@@ -1,164 +1,164 @@
/**
* Display selectable civs only.
*/
const g_CivData = loadCivData(true, false);
/**
* Callback function name on closing gui via Engine.PopGuiPage().
*/
var g_Callback = "";
var g_SelectedCiv = "";
/**
* Initialize the dropdown containing all the available civs.
*/
function init(data = {})
{
if (data.callback)
g_Callback = data.callback;
var civList = Object.keys(g_CivData).map(civ => ({ "name": g_CivData[civ].Name, "code": civ })).sort(sortNameIgnoreCase);
var civSelection = Engine.GetGUIObjectByName("civSelection");
civSelection.list = civList.map(civ => civ.name);
civSelection.list_data = civList.map(civ => civ.code);
civSelection.selected = data.civ ? civSelection.list_data.indexOf(data.civ) : 0;
Engine.GetGUIObjectByName("structreeButton").tooltip = colorizeHotkey(translate("%(hotkey)s: Switch to Structure Tree."), "structree");
Engine.GetGUIObjectByName("close").tooltip = colorizeHotkey(translate("%(hotkey)s: Close History."), "cancel");
}
/**
* Give the first character a larger font.
*/
function bigFirstLetter(str, size)
{
return '[font="sans-bold-' + (size + 6) + '"]' + str[0] + '[/font]' + '[font="sans-bold-' + size + '"]' + str.substring(1) + '[/font]';
}
/**
* Set heading font - bold and mixed caps
*
* @param string {string}
* @param size {number} - Font size
* @returns {string}
*/
function heading(string, size)
{
var textArray = string.split(" ");
for (let i in textArray)
{
var word = textArray[i];
var wordCaps = word.toUpperCase();
// Check if word is capitalized, if so assume it needs a big first letter
// Check if toLowerCase changes the character to avoid false positives from special signs
if (word.length && word[0].toLowerCase() != word[0])
textArray[i] = bigFirstLetter(wordCaps, size);
else
textArray[i] = '[font="sans-bold-' + size + '"]' + wordCaps + '[/font]'; // TODO: Would not be necessary if we could do nested tags
}
return textArray.join(" ");
}
/**
* Prepends a backslash to all quotation marks.
* @param str {string}
* @returns {string}
*/
function escapeQuotation(str)
{
return str.replace(/"/g, "\\\"");
}
/**
* Returns a styled concatenation of Name, History and Description of the given object.
*
* @param obj {Object}
* @returns {string}
*/
function subHeading(obj)
{
if (!obj.Name)
return "";
let string = '[font="sans-bold-14"]' + obj.Name + '[/font] ';
if (obj.History)
string += '[icon="iconInfo" tooltip="' + escapeQuotation(obj.History) + '" tooltip_style="civInfoTooltip"]';
if (obj.Description)
string += '\n ' + obj.Description;
return coloredText(string + "\n", "white");
}
function switchToStrucTreePage()
{
Engine.PopGuiPage();
Engine.PushGuiPage("page_structree.xml", { "civ": g_SelectedCiv, "callback": g_Callback });
}
-function close()
+function closePage()
{
if (g_Callback)
Engine.PopGuiPageCB({ "civ": g_SelectedCiv, "page": "page_civinfo.xml" });
else
Engine.PopGuiPage();
}
/**
* Updates the GUI after the user selected a civ from dropdown.
*
* @param code {string}
*/
function selectCiv(code)
{
var civInfo = g_CivData[code];
g_SelectedCiv = code;
if(!civInfo)
error(sprintf("Error loading civ data for \"%(code)s\"", { "code": code }));
// Update civ gameplay display
Engine.GetGUIObjectByName("civGameplayHeading").caption = heading(sprintf(translate("%(civilization)s Gameplay"), { "civilization": civInfo.Name }), 16);
// Bonuses
var bonusCaption = heading(translatePlural("Civilization Bonus", "Civilization Bonuses", civInfo.CivBonuses.length), 12) + '\n';
for (let bonus of civInfo.CivBonuses)
bonusCaption += subHeading(bonus);
// Team Bonuses
bonusCaption += heading(translatePlural("Team Bonus", "Team Bonuses", civInfo.TeamBonuses.length), 12) + '\n';
for (let bonus of civInfo.TeamBonuses)
bonusCaption += subHeading(bonus);
Engine.GetGUIObjectByName("civBonuses").caption = bonusCaption;
// Special techs
var techCaption = heading(translate("Special Technologies"), 12) + '\n';
for (let faction of civInfo.Factions)
for (let technology of faction.Technologies)
techCaption += subHeading(technology);
// Special buildings
techCaption += heading(translatePlural("Special Building", "Special Buildings", civInfo.Structures.length), 12) + '\n';
for (let structure of civInfo.Structures)
techCaption += subHeading(structure);
Engine.GetGUIObjectByName("civTechs").caption = techCaption;
// Heroes
var heroCaption = heading(translate("Heroes"), 12) + '\n';
for (let faction of civInfo.Factions)
{
for (let hero of faction.Heroes)
heroCaption += subHeading(hero);
heroCaption += '\n';
}
Engine.GetGUIObjectByName("civHeroes").caption = heroCaption;
// Update civ history display
Engine.GetGUIObjectByName("civHistoryHeading").caption = heading(sprintf(translate("History of the %(civilization)s"), { "civilization": civInfo.Name }), 16);
Engine.GetGUIObjectByName("civHistoryText").caption = civInfo.History;
}
Index: ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.xml (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.xml (revision 22669)
@@ -1,145 +1,141 @@
Index: ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.js
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.js (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.js (revision 22669)
@@ -1,232 +1,234 @@
var currentSubmenuType; // contains submenu type
var MARGIN = 4; // menu border size
var g_ShowSplashScreens;
/**
* Available backdrops
*/
var g_BackgroundLayerData = [];
/**
* Chosen backdrop
*/
var g_BackgroundLayerset;
var g_T0 = Date.now();
var g_LastTickTime = Date.now();
function init(initData, hotloadData)
{
initMusic();
global.music.setState(global.music.states.MENU);
// Initialize currentSubmenuType with placeholder to avoid null when switching
currentSubmenuType = "submenuSinglePlayer";
// Only show splash screen(s) once at startup, but not again after hotloading
g_ShowSplashScreens = hotloadData ? hotloadData.showSplashScreens : initData && initData.isStartup;
// Pick a random background and initialise it
g_BackgroundLayerset = pickRandom(g_BackgroundLayerData);
for (let i = 0; i < g_BackgroundLayerset.length; ++i)
{
let guiObj = Engine.GetGUIObjectByName("background[" + i + "]");
guiObj.hidden = false;
guiObj.sprite = g_BackgroundLayerset[i].sprite;
guiObj.z = i;
}
Engine.GetGUIObjectByName("structreeButton").tooltip = colorizeHotkey(
translate("%(hotkey)s: View the structure tree of civilizations featured in 0 A.D."),
"structree");
Engine.GetGUIObjectByName("civInfoButton").tooltip = colorizeHotkey(
translate("%(hotkey)s: Learn about the many civilizations featured in 0 A.D."),
"civinfo");
Engine.GetGUIObjectByName("lobbyButton").tooltip = colorizeHotkey(
translate("%(hotkey)s: Launch the multiplayer lobby to join and host publicly visible games and chat with other players."),
"lobby");
}
function getHotloadData()
{
return { "showSplashScreens": g_ShowSplashScreens };
}
function scrollBackgrounds()
{
for (let i = 0; i < g_BackgroundLayerset.length; ++i)
{
let guiObj = Engine.GetGUIObjectByName("background[" + i + "]");
let screen = guiObj.parent.getComputedSize();
let h = screen.bottom - screen.top;
let w = h * 16/9;
let iw = h * 2;
let offset = g_BackgroundLayerset[i].offset((Date.now() - g_T0) / 1000, w);
if (g_BackgroundLayerset[i].tiling)
{
let left = offset % iw;
if (left >= 0)
left -= iw;
guiObj.size = new GUISize(left, screen.top, screen.right, screen.bottom);
}
else
guiObj.size = new GUISize(screen.right/2 - h + offset, screen.top, screen.right/2 + h + offset, screen.bottom);
}
}
function onTick()
{
let now = Date.now();
let tickLength = Date.now() - g_LastTickTime;
g_LastTickTime = now;
scrollBackgrounds();
updateMenuPosition(tickLength);
// Show splash screens here, so we don't interfere with main menu hotloading
if (g_ShowSplashScreens)
{
g_ShowSplashScreens = false;
if (Engine.ConfigDB_GetValue("user", "gui.splashscreen.enable") === "true" ||
Engine.ConfigDB_GetValue("user", "gui.splashscreen.version") < Engine.GetFileMTime("gui/splashscreen/splashscreen.txt"))
- Engine.PushGuiPage("page_splashscreen.xml", { "page": "splashscreen", "callback": "SplashScreenClosedCallback" });
+ ShowSplashScreen();
else
ShowRenderPathMessage();
}
}
+function ShowSplashScreen()
+{
+ Engine.PushGuiPage("page_splashscreen.xml", {
+ "callback": "ShowRenderPathMessage"
+ });
+}
+
function ShowRenderPathMessage()
{
// Warn about removing fixed render path
if (Engine.Renderer_GetRenderPath() == "fixed")
messageBox(
600, 300,
"[font=\"sans-bold-16\"]" +
sprintf(translate("%(warning)s You appear to be using non-shader (fixed function) graphics. This option will be removed in a future 0 A.D. release, to allow for more advanced graphics features. We advise upgrading your graphics card to a more recent, shader-compatible model."), {
"warning": coloredText("Warning:", "200 20 20")
}) +
"\n\n" +
// Translation: This is the second paragraph of a warning. The
// warning explains that the user is using “non-shader“ graphics,
// and that in the future this will not be supported by the game, so
// the user will need a better graphics card.
translate("Please press \"Read More\" for more information or \"OK\" to continue."),
translate("WARNING!"),
[translate("OK"), translate("Read More")],
[ null, function() { Engine.OpenURL("https://www.wildfiregames.com/forum/index.php?showtopic=16734"); } ]
);
}
-function SplashScreenClosedCallback()
-{
- ShowRenderPathMessage();
-}
-
/**
* Slide menu.
*/
function updateMenuPosition(dt)
{
let submenu = Engine.GetGUIObjectByName("submenu");
if (submenu.hidden == false)
{
// Number of pixels per millisecond to move
let SPEED = 1.2;
let maxOffset = Engine.GetGUIObjectByName("mainMenu").size.right - submenu.size.left;
if (maxOffset > 0)
{
let offset = Math.min(SPEED * dt, maxOffset);
let size = submenu.size;
size.left += offset;
size.right += offset;
submenu.size = size;
}
}
}
/**
* Opens the menu by revealing the screen which contains the menu.
*/
function openMenu(newSubmenu, position, buttonHeight, numButtons)
{
currentSubmenuType = newSubmenu;
Engine.GetGUIObjectByName(currentSubmenuType).hidden = false;
let submenu = Engine.GetGUIObjectByName("submenu");
let top = position - MARGIN;
let bottom = position + ((buttonHeight + MARGIN) * numButtons);
submenu.size = new GUISize(submenu.size.left, top, submenu.size.right, bottom);
// Blend in right border of main menu into the left border of the submenu
blendSubmenuIntoMain(top, bottom);
submenu.hidden = false;
}
function closeMenu()
{
Engine.GetGUIObjectByName(currentSubmenuType).hidden = true;
let submenu = Engine.GetGUIObjectByName("submenu");
submenu.hidden = true;
submenu.size = Engine.GetGUIObjectByName("mainMenu").size;
Engine.GetGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% 100%";
}
/**
* Sizes right border on main menu panel to match the submenu.
*/
function blendSubmenuIntoMain(topPosition, bottomPosition)
{
Engine.GetGUIObjectByName("MainMenuPanelRightBorderTop").size = "100%-2 0 100% " + (topPosition + MARGIN);
Engine.GetGUIObjectByName("MainMenuPanelRightBorderBottom").size = "100%-2 " + (bottomPosition) + " 100% 100%";
}
function exitGamePressed()
{
closeMenu();
messageBox(
400, 200,
translate("Are you sure you want to quit 0 A.D.?"),
translate("Confirmation"),
[translate("No"), translate("Yes")],
[null, Engine.Exit]
);
}
function pressedScenarioEditorButton()
{
closeMenu();
if (Engine.AtlasIsAvailable())
messageBox(
400, 200,
translate("Are you sure you want to quit 0 A.D. and open the Scenario Editor?"),
translate("Confirmation"),
[translate("No"), translate("Yes")],
[null, Engine.RestartInAtlas]
);
else
messageBox(
400, 200,
translate("The scenario editor is not available or failed to load. See the game logs for additional information."),
translate("Error")
);
}
function getLobbyDisabledByBuild()
{
return translate("Launch the multiplayer lobby to join and host publicly visible games and chat with other players. \\[DISABLED BY BUILD]");
}
Index: ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/pregame/mainmenu.xml (revision 22669)
@@ -1,620 +1,617 @@
onTick();
closeMenu();
closeMenu();
ManualOpen the 0 A.D. Game Manual.
closeMenu();
Engine.PushGuiPage("page_manual.xml");
TutorialStart the economic tutorial.
Engine.SwitchGuiPage("page_gamesetup.xml", { "tutorial": true });
Structure Tree
closeMenu();
Engine.PushGuiPage("page_structree.xml", {});
History
closeMenu();
Engine.PushGuiPage("page_civinfo.xml");
MatchesClick here to start a new single player game.
Engine.SwitchGuiPage("page_gamesetup.xml", {});
CampaignsRelive history through historical military campaigns. \[NOT YET IMPLEMENTED]
closeMenu();
Load GameClick here to load a saved game.
closeMenu();
Engine.PushGuiPage("page_loadgame.xml", { "type": "offline" });
ReplaysPlayback previous games.
closeMenu();
Engine.SwitchGuiPage("page_replaymenu.xml", {
"replaySelectionData": {
"filters": {
"singleplayer": "Singleplayer"
}
}
});
Join GameJoining an existing multiplayer game.
closeMenu();
Engine.PushGuiPage("page_gamesetup_mp.xml", { "multiplayerGameType": "join" });
Host GameHost a multiplayer game.\n\nRequires UDP port 20595 to be open.
closeMenu();
Engine.PushGuiPage("page_gamesetup_mp.xml", { multiplayerGameType: "host" });
Game Lobby
if (!Engine.StartXmppClient)
return;
closeMenu();
Engine.PushGuiPage("page_prelobby_entrance.xml");
if (!Engine.StartXmppClient)
{
this.enabled = false;
this.tooltip = getLobbyDisabledByBuild();
}
ReplaysPlayback previous games.
closeMenu();
Engine.SwitchGuiPage("page_replaymenu.xml", {
"replaySelectionData": {
"filters": {
"singleplayer": "Multiplayer"
}
}
});
OptionsAdjust game settings.
closeMenu();
Engine.PushGuiPage("page_options.xml");
LanguageChoose the language of the game.
closeMenu();
Engine.PushGuiPage("page_locale.xml");
Mod SelectionSelect and download mods for the game.
Engine.SwitchGuiPage("page_modmod.xml");
Welcome ScreenShow the Welcome Screen. Useful if you hid it by mistake.
closeMenu();
- Engine.PushGuiPage("page_splashscreen.xml", {
- "page": "splashscreen",
- "callback": "SplashScreenClosedCallback"
- });
+ ShowSplashScreen();
Learn to PlayLearn how to play, start the tutorial, discover the technology trees, and the history behind the civilizations
closeMenu();
openMenu("submenuLearn", this.parent.size.top + this.size.top, this.size.bottom - this.size.top, 4);
Single PlayerChallenge the computer player to a single player match.
closeMenu();
openMenu("submenuSinglePlayer", this.parent.size.top + this.size.top, this.size.bottom - this.size.top, 4);
MultiplayerFight against one or more human players in a multiplayer game.
closeMenu();
openMenu("submenuMultiplayer", this.parent.size.top + this.size.top, this.size.bottom - this.size.top, 4);
SettingsGame options and mod selection.
closeMenu();
openMenu("submenuOptions", this.parent.size.top + this.size.top, this.size.bottom - this.size.top, 4);
Scenario EditorOpen the Atlas Scenario Editor in a new window. You can run this more reliably by starting the game with the command-line argument "-editor".
pressedScenarioEditorButton();
ExitExits the game.exitGamePressed();[font="sans-bold-16"]Alpha XXIV[/font]\n\nWARNING: This is an early development version of the game. Many features have not been added yet.WebsiteClick to open play0ad.com in your web browser.
openURL("https://play0ad.com/");
ChatClick to open the 0 A.D. IRC chat in your browser. (#0ad on webchat.quakenet.org)
openURL("https://webchat.quakenet.org/?channels=0ad");
Report a BugClick to visit 0 A.D. Trac to report a bug, crash, or error.
openURL("https://trac.wildfiregames.com/wiki/ReportingErrors/");
Translate the GameClick to open the 0 A.D. translate page in your browser.
openURL("https://trac.wildfiregames.com/wiki/Localization");
DonateHelp with the project expenses by donating.
openURL("https://play0ad.com/community/donate/");
CreditsClick to see the 0 A.D. credits.
Engine.PushGuiPage("page_credits.xml");
WILDFIRE GAMES
this.caption = getBuildString();
Index: ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.js
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.js (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.js (revision 22669)
@@ -1,206 +1,206 @@
/**
* Array of structure template names when given a civ and a phase name.
*/
var g_BuildList = {};
/**
* Array of template names that can be trained from a unit, given a civ and unit template name.
*/
var g_TrainList = {};
/**
* Callback function name on closing gui via Engine.PopGuiPage().
*/
var g_Callback = "";
/**
* Initialize the page
*
* @param {object} data - Parameters passed from the code that calls this page into existence.
*/
function init(data = {})
{
if (data.callback)
g_Callback = data.callback;
let civList = Object.keys(g_CivData).map(civ => ({
"name": g_CivData[civ].Name,
"code": civ,
})).sort(sortNameIgnoreCase);
if (!civList.length)
{
closePage();
return;
}
g_ParsedData = {
"units": {},
"structures": {},
"techs": {},
"phases": {}
};
let civSelection = Engine.GetGUIObjectByName("civSelection");
civSelection.list = civList.map(c => c.name);
civSelection.list_data = civList.map(c => c.code);
civSelection.selected = data.civ ? civSelection.list_data.indexOf(data.civ) : 0;
Engine.GetGUIObjectByName("civinfo").tooltip = colorizeHotkey(translate("%(hotkey)s: Switch to History."), "civinfo");
Engine.GetGUIObjectByName("close").tooltip = colorizeHotkey(translate("%(hotkey)s: Close Structure Tree."), "cancel");
}
function switchToCivInfoPage()
{
Engine.PopGuiPage();
Engine.PushGuiPage("page_civinfo.xml", { "civ": g_SelectedCiv, "callback": g_Callback });
}
-function close()
+function closePage()
{
if (g_Callback)
Engine.PopGuiPageCB({ "civ": g_SelectedCiv, "page": "page_structree.xml" });
else
Engine.PopGuiPage();
}
/**
* @param {string} civCode
*/
function selectCiv(civCode)
{
if (civCode === g_SelectedCiv || !g_CivData[civCode])
return;
g_SelectedCiv = civCode;
g_CurrentModifiers = deriveModifications(g_AutoResearchTechList);
// If a buildList already exists, then this civ has already been parsed
if (g_BuildList[g_SelectedCiv])
{
draw();
drawPhaseIcons();
return;
}
let templateLists = compileTemplateLists(civCode);
for (let u of templateLists.units.keys())
if (!g_ParsedData.units[u])
g_ParsedData.units[u] = loadEntityTemplate(u);
for (let s of templateLists.structures.keys())
if (!g_ParsedData.structures[s])
g_ParsedData.structures[s] = loadEntityTemplate(s);
// Load technologies
g_ParsedData.techs[civCode] = {};
for (let techcode of templateLists.techs.keys())
if (basename(techcode).startsWith("phase"))
g_ParsedData.phases[techcode] = loadPhase(techcode);
else
g_ParsedData.techs[civCode][techcode] = loadTechnology(techcode);
// Establish phase order
g_ParsedData.phaseList = UnravelPhases(g_ParsedData.phases);
// Load any required generic phases that aren't already loaded
for (let phasecode of g_ParsedData.phaseList)
if (!g_ParsedData.phases[phasecode])
g_ParsedData.phases[phasecode] = loadPhase(phasecode);
// Group production and upgrade lists of structures by phase
for (let structCode of templateLists.structures.keys())
{
let structInfo = g_ParsedData.structures[structCode];
structInfo.phase = getPhaseOfTemplate(structInfo);
let structPhaseIdx = g_ParsedData.phaseList.indexOf(structInfo.phase);
// If this building is shared with another civ,
// it may have already gone through the grouping process already
if (!Array.isArray(structInfo.production.techs))
continue;
// Sort techs by phase
let newProdTech = {};
for (let prod of structInfo.production.techs)
{
let phase = getPhaseOfTechnology(prod);
if (phase === false)
continue;
if (g_ParsedData.phaseList.indexOf(phase) < structPhaseIdx)
phase = structInfo.phase;
if (!(phase in newProdTech))
newProdTech[phase] = [];
newProdTech[phase].push(prod);
}
// Sort units by phase
let newProdUnits = {};
for (let prod of structInfo.production.units)
{
let phase = getPhaseOfTemplate(g_ParsedData.units[prod]);
if (phase === false)
continue;
if (g_ParsedData.phaseList.indexOf(phase) < structPhaseIdx)
phase = structInfo.phase;
if (!(phase in newProdUnits))
newProdUnits[phase] = [];
newProdUnits[phase].push(prod);
}
g_ParsedData.structures[structCode].production = {
"techs": newProdTech,
"units": newProdUnits
};
// Sort upgrades by phase
let newUpgrades = {};
if (structInfo.upgrades)
for (let upgrade of structInfo.upgrades)
{
let phase = getPhaseOfTemplate(upgrade);
if (g_ParsedData.phaseList.indexOf(phase) < structPhaseIdx)
phase = structInfo.phase;
if (!newUpgrades[phase])
newUpgrades[phase] = [];
newUpgrades[phase].push(upgrade);
}
g_ParsedData.structures[structCode].upgrades = newUpgrades;
}
// Determine the buildList for the civ (grouped by phase)
let buildList = {};
let trainerList = [];
for (let pha of g_ParsedData.phaseList)
buildList[pha] = [];
for (let structCode of templateLists.structures.keys())
{
let phase = g_ParsedData.structures[structCode].phase;
buildList[phase].push(structCode);
}
for (let unitCode of templateLists.units.keys())
{
let unitTemplate = g_ParsedData.units[unitCode];
if (!unitTemplate.production.units.length && !unitTemplate.production.techs.length && !unitTemplate.upgrades)
continue;
trainerList.push(unitCode);
}
g_BuildList[g_SelectedCiv] = buildList;
g_TrainList[g_SelectedCiv] = trainerList;
draw();
drawPhaseIcons();
}
Index: ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.xml (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.xml (revision 22669)
@@ -1,143 +1,141 @@
- close();
+ closePage();
Structure TreeCivilization:selectCiv(this.list_data[this.selected]);Trainer UnitsHistoryswitchToCivInfoPage();Close
-
- close();
-
+ closePage();
Index: ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.js
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.js (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.js (revision 22669)
@@ -1,5 +1,14 @@
+var g_SplashScreenFile = "gui/splashscreen/splashscreen.txt";
+
function init(data)
{
- Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile("gui/splashscreen/" + data.page + ".txt"));
+ Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile(g_SplashScreenFile));
Engine.GetGUIObjectByName("displaySplashScreen").checked = Engine.ConfigDB_GetValue("user", "gui.splashscreen.enable") === "true";
}
+
+function closePage()
+{
+ Engine.ConfigDB_CreateAndWriteValueToFile("user", "gui.splashscreen.enable", String(Engine.GetGUIObjectByName("displaySplashScreen").checked), "config/user.cfg");
+ Engine.ConfigDB_CreateAndWriteValueToFile("user", "gui.splashscreen.version", Engine.GetFileMTime(g_SplashScreenFile), "config/user.cfg");
+ Engine.PopGuiPageCB();
+}
Index: ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.xml (revision 22668)
+++ ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.xml (revision 22669)
@@ -1,37 +1,35 @@
+
Welcome!Show this message in the future
+
Known Issues (web)
-
+ openURL("https://www.wildfiregames.com/forum/index.php?showtopic=15796");
+
OK
-
+ closePage();
+