コード例 #1
0
ファイル: Settings+UI.cs プロジェクト: cabarius/ToyBox
        public static void OnGUI()
        {
            UI.HStack("Settings", 1,
                      () => {
                UI.ActionButton("Reset UI", () => Main.SetNeedsResetGameUI());
                25.space();
                UI.Label("Tells the game to reset the in game UI.".green() + " Warning".yellow() + " Using this in dialog or the book will dismiss that dialog which may break progress so use with care".orange());
            },
                      () => {
                UI.Toggle("Enable Game Development Mode", ref Main.settings.toggleDevopmentMode);
                UI.Space(25);
                UI.Label("This turns on the developer console which lets you access cheat commands, shows a FPS window (hide with F11), etc".green());
            },
                      () => UI.Label(""),
                      () => UI.EnumGrid("Log Level", ref Main.settings.loggingLevel, UI.AutoWidth()),
                      () => UI.Label(""),
                      () => UI.Toggle("Strip HTML (colors) from Native Console", ref Main.settings.stripHtmlTagsFromNativeConsole),
#if DEBUG
                      () => UI.Toggle("Strip HTML (colors) from Logs Tab in Unity Mod Manager", ref Main.settings.stripHtmlTagsFromUMMLogsTab),
#endif
                      () => UI.Toggle("Display guids in most tooltips, use shift + left click on items/abilities to copy guid to clipboard", ref Main.settings.toggleGuidsClipboard),
                      () => { }
                      );
#if DEBUG
            UI.Div(0, 25);
            UI.HStack("Localizaton", 1,
                      () => {
                var cultureInfo = Thread.CurrentThread.CurrentUICulture;
                var cultures    = CultureInfo.GetCultures(CultureTypes.AllCultures).OrderBy(ci => ci.DisplayName).ToList();
                using (UI.VerticalScope()) {
                    using (UI.HorizontalScope()) {
                        UI.Label("Current Cultrue".cyan(), UI.Width(275));
                        UI.Space(25);
                        UI.Label($"{cultureInfo.DisplayName}({cultureInfo.Name})".orange());
                    }
                    if (UI.GridPicker <CultureInfo>("Culture", ref uiCulture, cultures, null, ci => ci.DisplayName, ref cultureSearchText, 8, UI.rarityButtonStyle, UI.Width(UI.ummWidth - 350)))
                    {
                        // can we set it?
                    }
                }
            },
                      () => { }
                      );
#endif
        }
コード例 #2
0
ファイル: MulticlassPicker.cs プロジェクト: cabarius/ToyBox
        public static bool PickerRow(UnitEntityData ch, BlueprintCharacterClass cl, MulticlassOptions options, float indent = 100)
        {
            var changed  = false;
            var showDesc = settings.toggleMulticlassShowClassDescriptions;

            if (showDesc)
            {
                UI.Div(indent, 15);
            }
            var cd                = ch?.Progression.GetClassData(cl);
            var chArchetype       = cd?.Archetypes.FirstOrDefault <BlueprintArchetype>();
            var archetypeOptions  = options.ArchetypeOptions(cl);
            var showGestaltToggle = false;

            if (ch != null && cd != null)
            {
                var classes            = ch?.Progression.Classes;
                var classCount         = classes?.Count(x => !x.CharacterClass.IsMythic);
                var gestaltCount       = classes?.Count(cd => !cd.CharacterClass.IsMythic && ch.IsClassGestalt(cd.CharacterClass));
                var mythicCount        = classes.Count(x => x.CharacterClass.IsMythic);
                var mythicGestaltCount = classes.Count(cd => cd.CharacterClass.IsMythic && ch.IsClassGestalt(cd.CharacterClass));

                showGestaltToggle = ch.IsClassGestalt(cd.CharacterClass) ||
                                    !cd.CharacterClass.IsMythic && classCount - gestaltCount > 1 ||
                                    cd.CharacterClass.IsMythic && mythicCount - mythicGestaltCount > 1;
            }
            var charHasClass = cd != null && chArchetype == null;
            // Class Toggle
            var canSelectClass = MulticlassOptions.CanSelectClassAsMulticlass(ch, cl);

            using (UI.HorizontalScope()) {
                UI.Space(indent);
                var optionsHasClass = options.Contains(cl);
                UI.ActionToggle(
                    charHasClass ? cl.Name.orange() + $" ({cd.Level})".orange() : cl.Name,
                    () => optionsHasClass,
                    (v) => {
                    if (v)
                    {
                        archetypeOptions = options.Add(cl);
                        if (chArchetype != null)
                        {
                            archetypeOptions.Add(chArchetype);
                            options.SetArchetypeOptions(cl, archetypeOptions);
                        }
                    }
                    else
                    {
                        options.Remove(cl);
                    }
                    var action = v ? "Add".green() : "Del".yellow();
                    Mod.Trace($"PickerRow - {action} class: {cl.HashKey()} - {options} -> {options.Contains(cl)}");
                    changed = true;
                },
                    () => !canSelectClass,
                    350);
                UI.Space(247);
                using (UI.VerticalScope()) {
                    if (!canSelectClass)
                    {
                        UI.Label("to select this class you must unselect at least one of your other existing classes".orange());
                    }
                    if (optionsHasClass && chArchetype != null && archetypeOptions.Empty())
                    {
                        UI.Label($"due to existing archetype, {chArchetype.Name.yellow()},  this multiclass option will only be applied during respec.".orange());
                    }
                    if (showGestaltToggle && chArchetype == null)
                    {
                        using (UI.HorizontalScope()) {
                            UI.Space(-150);
                            UI.ActionToggle("gestalt".grey(), () => ch.IsClassGestalt(cd.CharacterClass),
                                            (v) => {
                                ch.SetClassIsGestalt(cd.CharacterClass, v);
                                ch.Progression.UpdateLevelsForGestalt();
                                changed = true;
                            }, 125);
                            UI.Space(25);
                            UI.Label("this flag lets you not count this class in computing character level".green());
                        }
                    }
                    if (showDesc)
                    {
                        using (UI.HorizontalScope()) {
                            UI.Label(cl.Description.StripHTML().green());
                        }
                    }
                }
            }
            // Archetypes
            using (UI.HorizontalScope()) {
                var showedGestalt = false;
                UI.Space(indent);
                var archetypes = cl.Archetypes;
                if (options.Contains(cl) && archetypes.Any() || chArchetype != null || charHasClass)
                {
                    UI.Space(50);
                    using (UI.VerticalScope()) {
                        foreach (var archetype in cl.Archetypes)
                        {
                            if (showDesc)
                            {
                                UI.Div();
                            }
                            using (UI.HorizontalScope()) {
                                var hasArch = archetypeOptions.Contains(archetype);
                                UI.ActionToggle(
                                    archetype == chArchetype ? cd.ArchetypesName().orange() + $" ({cd.Level})".orange() : archetype.Name,
                                    () => hasArch,
                                    (v) => {
                                    if (v)
                                    {
                                        archetypeOptions.AddExclusive(archetype);
                                    }
                                    else
                                    {
                                        archetypeOptions.Remove(archetype);
                                    }
                                    options.SetArchetypeOptions(cl, archetypeOptions);
                                    var action = v ? "Add".green() : "Del".yellow();
                                    Mod.Trace($"PickerRow -  {action}  - arch: {archetype.HashKey()} - {archetypeOptions}");
                                    changed = true;
                                },
                                    () => !canSelectClass,
                                    300);
                                UI.Space(250);
                                using (UI.VerticalScope()) {
                                    if (hasArch && archetype != chArchetype && (chArchetype != null || charHasClass))
                                    {
                                        if (chArchetype != null)
                                        {
                                            UI.Label($"due to existing archetype, {chArchetype.Name.yellow()}, this multiclass archetype will only be applied during respec.".orange());
                                        }
                                        else
                                        {
                                            UI.Label($"due to existing class, {cd.CharacterClass.Name.yellow()}, this multiclass archetype will only be applied during respec.".orange());
                                        }
                                    }
                                    else if (showGestaltToggle && archetype == chArchetype)
                                    {
                                        using (UI.HorizontalScope()) {
                                            UI.Space(-155);
                                            UI.ActionToggle("gestalt".grey(), () => ch.IsClassGestalt(cd.CharacterClass),
                                                            (v) => {
                                                ch.SetClassIsGestalt(cd.CharacterClass, v);
                                                ch.Progression.UpdateLevelsForGestalt();
                                                changed = true;
                                            }, 125);
                                            UI.Space(25);
                                            UI.Label("this flag lets you not count this class in computing character level".green());
                                            showedGestalt = true;
                                        }
                                    }
                                    if (showDesc)
                                    {
                                        using (UI.VerticalScope()) {
                                            if (showedGestalt)
                                            {
                                                UI.Label("this flag lets you not count this class in computing character level".green());
                                                UI.DivLast();
                                            }
                                            UI.Label(archetype.Description.StripHTML().green());
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(changed);
        }
コード例 #3
0
ファイル: MulticlassPicker.cs プロジェクト: cabarius/ToyBox
        public static void MigrationOptions(float indent)
        {
            if (!Main.IsInGame)
            {
                return;
            }
            var hasMulticlassMigration = settings.multiclassSettings.Count > 0 &&
                                         (settings.toggleAlwaysShowMigration || settings.perSave.multiclassSettings.Count == 0);
            var hasGestaltMigration = settings.excludeClassesFromCharLevelSets.Count > 0 &&
                                      (settings.toggleAlwaysShowMigration || settings.perSave.excludeClassesFromCharLevelSets.Count == 0);
            var hasLevelAsLegendMigration = settings.perSave.charIsLegendaryHero.Count > 0 &&
                                            (settings.toggleAlwaysShowMigration || settings.perSave.charIsLegendaryHero.Count == 0);
            var hasAvailableMigrations = hasMulticlassMigration || hasGestaltMigration || hasLevelAsLegendMigration;
            var migrationCount         = settings.multiclassSettings.Count + settings.excludeClassesFromCharLevelSets.Count + settings.charIsLegendaryHero.Count;

            if (migrationCount > 0)
            {
                using (UI.HorizontalScope()) {
                    UI.Space(indent);
                    UI.Toggle("Show Migrations", ref settings.toggleAlwaysShowMigration);
                    UI.Space(25);
                    UI.Label("toggle this if you want show older ToyBox settings for ".green() + "Multi-class selections, Gestalt Flags and Allow Levels Past 20 ".cyan());
                }
            }
            if (migrationCount > 0)
            {
                UI.Div(indent);
                if (hasAvailableMigrations)
                {
                    using (UI.HorizontalScope()) {
                        UI.Space(indent);
                        using (UI.VerticalScope()) {
                            UI.Label("the following options allow you to migrate previous settings that were stored in toybox to the new per setting save mechanism for ".green() + "Multi-class selections, Gestalt Flags and Allow Levels Past 20 ".cyan() + "\nNote:".orange() + "you may have configured this for a different save so use care in doing this migration".green());
                            if (hasMulticlassMigration)
                            {
                                using (UI.HorizontalScope()) {
                                    UI.Label("Multi-class settings", UI.Width(300));
                                    UI.Space(25);
                                    UI.Label($"{settings.multiclassSettings.Count}".cyan());
                                    UI.Space(25);
                                    UI.ActionButton("Migrate", () => { settings.perSave.multiclassSettings = settings.multiclassSettings; Settings.SavePerSaveSettings(); });
                                    UI.Space(25);
                                    UI.DangerousActionButton("Remove", "this will remove your old multiclass settings from ToyBox settings but does not affect any other saves that have already migrated them", ref areYouSure1, () => settings.multiclassSettings.Clear());
                                }
                            }
                            if (hasGestaltMigration)
                            {
                                using (UI.HorizontalScope()) {
                                    UI.Label("Gestalt Flags", UI.Width(300));
                                    UI.Space(25);
                                    UI.Label($"{settings.excludeClassesFromCharLevelSets.Count}".cyan());
                                    UI.Space(25);
                                    UI.ActionButton("Migrate", () => {
                                        settings.perSave.excludeClassesFromCharLevelSets = settings.excludeClassesFromCharLevelSets; Settings.SavePerSaveSettings();
                                        MultipleClasses.SyncAllGestaltState();
                                    });
                                    UI.Space(25);
                                    UI.DangerousActionButton("Remove", "this will remove your old gestalt flags from ToyBox settings but does not affect any other saves that have already migrated them", ref areYouSure2, () => settings.excludeClassesFromCharLevelSets.Clear());
                                }
                            }
                            if (hasLevelAsLegendMigration)
                            {
                                using (UI.HorizontalScope()) {
                                    UI.Label("Chars Able To Exceed Level 20", UI.Width(300));
                                    UI.Space(25);
                                    UI.Label($"{settings.charIsLegendaryHero.Count}".cyan());
                                    UI.Space(25);
                                    UI.ActionButton("Migrate", () => { settings.perSave.charIsLegendaryHero = settings.charIsLegendaryHero; Settings.SavePerSaveSettings(); });
                                    UI.Space(25);
                                    UI.DangerousActionButton("Remove", "this will remove your old Allow Level Past 20 flags from ToyBox settings but does not affect any other saves that have already migrated them", ref areYouSure3, () => settings.charIsLegendaryHero.Clear());
                                }
                            }
                        }
                    }
                    UI.Div(indent);
                }
            }
        }
コード例 #4
0
        public void OnGUI(UnitEntityData character, bool refresh)
        {
            if (!Main.IsInGame)
            {
                return;
            }
            var activeScene = SceneManager.GetActiveScene().name;

            if (Game.Instance?.Player == null || activeScene == "MainMenu" || activeScene == "Start")
            {
                UI.Label(" * Please start or load the game first.".color(RGBA.yellow));
                return;
            }
            if (_buttonStyle == null)
            {
                _buttonStyle = new GUIStyle(GUI.skin.button)
                {
                    alignment = TextAnchor.MiddleLeft, wordWrap = true
                }
            }
            ;

            try {
                if (character != _selectedCharacter || refresh)
                {
                    _selectedCharacter = character;
                    _featuresTree      = new FeaturesTree(_selectedCharacter.Descriptor.Progression);;
                }
                using (UI.HorizontalScope()) {
                    // features tree
                    if (_featuresTree != null)
                    {
                        using (UI.VerticalScope()) {
                            var expandAll   = false;
                            var collapseAll = false;

                            // draw tool bar
                            using (UI.HorizontalScope()) {
                                UI.ActionButton("Refresh", () => _featuresTree = new FeaturesTree(_selectedCharacter.Descriptor.Progression), UI.Width(200));
                                UI.Button("Expand All", ref expandAll, UI.Width(200));
                                UI.Button("Collapse All", ref collapseAll, UI.Width(200));
                            }

                            UI.Space(10f);

                            // draw tree
                            foreach (var node in _featuresTree.RootNodes)
                            {
                                draw(node);
                            }

                            void draw(FeaturesTree.FeatureNode node)
                            {
                                using (UI.HorizontalScope()) {
                                    var levelText     = node.Level == 0 ? "" : $" {node.Level} - ";
                                    var blueprintName = $"[{node.Blueprint.name}]".color(node.IsMissing ? RGBA.maroon : RGBA.aqua);
                                    var titleText     = $"{levelText}{node.Name.Bold()} {blueprintName}";
                                    if (node.ChildNodes.Count > 0)
                                    {
                                        if (node.Expanded == ToggleState.None)
                                        {
                                            node.Expanded = ToggleState.Off;
                                        }
                                        node.Expanded = expandAll ? ToggleState.On : collapseAll ? ToggleState.Off : node.Expanded;
                                    }
                                    else
                                    {
                                        node.Expanded = ToggleState.None;
                                    }
                                    Mod.Trace($"{node.Expanded} {titleText}");
                                    UI.ToggleButton(ref node.Expanded, titleText, _buttonStyle);
                                    if (node.Expanded.IsOn())
                                    {
                                        using (UI.VerticalScope(UI.ExpandWidth(false))) {
                                            foreach (var child in node.ChildNodes.OrderBy(n => n.Level))
                                            {
                                                draw(child);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        GUILayout.FlexibleSpace();
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e) {
                _selectedCharacter = null;
                _featuresTree      = null;
                Mod.Error(e);
                throw e;
            }
        }
コード例 #5
0
        public static IEnumerable OnGUI()
        {
            // Stackable browser
            using (UI.HorizontalScope(UI.Width(450))) {
                // First column - Type Selection Grid
                using (UI.VerticalScope(GUI.skin.box)) {
                    UI.ActionSelectionGrid(ref settings.selectedBPTypeFilter,
                                           blueprintTypeFilters.Select(tf => tf.name).ToArray(),
                                           1,
                                           (selected) => { UpdateSearchResults(); },
                                           UI.buttonStyle,
                                           UI.Width(200));
                }
                bool collationChanged = false;
                if (collatedBPs != null)
                {
                    using (UI.VerticalScope(GUI.skin.box)) {
                        UI.ActionSelectionGrid(ref selectedCollationIndex, collationKeys.ToArray(),
                                               1,
                                               (selected) => { collationChanged = true; BlueprintListUI.needsLayout = true; },
                                               UI.buttonStyle,
                                               UI.Width(200));
                    }
                }
                // Section Column  - Main Area
                float remainingWidth = Main.ummWidth - 325;
                using (UI.VerticalScope(UI.Width(remainingWidth))) {
                    // Search Field and modifiers
                    using (UI.HorizontalScope()) {
                        UI.ActionTextField(
                            ref settings.searchText,
                            "searhText",
                            (text) => { },
                            () => { UpdateSearchResults(); },
                            UI.Width(400));
                        UI.Label("Limit", UI.ExpandWidth(false));
                        UI.ActionIntTextField(
                            ref settings.searchLimit,
                            "searchLimit",
                            (limit) => { },
                            () => { UpdateSearchResults(); },
                            UI.Width(200));
                        if (settings.searchLimit > 1000)
                        {
                            settings.searchLimit = 1000;
                        }
                        UI.Space(25);
                        UI.Toggle("Show GUIDs", ref settings.showAssetIDs);
                        UI.Space(25);
                        UI.Toggle("Components", ref settings.showComponents);
                        UI.Space(25);
                        UI.Toggle("Elements", ref settings.showElements);
                        UI.Space(25);
                        UI.Toggle("Dividers", ref settings.showDivisions);
                    }
                    // Search Button and Results Summary
                    using (UI.HorizontalScope()) {
                        UI.ActionButton("Search", () => {
                            UpdateSearchResults();
                        }, UI.AutoWidth());
                        UI.Space(25);
                        if (firstSearch)
                        {
                            UI.Label("please note the first search may take a few seconds.".green(), UI.AutoWidth());
                        }
                        else if (matchCount > 0)
                        {
                            String title = "Matches: ".green().bold() + $"{matchCount}".orange().bold();
                            if (matchCount > settings.searchLimit)
                            {
                                title += " => ".cyan() + $"{settings.searchLimit}".cyan().bold();
                            }
                            UI.Label(title, UI.ExpandWidth(false));
                        }
                        UI.Space(50);
                        UI.Label($"".green(), UI.AutoWidth());
                    }
                    UI.Space(10);

                    if (filteredBPs != null)
                    {
                        CharacterPicker.OnGUI();
                        UnitReference selected = CharacterPicker.GetSelectedCharacter();
                        var           bps      = filteredBPs;
                        if (selectedCollationIndex == 0)
                        {
                            selectedCollatedBPs = null;
                        }
                        if (selectedCollationIndex > 0)
                        {
                            if (collationChanged)
                            {
                                var key = collationKeys.ElementAt(selectedCollationIndex);

                                var selectedKey = collationKeys.ElementAt(selectedCollationIndex);

                                foreach (var group in collatedBPs)
                                {
                                    if (group.Key == selectedKey)
                                    {
                                        selectedCollatedBPs = group.Take(settings.searchLimit).ToArray();
                                    }
                                }
                                BlueprintListUI.needsLayout = true;
                            }
                            bps = selectedCollatedBPs;
                        }
                        BlueprintListUI.OnGUI(selected, bps, 0, remainingWidth, null, selectedTypeFilter);
                    }
                    UI.Space(25);
                }
            }
            return(null);
        }
コード例 #6
0
        public static void OnGUI()
        {
#if DEBUG
            UI.Div(0, 25);
            var inventory = Game.Instance.Player.Inventory;
            var items     = inventory.ToList();
            UI.HStack("Inventory", 1,
                      () => {
                UI.ActionButton("Export", () => items.Export("inventory.json"), UI.Width(150));
                UI.Space(25);
                UI.ActionButton("Import", () => inventory.Import("inventory.json"), UI.Width(150));
                UI.Space(25);
                UI.ActionButton("Replace", () => inventory.Import("inventory.json", true), UI.Width(150));
            },
                      () => { }
                      );
#endif
            UI.Div(0, 25);
            UI.HStack("Loot", 1,
                      () => {
                UI.BindableActionButton(MassLootBox, UI.Width(200));
                UI.Space(5); UI.Label("Area exit loot screen useful with the mod Cleaner to clear junk loot mid dungeon leaving less clutter on the map".green());
            },
                      () => {
                UI.ActionButton("Reveal Ground Loot", () => LootHelper.ShowAllChestsOnMap(), UI.Width(200));
                UI.Space(210); UI.Label("Shows all chests/bags/etc on the map excluding hidden".green());
            },
                      () => {
                UI.ActionButton("Reveal Hidden Ground Loot", () => LootHelper.ShowAllChestsOnMap(true), UI.Width(200));
                UI.Space(210); UI.Label("Shows all chests/bags/etc on the map including hidden".green());
            },
                      () => {
                UI.ActionButton("Reveal Inevitable Loot", () => LootHelper.ShowAllInevitablePortalLoot(), UI.Width(200));
                UI.Space(210); UI.Label("Shows unlocked Inevitable Excess DLC rewards on the map".green());
            },
                      () => {
                UI.Toggle("Mass Loot Shows Everything When Leaving Map", ref settings.toggleMassLootEverything);
                UI.Space(100); UI.Label("Some items might be invisible until looted".green());
            },
                      () => {
                UI.Toggle("Color Items By Rarity", ref settings.toggleColorLootByRarity);
                UI.Space(25);
                using (UI.VerticalScope()) {
                    UI.Label($"This makes loot function like Diablo or Borderlands. {"Note: turning this off requires you to save and reload for it to take effect.".orange()}".green());
                    UI.Label("The coloring of rarity goes as follows:".green());
                    UI.HStack("Rarity".orange(), 1,
                              () => {
                        UI.Label("Trash".Rarity(RarityType.Trash).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Common".Rarity(RarityType.Common).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Uncommon".Rarity(RarityType.Uncommon).bold(), UI.rarityStyle, UI.Width(200));
                    },
                              () => {
                        UI.Space(3); UI.Label("Rare".Rarity(RarityType.Rare).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Epic".Rarity(RarityType.Epic).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Legendary".Rarity(RarityType.Legendary).bold(), UI.rarityStyle, UI.Width(200));
                    },
                              () => {
                        UI.Space(5); UI.Label("Mythic".Rarity(RarityType.Mythic).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Godly".Rarity(RarityType.Godly).bold(), UI.rarityStyle, UI.Width(200));
                        UI.Space(5); UI.Label("Notable".Rarity(RarityType.Notable).bold() + "*".orange().bold(), UI.rarityStyle, UI.Width(200));
                    },
                              () => {
                        UI.Space(3); UI.Label("*".orange().bold() + " Notable".Rarity(RarityType.Notable) + " denotes items that are deemed to be significant for plot reasons or have significant subtle properties".green(), UI.Width(615));
                    },
                              () => { }
                              );
                }

                // The following options let you configure loot filtering and auto sell levels:".green());
            },
#if false
                      () => UI.RarityGrid("Hide Level ", ref settings.lootFilterIgnore, 0, UI.AutoWidth()),
                      () => UI.RarityGrid("Auto Sell Level ", ref settings.lootFilterAutoSell, 0, UI.AutoWidth()),
#endif
                      () => { }
                      );
            UI.Div(0, 25);
            var isEmpty = true;
            UI.HStack("Loot Checklist", 1,
                      () => {
                var areaName = "";
                if (Main.IsInGame)
                {
                    areaName            = Game.Instance.CurrentlyLoadedArea.AreaDisplayName;
                    var areaPrivateName = Game.Instance.CurrentlyLoadedArea.name;
                    if (areaPrivateName != areaName)
                    {
                        areaName += $"\n({areaPrivateName})".yellow();
                    }
                }
                UI.Label(areaName.orange().bold(), UI.Width(300));
                UI.Label("Rarity: ".cyan(), UI.AutoWidth());
                UI.RarityGrid(ref settings.lootChecklistFilterRarity, 4, UI.AutoWidth());
            },
                      () => {
                UI.ActionTextField(
                    ref searchText,
                    "itemSearchText",
                    (text) => { },
                    () => { },
                    UI.Width(300));
                UI.Space(25); UI.Toggle("Show Friendly", ref settings.toggleLootChecklistFilterFriendlies);
                UI.Space(25); UI.Toggle("Blueprint", ref settings.toggleLootChecklistFilterBlueprint, UI.AutoWidth());
                UI.Space(25); UI.Toggle("Description", ref settings.toggleLootChecklistFilterDescription, UI.AutoWidth());
            },
                      () => {
                if (!Main.IsInGame)
                {
                    UI.Label("Not available in the Main Menu".orange()); return;
                }
                var presentGroups = LootHelper.GetMassLootFromCurrentArea().GroupBy(p => p.InteractionLoot != null ? "Containers" : "Units");
                var indent        = 3;
                using (UI.VerticalScope()) {
                    foreach (var group in presentGroups.Reverse())
                    {
                        var presents = group.AsEnumerable().OrderByDescending(p => {
                            var loot = p.GetLewtz(searchText);
                            if (loot.Count == 0)
                            {
                                return(0);
                            }
                            else
                            {
                                return((int)loot.Max(l => l.Rarity()));
                            }
                        });
                        var rarity = settings.lootChecklistFilterRarity;
                        var count  = presents.Where(p => p.Unit == null || (settings.toggleLootChecklistFilterFriendlies && !p.Unit.IsPlayersEnemy || p.Unit.IsPlayersEnemy) || (!settings.toggleLootChecklistFilterFriendlies && p.Unit.IsPlayersEnemy)).Count(p => p.GetLewtz(searchText).Lootable(rarity).Count() > 0);
                        UI.Label($"{group.Key.cyan()}: {count}");
                        UI.Div(indent);
                        foreach (var present in presents)
                        {
                            var pahtLewts = present.GetLewtz(searchText).Lootable(rarity).OrderByDescending(l => l.Rarity());
                            var unit      = present.Unit;
                            if (pahtLewts.Count() > 0 && (unit == null || (settings.toggleLootChecklistFilterFriendlies && !unit.IsPlayersEnemy || unit.IsPlayersEnemy) || (!settings.toggleLootChecklistFilterFriendlies && unit.IsPlayersEnemy)))
                            {
                                isEmpty = false;
                                UI.Div();
                                using (UI.HorizontalScope()) {
                                    UI.Space(indent);
                                    UI.Label($"{present.GetName()}".orange().bold(), UI.Width(325));
                                    if (present.InteractionLoot != null)
                                    {
                                        if (present.InteractionLoot?.Owner?.PerceptionCheckDC > 0)
                                        {
                                            UI.Label($" Perception DC: {present.InteractionLoot?.Owner?.PerceptionCheckDC}".green().bold(), UI.Width(125));
                                        }
                                        else
                                        {
                                            UI.Label($" Perception DC: NA".orange().bold(), UI.Width(125));
                                        }
                                        int?trickDc = present.InteractionLoot?.Owner?.Get <DisableDeviceRestrictionPart>()?.DC;
                                        if (trickDc > 0)
                                        {
                                            UI.Label($" Trickery DC: {trickDc}".green().bold(), UI.Width(125));
                                        }
                                        else
                                        {
                                            UI.Label($" Trickery DC: NA".orange().bold(), UI.Width(125));
                                        }
                                    }
                                    UI.Space(25);
                                    using (UI.VerticalScope()) {
                                        foreach (var lewt in pahtLewts)
                                        {
                                            var description = lewt.Blueprint.Description;
                                            var showBP      = settings.toggleLootChecklistFilterBlueprint;
                                            var showDesc    = settings.toggleLootChecklistFilterDescription && description != null && description.Length > 0;
                                            using (UI.HorizontalScope()) {
                                                //Main.Log($"rarity: {lewt.Blueprint.Rarity()} - color: {lewt.Blueprint.Rarity().color()}");
                                                UI.Label(lewt.Name.Rarity(lewt.Blueprint.Rarity()), showDesc || showBP ? UI.Width(350) : UI.AutoWidth());
                                                if (showBP)
                                                {
                                                    UI.Space(100); UI.Label(lewt.Blueprint.GetDisplayName().grey(), showDesc ? UI.Width(350) : UI.AutoWidth());
                                                }
                                                if (showDesc)
                                                {
                                                    UI.Space(100); UI.Label(description.StripHTML().green());
                                                }
                                            }
                                        }
                                    }
                                }
                                UI.Space(25);
                            }
                        }
                        UI.Space(25);
                    }
                }
            },
                      () => {
                if (isEmpty)
                {
                    using (UI.HorizontalScope()) {
                        UI.Label("No Loot Available".orange(), UI.AutoWidth());
                    }
                }
            }
                      );
        }