Implemented lights.lua
Fixed syntax error in instruments.lua Added scripts to setup Update documentation to reflect automatic creation of scripts folders
This commit is contained in:
parent
fc17314236
commit
71a65c91c9
@ -10,7 +10,7 @@ Script locations
|
||||
----------------
|
||||
The default scripts included with G940LEDControl can be found in the folder selected during installation, for example "C:\\Program Files (x86)\\G940 LED Control". In there you will find a Scripts\\FSX folder containing the Lua files.
|
||||
|
||||
In addition scripts are loaded from your user data path. This folder is automatically created by G940LEDControl after you have changed any button configuration or settings. To open the folder, type or paste "%APPDATA%\\G940LEDControl" into a Windows Explorer address bar and press Enter. Inside you can create the same Scripts\\FSX folder structure. Scripts in this folder will not be overwritten when installing a new version.
|
||||
In addition scripts are loaded from your user data path. This folder is automatically created by G940LEDControl. To open the folder, type or paste "%APPDATA%\\G940LEDControl\\Scripts\\FSX" into a Windows Explorer address bar and press Enter. Scripts in this folder will not be overwritten when installing a new version.
|
||||
|
||||
|
||||
Anatomy of a button function
|
||||
|
@ -52,7 +52,7 @@ RegisterFunction(
|
||||
SetState(context, prefix..'50To75')
|
||||
elseif ice >= 75 and ice <= 99 then
|
||||
SetState(context, prefix..'75To100')
|
||||
elseif ice = 100 then
|
||||
elseif ice == 100 then
|
||||
SetState(context, prefix..'100')
|
||||
else
|
||||
SetState(context, prefix..'0')
|
||||
|
@ -1,8 +1,64 @@
|
||||
-- Beacon lights
|
||||
-- Instrument lights
|
||||
-- Landing lights
|
||||
-- Nav lights
|
||||
-- Recognition lights
|
||||
-- Strobe lights
|
||||
-- Taxi lights
|
||||
-- All lights
|
||||
local strings = require './lib/strings'
|
||||
|
||||
-- Lights
|
||||
local function RegisterLightsFunction(functionUid, functionDisplayName, lightsMask)
|
||||
RegisterFunction(
|
||||
{
|
||||
uid = functionUid,
|
||||
category = strings.Category.FSX.Lights,
|
||||
displayName = functionDisplayName,
|
||||
states = {
|
||||
on = { displayName = 'On', default = LEDColor.Green, order = 1 },
|
||||
off = { displayName = 'Off', default = LEDColor.Red, order = 2 }
|
||||
}
|
||||
},
|
||||
function(context)
|
||||
SetState(context, 'on')
|
||||
|
||||
OnSimConnect(context,
|
||||
{
|
||||
states = { variable = 'LIGHT ON STATES', type = SimConnectDataType.Int32, units = 'mask' }
|
||||
},
|
||||
function(context, data)
|
||||
if bit32.band(data.states, lightsMask) ~= 0 then
|
||||
SetState(context, 'on')
|
||||
else
|
||||
SetState(context, 'off')
|
||||
end
|
||||
end)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
local LightsMaskNav = 0x0001
|
||||
local LightsMaskBeacon = 0x0002
|
||||
local LightsMaskLanding = 0x0004
|
||||
local LightsMaskTaxi = 0x0008
|
||||
local LightsMaskStrobe = 0x0010
|
||||
local LightsMaskPanel = 0x0020
|
||||
local LightsMaskRecognition = 0x0040
|
||||
local LightsMaskWing = 0x0080
|
||||
local LightsMaskLogo = 0x0100
|
||||
local LightsMaskCabin = 0x0200
|
||||
|
||||
local LightsMaskAll = bit32.bor(
|
||||
LightsMaskNav,
|
||||
LightsMaskBeacon,
|
||||
LightsMaskLanding,
|
||||
LightsMaskTaxi,
|
||||
LightsMaskStrobe,
|
||||
LightsMaskPanel,
|
||||
LightsMaskRecognition,
|
||||
LightsMaskWing,
|
||||
LightsMaskLogo,
|
||||
LightsMaskCabin
|
||||
)
|
||||
|
||||
|
||||
RegisterLightsFunction('beaconLights', 'Beacon lights', LightsMaskBeacon)
|
||||
RegisterLightsFunction('navLights', 'Nav lights', LightsMaskNav)
|
||||
RegisterLightsFunction('strobeLights', 'Strobe lights', LightsMaskStrobe)
|
||||
RegisterLightsFunction('taxiLights', 'Taxi lights', LightsMaskTaxi)
|
||||
RegisterLightsFunction('recognitionLights', 'Recognition lights', LightsMaskRecognition)
|
||||
RegisterLightsFunction('allLights', 'All lights', LightsMaskAll)
|
||||
|
@ -32,6 +32,7 @@ Source: "..\G940LEDControl\Bin\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreve
|
||||
Source: "..\G940LEDControl\Bin\LogiJoystickDLL.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\G940LEDControl\Bin\FSX-SimConnect.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\G940LEDControl\Bin\FSX-SE-SimConnect.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\G940LEDControl\Scripts\*.lua"; DestDir: "{app}\Scripts"; Flags: ignoreversion recursesubdirs
|
||||
|
||||
[Dirs]
|
||||
Name: "{userappdata}\G940LEDControl\Scripts\FSX"
|
||||
|
Loading…
Reference in New Issue
Block a user