Add config settings for FPS, realtime, and gametime overlays.

This was SVN commit r15634.
This commit is contained in:
JoshuaJB
2014-08-13 18:56:07 +00:00
parent c13547c9a0
commit 704d0f9511
5 changed files with 18 additions and 8 deletions
+4
View File
@@ -369,3 +369,7 @@ lobby.xpartamupp = "wfgbot17" ; Name of the server-side xmpp client
lobby.chattimestamp = false ; Show time chat message was posted
lobby.room = "arena17" ; Default MUC room to join
lobby.history = 0 ; Number of past messages to display on join
; Overlay Preferances
overlay.fps = "false" ; Show frames per second in top right corner
overlay.realtime = "false" ; Show current system time in top right corner
@@ -30,10 +30,11 @@
z="199"
>
<action on="Tick">
this.hidden = Engine.ConfigDB_GetValue("user", "overlay.fps") == "false";
updateFPS();
</action>
<action on="Press">
this.hidden = !this.hidden;
Engine.ConfigDB_CreateValue("user", "overlay.realtime", !this.hidden);
</action>
</object>
@@ -55,11 +56,12 @@
z="199"
>
<action on="Tick">
this.hidden = Engine.ConfigDB_GetValue("user", "overlay.realtime") == "false";
var d = new Date();
this.caption = d.toLocaleTimeString();
</action>
<action on="Press">
this.hidden = !this.hidden;
Engine.ConfigDB_CreateValue("user", "overlay.realtime", !this.hidden);
</action>
</object>
@@ -10,6 +10,9 @@ var options = {
[translate("Background Pause"), translate("Pause single player games when window loses focus"), {"config":"pauseonfocusloss"}, "boolean"],
[translate("Disable Welcome Screen"), translate("If you disable this screen completely, you may miss important announcements.\nYou can still launch it using the main menu."), {"config":"splashscreendisable"}, "boolean"],
[translate("Detailed Tooltips"), translate("Show detailed tooltips for trainable units in unit-producing buildings."), {"config":"showdetailedtooltips"}, "boolean"],
[translate("FPS Overlay"), translate("Show frames per second in top right corner."), {"config":"overlay.fps"}, "boolean"],
[translate("Realtime Overlay"), translate("Show current system time in top right corner."), {"config":"overlay.realtime"}, "boolean"],
[translate("Gametime Overlay"), translate("Show current simulation time in top right corner."), {"config":"gui.session.timeelapsedcounter"}, "boolean"],
],
"graphicsSetting":
[
@@ -231,10 +231,6 @@ function init(initData, hotloadData)
}
global.music.setState(global.music.states.PEACE);
playRandomAmbient("temperate");
if (Engine.ConfigDB_GetValue("user", "gui.session.timeelapsedcounter") === "true")
Engine.GetGUIObjectByName("timeElapsedCounter").hidden = false;
onSimulationUpdate();
// Report the performance after 5 seconds (when we're still near
@@ -149,9 +149,14 @@
<!-- ================================ ================================ -->
<!-- Time elapsed counter -->
<!-- ================================ ================================ -->
<object size="100%-120 45 100%-10 65" type="text" name="timeElapsedCounter" style="SettingsText" hotkey="timeelapsedcounter.toggle" hidden="true">
<action on="Press">this.hidden = !this.hidden;</action>
<action on="Tick">
this.hidden = Engine.ConfigDB_GetValue("user", "gui.session.timeelapsedcounter") == "false";
</action>
<action on="Press">
Engine.ConfigDB_CreateValue("user", "gui.session.timeelapsedcounter", !this.hidden);
</action>
</object>
<!-- ================================ ================================ -->