1
0
Fork 0

Add a basic "ok" message if an error condition occurs with the snapshot

(based on tip from Melchior)
This commit is contained in:
Curtis L. Olson 2011-05-03 10:50:36 -05:00
parent e8015f0840
commit b2f9f52f88

View file

@ -1125,19 +1125,20 @@ top down before the key bindings are parsed.
var path = getprop("/sim/paths/screenshot-last");
var threading = getprop("/sim/rendering/multithreading-mode");
var message = "";
var delay = 3;
if ( threading != nil and threading != "" and
threading != "SingleThreaded" )
{
message = "Threading model must be SingleThreaded (or not defined) for snapshots to work.";
gui.popupTip(message, 600, { button: { legend: "Ok", default: 1, binding: { command: "dialog-close" }}});
} else {
if (success) {
message = "Screenshot written to '" ~ path ~ "'";
delay = 2;
gui.popupTip(message, 2);
} else {
message = "Error writing screenshot '" ~ path ~ "'";
delay = 5;
gui.popupTip(message, 600, { button: { legend: "Ok", default: 1, binding: { command: "dialog-close" }}});
}
if ( threading != nil and threading != "" and threading != "SingleThreaded" ) {
message = "Threading model must be SingleThreaded (or not defined) for snapshots to work.";
delay = 7;
}
gui.popupTip(message, delay);
</script>
</binding>
<mod-shift>