implement frame rate display as transparent & draggable dialog
(ordered by Curt as Christmas present :-)
This commit is contained in:
parent
5c4731ea93
commit
fbd735408d
4 changed files with 48 additions and 1 deletions
|
@ -69,10 +69,26 @@ INIT = func {
|
|||
# enable/disable menu entries
|
||||
menuEnable("fuel-and-payload", getprop("/sim/flight-model") == "yasim");
|
||||
menuEnable("autopilot", props.globals.getNode("/autopilot/KAP140/locks") == nil);
|
||||
|
||||
fps_loop();
|
||||
}
|
||||
settimer(INIT, 0);
|
||||
|
||||
|
||||
##
|
||||
# Show/hide the fps display dialog.
|
||||
#
|
||||
var show_fps = -1;
|
||||
fps_loop = func {
|
||||
var i = getprop("/sim/rendering/fps-display");
|
||||
if (i != show_fps) {
|
||||
fgcommand(i ? "dialog-show" : "dialog-close",
|
||||
props.Node.new({"dialog-name": "fps"}));
|
||||
show_fps = i;
|
||||
}
|
||||
settimer(fps_loop, 1);
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# How many seconds do we show the tip?
|
||||
|
|
30
gui/dialogs/fps.xml
Normal file
30
gui/dialogs/fps.xml
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
<name>fps</name>
|
||||
<x>-1</x>
|
||||
<y>0</y>
|
||||
<width>30</width>
|
||||
<height>20</height>
|
||||
<color>
|
||||
<red>1</red>
|
||||
<green>1</green>
|
||||
<blue>1</blue>
|
||||
<alpha>0</alpha>
|
||||
</color>
|
||||
<text>
|
||||
<label>000</label>
|
||||
<property>/sim/frame-rate</property>
|
||||
<live>true</live>
|
||||
<!--font>
|
||||
<name>typewriter</name>
|
||||
<size>16</size>
|
||||
</font-->
|
||||
<color>
|
||||
<red>1</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
<alpha>1</alpha>
|
||||
</color>
|
||||
</text>
|
||||
</PropertyList>
|
|
@ -18,7 +18,7 @@
|
|||
<checkbox>
|
||||
<halign>left</halign>
|
||||
<label>Show frame rate</label>
|
||||
<property>/sim/hud/draw-fps</property>
|
||||
<property>/sim/rendering/fps-display</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
|
|
|
@ -56,6 +56,7 @@ Started September 2000 by David Megginson, david@megginson.com
|
|||
<shadows-ai type="bool">false</shadows-ai>
|
||||
<shadows-to type="bool">false</shadows-to>
|
||||
<shadows-debug type="bool">false</shadows-debug>
|
||||
<fps-display type="bool">false</fps-display>
|
||||
</rendering>
|
||||
<model-hz type="int">120</model-hz>
|
||||
<navdb>
|
||||
|
|
Loading…
Add table
Reference in a new issue