Fixed FPS, which had stopped working (since it no longer recognised the mouse.x and mouse.y component of the string).

This was SVN commit r2579.
This commit is contained in:
Acumen 2005-08-07 14:51:55 +00:00
parent f1eeadb2c6
commit 76f3524190
3 changed files with 16 additions and 9 deletions

View File

@ -73,9 +73,12 @@ font.misc = verdana16
; Colour of the sky (in "r g b" format). (Will be removed once there's proper sky support).
;skycolor = "255 0 0"
; Maximum number of players in a session (default 6).
max_players = 8
; GENERAL PREFERENCES:
sound.mastergain = 0.1
sound.mastergain = 0.5
; selection.outline.quality = 9; ( higher => very slightly slower, better quality)
; view.scroll.speed = 60

View File

@ -90,19 +90,15 @@
hotkey="fps.toggle"
font="verdana16"
textcolor="100 100 0"
size="18 0 200 35"
size="18 18 200 35"
z="199"
>
<action on="Load"><![CDATA[
setInterval (updateFPS, 1, 200);
]]></action>
<action on="Press"><![CDATA[
guiToggle (this.name);
]]></action>
<action on="Tick"><![CDATA[
if (this.hidden == "false"){
g_mouse_x = mouse.x;
g_mouse_y = mouse.y;
getGUIObjectByName(this.name).caption = "FPS: " + getFPS() + " " + g_mouse_x + " " + g_mouse_y;
}
]]></action>
</object>
<!--

View File

@ -123,3 +123,11 @@ function messageBox (mbWidth, mbHeight, mbMessage, mbTitle, mbMode, mbButtonCapt
}
// ====================================================================
function updateFPS()
{
getGUIObjectByName("fpsCounter").caption = "FPS: " + getFPS();
}
// ====================================================================