From 2b36066e6b95bb603489d7d7ba8bbe6e97a22f5b Mon Sep 17 00:00:00 2001 From: Tadikas Date: Sun, 8 Dec 2024 12:19:25 +0100 Subject: [PATCH] Fixed a few bugs with keybinds and unjacked flea more --- .gitignore | 3 ++- Patches/ConfigController.cs | 6 ++++-- Patches/QuickSell.cs | 19 +------------------ QuickSell.csproj | 1 + 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 9491a2f..7a7b25c 100644 --- a/.gitignore +++ b/.gitignore @@ -360,4 +360,5 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd +/Patches/TestPatch.cs diff --git a/Patches/ConfigController.cs b/Patches/ConfigController.cs index dd2987e..597e569 100644 --- a/Patches/ConfigController.cs +++ b/Patches/ConfigController.cs @@ -58,7 +58,8 @@ private static Item SelectItem() var preloader = GameObject.Find("/Preloader UI/Preloader UI"); if (preloader == null) { - Utils.SendError("Preloader not found"); + Utils.SendDebugNotification("Preloader not found"); + return null; } var raycaster = preloader.GetComponent() ?? preloader.AddComponent(); PointerEventData eventData = new(EventSystem.current) @@ -80,7 +81,8 @@ private static Item SelectItem() var target = GameObject.Find("InventoryScreen"); if (target == null) { - Utils.SendError("InventoryScreen not found"); + Utils.SendDebugNotification("InventoryScreen not found"); + return null; } raycaster = target.GetComponent() ?? target.AddComponent(); diff --git a/Patches/QuickSell.cs b/Patches/QuickSell.cs index ad4f3fc..b49d785 100644 --- a/Patches/QuickSell.cs +++ b/Patches/QuickSell.cs @@ -118,11 +118,6 @@ public static void SellFlea(Item item) var tradingScreen = Singleton.Instance.TradingScreen; if (tradingScreen == null) Utils.SendError("Counldnt Load tradingScreen"); - //RagfairScreen flea = (RagfairScreen)typeof(TradingScreen).GetField("_ragfairScreen", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(tradingScreen); - //if (flea == null) Utils.SendError("Counldnt Load flea"); - - //flea.method_4(); - var session = GetSession(); if (session == null) Utils.SendError("Counldnt Load session"); @@ -176,7 +171,7 @@ void res(ItemMarketPrices result) - session.RagfairAddOffer(false, [item.Id], [.. list], new Callback(FleaSellerFixer)); + session.RagfairAddOffer(false, [item.Id], [.. list], new Callback(PlaySellSound)); } catch (Exception ex) @@ -234,18 +229,6 @@ private static void PlaySellSound(IResult result) if (result.Succeed) Singleton.Instance.PlayUISound(EUISoundType.TradeOperationComplete); } - //For some reason selling on the flea causes black screens if the flea market screen is still open - // This is a janky fix for that issue, i am not putting more tim - private static void FleaSellerFixer(IResult result) - { - if (!result.Succeed) return; - - var rotator = GameObject.Find("/Rotator parent"); - if (rotator != null) GameObject.Destroy(rotator); - - - PlaySellSound(result); - } private static void forceReloadTraders() { traders = GetSession().Traders.Where(new Func(MainMenuController.Class1378.class1378_0.method_3)).ToArray(); diff --git a/QuickSell.csproj b/QuickSell.csproj index 62aca59..e4bb1a9 100644 --- a/QuickSell.csproj +++ b/QuickSell.csproj @@ -115,6 +115,7 @@ +