1
1
import bl2sdk
2
+ from bl2sdk import *
2
3
import os
4
+ import mypy
3
5
4
6
def log (s ):
5
7
s = str (s )
@@ -27,11 +29,11 @@ def Disable(self):
27
29
28
30
import randomizer
29
31
30
- def LoadModList (caller , function , parms , result ) :
32
+ def LoadModList (caller : UObject , function : UFunction , parms : FStruct , result : FStruct ) -> bool :
31
33
caller .SetStoreHeader ("Mods" , 0 , "By Abahbob" , "Mod Manager" )
32
- pc = bl2sdk . GetEngine ().GamePlayers [0 ]
34
+ pc = GetEngine ().GamePlayers [0 ]
33
35
for idx , mod in enumerate (bl2sdk .Mods ):
34
- obj = caller .CreateMarketplaceItem (bl2sdk . FMarketplaceContent ())
36
+ obj = caller .CreateMarketplaceItem (FMarketplaceContent ())
35
37
obj .SetString (caller .Prop_contentTitleText , mod .Name , pc .GetTranslationContext ())
36
38
obj .SetString (caller .Prop_descriptionText , mod .Description , pc .GetTranslationContext ())
37
39
obj .SetString (caller .Prop_offeringId , str (idx ), pc .GetTranslationContext ())
@@ -40,11 +42,11 @@ def LoadModList(caller, function, parms, result):
40
42
caller .PostContentLoaded (True )
41
43
return False
42
44
43
- bl2sdk . RemoveEngineHook ("WillowGame.MarketplaceGFxMovie.OnDownloadableContentListRead" , "InjectMods" )
44
- bl2sdk . RegisterEngineHook ("WillowGame.MarketplaceGFxMovie.OnDownloadableContentListRead" , "InjectMods" , LoadModList )
45
+ RemoveEngineHook ("WillowGame.MarketplaceGFxMovie.OnDownloadableContentListRead" , "InjectMods" )
46
+ RegisterEngineHook ("WillowGame.MarketplaceGFxMovie.OnDownloadableContentListRead" , "InjectMods" , LoadModList )
45
47
46
- def process_hook (caller , function , parms , result ) :
47
- pc = bl2sdk . GetEngine ().GamePlayers [0 ]
48
+ def process_hook (caller : UObject , function : UFunction , parms : FStruct , result : FStruct ) -> bool :
49
+ pc = GetEngine ().GamePlayers [0 ]
48
50
ControllerId = parms .popInt ()
49
51
ukey = parms .popFName ()
50
52
event = parms .popByte ()
@@ -65,11 +67,11 @@ def process_hook(caller, function, parms, result):
65
67
return False
66
68
return True
67
69
68
- bl2sdk . RemoveEngineHook ("WillowGame.MarketplaceGFxMovie.ShopInputKey" , "OpenModMenu" )
69
- bl2sdk . RegisterEngineHook ("WillowGame.MarketplaceGFxMovie.ShopInputKey" , "OpenModMenu" , process_hook )
70
+ RemoveEngineHook ("WillowGame.MarketplaceGFxMovie.ShopInputKey" , "OpenModMenu" )
71
+ RegisterEngineHook ("WillowGame.MarketplaceGFxMovie.ShopInputKey" , "OpenModMenu" , process_hook )
70
72
71
73
72
- def ReplaceDLCWithMods (caller , stack , result , function ) :
74
+ def ReplaceDLCWithMods (caller : UObject , stack : FFrame , result : FStruct , function : UFunction ) -> bool :
73
75
EventID = stack .popInt ()
74
76
Caption = stack .popFString ()
75
77
bDisabled = stack .popULong ()
@@ -81,12 +83,12 @@ def ReplaceDLCWithMods(caller, stack, result, function):
81
83
return False
82
84
83
85
84
- def HookMainMenuPopulateForMods (caller , stack , result , function ) :
85
- bl2sdk . RegisterScriptHook ("WillowGame.WillowScrollingList.AddListItem" , "ReplaceDLCWithMods" , ReplaceDLCWithMods )
86
+ def HookMainMenuPopulateForMods (caller : UObject , stack : FFrame , result : FStruct , function : UFunction ) -> bool :
87
+ RegisterScriptHook ("WillowGame.WillowScrollingList.AddListItem" , "ReplaceDLCWithMods" , ReplaceDLCWithMods )
86
88
caller .Populate (stack .popObject ())
87
- bl2sdk . RemoveScriptHook ("WillowGame.WillowScrollingList.AddListItem" , "ReplaceDLCWithMods" )
89
+ RemoveScriptHook ("WillowGame.WillowScrollingList.AddListItem" , "ReplaceDLCWithMods" )
88
90
stack .SkipFunction ()
89
91
return False
90
92
91
- bl2sdk . RemoveEngineHook ("WillowGame.WillowScrollingListDataProviderFrontEnd.Populate" , "HookMainMenuPopulateForMods" )
92
- bl2sdk . RegisterScriptHook ("WillowGame.WillowScrollingListDataProviderFrontEnd.Populate" , "HookMainMenuPopulateForMods" , HookMainMenuPopulateForMods )
93
+ RemoveEngineHook ("WillowGame.WillowScrollingListDataProviderFrontEnd.Populate" , "HookMainMenuPopulateForMods" )
94
+ RegisterScriptHook ("WillowGame.WillowScrollingListDataProviderFrontEnd.Populate" , "HookMainMenuPopulateForMods" , HookMainMenuPopulateForMods )
0 commit comments