Skip to content

Commit

Permalink
Merge pull request #113 from sparker256/master
Browse files Browse the repository at this point in the history
Fixed missing Throttle 9 and Copilot Nosewheel Tiller
  • Loading branch information
sparker256 authored Oct 24, 2023
2 parents 2bbb84f + 80a8d7f commit 966375e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
FWL_VERSION: 2.8.10
FWL_VERSION: 2.8.11

jobs:
build-lin:
Expand Down
4 changes: 3 additions & 1 deletion FlyWithLua/Documentation/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,6 @@ v2.8.8 Added support for the horizontal scrollbar in Imgui windows.

v2.8.9 Added support for X-Plane Fmod SDK.

v2.8.10 emoved X-Plane LuaJIT alloc because it is not needed and was causing issues with Linux.
v2.8.10 Removed X-Plane LuaJIT alloc because it is not needed and was causing issues with Linux.

v2.8.11 Fixed missing Throttle 9 from SaveInitalAssignments.ini Thanks XPJavelin
10 changes: 5 additions & 5 deletions FlyWithLua/Internals/SaveInitialAssignments.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- SaveInitialAssignments.ini version 2.8.0 build 2022-11-10
-- SaveInitialAssignments.ini version 2.8.11 build 2023-10-19
-- Support for X-Plane 12.00+

function save_initial_assignments()
Expand All @@ -21,7 +21,7 @@ function save_initial_assignments()

-- now we can read and write the axis assignments, the code is taken from the old 1.x script
-- X-Plane only stores an integer to represent the function, we use a table to give it a name
local axis_functions = { "Pitch", "Roll", "Yaw", "Throttle", "Collective", "Left toe brake", "Right toe brake", "Prop",
local axis_functions = {"Pitch", "Roll", "Yaw", "Throttle", "Collective", "Left toe brake", "Right toe brake", "Prop",
"Mixture", "Carb heat", "Flaps", "Thrust vector", "Wing sweep", "Speedbrakes", "Displacement",
"Reverse", "Elevator trim", "Aileron trim", "Rudder trim", "Throttle 1", "Throttle 2", "Throttle 3",
"Throttle 4", "Prop 1", "Prop 2", "Prop 3", "Prop 4", "Mixture 1", "Mixture 2",
Expand All @@ -30,12 +30,12 @@ function save_initial_assignments()
"Camera left/right", "Camera up/down", "Camera zoom", "Gun/bomb left/right", "Gun/bomb up/down",
"VR Touchpad X", "VR Touchpad Y", "VR Trigger", "Custom command(s)", "Throttle 5", "Throttle 6", "Throttle 7",
"Throttle 8", "Cowl flaps 1", "Cowl flaps 2", "Cowl flaps 3", "Cowl flaps 4", "Cowl flaps 5", "Cowl flaps 6",
"Cowl flaps 7", "Cowl flaps 8", "Throttle Vertical", "Throttle Horizontal", "Copilot Pitch", "Copilot Roll",
"Copilot Yaw", "Copilot Left toe brake", "Copilot Right toe brake" }
"Cowl flaps 7", "Cowl flaps 8", "Throttle Vertical", "Throttle Horizontal", "Throttle 9", "Copilot Pitch", "Copilot Roll",
"Copilot Yaw", "Copilot Left toe brake", "Copilot Right toe brake", "Copilot Nosewheel Tiller"}

-- now we can write the axis config to the Log.txt file
textfile:write("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n")
textfile:write("-- -- FlyWithLua: SaveInitialAssignments.ini version 2.8.0 build 2022-11-10 -- --\n")
textfile:write("-- -- FlyWithLua: SaveInitialAssignments.ini version 2.8.11 build 2023-10-19 -- --\n")
textfile:write("-- -- The initial assignments are stored in this file. -- --- -- -- -- -- -- -- --\n")
textfile:write("-- -- 8< -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\n")
textfile:write("clear_all_axis_assignments()\n")
Expand Down
Binary file modified FlyWithLua/lin_x64/FlyWithLua.xpl
Binary file not shown.
Binary file modified FlyWithLua/mac_x64/FlyWithLua.xpl
Binary file not shown.
Binary file modified FlyWithLua/win_x64/FlyWithLua.xpl
Binary file not shown.
17 changes: 11 additions & 6 deletions src/FlyWithLua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FlyWithLua Plugin for X-Plane 12
// ----------------------------------

#define PLUGIN_VERSION_NO "2.8.10"
#define PLUGIN_VERSION_NO "2.8.11"
#define PLUGIN_VERSION_BUILD __DATE__ " " __TIME__
#define PLUGIN_VERSION PLUGIN_VERSION_NO " build " PLUGIN_VERSION_BUILD

Expand Down Expand Up @@ -168,6 +168,7 @@
* v2.8.8 [added] Added support for the horizontal scrollbar in Imgui windows.
* v2.8.9 [changed] Now using the X-Plane Fmod SDK for the com1, interior, ui and the master buses.
* v2.8.10 [changed] Removed X-Plane LuaJIT alloc because it is not needed and was causing issues with Linux.
* v2.8.11 [changed] Fixed missing Throttle 9 from SaveInitalAssignments.ini Thanks XPJavelin
*
*
* Markus (Teddii):
Expand Down Expand Up @@ -3165,16 +3166,20 @@ static int LuaSetAxisAssignment(lua_State* L)
CommandRefIdWanted = 65;
else if (CommandWanted == "throttle horizontal")
CommandRefIdWanted = 66;
else if (CommandWanted == "copilot pitch")
else if (CommandWanted == "throttle 9")
CommandRefIdWanted = 67;
else if (CommandWanted == "copilot roll")
else if (CommandWanted == "copilot pitch")
CommandRefIdWanted = 68;
else if (CommandWanted == "copilot yaw")
else if (CommandWanted == "copilot roll")
CommandRefIdWanted = 69;
else if (CommandWanted == "copilot left toe brake")
else if (CommandWanted == "copilot yaw")
CommandRefIdWanted = 70;
else if (CommandWanted == "copilot right toe brake")
else if (CommandWanted == "copilot left toe brake")
CommandRefIdWanted = 71;
else if (CommandWanted == "copilot right toe brake")
CommandRefIdWanted = 72;
else if (CommandWanted == "copilot nosewheel tiller")
CommandRefIdWanted = 73;

XPLMSetDatavi(gJoystickAxisAssignments, &CommandRefIdWanted, AxisNumber, 1);

Expand Down

0 comments on commit 966375e

Please sign in to comment.