Skip to content

Commit

Permalink
Add support for the weird new update
Browse files Browse the repository at this point in the history
BL2/TPS came out on Epic and it does some shenanigans, this should be a valid enough fix
(also update the vcxproj because I've been tinkering inside of it)
  • Loading branch information
FromDarkHell committed May 28, 2020
1 parent a9a95a5 commit 3787860
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
23 changes: 22 additions & 1 deletion Mods/ModMenuManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ def HookModSelected(caller: UObject, function: UFunction, params: FStruct) -> bo

RunHook("WillowGame.MarketplaceGFxMovie.extOnOfferingChanged","HookModSelected", HookModSelected)

def HookHandleClick(caller: UObject, function: UFunction, params: FStruct) -> bool:
if params.EventID == 4:
gfxmovie = params.TheList.MyOwnerMovie
if(gfxmovie.IsOverlayMenuOpen() == False):
WPCOwner = unrealsdk.GetEngine().GamePlayers[0].Actor
gfxmovie.CheckDownloadableContentListCompleted(WPCOwner.GetMyControllerId(), True)
return False
else:
return True

RunHook("WillowGame.WillowScrollingListDataProviderFrontEnd.HandleClick", "HookHandleClick", HookHandleClick)


def HookGetSubmenuForEvent(caller: UObject, function: UFunction, params: FStruct) -> bool:
return (params.EventID != 4)

RunHook("WillowGame.WillowScrollingListDataProviderFrontEnd.GetSubmenuForEvent", "HookGetSubmenuForEvent", HookGetSubmenuForEvent)

def HookContentMenu(caller: UObject, function: UFunction, params: FStruct) -> bool:
WPCOwner = unrealsdk.GetEngine().GamePlayers[0].Actor
caller.CheckDownloadableContentListCompleted(WPCOwner.GetMyControllerId(), True)
Expand All @@ -204,7 +222,10 @@ def HookContentMenu(caller: UObject, function: UFunction, params: FStruct) -> bo

def HookMainMenuInput(caller: UObject, function: UFunction, params: FStruct) -> bool:
if params.ukey == "M" and params.uevent == 1:
caller.ShowMarketplaceMovie()
gfxmovie = caller
if(gfxmovie.IsOverlayMenuOpen() == False):
WPCOwner = unrealsdk.GetEngine().GamePlayers[0].Actor
gfxmovie.CheckDownloadableContentListCompleted(WPCOwner.GetMyControllerId(), True)
return True


Expand Down
4 changes: 2 additions & 2 deletions PythonSDK.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
Expand Down Expand Up @@ -182,7 +182,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>MinSpace</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BL2SDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WINDOWS_IGNORE_PACKING_MISMATCH;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BL2SDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
Expand Down

0 comments on commit 3787860

Please sign in to comment.