From 2c3954718050898b0b1d27f9cea36481cdd60e25 Mon Sep 17 00:00:00 2001 From: Svetlozar Valchev Date: Sun, 22 Oct 2023 04:39:38 +0300 Subject: [PATCH] rename to fit better the purpose of the mod --- .../{dsxAdvancedHaptic.lua => dsx.lua} | 4 +- .../dsxAdvancedHapticVehicleDispatcher.lua | 13 ---- .../extensions/auto/dsxTriggerEnum.lua | 64 ------------------- .../extensions/auto/dsxVehicleDispatcher.lua | 13 ++++ scripts/dsx/modScript.lua | 2 + scripts/dsxAdvancedHaptic/modScript.lua | 2 - 6 files changed, 17 insertions(+), 81 deletions(-) rename lua/ge/extensions/{dsxAdvancedHaptic.lua => dsx.lua} (95%) delete mode 100644 lua/vehicle/extensions/auto/dsxAdvancedHapticVehicleDispatcher.lua delete mode 100644 lua/vehicle/extensions/auto/dsxTriggerEnum.lua create mode 100644 lua/vehicle/extensions/auto/dsxVehicleDispatcher.lua create mode 100644 scripts/dsx/modScript.lua delete mode 100644 scripts/dsxAdvancedHaptic/modScript.lua diff --git a/lua/ge/extensions/dsxAdvancedHaptic.lua b/lua/ge/extensions/dsx.lua similarity index 95% rename from lua/ge/extensions/dsxAdvancedHaptic.lua rename to lua/ge/extensions/dsx.lua index ff7d301..2d5c07b 100644 --- a/lua/ge/extensions/dsxAdvancedHaptic.lua +++ b/lua/ge/extensions/dsx.lua @@ -116,7 +116,7 @@ local function handleVehicleData() ) end -local function dsxAdvancedUpdate(throttle, brake, isABSActive, airSpeedKmh, beamDamage) +local function dsxUpdate(throttle, brake, isABSActive, airSpeedKmh, beamDamage) state.throttle = throttle state.brake = brake state.isABSActive = isABSActive @@ -126,5 +126,5 @@ local function dsxAdvancedUpdate(throttle, brake, isABSActive, airSpeedKmh, beam handleVehicleData() end -M.dsxAdvancedUpdate = dsxAdvancedUpdate +M.dsxUpdate = dsxUpdate return M diff --git a/lua/vehicle/extensions/auto/dsxAdvancedHapticVehicleDispatcher.lua b/lua/vehicle/extensions/auto/dsxAdvancedHapticVehicleDispatcher.lua deleted file mode 100644 index 774fc56..0000000 --- a/lua/vehicle/extensions/auto/dsxAdvancedHapticVehicleDispatcher.lua +++ /dev/null @@ -1,13 +0,0 @@ -local M = {} - -local function updateGFX(dt) - if not playerInfo.firstPlayerSeated then - return - end - - obj:queueGameEngineLua(string.format("extensions.hook('dsxAdvancedUpdate', %f, %f, %s, %f, %f)", input.state.throttle.val, input.state.brake.val, electrics.values.absActive == 1, electrics.values.airspeed * 3.6, beamstate.damage)) -end - -M.updateGFX = updateGFX - -return M diff --git a/lua/vehicle/extensions/auto/dsxTriggerEnum.lua b/lua/vehicle/extensions/auto/dsxTriggerEnum.lua deleted file mode 100644 index b58e384..0000000 --- a/lua/vehicle/extensions/auto/dsxTriggerEnum.lua +++ /dev/null @@ -1,64 +0,0 @@ -local Triggers = {} - --- TriggerMode Enum -Triggers.TriggerMode = { - Normal = 0, - GameCube = 1, - VerySoft = 2, - Soft = 3, - Hard = 4, - VeryHard = 5, - Hardest = 6, - Rigid = 7, - VibrateTrigger = 8, - Choppy = 9, - Medium = 10, - VibrateTriggerPulse = 11, - CustomTriggerValue = 12, - Resistance = 13, - Bow = 14, - Galloping = 15, - SemiAutomaticGun = 16, - AutomaticGun = 17, - Machine = 18 -} - --- CustomTriggerValueMode Enum -Triggers.CustomTriggerValueMode = { - OFF = 0, - Rigid = 1, - RigidA = 2, - RigidB = 3, - RigidAB = 4, - Pulse = 5, - PulseA = 6, - PulseB = 7, - PulseAB = 8, - VibrateResistance = 9, - VibrateResistanceA = 10, - VibrateResistanceB = 11, - VibrateResistanceAB = 12, - VibratePulse = 13, - VibratePulseA = 14, - VibratePulsB = 15, - VibratePulseAB = 16 -} - --- Trigger Enum -Triggers.Trigger = { - Invalid = 0, - Left = 1, - Right = 2 -} - --- InstructionType Enum -Triggers.InstructionType = { - Invalid = 0, - TriggerUpdate = 1, - RGBUpdate = 2, - PlayerLED = 3, - TriggerThreshold = 4 -} - --- This is the representation of your enums in Lua tables -return Triggers \ No newline at end of file diff --git a/lua/vehicle/extensions/auto/dsxVehicleDispatcher.lua b/lua/vehicle/extensions/auto/dsxVehicleDispatcher.lua new file mode 100644 index 0000000..4dab9e5 --- /dev/null +++ b/lua/vehicle/extensions/auto/dsxVehicleDispatcher.lua @@ -0,0 +1,13 @@ +local M = {} + +local function updateGFX(dt) + if not playerInfo.firstPlayerSeated then + return + end + + obj:queueGameEngineLua(string.format("extensions.hook('dsxUpdate', %f, %f, %s, %f, %f)", input.state.throttle.val, input.state.brake.val, electrics.values.absActive == 1, electrics.values.airspeed * 3.6, beamstate.damage)) +end + +M.updateGFX = updateGFX + +return M diff --git a/scripts/dsx/modScript.lua b/scripts/dsx/modScript.lua new file mode 100644 index 0000000..388d719 --- /dev/null +++ b/scripts/dsx/modScript.lua @@ -0,0 +1,2 @@ +load("dsx") +registerCoreModule("dsx") \ No newline at end of file diff --git a/scripts/dsxAdvancedHaptic/modScript.lua b/scripts/dsxAdvancedHaptic/modScript.lua deleted file mode 100644 index 563bb10..0000000 --- a/scripts/dsxAdvancedHaptic/modScript.lua +++ /dev/null @@ -1,2 +0,0 @@ -load("dsxAdvancedHaptic") -registerCoreModule("dsxAdvancedHaptic") \ No newline at end of file