Add printing messages to the console

This commit is contained in:
PlayeRom
2022-08-15 01:25:13 +02:00
parent 2e5dbbc0b8
commit 2fa6110ba0
+7 -7
View File
@@ -34,20 +34,20 @@ var displayError = func (message) {
# type - The type of message. It can take values as "ok" or "error".
#
var display = func (message, type) {
# Print to console
print("Aerotow Everywhere add-on: " ~ message);
# Read the message by speech synthesizer
props.globals.getNode("/sim/sound/voices/ai-plane").setValue(message);
# Display message on the screan
# Display message on the screen
var durationInSec = int(size(message) / 12) + 3;
var window = screen.window.new(nil, -40, 10, durationInSec);
window.bg = [0.0, 0.0, 0.0, 0.40];
if (type == "error") {
window.fg = [1.0, 0.0, 0.0, 1];
}
else {
window.fg = [0.0, 1.0, 0.0, 1];
}
window.fg = type == "error"
? [1.0, 0.0, 0.0, 1]
: [0.0, 1.0, 0.0, 1];
window.align = "center";
window.write(message);