From 2df8c135253bf306e472a24001f5bc8b2b59df8e Mon Sep 17 00:00:00 2001 From: uramer Date: Wed, 7 Aug 2024 19:05:47 +0200 Subject: [PATCH] Lua triggers to cover remaining deprecated actions --- files/data/l10n/OMWControls/en.yaml | 46 +++++++++++++++++++ .../data/scripts/omw/input/actionbindings.lua | 32 +++++++++++++ 2 files changed, 78 insertions(+) diff --git a/files/data/l10n/OMWControls/en.yaml b/files/data/l10n/OMWControls/en.yaml index d4df56436b..1be6da6baf 100644 --- a/files/data/l10n/OMWControls/en.yaml +++ b/files/data/l10n/OMWControls/en.yaml @@ -82,3 +82,49 @@ SmoothMoveLeft_description: "Left movement adjusted for smooth Walk-Run transiti SmoothMoveRight_name: "Smooth Move Right" SmoothMoveRight_description: "Right movement adjusted for smooth Walk-Run transitions." + +# Non-dehardcoded actions +Activate_name: "Activate" +Activate_description: "Fallback for input.ACTIONS.Activate, binding does not do anything yet" +Console_name: "Console" +Console_description: "Fallback for input.ACTIONS.Console, binding does not do anything yet" +CycleSpellLeft_name: "CycleSpellLeft" +CycleSpellLeft_description: "Fallback for input.ACTIONS.CycleSpellLeft, binding does not do anything yet" +CycleSpellRight_name: "CycleSpellRight" +CycleSpellRight_description: "Fallback for input.ACTIONS.CycleSpellRight, binding does not do anything yet" +CycleWeaponLeft_name: "CycleWeaponLeft" +CycleWeaponLeft_description: "Fallback for input.ACTIONS.CycleWeaponLeft, binding does not do anything yet" +CycleWeaponRight_name: "CycleWeaponRight" +CycleWeaponRight_description: "Fallback for input.ACTIONS.CycleWeaponRight, binding does not do anything yet" +GameMenu_name: "GameMenu" +GameMenu_description: "Fallback for input.ACTIONS.GameMenu, binding does not do anything yet" +QuickLoad_name: "QuickLoad" +QuickLoad_description: "Fallback for input.ACTIONS.QuickLoad, binding does not do anything yet" +QuickSave_name: "QuickSave" +QuickSave_description: "Fallback for input.ACTIONS.QuickSave, binding does not do anything yet" +Screenshot_name: "Screenshot" +Screenshot_description: "Fallback for input.ACTIONS.Screenshot, binding does not do anything yet" +ToggleDebug_name: "ToggleDebug" +ToggleDebug_description: "Fallback for input.ACTIONS.ToggleDebug, binding does not do anything yet" +ToggleHUD_name: "ToggleHUD" +ToggleHUD_description: "Fallback for input.ACTIONS.ToggleHUD, binding does not do anything yet" +TogglePostProcessorHUD_name: "TogglePostProcessorHUD" +TogglePostProcessorHUD_description: "Fallback for input.ACTIONS.TogglePostProcessorHUD, binding does not do anything yet" +QuickKey1_name: "QuickKey1" +QuickKey1_description: "Fallback for input.ACTIONS.QuickKey1, binding does not do anything yet" +QuickKey2_name: "QuickKey2" +QuickKey2_description: "Fallback for input.ACTIONS.QuickKey2, binding does not do anything yet" +QuickKey3_name: "QuickKey3" +QuickKey3_description: "Fallback for input.ACTIONS.QuickKey3, binding does not do anything yet" +QuickKey4_name: "QuickKey4" +QuickKey4_description: "Fallback for input.ACTIONS.QuickKey4, binding does not do anything yet" +QuickKey5_name: "QuickKey5" +QuickKey5_description: "Fallback for input.ACTIONS.QuickKey5, binding does not do anything yet" +QuickKey6_name: "QuickKey6" +QuickKey6_description: "Fallback for input.ACTIONS.QuickKey6, binding does not do anything yet" +QuickKey7_name: "QuickKey7" +QuickKey7_description: "Fallback for input.ACTIONS.QuickKey7, binding does not do anything yet" +QuickKey8_name: "QuickKey8" +QuickKey8_description: "Fallback for input.ACTIONS.QuickKey8, binding does not do anything yet" +QuickKey9_name: "QuickKey9" +QuickKey9_description: "Fallback for input.ACTIONS.QuickKey9, binding does not do anything yet" diff --git a/files/data/scripts/omw/input/actionbindings.lua b/files/data/scripts/omw/input/actionbindings.lua index bc871a3934..741376bc75 100644 --- a/files/data/scripts/omw/input/actionbindings.lua +++ b/files/data/scripts/omw/input/actionbindings.lua @@ -29,6 +29,38 @@ local function bindTrigger(key, actionid) end) end +do -- Actions and Triggers currently unused by builtin scripts + -- TODO: as more mechanics are dehardcoded, move these declarations to relevant files + local triggers = { + Activate = input.ACTION.Activate, + Console = input.ACTION.Console, + CycleSpellLeft = input.ACTION.CycleSpellLeft, + CycleSpellRight = input.ACTION.CycleSpellRight, + CycleWeaponLeft = input.ACTION.CycleWeaponLeft, + CycleWeaponRight = input.ACTION.CycleWeaponRight, + GameMenu = input.ACTION.GameMenu, + QuickLoad = input.ACTION.QuickLoad, + QuickSave = input.ACTION.QuickSave, + Screenshot = input.ACTION.Screenshot, + ToggleDebug = input.ACTION.ToggleDebug, + ToggleHUD = input.ACTION.ToggleHUD, + TogglePostProcessorHUD = input.ACTION.ToggleHUD, + } + for i = 1, 9 do + local key = string.format('QuickKey%s', i) + triggers[key] = input.ACTION[key] + end + for key, action in pairs(triggers) do + input.registerTrigger { + key = key, + l10n = 'OMWControls', + name = key .. '_name', + description = key .. '_description', + } + bindTrigger(key, action) + end +end + bindTrigger('AlwaysRun', input.ACTION.AlwaysRun) bindTrigger('ToggleSneak', input.ACTION.Sneak) bindTrigger('ToggleWeapon', input.ACTION.ToggleWeapon)