From 7a0b998d4f7f7c30f25ad319512147fb031bb7c3 Mon Sep 17 00:00:00 2001
From: Petr Mikheev <ptmikheev@gmail.com>
Date: Sat, 7 Jan 2023 23:42:53 +0100
Subject: [PATCH] Cleanup unused actions

---
 apps/openmw/mwinput/actions.hpp     | 103 +++++++++++++---------------
 apps/openmw/mwlua/inputbindings.cpp |   3 -
 files/lua_api/openmw/input.lua      |   3 -
 3 files changed, 48 insertions(+), 61 deletions(-)

diff --git a/apps/openmw/mwinput/actions.hpp b/apps/openmw/mwinput/actions.hpp
index e586a613f7..538d12f2c2 100644
--- a/apps/openmw/mwinput/actions.hpp
+++ b/apps/openmw/mwinput/actions.hpp
@@ -5,75 +5,68 @@ namespace MWInput
 {
     enum Actions
     {
-        // please add new actions at the bottom, in order to preserve the channel IDs in the key configuration files
+        // Action IDs are used in the configuration file input_v3.xml
 
-        A_GameMenu,
+        A_GameMenu = 0,
 
-        A_Unused,
+        A_Screenshot = 2, // Take a screenshot
 
-        A_Screenshot, // Take a screenshot
+        A_Inventory = 3, // Toggle inventory screen
+        A_Console = 4, // Toggle console screen
 
-        A_Inventory, // Toggle inventory screen
+        A_MoveLeft = 5, // Move player left / right
+        A_MoveRight = 6,
+        A_MoveForward = 7, // Forward / Backward
+        A_MoveBackward = 8,
 
-        A_Console, // Toggle console screen
+        A_Activate = 9,
 
-        A_MoveLeft, // Move player left / right
-        A_MoveRight,
-        A_MoveForward, // Forward / Backward
-        A_MoveBackward,
+        A_Use = 10, // Use weapon, spell, etc.
+        A_Jump = 11,
+        A_AutoMove = 12, // Toggle Auto-move forward
+        A_Rest = 13, // Rest
+        A_Journal = 14, // Journal
+        A_Run = 17, // Run when held
+        A_CycleSpellLeft = 18, // cycling through spells
+        A_CycleSpellRight = 19,
+        A_CycleWeaponLeft = 20, // Cycling through weapons
+        A_CycleWeaponRight = 21,
+        A_AlwaysRun = 23, // Toggle Walking/Running
+        A_Sneak = 24,
 
-        A_Activate,
+        A_QuickSave = 25,
+        A_QuickLoad = 26,
+        A_QuickMenu = 27,
+        A_ToggleWeapon = 28,
+        A_ToggleSpell = 29,
 
-        A_Use, // Use weapon, spell, etc.
-        A_Jump,
-        A_AutoMove, // Toggle Auto-move forward
-        A_Rest, // Rest
-        A_Journal, // Journal
-        A_Weapon, // Draw/Sheath weapon
-        A_Spell, // Ready/Unready Casting
-        A_Run, // Run when held
-        A_CycleSpellLeft, // cycling through spells
-        A_CycleSpellRight,
-        A_CycleWeaponLeft, // Cycling through weapons
-        A_CycleWeaponRight,
-        A_ToggleSneak, // Toggles Sneak
-        A_AlwaysRun, // Toggle Walking/Running
-        A_Sneak,
+        A_TogglePOV = 30,
 
-        A_QuickSave,
-        A_QuickLoad,
-        A_QuickMenu,
-        A_ToggleWeapon,
-        A_ToggleSpell,
+        A_QuickKey1 = 31,
+        A_QuickKey2 = 32,
+        A_QuickKey3 = 33,
+        A_QuickKey4 = 34,
+        A_QuickKey5 = 35,
+        A_QuickKey6 = 36,
+        A_QuickKey7 = 37,
+        A_QuickKey8 = 38,
+        A_QuickKey9 = 39,
+        A_QuickKey10 = 40,
 
-        A_TogglePOV,
+        A_QuickKeysMenu = 41,
 
-        A_QuickKey1,
-        A_QuickKey2,
-        A_QuickKey3,
-        A_QuickKey4,
-        A_QuickKey5,
-        A_QuickKey6,
-        A_QuickKey7,
-        A_QuickKey8,
-        A_QuickKey9,
-        A_QuickKey10,
+        A_ToggleHUD = 42,
+        A_ToggleDebug = 43,
 
-        A_QuickKeysMenu,
+        A_LookUpDown = 44, // Joystick look
+        A_LookLeftRight = 45,
+        A_MoveForwardBackward = 46,
+        A_MoveLeftRight = 47,
 
-        A_ToggleHUD,
+        A_ZoomIn = 48,
+        A_ZoomOut = 49,
 
-        A_ToggleDebug,
-
-        A_LookUpDown, // Joystick look
-        A_LookLeftRight,
-        A_MoveForwardBackward,
-        A_MoveLeftRight,
-
-        A_ZoomIn,
-        A_ZoomOut,
-
-        A_TogglePostProcessorHUD,
+        A_TogglePostProcessorHUD = 50,
 
         A_Last // Marker for the last item
     };
diff --git a/apps/openmw/mwlua/inputbindings.cpp b/apps/openmw/mwlua/inputbindings.cpp
index 105a107301..ae3ce82fcb 100644
--- a/apps/openmw/mwlua/inputbindings.cpp
+++ b/apps/openmw/mwlua/inputbindings.cpp
@@ -98,14 +98,11 @@ namespace MWLua
             { "AutoMove", MWInput::A_AutoMove },
             { "Rest", MWInput::A_Rest },
             { "Journal", MWInput::A_Journal },
-            { "Weapon", MWInput::A_Weapon },
-            { "Spell", MWInput::A_Spell },
             { "Run", MWInput::A_Run },
             { "CycleSpellLeft", MWInput::A_CycleSpellLeft },
             { "CycleSpellRight", MWInput::A_CycleSpellRight },
             { "CycleWeaponLeft", MWInput::A_CycleWeaponLeft },
             { "CycleWeaponRight", MWInput::A_CycleWeaponRight },
-            { "ToggleSneak", MWInput::A_ToggleSneak },
             { "AlwaysRun", MWInput::A_AlwaysRun },
             { "Sneak", MWInput::A_Sneak },
 
diff --git a/files/lua_api/openmw/input.lua b/files/lua_api/openmw/input.lua
index 205ab584d9..e0aa917420 100644
--- a/files/lua_api/openmw/input.lua
+++ b/files/lua_api/openmw/input.lua
@@ -118,14 +118,11 @@
 -- @field [parent=#ACTION] #number Jump
 -- @field [parent=#ACTION] #number AutoMove
 -- @field [parent=#ACTION] #number Journal
--- @field [parent=#ACTION] #number Weapon
--- @field [parent=#ACTION] #number Spell
 -- @field [parent=#ACTION] #number Run
 -- @field [parent=#ACTION] #number CycleSpellLeft
 -- @field [parent=#ACTION] #number CycleSpellRight
 -- @field [parent=#ACTION] #number CycleWeaponLeft
 -- @field [parent=#ACTION] #number CycleWeaponRight
--- @field [parent=#ACTION] #number ToggleSneak
 -- @field [parent=#ACTION] #number AlwaysRun
 -- @field [parent=#ACTION] #number Sneak
 -- @field [parent=#ACTION] #number QuickSave