issue #127: make screen shots work with OSG multi-threading
Use listener to report success/error messages for screen shots (depends on simgear+fgdata update!)
This commit is contained in:
parent
ac46479d0a
commit
b34be9cf92
2 changed files with 13 additions and 14 deletions
|
@ -1254,3 +1254,15 @@ var common_aircraft_keys = {
|
|||
{ name: "Shift-F8", desc: "scroll 2D panel right" },
|
||||
],
|
||||
};
|
||||
|
||||
_setlistener("/sim/signals/screenshot", func {
|
||||
var path = getprop("/sim/paths/screenshot-last");
|
||||
var button = { button: { legend: "Ok", default: 1, binding: { command: "dialog-close" }}};
|
||||
var success= getprop("/sim/signals/screenshot");
|
||||
if (success) {
|
||||
popupTip("Screenshot written to '" ~ path ~ "'", 3);
|
||||
} else {
|
||||
popupTip("Error writing screenshot '" ~ path ~ "'", 600, button);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
15
keyboard.xml
15
keyboard.xml
|
@ -1106,20 +1106,7 @@ top down before the key bindings are parsed.
|
|||
<name>F3</name>
|
||||
<desc>Capture screen</desc>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>
|
||||
var success = fgcommand("screen-capture");
|
||||
var path = getprop("/sim/paths/screenshot-last");
|
||||
var threading = getprop("/sim/rendering/multithreading-mode");
|
||||
var button = { button: { legend: "Ok", default: 1, binding: { command: "dialog-close" }}};
|
||||
if (threading and threading != "SingleThreaded") {
|
||||
gui.popupTip("Threading model must be SingleThreaded (or not defined) for snapshots to work.", 600, button);
|
||||
} elsif (success) {
|
||||
gui.popupTip("Screenshot written to '" ~ path ~ "'", 2);
|
||||
} else {
|
||||
gui.popupTip("Error writing screenshot '" ~ path ~ "'", 600, button);
|
||||
}
|
||||
</script>
|
||||
<command>screen-capture</command>
|
||||
</binding>
|
||||
<mod-shift>
|
||||
<desc>Load panel</desc>
|
||||
|
|
Loading…
Reference in a new issue