foxygit / doom Log in
commit d08dc2b991bff9259ca55fe1cb4d04e00b410a5a
Author:     Michael Day <michael.day@lexmark.com>
AuthorDate: Thu Apr 21 09:15:37 2022 -0400
Commit:     Michael Day <michael.day@lexmark.com>
CommitDate: Thu Apr 21 09:15:37 2022 -0400

    Hexen: Add mouse inventory buttons

    Co-authored-by: kraflab <kraflab@gmail.com>
---
 src/hexen/g_game.c | 8 ++++++++
 src/setup/mouse.c  | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c
index 4bdd0a7c..c7ec3095 100644
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -817,6 +817,14 @@ static void SetMouseButtons(unsigned int buttons_mask)
             {
                 next_weapon = 1;
             }
+            else if (i == mousebinvleft)
+            {
+                InventoryMoveLeft();
+            }
+            else if (i == mousebinvright)
+            {
+                InventoryMoveRight();
+            }
         }

         mousebuttons[i] = button_on;
diff --git a/src/setup/mouse.c b/src/setup/mouse.c
index ffb72dd1..7b243c3c 100644
--- a/src/setup/mouse.c
+++ b/src/setup/mouse.c
@@ -109,7 +109,7 @@ static void ConfigExtraButtons(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
     AddMouseControl(buttons_table, "Next weapon", &mousebnextweapon);
     AddMouseControl(buttons_table, "Run", &mousebspeed);

-    if (gamemission == heretic)
+    if (gamemission == heretic || gamemission == hexen)
     {
       AddMouseControl(buttons_table, "Inventory left", &mousebinvleft);
       AddMouseControl(buttons_table, "Inventory right", &mousebinvright);