Compare commits
No commits in common. "5f83cb9cffb651823a2df4e996490782af826896" and "c28292fca581b767960f5afea395bd0c426cbd53" have entirely different histories.
5f83cb9cff
...
c28292fca5
4 changed files with 2460 additions and 17916 deletions
45
FlyWithLua/passengerflying-xkeypad-zibo.lua
Normal file
45
FlyWithLua/passengerflying-xkeypad-zibo.lua
Normal file
|
@ -0,0 +1,45 @@
|
|||
-- Create a table to store previous positions of switches
|
||||
local previous_positions = {}
|
||||
|
||||
-- Function to toggle switch
|
||||
function toggle_switch(position, command_base, min, max)
|
||||
local switch_value = _G[position]
|
||||
local previous_position = previous_positions[position] or min
|
||||
|
||||
local command_suffix
|
||||
if switch_value == min then
|
||||
command_suffix = "_up"
|
||||
elseif switch_value == max then
|
||||
command_suffix = "_dn"
|
||||
elseif switch_value < previous_position then
|
||||
command_suffix = "_dn"
|
||||
elseif switch_value > previous_position then
|
||||
command_suffix = "_up"
|
||||
end
|
||||
|
||||
command_once(command_base .. command_suffix)
|
||||
previous_positions[position] = switch_value
|
||||
end
|
||||
|
||||
-- Function to create command
|
||||
function create_switch_command(command, description, position, command_base,
|
||||
min, max)
|
||||
dataref(position, position, "readonly")
|
||||
create_command(command, description,
|
||||
"toggle_switch('" .. position .. "', '" .. command_base ..
|
||||
"', " .. min .. "," .. max .. ")", "", "")
|
||||
end
|
||||
|
||||
if PLANE_ICAO == "B738" then
|
||||
-- Lights test (bright_test)
|
||||
create_switch_command("PassengerFlying/zibo/switch_bright_test",
|
||||
"Toggle lights switch between TEST, BRT and DIM",
|
||||
"laminar/B738/toggle_switch/bright_test",
|
||||
"laminar/B738/toggle_switch/bright_test", -1, 1)
|
||||
|
||||
-- Transponder Knob (transponder_mode)
|
||||
create_switch_command("PassengerFlying/zibo/switch_transponder_mode",
|
||||
"Toggle transponder modes",
|
||||
"laminar/B738/knob/transponder_pos",
|
||||
"laminar/B738/knob/transponder_mode", 1, 5)
|
||||
end
|
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -3,10 +3,10 @@ TARGET="Zibo B738 v$1"
|
|||
rm -rf "release/$TARGET"
|
||||
mkdir -p "release/$TARGET/Aircraft/B737-800X"
|
||||
mkdir -p "release/$TARGET/Stream Deck"
|
||||
# mkdir -p "release/$TARGET/Resources/plugins/FlyWithLua/Scripts"
|
||||
mkdir -p "release/$TARGET/Resources/plugins/FlyWithLua/Scripts"
|
||||
cp -R ./Stream\ Deck/* "release/$TARGET/Stream Deck/"
|
||||
cp -R ./X-KeyPad/* "release/$TARGET/Aircraft/B737-800X/"
|
||||
# cp -R ./FlyWithLua/* "release/$TARGET/Resources/plugins/FlyWithLua/Scripts"
|
||||
cp -R ./FlyWithLua/* "release/$TARGET/Resources/plugins/FlyWithLua/Scripts"
|
||||
cp ./README.md "release/$TARGET/"
|
||||
cp ./Installation.pdf "release/$TARGET/"
|
||||
7z a -tzip "release/$TARGET.zip" "./release/$TARGET/*"
|
||||
|
|
Loading…
Reference in a new issue