diff --git a/Input/Joysticks/ThrustMaster/Warthog/README b/Input/Joysticks/ThrustMaster/Warthog/README index a0aa1d4e5..aced0ebcf 100644 --- a/Input/Joysticks/ThrustMaster/Warthog/README +++ b/Input/Joysticks/ThrustMaster/Warthog/README @@ -69,7 +69,7 @@ via raw HID support. If you don't have a user group "js" (for joystick hardware access) either create one or, in the fourth line, use a group instead where all joystick users are member, e.g. GROUP:="users". Then plug your Warthog devices out - and in again and check if this created two device files under /dev/hid/: + and in again and check if this created two device links: $ ls -l /dev/input/hidraw/* lrwxrwxrwx 1 root root 10 Oct 2 14:23 Thrustmaster_Throttle_-_HOTAS_Warthog -> ../hidraw1 @@ -80,7 +80,7 @@ via raw HID support. $ ls -l /dev/hidraw* crw-rw---- 1 root js 251, 0 Oct 2 09:11 /dev/hidraw0 crw-rw---- 1 root js 251, 1 Oct 2 14:23 /dev/hidraw1 - + ^^ ^^ (3) Allow FlightGear to write to the two devices. The best way to do this is diff --git a/Input/Joysticks/ThrustMaster/Warthog/Warthog-Throttle.xml b/Input/Joysticks/ThrustMaster/Warthog/Warthog-Throttle.xml index 03fa15e62..4df6572b8 100644 --- a/Input/Joysticks/ThrustMaster/Warthog/Warthog-Throttle.xml +++ b/Input/Joysticks/ThrustMaster/Warthog/Warthog-Throttle.xml @@ -50,7 +50,8 @@ warthog.throttle.set_leds(0, 1, 2, 3, 4, 5); settimer(gearcheck, 0.5); }; - init and gearcheck(); + if (init) + gearcheck(); var mod = 0; var m = props.globals.initNode("/devices/status/joysticks/warthog/modifier", mod, "INT"); diff --git a/Input/Joysticks/ThrustMaster/Warthog/warthog.nas b/Input/Joysticks/ThrustMaster/Warthog/warthog.nas index 847a8defa..56cf3d96a 100644 --- a/Input/Joysticks/ThrustMaster/Warthog/warthog.nas +++ b/Input/Joysticks/ThrustMaster/Warthog/warthog.nas @@ -1,4 +1,4 @@ -# HIDRAW Interface (currently Linux-only; see README) +# Hardware Interface (currently Linux/HIDRAW-only; see README) var device = { new: func(path, bufsize) { @@ -21,9 +21,19 @@ var device = { io.write(file, buf); io.close(file); }, - set_leds: func(on, which...) { # on/off, list of leds (0: background, 1-5) +}; + + +var joystick = { + parents: [device.new("/dev/input/hidraw/Thustmaster_Joystick_-_HOTAS_Warthog", 12)], +}; + + +var throttle = { + parents: [device.new("/dev/input/hidraw/Thrustmaster_Throttle_-_HOTAS_Warthog", 36)], + set_leds: func(state, which...) { # on/off, list of leds (0: background, 1-5) foreach (var w; which) - me.leds = bits.switch(me.leds, me._ledmap[w], on); + me.leds = bits.switch(me.leds, me._ledmap[w], state); me.send(6, me.leds, me.bright); }, toggle_leds: func(which...) { @@ -31,7 +41,7 @@ var device = { me.leds = bits.toggle(me.leds, me._ledmap[w]); me.send(6, me.leds, me.bright); }, - set_brightness: func(v) { + set_brightness: func(v) { # clamped to [0,5], where 0 is off and 5 is bright me.send(6, me.leds, me.bright = v < 0 ? 0 : v > 5 ? 5 : v); }, brighter: func { @@ -46,9 +56,6 @@ var device = { }; -var joystick = device.new("/dev/input/hidraw/Thustmaster_Joystick_-_HOTAS_Warthog", 12); -var throttle = device.new("/dev/input/hidraw/Thrustmaster_Throttle_-_HOTAS_Warthog", 36); - -throttle.set_brightness(1); +throttle.set_brightness(1); # LEDs dark (but on) throttle.set_leds(1, 0); # backlight on -throttle.set_leds(0, 1, 2, 3, 4, 5); # other LEDs off +setlistener("/sim/signals/exit", func throttle.set_leds(0, 1, 2, 3, 4, 5), 1); # other LEDs off (now and at exit) diff --git a/Nasal/controls.nas b/Nasal/controls.nas index 16d517a87..07a612bf3 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -470,3 +470,33 @@ _setlistener("/sim/signals/fdm-initialized", func { } }); +var replaySkip = func(skip_time) +{ + var t = getprop("/sim/replay/time"); + if (t != "") + { + t+=skip_time; + if (t>getprop("/sim/replay/end-time")) + t = getprop("/sim/replay/end-time"); + if (t<0) + t=0; + setprop("/sim/replay/time", t); + } +} + +var speedup = func(speed_up) +{ + var t = getprop("/sim/speed-up"); + if (speed_up < 0) + { + t = (t > 1/32) ? t/2 : 1/32; + if ((t<1)and(0==getprop("/sim/freeze/replay-state"))) + t=1; + } + else + { + t = (t < 32) ? t*2 : 32; + } + setprop("/sim/speed-up", t); +} + diff --git a/gui/dialogs/replay.xml b/gui/dialogs/replay.xml index 6d192f821..acaef886c 100644 --- a/gui/dialogs/replay.xml +++ b/gui/dialogs/replay.xml @@ -183,17 +183,9 @@ 0.3 0.8 - 359 nasal - + @@ -219,17 +211,9 @@ 0.3 0.8 - 357 nasal - + @@ -290,15 +274,7 @@ nasal - + @@ -312,18 +288,9 @@ 0.3 0.8 - 356 nasal - + @@ -386,20 +353,9 @@ 0.3 0.8 - 358 nasal - + @@ -415,17 +371,7 @@ nasal - + diff --git a/gui/dialogs/static-lod.xml b/gui/dialogs/static-lod.xml index 3774b08fd..81668d9ce 100644 --- a/gui/dialogs/static-lod.xml +++ b/gui/dialogs/static-lod.xml @@ -33,46 +33,67 @@ center - 01 - + 013 + - 10 - right + 11 - - - 11 - fill - /sim/rendering/static-lod/detailed - + + 12 + + + + 13 + + 20 right - + 21 fill + /sim/rendering/static-lod/detailed + + + + 22 + fill /sim/rendering/static-lod/rough + + 23 + fill + /sim/rendering/static-lod/bare + + 30 right - + 31 fill - /sim/rendering/static-lod/bare + /sim/rendering/static-lod/ai-detailed + + diff --git a/gui/dialogs/timeofday.xml b/gui/dialogs/timeofday.xml index 1e9ae6b5a..07592a219 100644 --- a/gui/dialogs/timeofday.xml +++ b/gui/dialogs/timeofday.xml @@ -86,10 +86,8 @@ diff --git a/keyboard.xml b/keyboard.xml index ce8a214ed..107e04889 100644 --- a/keyboard.xml +++ b/keyboard.xml @@ -1259,7 +1259,10 @@ top down before the key bindings are parsed. nasal @@ -1279,7 +1282,10 @@ top down before the key bindings are parsed. nasal @@ -1299,7 +1305,10 @@ top down before the key bindings are parsed. nasal 0.05 @@ -1320,7 +1329,10 @@ top down before the key bindings are parsed. nasal diff --git a/preferences.xml b/preferences.xml index f5831610b..d7081f3f3 100644 --- a/preferences.xml +++ b/preferences.xml @@ -85,13 +85,13 @@ Started September 2000 by David Megginson, david@megginson.com DrawThreadPerContext CullDrawThreadPerContext CullThreadPerCameraDrawThreadPerContext - - NOTE: Enabling this option currently breaks the screenshot function. --> 1500 9000 30000 + 10000 + true @@ -740,6 +740,7 @@ Started September 2000 by David Megginson, david@megginson.com userarchive="y">true false + true Models/Geometry/glider.ac