@@ -54,9 +54,30 @@ def HookShopInputKey(caller: UObject, function: UFunction, params: FStruct) -> b
54
54
key = params .ukey
55
55
event = params .uevent
56
56
57
- if key in ["Escape" , "Up" , "Down" ]:
57
+ ControllerKeyMap = {
58
+ "Gamepad_LeftStick_Up" : "Up" ,
59
+ "Gamepad_LeftStick_Down" : "Down" ,
60
+ "XboxTypeS_A" : "Enter" ,
61
+ "XboxTypeS_B" : "Escape" ,
62
+ "XboxTypeS_Y" : "Q" ,
63
+ "XboxTypeS_LeftTrigger" : "PageUp" ,
64
+ "XboxTypeS_RightTrigger" : "PageDown"
65
+ }
66
+ if key in ControllerKeyMap :
67
+ key = ControllerKeyMap [key ]
68
+
69
+ if key in ("Escape" , "Up" , "Down" ):
58
70
return True
59
71
72
+ if event == 0 or event == 2 :
73
+ # These two are bugged on gearbox's end, we manually fix them
74
+ if key == "PageUp" :
75
+ caller .ScrollDescription (True )
76
+ return False
77
+ elif key == "PageDown" :
78
+ caller .ScrollDescription (False )
79
+ return False
80
+
60
81
selectedObject = caller .GetSelectedObject ()
61
82
try :
62
83
modIndex = int (selectedObject .GetString (caller .Prop_offeringId ))
@@ -100,7 +121,7 @@ def HookShopInputKey(caller: UObject, function: UFunction, params: FStruct) -> b
100
121
pass
101
122
caller .RefreshDLC ()
102
123
103
- elif key != "Enter" :
124
+ elif key not in ( "Enter" , "E" , "XboxTypeS_Start" , "XboxTypes_X" ) :
104
125
return True
105
126
106
127
return False
@@ -179,3 +200,12 @@ def HookContentMenu(caller: UObject, function: UFunction, params: FStruct) -> bo
179
200
return False
180
201
181
202
RunHook ("WillowGame.FrontendGFxMovie.ShowMarketplaceMovie" ,"HookContentMenu" , HookContentMenu )
203
+
204
+
205
+ def HookMainMenuInput (caller : UObject , function : UFunction , params : FStruct ) -> bool :
206
+ if params .ukey == "M" and params .uevent == 1 :
207
+ caller .ShowMarketplaceMovie ()
208
+ return True
209
+
210
+
211
+ RunHook ("WillowGame.FrontendGFxMovie.SharedHandleInputKey" , "ModMenuBind" , HookMainMenuInput )
0 commit comments