RynthCore/tools/SettingsLayoutTests/Program.cs

375 lines
27 KiB
C#

using System.Collections;
using System.Reflection;
namespace SettingsLayoutTests
{
// Reaches RynthCore.Engine's internal settings schema and QuickSettings by reflection. See the csproj.
internal static class Program
{
private static int _fails, _asserts;
private static void Check(bool cond, string msg)
{
_asserts++;
if (!cond) { _fails++; Console.WriteLine($" [FAIL] {msg}"); }
}
private const BindingFlags All = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance;
private static Assembly _engine = null!;
private static Type _schema = null!, _quick = null!;
private static IList Tabs => (IList)_schema.GetField("Tabs", All)!.GetValue(null)!;
private static string Name(object tab) => (string)tab.GetType().GetProperty("Name")!.GetValue(tab)!;
private static IList Rows(object tab) => (IList)tab.GetType().GetProperty("Rows")!.GetValue(tab)!;
private static string Label(object row) => (string?)row.GetType().GetProperty("Label")!.GetValue(row) ?? "";
private static string Kind(object row) => row.GetType().GetProperty("Kind")!.GetValue(row)!.ToString()!;
private static string? KeyOf(object row) => (string?)_quick.GetMethod("KeyOf", All)!.Invoke(null, new[] { row });
private static object? RowOf(string key) => _quick.GetMethod("RowOf", All)!.Invoke(null, new object[] { key });
private static IEnumerable<string> AllKeys()
{
foreach (object tab in Tabs)
foreach (object row in Rows(tab))
if (KeyOf(row) is { } key) yield return key;
}
private static int Main(string[] args)
{
_engine = Assembly.Load("RynthCore.Engine");
_schema = _engine.GetType("RynthCore.Engine.UI.Data.SettingsSchema", throwOnError: true)!;
_quick = _engine.GetType("RynthCore.Engine.UI.QuickSettings", throwOnError: true)!;
// -dump <file>: every pin key of this build's layout, one per line (how OldPinKeys.txt was made).
if (args.Length == 2 && args[0] == "-dump")
{
File.WriteAllLines(args[1], AllKeys());
Console.WriteLine($"wrote {AllKeys().Count()} keys to {args[1]}");
return 0;
}
TabList();
OldPins();
OldTabNames();
Moves();
HuntAndDirtyFighting();
LootProfileRow();
NavmeshViewRows();
return Finish();
}
// ── Settings > Navigation > Navmesh View: RynthNav's navmesh switches (2026-11-26) ─────────────
private static void NavmeshViewRows()
{
object? nav = Tabs.Cast<object>().FirstOrDefault(t => Name(t) == "Navigation");
Check(nav != null, "there is a Navigation tab");
if (nav == null) return;
List<object> rows = Rows(nav).Cast<object>().ToList();
int Index(string kind, string label) => rows.FindIndex(r => Kind(r) == kind && Label(r).Trim() == label);
// Right after Nav Marker Display (it ends with Guide Line), before Doors.
int guide = Index("Bool", "Guide Line"), section = Index("Section", "Navmesh View"), doors = Index("Section", "Doors");
Check(guide >= 0 && section > guide && doors > section, $"Navmesh View sits between Guide Line and Doors (Guide Line {guide}, Navmesh View {section}, Doors {doors})");
Check(section > guide && rows.Skip(guide + 1).Take(section - guide - 1).All(r => Kind(r) == "Spacer"), "...with only a spacer between Guide Line and it");
if (section < 0 || doors < 0) return;
List<object> mine = rows.Skip(section + 1).Take(doors - section - 1).ToList();
object? Mine(string kind, string label) => mine.FirstOrDefault(r => Kind(r) == kind && Label(r).Trim() == label);
double D(object row, string prop) => (double)row.GetType().GetProperty(prop)!.GetValue(row)!;
string? Tip(object row) => (string?)row.GetType().GetProperty("Tooltip")!.GetValue(row);
foreach (var (kind, label, min, max, step, tipStart) in new[]
{
("Bool", "Show Navmesh", 0.0, 0.0, 1.0, "Draw the navigation mesh in the world"),
("Bool", "Green Floor", 0, 0, 1, "The walkable ground, in green."),
("Bool", "Red Walls", 0, 0, 1, "Upright red strips along every edge nav will not cross."),
("Int", "Mesh Radius (m)", 10, 150, 10, "How far around you the mesh is drawn."),
("Int", "Mesh Detail (triangles)", 200, 7000, 500, "The most triangles the mesh may use."),
})
{
object? row = Mine(kind, label);
Check(row != null, $"Navmesh View has a {kind} row '{label}'");
if (row == null) continue;
if (kind == "Int") Check(D(row, "Min") == min && D(row, "Max") == max && D(row, "Step") == step, $"{label}: {min}..{max}, step {step} (the Go tab's)");
Check(Tip(row)?.StartsWith(tipStart, StringComparison.Ordinal) == true, $"{label}: the Go tab's tooltip");
Check(Tip(row)?.Contains("not in the RynthAi profile") == true, $"{label}: the tooltip says it is RynthNav's, not the profile's");
Check(KeyOf(row) == "Navigation/Navmesh View/" + label, $"{label} can be pinned under Navmesh View (got {KeyOf(row)})");
}
Check(mine.Count(r => Kind(r) is "Bool" or "Int") == 5, "five switches and steppers, no more");
// Without RynthNav (no status here): the rows hide and a note says why.
Type settings = _engine.GetType("RynthCore.Engine.UI.Data.RynthAiSettings", throwOnError: true)!;
object s = Activator.CreateInstance(settings, true)!;
bool Visible(object row) => (bool)row.GetType().GetMethod("IsVisible")!.Invoke(row, new[] { s })!;
Check(mine.Where(r => Kind(r) is "Bool" or "Int" or "Status").All(r => !Visible(r)), "no RynthNav: the switches, steppers and status line hide");
List<object> notes = mine.Where(r => Kind(r) == "Note" && Visible(r)).ToList();
Check(notes.Count == 1 && Label(notes[0]).Contains("RynthNav plugin"), $"...and one note says RynthNav is needed (got {string.Join(" | ", notes.Select(Label))})");
Check(Visible(rows[section]), "...under the Navmesh View heading, which stays");
double Get(object row) => (double)((Delegate)row.GetType().GetProperty("Get")!.GetValue(row)!).DynamicInvoke(s)!;
Check(Get(Mine("Bool", "Show Navmesh")!) == 0 && Get(Mine("Int", "Mesh Radius (m)")!) == 40 && Get(Mine("Int", "Mesh Detail (triangles)")!) == 3000,
"reading them with no RynthNav doesn't throw (off, RynthNav's defaults)");
// Not RynthAi settings: nothing about the mesh in the payload.
Type ctxType = _engine.GetType("RynthCore.Engine.UI.Data.RynthAiSettingsJsonContext", throwOnError: true)!;
object ctx = ctxType.GetProperty("Default", All)!.GetValue(null)!;
var info = (System.Text.Json.Serialization.Metadata.JsonTypeInfo)ctxType.GetProperty("RynthAiSettings", All)!.GetValue(ctx)!;
string json = System.Text.Json.JsonSerializer.Serialize(s, info);
Check(!json.Contains("Mesh", StringComparison.OrdinalIgnoreCase) && !json.Contains("Navmesh", StringComparison.OrdinalIgnoreCase),
"the RynthAi settings payload has no navmesh fields");
// The rules behind the rows (UI/Data/NavmeshView.cs).
Type view = _engine.GetType("RynthCore.Engine.UI.Data.NavmeshView", throwOnError: true)!;
Type statusType = _engine.GetType("RynthCore.Engine.UI.Data.RynthNavStatus", throwOnError: true)!;
object? Parse(string j) => statusType.GetMethod("Parse", All)!.Invoke(null, new object[] { j });
object? V(string name, params object?[] a) => view.GetMethod(name, All)!.Invoke(null, a);
object? older = Parse("{\"hasPose\":1}"), newer = Parse("{\"hasPose\":1,\"mesh\":{\"on\":1,\"floor\":0,\"walls\":1,\"radius\":70,\"triangles\":4200,\"drawn\":1840}}");
Check(older != null && newer != null, "RynthNav statuses parse");
Check(!(bool)V("Available", (object?)null)! && !(bool)V("Available", older)! && (bool)V("Available", newer)!, "the rows show only for a RynthNav that sends its mesh state (0.6.7+)");
Check(((string)V("Unavailable", older)!).Contains("0.6.7"), "an older RynthNav: the note says which version is needed");
Check((string)V("Unavailable", newer)! == "", "a new one: no note");
Check((bool)V("GetSwitch", newer, "Show Navmesh")! && !(bool)V("GetSwitch", newer, "Green Floor")! && (bool)V("GetSwitch", newer, "Red Walls")!, "the switches read RynthNav's on / floor / walls");
Check((string)V("Drawn", newer)! == "1840 triangles drawn now." && (string)V("Drawn", older)! == "", "the status line: triangles drawn while on");
Check((string)V("SwitchCommand", "Show Navmesh", true)! == "mesh on" && (string)V("SwitchCommand", "Show Navmesh", false)! == "mesh off", "Show Navmesh sends /rnav mesh on|off");
Check((string)V("SwitchCommand", "Green Floor", false)! == "mesh floor off" && (string)V("SwitchCommand", "Red Walls", true)! == "mesh walls on", "Green Floor / Red Walls send mesh floor|walls on|off");
Check((string)V("RadiusCommand", 70)! == "mesh radius 70" && (string)V("RadiusCommand", 999)! == "mesh radius 150" && (string)V("RadiusCommand", 0)! == "mesh radius 10", "Mesh Radius sends mesh radius N, 10..150");
Check((string)V("DetailCommand", 3700)! == "mesh triangles 3700" && (string)V("DetailCommand", 9000)! == "mesh triangles 7000" && (string)V("DetailCommand", 1)! == "mesh triangles 200", "Mesh Detail sends mesh triangles N, 200..7000");
Check((bool)V("IsMeshLabel", "Mesh Radius (m)")! && !(bool)V("IsMeshLabel", "Guide Line")! && !(bool)V("IsMeshLabel", (object?)null)!, "the drawer knows a pinned navmesh row");
}
// ── Settings > Looting's Loot Profile picker (2026-11-22) ──────────────────────────────
private static void LootProfileRow()
{
object? looting = Tabs.Cast<object>().FirstOrDefault(t => Name(t) == "Looting");
Check(looting != null, "there is a Looting tab");
if (looting == null) return;
object first = Rows(looting)[0]!;
Check(Label(first) == "Loot Profile" && Kind(first) == "Combo", $"Looting starts with the Loot Profile combo (got {Kind(first)} '{Label(first)}')");
Check(first.GetType().GetProperty("ItemsNow")!.GetValue(first) != null, "its list is asked for as it draws (RynthAi's, not a fixed one)");
Check(KeyOf(first) == "Looting//Loot Profile", $"it can be pinned to My settings (got {KeyOf(first)})");
// Which entry is the profile in use (UI/Data/LootProfilePick.cs).
Type pick = _engine.GetType("RynthCore.Engine.UI.Data.LootProfilePick", throwOnError: true)!;
int Index(string[]? items, string? path, int sel) => (int)pick.GetMethod("Index", All)!.Invoke(null, new object?[] { items, path, sel })!;
string[] list = { "None", "Alpha.utl", "beta.json", "Gamma.utl" };
Check(Index(list, "", 2) == 0, "no profile in use: None, whatever RynthAi's index says");
Check(Index(list, @"C:\Games\RynthSuite\RynthAi\LootProfiles\Gamma.utl", 0) == 3, "the file in use, by its name");
Check(Index(list, @"C:\x\BETA.JSON", 0) == 2, "any case, either extension");
Check(Index(list, "\"C:/x/Alpha.utl\" ", 0) == 1, "quotes, spaces and forward slashes");
Check(Index(list, @"C:\x\Elsewhere.utl", 2) == 2, "a file not listed: RynthAi's own index");
Check(Index(list, @"C:\x\Elsewhere.utl", 9) == 3 && Index(list, @"C:\x\Elsewhere.utl", -1) == 0, "...kept in range");
Check(Index(Array.Empty<string>(), @"C:\x\Alpha.utl", 2) == 0 && Index(null, "a.utl", 1) == 0, "no list yet: 0");
Check(Index(list, "None", 2) == 2, "a file called None is not the None entry");
}
// ── Hunt On Login and the Dirty Fighting rotation (rows added 2026-11-11, after the regroup) ──────
private static void HuntAndDirtyFighting()
{
Type settings = _engine.GetType("RynthCore.Engine.UI.Data.RynthAiSettings", throwOnError: true)!;
Type ctxType = _engine.GetType("RynthCore.Engine.UI.Data.RynthAiSettingsJsonContext", throwOnError: true)!;
object ctx = ctxType.GetProperty("Default", All)!.GetValue(null)!;
var info = (System.Text.Json.Serialization.Metadata.JsonTypeInfo)ctxType.GetProperty("RynthAiSettings", All)!.GetValue(ctx)!;
object Parse(string json) => System.Text.Json.JsonSerializer.Deserialize(json, info)!;
object? P(object s, string name) => settings.GetProperty(name, All)!.GetValue(s);
object? Row(string tab, string label)
{
foreach (object t in Tabs)
if (Name(t) == tab)
foreach (object r in Rows(t))
if (Label(r).Trim() == label) return r;
return null;
}
bool Visible(object row, object s) => (bool)row.GetType().GetMethod("IsVisible")!.Invoke(row, new[] { s })!;
double Get(object row, object s) => (double)((Delegate)row.GetType().GetProperty("Get")!.GetValue(row)!).DynamicInvoke(s)!;
void Set(object row, object s, double v) => ((Delegate)row.GetType().GetProperty("Set")!.GetValue(row)!).DynamicInvoke(s, v);
object? hunt = Row("General", "Hunt On Login"), patrol = Row("General", "Patrol On Login");
object? rot = Row("Combat", "Dirty Fighting rotation"), order = Row("Combat", "Effect order"), then = Row("Combat", "Then attack");
Check(hunt != null && patrol != null, "General has Patrol On Login and Hunt On Login");
Check(rot != null && order != null && then != null, "Combat has the Dirty Fighting rotation, its order and its Then attack");
if (hunt == null || patrol == null || rot == null || order == null || then == null) return;
Check(KeyOf(hunt) == "General/Starting Up/Hunt On Login", $"Hunt On Login sits under Starting Up (got {KeyOf(hunt)})");
Check(KeyOf(rot) == "Combat/Attack Power & Height/Dirty Fighting rotation", $"the rotation sits under Attack Power & Height (got {KeyOf(rot)})");
// A RynthAi that doesn't send them: the rows hide, and nothing is claimed.
object older = Parse("{\"PatrolOnLogin\":true}");
Check(!Visible(hunt, older) && !Visible(rot, older) && !Visible(order, older) && !Visible(then, older), "hidden for a RynthAi that doesn't send them");
Check(P(older, "HuntOnLogin") == null && P(older, "DfHeightRotation") == null, "...and their values stay null (a save leaves them alone)");
// One or the other, as RynthAi keeps them.
object s1 = Parse("{\"PatrolOnLogin\":true,\"HuntOnLogin\":false}");
Check(Visible(hunt, s1) && Get(hunt, s1) == 0, "Hunt On Login shows once RynthAi sends it");
Set(hunt, s1, 1);
Check((bool?)P(s1, "HuntOnLogin") == true && (bool)P(s1, "PatrolOnLogin")! == false, "ticking Hunt On Login clears Patrol On Login");
Set(patrol, s1, 1);
Check((bool)P(s1, "PatrolOnLogin")! && (bool?)P(s1, "HuntOnLogin") == false, "ticking Patrol On Login clears Hunt On Login");
Set(patrol, s1, 0);
Check(!(bool)P(s1, "PatrolOnLogin")! && (bool?)P(s1, "HuntOnLogin") == false, "unticking one leaves the other as it was");
object s2 = Parse("{\"PatrolOnLogin\":false}");
Set(patrol, s2, 1);
Check(P(s2, "HuntOnLogin") == null, "Patrol On Login with a RynthAi that has no Hunt On Login sends no Hunt On Login");
// The rotation: its two choices show while it's on; RynthAi's values both ways.
object d = Parse("{\"DfHeightRotation\":false,\"DfHeightOrder\":\"HML\",\"DfDefaultHeight\":-1}");
Check(Visible(rot, d) && !Visible(order, d) && !Visible(then, d), "the rotation shows; its order and Then attack only while it's on");
Set(rot, d, 1);
Check((bool?)P(d, "DfHeightRotation") == true && Visible(order, d) && Visible(then, d), "on: the order and Then attack show");
Check(Get(order, d) == 0 && Get(then, d) == 0, "HML is the first order; -1 is 'Attack Height setting'");
Set(order, d, 5);
Set(then, d, 3);
Check((string?)P(d, "DfHeightOrder") == "LMH" && (int?)P(d, "DfDefaultHeight") == 2, "the last order is LMH; High is 2");
object d2 = Parse("{\"DfHeightRotation\":true,\"DfHeightOrder\":\"mlh\",\"DfDefaultHeight\":0}");
Check(Get(order, d2) == 3 && Get(then, d2) == 1, "RynthAi's MLH (any case) and Low (0) read back as theirs");
var items = (string[])order.GetType().GetProperty("Items")!.GetValue(order)!;
Check(items.Length == 15 && items[0] == "High, Medium, Low" && items[5] == "Low, Medium, High" && items[6] == "High, Medium" && items[14] == "Low only",
"the order choices read as RynthAi's window shows them (one or two heights too, R-20261120-014055-59be)");
Set(order, d, 6);
Check((string?)P(d, "DfHeightOrder") == "HM", "two heights: HM");
object d3 = Parse("{\"DfHeightRotation\":true,\"DfHeightOrder\":\"L\",\"DfDefaultHeight\":-1}");
Check(Get(order, d3) == 14, "RynthAi's L reads back as Low only");
}
// ── The tabs, in order, and the sidebar's groups ───────────────────────────────
private static void TabList()
{
string[] want =
{
"Interface", "Game Client", "Hotkeys",
"General", "Recharge", "Combat", "Spell Combat", "Ranges", "Navigation", "Buffing", "Looting", "Inventory", "Vendoring",
"Diagnostics",
};
string[] got = Tabs.Cast<object>().Select(Name).ToArray();
Check(got.SequenceEqual(want), $"the tabs, in order (got {string.Join(", ", got)})");
var groups = new List<string>();
foreach (object tab in Tabs)
if (tab.GetType().GetProperty("Group")!.GetValue(tab) is string g) groups.Add(Name(tab) + "=" + g);
Check(groups.SequenceEqual(new[] { "Interface=RynthCore · this PC", "General=RynthAi · saved in the profile", "Diagnostics=Support" }),
$"the sidebar's three group headings sit over Interface, General and Diagnostics (got {string.Join("; ", groups)})");
// Every pinnable row has its own key (a duplicate would make two rows one pin).
var keys = AllKeys().ToList();
Check(keys.Count == keys.Distinct(StringComparer.OrdinalIgnoreCase).Count(),
"no two pinnable rows share a pin key: " + string.Join(", ", keys.GroupBy(k => k, StringComparer.OrdinalIgnoreCase).Where(g => g.Count() > 1).Select(g => g.Key)));
// No tab starts or ends on an empty heading, and no tab is empty.
foreach (object tab in Tabs)
{
IList rows = Rows(tab);
Check(rows.Count > 0, $"{Name(tab)} has rows");
if (rows.Count == 0) continue;
Check(Kind(rows[rows.Count - 1]!) is not ("Section" or "Spacer"), $"{Name(tab)} doesn't end on a heading or a spacer");
}
}
// ── Every pin of the old layout still finds its row ───────────────────────────
private static void OldPins()
{
string file = Path.Combine(AppContext.BaseDirectory, "OldPinKeys.txt");
Check(File.Exists(file), "OldPinKeys.txt is beside the test");
if (!File.Exists(file)) return;
string[] old = File.ReadAllLines(file).Where(l => l.Trim().Length > 0).ToArray();
Check(old.Length > 250, $"OldPinKeys.txt holds the old layout's keys ({old.Length})");
MethodInfo? migrate = _quick.GetMethod("MigrateKey", All);
Check(migrate != null, "QuickSettings.MigrateKey exists");
if (migrate == null) return;
string? Migrate(string k) => (string?)migrate.Invoke(null, new object[] { k });
// Rows taken out of the panel on purpose (their values stay in the payload).
var gone = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"Misc//Auto Cram", // the same switch as Inventory > Packs > Enable Autocram
"Recharge/Helper Settings (%) — NOT WIRED YET/Heal Others", // inert sliders: hidden until they do something
"Recharge/Helper Settings (%) — NOT WIRED YET/Re-stam Others",
"Recharge/Helper Settings (%) — NOT WIRED YET/Infuse Others",
};
int moved = 0;
foreach (string key in old)
{
string? now = Migrate(key);
if (gone.Contains(key))
{
// Auto Cram's pin goes to the one Autocram switch left; the inert sliders' pins go nowhere.
if (key == "Misc//Auto Cram") Check(now != null && RowOf(now) is { } r && Label(r) == "Enable Autocram", $"{key} -> Enable Autocram (got {now})");
else Check(now == null, $"{key}: its row is gone, so the pin leads nowhere (got {now})");
continue;
}
// Labels and sections can hold '/', so the old key must end with the row's whole label.
object? row = now == null ? null : RowOf(now);
Check(row != null && key.EndsWith("/" + Label(row).Trim(), StringComparison.Ordinal) && now!.EndsWith("/" + Label(row).Trim(), StringComparison.Ordinal),
$"{key} -> the row with the same label (got {now ?? "nothing"})");
if (now != null && !string.Equals(now, key, StringComparison.OrdinalIgnoreCase)) moved++;
}
Check(moved > 80, $"a good share of the old keys moved ({moved})");
// The owner's two pins (2026-11-11), by name.
Check(Migrate("Misc//Video patch") == "Game Client/Performance/Video patch", "Misc//Video patch -> Game Client/Performance/Video patch");
Check(Migrate("Spell Combat/Ring Spell Override/Min Ring Targets") == "Spell Combat/Ring Spell Override/Min Ring Targets", "a pin that didn't move stays as it is");
Check(Migrate("Nowhere/At All/Nothing") == null, "a key no layout ever had leads nowhere (kept in the file, not drawn)");
}
// ── /rc settings <old name> still opens the tab ───────────────────────────────
private static void OldTabNames()
{
MethodInfo? find = _schema.GetMethod("FindTab", All);
Check(find != null, "SettingsSchema.FindTab exists");
if (find == null) return;
string? Find(string n) => find.Invoke(null, new object[] { n }) is { } t ? Name(t) : null;
foreach (var (from, to) in new[]
{
("Display", "Interface"), ("ui", "Interface"), ("misc", "General"), ("Melee Combat", "Combat"), ("melee", "Combat"),
("Crafting", "Combat"), ("interface", "Interface"), ("game client", "Game Client"), ("inventory", "Inventory"),
("buffing", "Buffing"), ("Hotkeys", "Hotkeys"), ("Diagnostics", "Diagnostics"),
})
Check(Find(from) == to, $"'{from}' opens {to} (got {Find(from) ?? "nothing"})");
Check(Find("No Such Tab") == null, "an unknown name opens nothing");
}
// ── Where a few rows went (the ones other code finds by tab or label) ─────────
private static void Moves()
{
string? Where(string label)
{
foreach (object tab in Tabs)
foreach (object row in Rows(tab))
if (Label(row).Trim() == label && KeyOf(row) is { } k) return k;
return null;
}
foreach (var (label, key) in new[]
{
("Hide retail radar", "Interface/Hide The Game's Own/Hide retail radar"),
("Lock your vitals plate", "Interface/Your Vitals/Lock your vitals plate"),
("Borderless Windowed", "Game Client/Game Window/Borderless Windowed"),
("Insert Key Releases the UI", "Hotkeys//Insert Key Releases the UI"),
("Enable FPS Limit", "Game Client/Performance/Enable FPS Limit"),
("Close Client on Server Disconnect", "Game Client/Disconnects And Updates/Close Client on Server Disconnect"),
("Vaulted Dungeons", "General/Server Features/Vaulted Dungeons"),
("Auto Fellowship Management", "General/Fellowship/Auto Fellowship Management"),
("Stop Macro On Death", "General/Safety Stops/Stop Macro On Death"),
("Recall On Death", "General/On Death/Recall On Death"),
("Buff Spell Interval (ms)", "Buffing//Buff Spell Interval (ms)"),
("Use Buff Items", "Buffing//Use Buff Items"),
("Targeting", "Combat/Targeting/Targeting"),
("Attempts Before Blacklist", "Combat/Targeting/Attempts Before Blacklist"),
("Enable Raycasting", "Combat/Line Of Sight/Enable Raycasting"),
("Show Line of Sight", "Combat/Line Of Sight/Show Line of Sight"), // 2026-11-26, next to Enable Raycasting
("Magic Response", "Combat/Hitting the Environment/Magic Response"),
("Enable Missile Crafting", "Combat/Missile Ammo Crafting/Enable Missile Crafting"),
("Enable Autostack", "Inventory/Packs/Enable Autostack"),
("Give Interval (ms)", "Inventory/Giving And Trading/Give Interval (ms)"),
("Describe Items When Selected", "Inventory/Item Info/Describe Items When Selected"),
("Monster Range", "Ranges/Standard Ranges (Yards)/Monster Range"),
("Corpse Max (yd)", "Ranges/Corpse Acquisition (Yards)/Corpse Max (yd)"),
("Coverage", "Navigation/Dungeon Patrol/Coverage"),
})
Check(Where(label) == key, $"{label} is at {key} (got {Where(label) ?? "nothing"})");
Check(Where("Auto Cram") == null, "the duplicate Auto Cram row is gone (Inventory > Packs > Enable Autocram stays)");
Check(Where("Heal Others") == null, "the inert Helper sliders are hidden");
}
private static int Finish()
{
Console.WriteLine(_fails == 0 ? $"PASS ({_asserts} checks)" : $"FAIL: {_fails} of {_asserts} checks");
return _fails == 0 ? 0 : 1;
}
}
}