From 76b1d549a522eac959c32059df9ee1857e100135 Mon Sep 17 00:00:00 2001 From: Melchior FRANZ Date: Mon, 12 Sep 2011 18:58:44 +0200 Subject: [PATCH 1/2] warthog: move js config files into Warthog dir; add more overlays --- .../Warthog/Throttle/helicopter.xml | 13 ++++ .../{ => Warthog}/Warthog-Stick.xml | 67 ++++++++++--------- .../{ => Warthog}/Warthog-Throttle.xml | 21 ++++-- 3 files changed, 61 insertions(+), 40 deletions(-) create mode 100644 Input/Joysticks/ThrustMaster/Warthog/Throttle/helicopter.xml rename Input/Joysticks/ThrustMaster/{ => Warthog}/Warthog-Stick.xml (85%) rename Input/Joysticks/ThrustMaster/{ => Warthog}/Warthog-Throttle.xml (95%) diff --git a/Input/Joysticks/ThrustMaster/Warthog/Throttle/helicopter.xml b/Input/Joysticks/ThrustMaster/Warthog/Throttle/helicopter.xml new file mode 100644 index 000000000..51cf49390 --- /dev/null +++ b/Input/Joysticks/ThrustMaster/Warthog/Throttle/helicopter.xml @@ -0,0 +1,13 @@ + + + + + Hat Switch Horizontal + adjust engine balance + + + + Hat Switch Vertical + adjust engine power + + diff --git a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml b/Input/Joysticks/ThrustMaster/Warthog/Warthog-Stick.xml similarity index 85% rename from Input/Joysticks/ThrustMaster/Warthog-Stick.xml rename to Input/Joysticks/ThrustMaster/Warthog/Warthog-Stick.xml index 4b47100ff..614cb4d44 100644 --- a/Input/Joysticks/ThrustMaster/Warthog-Stick.xml +++ b/Input/Joysticks/ThrustMaster/Warthog/Warthog-Stick.xml @@ -1,7 +1,12 @@ @@ -13,10 +18,12 @@ var this = cmdarg().getParent(); var popup = func gui.popupTip(call(sprintf, arg)); var is_helicopter = (var _ = props.globals.getNode("rotors", 0)) != nil and _.getAttribute("children"); + var aircraft_type = getprop("/sim/type"); + var overlay = getprop("/input/joysticks/overlay"); var load_overlay = func(name) { foreach (var dir; [getprop("/sim/fg-home"), getprop("/sim/fg-root")]) { - var file = dir ~ "/Input/Joysticks/ThrustMaster/Warthog/Joystick/" ~ name; + var file = dir ~ "/Input/Joysticks/ThrustMaster/Warthog/Joystick/" ~ name ~ ".xml"; if (io.stat(file) != nil) { printlog("info", "WARTHOG: loading overlay " ~ file); cmdarg().getNode("script").setValue(""); @@ -48,10 +55,14 @@ viewdir[i] = t != nil and t.getValue() == "lookat" ? 1 : -1; } - load_overlay("generic.xml"); + load_overlay("generic"); if (is_helicopter) - load_overlay("helicopter.xml"); - load_overlay(getprop("/sim/aircraft") ~ ".xml"); + load_overlay("helicopter"); + if (aircraft_type) + load_overlay(aircraft_type); + if (overlay) + load_overlay(overlay); + load_overlay(getprop("/sim/aircraft")); @@ -77,7 +88,7 @@ - Trim Coolie Left/Right + Trim Hat Switch Left/Right adjust aileron trim, +mod: reset aileron trim true @@ -106,7 +117,7 @@ - Trim Coolie Down/Up + Trim Hat Switch Down/Up adjust elevator trim, +mod: reset elevator trim true @@ -136,17 +147,7 @@