From 37878605ce2d342a117e99b629e7d3fa46f50053 Mon Sep 17 00:00:00 2001 From: FromDarkHell Date: Thu, 28 May 2020 18:21:13 -0500 Subject: [PATCH] Add support for the weird new update 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) --- Mods/ModMenuManager.py | 23 ++++++++++++++++++++++- PythonSDK.vcxproj | 4 ++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Mods/ModMenuManager.py b/Mods/ModMenuManager.py index 6167cc6a..972fa92a 100644 --- a/Mods/ModMenuManager.py +++ b/Mods/ModMenuManager.py @@ -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) @@ -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 diff --git a/PythonSDK.vcxproj b/PythonSDK.vcxproj index 9084c1da..4392517a 100644 --- a/PythonSDK.vcxproj +++ b/PythonSDK.vcxproj @@ -107,7 +107,7 @@ DynamicLibrary true - v140 + v142 Unicode true @@ -182,7 +182,7 @@ Level3 MinSpace false - WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BL2SDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WINDOWS_IGNORE_PACKING_MISMATCH;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BL2SDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true $(ProjectDir)src\include;%(AdditionalIncludeDirectories) true