1
- import bl2sdk
2
- from bl2sdk import *
1
+ import unrealsdk
2
+ from unrealsdk import *
3
3
from collections import namedtuple
4
4
5
5
from .Util import getLoadedMods
11
11
def HookInitKeyBinding (caller : UObject , function : UFunction , params : FStruct ) -> bool :
12
12
for mod in getLoadedMods ():
13
13
if mod .Keybinds :
14
- tag = f"bl2sdk .seperator.{ mod .Name } "
14
+ tag = f"unrealsdk .seperator.{ mod .Name } "
15
15
caller .AddKeyBindEntry (tag , tag , mod .Name )
16
16
for GameInput in mod .Keybinds :
17
17
InputName , InputKey = GameInput
18
- tag = f"bl2sdk .input.{ mod .Name } .{ InputName } "
18
+ tag = f"unrealsdk .input.{ mod .Name } .{ InputName } "
19
19
caller .AddKeyBindEntry (tag , tag , f" { InputName } " )
20
20
return True
21
21
@@ -44,15 +44,15 @@ def HookOnPopulateKeys(caller: UObject, function: UFunction, params: FStruct) ->
44
44
translationContext = GetEngine ().GamePlayers [0 ].GetTranslationContext ()
45
45
46
46
for keyBind in caller .KeyBinds :
47
- if keyBind .Tag .startswith ("bl2sdk " ):
48
- if keyBind .Tag .startswith ("bl2sdk .seperator" ):
47
+ if keyBind .Tag .startswith ("unrealsdk " ):
48
+ if keyBind .Tag .startswith ("unrealsdk .seperator" ):
49
49
keyBind .Object .SetString ("value" , "" )
50
50
keyBind .Object .SetVisible (False )
51
51
else :
52
52
for mod in getLoadedMods ():
53
53
if mod .Name == keyBind .Tag .split ('.' )[2 ]:
54
54
for GameInput in mod .Keybinds :
55
- if keyBind .Tag == f"bl2sdk .input.{ mod .Name } .{ GameInput [0 ]} " :
55
+ if keyBind .Tag == f"unrealsdk .input.{ mod .Name } .{ GameInput [0 ]} " :
56
56
keyBind .CurrentKey = GameInput [1 ]
57
57
if keyBind .CurrentKey != "None" :
58
58
for mod in getLoadedMods ():
@@ -74,7 +74,7 @@ def HookOnPopulateKeys(caller: UObject, function: UFunction, params: FStruct) ->
74
74
75
75
def HookBindCurrentSelection (caller : UObject , function : UFunction , params : FStruct ) -> bool :
76
76
selectedKeyBind = caller .KeyBinds [caller .CurrentKeyBindSelection ]
77
- if selectedKeyBind .Tag .startswith ("bl2sdk .seperator" ):
77
+ if selectedKeyBind .Tag .startswith ("unrealsdk .seperator" ):
78
78
return False
79
79
80
80
PreviousKeyBinds = {bind .Tag : bind .CurrentKey for bind in caller .KeyBinds }
@@ -83,11 +83,11 @@ def HookBindCurrentSelection(caller: UObject, function: UFunction, params: FStru
83
83
caller .BindCurrentSelection (params .Key )
84
84
85
85
for bind in caller .KeyBinds :
86
- if bind .Tag .startswith ("bl2sdk " ) and bind .Tag in PreviousKeyBinds .keys () and PreviousKeyBinds [bind .Tag ] != bind .CurrentKey :
86
+ if bind .Tag .startswith ("unrealsdk " ) and bind .Tag in PreviousKeyBinds .keys () and PreviousKeyBinds [bind .Tag ] != bind .CurrentKey :
87
87
for mod in getLoadedMods ():
88
88
if mod .Name == bind .Tag .split ('.' )[2 ]:
89
89
for GameInput in mod .Keybinds :
90
- if bind .Tag == f"bl2sdk .input.{ mod .Name } .{ GameInput [0 ]} " :
90
+ if bind .Tag == f"unrealsdk .input.{ mod .Name } .{ GameInput [0 ]} " :
91
91
GameInput [1 ] = bind .CurrentKey
92
92
mod .GameInputRebound (GameInput [0 ], bind .CurrentKey )
93
93
@@ -107,7 +107,7 @@ def HookBindCurrentSelection(caller: UObject, function: UFunction, params: FStru
107
107
108
108
109
109
def HookDoBind (caller : UObject , function : UFunction , params : FStruct ) -> bool :
110
- if caller .KeyBinds [caller .CurrentKeyBindSelection ].Tag .startswith ("bl2sdk .seperator" ):
110
+ if caller .KeyBinds [caller .CurrentKeyBindSelection ].Tag .startswith ("unrealsdk .seperator" ):
111
111
return False
112
112
return True
113
113
0 commit comments