From d5cc474d90e2cae4e2c1a6fd797a18e355d9491e Mon Sep 17 00:00:00 2001 From: xADDBx <62178123+xADDBx@users.noreply.github.com> Date: Wed, 18 Dec 2024 04:28:24 +0100 Subject: [PATCH] * (***ADDB***) Add "Show hidden loot in Checklist" to the Loot Tab. The checklist doesn't show loot which wasn't seen yet. --- ToyBox/Classes/MainUI/EnhancedUI/LootHelper.cs | 6 ++++-- ToyBox/Classes/MainUI/EnhancedUI/PhatLoot.cs | 5 +++++ ToyBox/Classes/Models/Settings.cs | 1 + ToyBox/ReadMe.md | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ToyBox/Classes/MainUI/EnhancedUI/LootHelper.cs b/ToyBox/Classes/MainUI/EnhancedUI/LootHelper.cs index e46e06e2..909329c6 100644 --- a/ToyBox/Classes/MainUI/EnhancedUI/LootHelper.cs +++ b/ToyBox/Classes/MainUI/EnhancedUI/LootHelper.cs @@ -23,6 +23,7 @@ using System.Reflection; using System.Runtime.Serialization.Formatters.Binary; using UnityEngine; +using UnityModManagerNet; namespace ToyBox { public static class LootHelper { @@ -80,8 +81,8 @@ public static IEnumerable GetMassLootFromCurrentArea() { .Concat(Game.Instance.State.AllUnits.Select(i => i.GetOptional())).NotNull(); var source = TempList.Get(); foreach (var interactionLootPart in interactionLootParts) - if (interactionLootPart.Owner.IsRevealed && interactionLootPart.Loot.HasLoot && - (interactionLootPart.LootViewed || + if ((interactionLootPart.Owner.IsRevealed || Main.Settings.toggleShowHiddenLoot) && interactionLootPart.Loot.HasLoot && + (interactionLootPart.LootViewed || Main.Settings.toggleShowHiddenLoot || (interactionLootPart.View is DroppedLoot && !(bool)(EntityPart)interactionLootPart.Owner .GetOptional()) || (bool)(UnityEngine.Object)interactionLootPart.View.GetComponent())) @@ -112,6 +113,7 @@ public static void OpenMassLoot() { contextVM.LootVM.Value = lootVM; //EventBus.RaiseEvent((Action)(e => e.HandleZoneLootInterraction(null))); + UnityModManager.UI.Instance.ToggleWindow(false); } public static void OpenPlayerChest() { // Access to LootContextVM diff --git a/ToyBox/Classes/MainUI/EnhancedUI/PhatLoot.cs b/ToyBox/Classes/MainUI/EnhancedUI/PhatLoot.cs index 0a5bccfe..a795bd63 100644 --- a/ToyBox/Classes/MainUI/EnhancedUI/PhatLoot.cs +++ b/ToyBox/Classes/MainUI/EnhancedUI/PhatLoot.cs @@ -111,6 +111,11 @@ public static void OnGUI() { if (Game.Instance.CurrentlyLoadedArea == null) return; var isEmpty = true; HStack("Loot Checklist".localize(), 1, + () => { + Toggle("Show hidden loot in Checklist".localize(), ref Settings.toggleShowHiddenLoot, 400.width()); + 150.space(); + Label(RichText.Green("Also lists containers that are still hidden.".localize())); + }, () => { var areaName = ""; if (Main.IsInGame) { diff --git a/ToyBox/Classes/Models/Settings.cs b/ToyBox/Classes/Models/Settings.cs index a92109a3..44ff822a 100644 --- a/ToyBox/Classes/Models/Settings.cs +++ b/ToyBox/Classes/Models/Settings.cs @@ -165,6 +165,7 @@ internal PerSaveSettings perSave { public RarityType minRarityToColor = 0; public bool toggleMassLootEverything = false; public bool toggleLootAliveUnits = false; + public bool toggleShowHiddenLoot = false; public bool toggleLootChecklistFilterBlueprint = false; public bool toggleLootChecklistFilterDescription = false; public RarityType lootChecklistFilterRarity = RarityType.None; diff --git a/ToyBox/ReadMe.md b/ToyBox/ReadMe.md index 9ddad56b..c6c0ad5f 100644 --- a/ToyBox/ReadMe.md +++ b/ToyBox/ReadMe.md @@ -45,10 +45,11 @@ Here is a summarized list of features. This list only includes a part of the fea ### ToyBox Rogue - Ver 1.7.7 built for Rogue Trader 1.3.0.57 +* (***jonHinkerton***) Add Button (allows binding to hotkey) to open faction trade vendor window from anywhere. +* (***ADDB***) Add "Show hidden loot in Checklist" to the Loot Tab. The checklist doesn't show loot which wasn't seen yet. * (***ADDB***) Patch Tool fixes: * Fix Patch Tool for types implementing IList * Fix Patch Tool possible stack overflow in DeepCopy -* (***jonHinkerton***) Add Button (allows binding to hotkey) to open faction trade vendor window from anywhere. ### ToyBox Rogue - Ver 1.7.6 built for Rogue Trader 1.2.1.26 * (***ADDB***) Fix Patch Tool not being able to modify top level primitives.