From 9e23f0acb659e647cb27dc9aad55c32ed500585b Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 7 Sep 2026 18:43:20 +0200 Subject: [PATCH] =?UTF-8?q?fix(vtank):=20slice=207=20round=20F=20item=202?= =?UTF-8?q?=20=E2=80=94=20hide=20tString=20settings=20from=20Advanced=20Op?= =?UTF-8?q?tions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Owner's second live look: "Buff_Profile banes and prots got duplicated. Only the one with ALL works as intended." BuffProfile-Prots/-Banes are tString rows (VtankOptionCatalog.DeclaredType == String); VTank's own Advanced Options list has NO case for tString at all (KB 01-settings-and-profiles.md, db.cs:132-166 for the list switch and :201-203 for the click handler — both "Not exposed"), so the hyphen rows never belonged in the list next to their real tEnum twins (BuffProfile_Prots/_Banes) — that mismatched pair is the "duplicate" the owner saw. FilteredAdvancedOptionNames now excludes every tString row (also catches BlacklistedSpellComps, the catalog's third tString entry); the enum rows stay listed and clickable exactly as before. tString settings are unaffected otherwise — still real, still settable via `/vt opt set`, only no longer rendered in this list. Mutation shown to fail first: the new AdvancedOptionListHidesTStringSettingsButKeepsTheirEnumCounterparts test asserted BuffProfile-Prots/-Banes/BlacklistedSpellComps absent and the two enum names present against the UNCHANGED filter — failed with "BuffProfile-Prots" found in the collection — then passed once FilteredAdvancedOptionNames gained the DeclaredType != String guard. MossTank suite 722 -> 723 (one new pin); App markup/plugin filter 258/258 (unaffected — no App-side markup change). Co-Authored-By: Claude Fable 5.1 --- src/AcDream.Plugins.MossTank/MossTankPanel.cs | 17 ++++++++++--- .../MossTankPanelTests.cs | 25 +++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/AcDream.Plugins.MossTank/MossTankPanel.cs b/src/AcDream.Plugins.MossTank/MossTankPanel.cs index 04a7a542..a29e64f6 100644 --- a/src/AcDream.Plugins.MossTank/MossTankPanel.cs +++ b/src/AcDream.Plugins.MossTank/MossTankPanel.cs @@ -552,9 +552,20 @@ internal sealed partial class MossTankPanel enabledMask |= VtankOptionCatalog.CategoryBits[i]; return VtankOptionCatalog.Names.Where(name => - !VtankDefaultSettingsDatabase.SettingCategoryBitmasks.TryGetValue(name, out int mask) - || mask == 0 - || (mask & enabledMask) != 0).ToArray(); + // Round F item 2 (owner's second live look: "Buff_Profile + // banes and prots got duplicated. Only the one with ALL + // works as intended."): VTank's own Advanced Options list + // has NO case for tString at all (KB 01, db.cs:132-166, + // :201-203 — "Not exposed"), so a tString row (the hyphen + // BuffProfile-Prots/-Banes, BlacklistedSpellComps) never + // belonged in this list — that mismatched twin next to the + // real tEnum row (BuffProfile_Prots/_Banes) is what read as + // a duplicate. tString settings stay real and settable via + // `/vt opt set`; they just never render here. + VtankOptionCatalog.DeclaredType(name) != VtankSettingValueType.String + && (!VtankDefaultSettingsDatabase.SettingCategoryBitmasks.TryGetValue(name, out int mask) + || mask == 0 + || (mask & enabledMask) != 0)).ToArray(); } /// diff --git a/tests/AcDream.Plugins.MossTank.Tests/MossTankPanelTests.cs b/tests/AcDream.Plugins.MossTank.Tests/MossTankPanelTests.cs index 2edb95e2..ec5bd067 100644 --- a/tests/AcDream.Plugins.MossTank.Tests/MossTankPanelTests.cs +++ b/tests/AcDream.Plugins.MossTank.Tests/MossTankPanelTests.cs @@ -1332,6 +1332,31 @@ public sealed class MossTankPanelTests Assert.Contains("EnableNav", panel.AdvancedOptionNames); } + [Fact] + public void AdvancedOptionListHidesTStringSettingsButKeepsTheirEnumCounterparts() + { + // Owner's second live look (2026-09-07): "Buff_Profile banes and + // prots got duplicated. Only the one with ALL works as intended." + // BuffProfile-Prots/BuffProfile-Banes are tString rows + // (VtankSettingValueType.String); VTank's own Advanced Options + // list has NO case for tString at all (KB 01, + // db.cs:132-166/:201-203 — "Not exposed"), so they never + // belonged in the list to begin with — that is the "duplicate" + // the owner saw, not a real second setting. Every tString row + // in the catalog (BuffProfile-Prots, BuffProfile-Banes, + // BlacklistedSpellComps) follows the same rule; the enum + // counterparts (BuffProfile_Prots/_Banes) stay listed and + // clickable exactly as before. + var panel = new MossTankPanel(new FakeHost(new FakeAutomation())); + + Assert.DoesNotContain("BuffProfile-Prots", panel.AdvancedOptionNames); + Assert.DoesNotContain("BuffProfile-Banes", panel.AdvancedOptionNames); + Assert.DoesNotContain("BlacklistedSpellComps", panel.AdvancedOptionNames); + + Assert.Contains("BuffProfile_Prots", panel.AdvancedOptionNames); + Assert.Contains("BuffProfile_Banes", panel.AdvancedOptionNames); + } + [Fact] public void AdvancedOptionCategoryEnabledIsNotTheMutableBackingArray() {