re-position FPS display on window resizing
This commit is contained in:
parent
638fe3ca29
commit
a1746e9f77
1 changed files with 6 additions and 6 deletions
|
@ -70,10 +70,10 @@ INIT = func {
|
||||||
menuEnable("fuel-and-payload", getprop("/sim/flight-model") == "yasim");
|
menuEnable("fuel-and-payload", getprop("/sim/flight-model") == "yasim");
|
||||||
menuEnable("autopilot", props.globals.getNode("/autopilot/KAP140/locks") == nil);
|
menuEnable("autopilot", props.globals.getNode("/autopilot/KAP140/locks") == nil);
|
||||||
|
|
||||||
setlistener("/sim/rendering/fps-display", fpsDisplay);
|
var fps = props.globals.getNode("/sim/rendering/fps-display", 1);
|
||||||
if (getprop("/sim/rendering/fps-display")) {
|
if (fps.getValue()) { fpsDisplay(1) }
|
||||||
fgcommand("dialog-show", props.Node.new({"dialog-name": "fps"}));
|
setlistener(fps, fpsDisplay);
|
||||||
}
|
setlistener("/sim/startup/xsize", func { if (fps.getValue()) { fpsDisplay(0); fpsDisplay(1) } });
|
||||||
}
|
}
|
||||||
settimer(INIT, 0);
|
settimer(INIT, 0);
|
||||||
|
|
||||||
|
@ -82,8 +82,8 @@ settimer(INIT, 0);
|
||||||
# Show/hide the fps display dialog.
|
# Show/hide the fps display dialog.
|
||||||
#
|
#
|
||||||
fpsDisplay = func {
|
fpsDisplay = func {
|
||||||
var cmd = cmdarg().getBoolValue() ? "dialog-show" : "dialog-close";
|
var w = size(arg) ? arg[0] : cmdarg().getBoolValue();
|
||||||
fgcommand(cmd, props.Node.new({"dialog-name": "fps"}));
|
fgcommand(w ? "dialog-show" : "dialog-close", props.Node.new({"dialog-name": "fps"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue