Skip to content

Commit

Permalink
OH-58D: Add Interior Lights (#898)
Browse files Browse the repository at this point in the history
Fixes #760
  • Loading branch information
charliefoxtwo authored Jul 27, 2024
1 parent dd6751b commit eaebf0a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Scripts/DCS-BIOS/doc/Addresses.h
Original file line number Diff line number Diff line change
Expand Up @@ -29112,6 +29112,14 @@
#define OH_58D_FRONT_OVERHEAD_SW_IGN_AM 0x8A0C, 0x0400
#define OH_58D_IGNITION_KEY 0x8A1E, 0x0010, 4
#define OH_58D_IGNITION_KEY_AM 0x8A1E, 0x0010
#define OH_58D_INTERIOR_CENTER_CONSOLE_BRIGHTNESS 0x8CBE, 0xFFFF, 0
#define OH_58D_INTERIOR_CENTER_CONSOLE_BRIGHTNESS_A 0x8CBE
#define OH_58D_INTERIOR_FLOODLIGHT_GREEN 0x8CC0, 0xFFFF, 0
#define OH_58D_INTERIOR_FLOODLIGHT_GREEN_A 0x8CC0
#define OH_58D_INTERIOR_FLOODLIGHT_WHITE 0x8CC2, 0xFFFF, 0
#define OH_58D_INTERIOR_FLOODLIGHT_WHITE_A 0x8CC2
#define OH_58D_INTERIOR_FRONT_DASH_BRIGHTNESS 0x8CBC, 0xFFFF, 0
#define OH_58D_INTERIOR_FRONT_DASH_BRIGHTNESS_A 0x8CBC
#define OH_58D_MFD_CPLT_AUX_ALE 0x8C4A, 0x0002, 1
#define OH_58D_MFD_CPLT_AUX_ALE_AM 0x8C4A, 0x0002
#define OH_58D_MFD_CPLT_AUX_ALFGL 0x8BD4, 0x0100, 8
Expand Down
21 changes: 18 additions & 3 deletions Scripts/DCS-BIOS/lib/modules/aircraft_modules/OH-58D.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1411,9 +1411,24 @@ OH_58D:reserveIntValue(2)
OH_58D:reserveIntValue(2)

-- Interior Lights
-- local INTERIOR_LIGHTS = "Interior Lights"
-- Floodlights
-- Console lights
local INTERIOR_LIGHTS = "Interior Lights"

OH_58D:defineFloat("INTERIOR_FRONT_DASH_BRIGHTNESS", 28, { 0, 1 }, INTERIOR_LIGHTS, "Front Dash Brightness")
OH_58D:defineFloat("INTERIOR_CENTER_CONSOLE_BRIGHTNESS", 31, { 0, 1 }, INTERIOR_LIGHTS, "Center Console Brightness")
OH_58D:defineIntegerFromGetter("INTERIOR_FLOODLIGHT_GREEN", function(dev0)
local which_floodlight = dev0:get_argument_value(304)
if which_floodlight < 0 then
return 0
end
return which_floodlight < 0.5 and Module.valueConvert(dev0:get_argument_value(26), { -0.01, 0.75 }, { 0, 65535 }) or 0
end, 65535, INTERIOR_LIGHTS, "Green Floodlight Intensity")
OH_58D:defineIntegerFromGetter("INTERIOR_FLOODLIGHT_WHITE", function(dev0)
local which_floodlight = dev0:get_argument_value(304)
if which_floodlight < 0 then
return 0
end
return which_floodlight > 0.99 and Module.valueConvert(dev0:get_argument_value(26), { -0.01, 0.75 }, { 0, 65535 }) or 0
end, 65535, INTERIOR_LIGHTS, "White Floodlight Intensity")

-- Free Air Temperature Gauge
-- local FREE_AIR_TEMP = "Free Air Temperature Gauge"
Expand Down

0 comments on commit eaebf0a

Please sign in to comment.