RynthSuite as of 2026-11-05 (internal a77109a): release 2026.11.3.2
This commit is contained in:
parent
d02690c0d2
commit
7166d256ce
62 changed files with 330 additions and 17 deletions
|
|
@ -211,6 +211,14 @@ internal sealed class HudController
|
||||||
_combat.OnLogout();
|
_combat.OnLogout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// What the character carries, from a walk of the client's own pack contents (the loot step's
|
||||||
|
/// Keep # count reads the same). The cache's inventory set, kept up from object events, drifts over
|
||||||
|
/// a long session: after 10+ hours of macro the HUD showed 1 healing kit of 4 and 4 mana stones of
|
||||||
|
/// 6 (report R-20261103-125252-251c, 2026-11-03).
|
||||||
|
/// </summary>
|
||||||
|
private static IEnumerable<WorldObject> Carried(WorldObjectCache cache) => cache.GetDirectInventory();
|
||||||
|
|
||||||
/// <summary>Aggregates the pack by item name and refreshes pinned entries' icon / WCID.</summary>
|
/// <summary>Aggregates the pack by item name and refreshes pinned entries' icon / WCID.</summary>
|
||||||
private void RebuildPack()
|
private void RebuildPack()
|
||||||
{
|
{
|
||||||
|
|
@ -219,7 +227,7 @@ internal sealed class HudController
|
||||||
|
|
||||||
var byName = new Dictionary<string, HudPackRow>(StringComparer.OrdinalIgnoreCase);
|
var byName = new Dictionary<string, HudPackRow>(StringComparer.OrdinalIgnoreCase);
|
||||||
var seen = new HashSet<int>();
|
var seen = new HashSet<int>();
|
||||||
foreach (var wo in cache.GetInventory())
|
foreach (var wo in Carried(cache))
|
||||||
{
|
{
|
||||||
if (wo == null || string.IsNullOrWhiteSpace(wo.Name)) continue;
|
if (wo == null || string.IsNullOrWhiteSpace(wo.Name)) continue;
|
||||||
seen.Add(wo.Id);
|
seen.Add(wo.Id);
|
||||||
|
|
@ -270,7 +278,7 @@ internal sealed class HudController
|
||||||
if (entry.IsEmpty) return;
|
if (entry.IsEmpty) return;
|
||||||
var cache = _cache();
|
var cache = _cache();
|
||||||
if (cache == null || !_host.HasUseObject) return;
|
if (cache == null || !_host.HasUseObject) return;
|
||||||
var inv = cache.GetInventory().Where(w => w != null).ToList();
|
var inv = Carried(cache).Where(w => w != null).ToList();
|
||||||
var wo = inv.FirstOrDefault(w => w.Name.Equals(entry.Name, StringComparison.OrdinalIgnoreCase))
|
var wo = inv.FirstOrDefault(w => w.Name.Equals(entry.Name, StringComparison.OrdinalIgnoreCase))
|
||||||
?? (entry.Wcid != 0 ? inv.FirstOrDefault(w => Wcid(w) == entry.Wcid) : null);
|
?? (entry.Wcid != 0 ? inv.FirstOrDefault(w => Wcid(w) == entry.Wcid) : null);
|
||||||
if (wo == null) { Chat($"[RynthAi] No {entry.Name} in your pack."); return; }
|
if (wo == null) { Chat($"[RynthAi] No {entry.Name} in your pack."); return; }
|
||||||
|
|
@ -280,7 +288,7 @@ internal sealed class HudController
|
||||||
|
|
||||||
/// <summary>Carried item by object id, or null.</summary>
|
/// <summary>Carried item by object id, or null.</summary>
|
||||||
private WorldObject? PackItem(int id)
|
private WorldObject? PackItem(int id)
|
||||||
=> id == 0 ? null : _cache()?.GetInventory().FirstOrDefault(w => w != null && w.Id == id);
|
=> id == 0 || _cache() is not WorldObjectCache cache ? null : Carried(cache).FirstOrDefault(w => w != null && w.Id == id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remembers the last pack item selected in the game (native inventory, or the RynthCore
|
/// Remembers the last pack item selected in the game (native inventory, or the RynthCore
|
||||||
|
|
|
||||||
|
|
@ -333,10 +333,15 @@ internal sealed class LegacyAdvancedSettingsUi
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGui.Checkbox("Auto Cram", ref _settings.EnableAutocram);
|
ImGui.BeginDisabled(_settings.AutoSortOn);
|
||||||
if (ImGui.IsItemHovered())
|
bool cramShown = _settings.EnableAutocram && !_settings.AutoSortOn;
|
||||||
|
if (ImGui.Checkbox("Auto Cram", ref cramShown)) _settings.EnableAutocram = cramShown;
|
||||||
|
ImGui.EndDisabled();
|
||||||
|
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||||
{
|
{
|
||||||
ImGui.SetTooltip("Automatically moves items from your main pack into side packs.\nNote: recently used weapons stay in the main pack.");
|
ImGui.SetTooltip(_settings.AutoSortOn
|
||||||
|
? "Off while RynthSort's auto-sort is on: RynthSort keeps your packs sorted, and the two fight."
|
||||||
|
: "Automatically moves items from your main pack into side packs.\nNote: recently used weapons stay in the main pack.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
@ -1142,7 +1147,12 @@ internal sealed class LegacyAdvancedSettingsUi
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
ImGui.Text("Inventory Management");
|
ImGui.Text("Inventory Management");
|
||||||
ImGui.Checkbox("Enable Autostack", ref _settings.EnableAutostack);
|
ImGui.Checkbox("Enable Autostack", ref _settings.EnableAutostack);
|
||||||
ImGui.Checkbox("Enable Autocram", ref _settings.EnableAutocram);
|
ImGui.BeginDisabled(_settings.AutoSortOn);
|
||||||
|
bool cramShown2 = _settings.EnableAutocram && !_settings.AutoSortOn;
|
||||||
|
if (ImGui.Checkbox("Enable Autocram", ref cramShown2)) _settings.EnableAutocram = cramShown2;
|
||||||
|
ImGui.EndDisabled();
|
||||||
|
if (_settings.AutoSortOn && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||||
|
ImGui.SetTooltip("Off while RynthSort's auto-sort is on: RynthSort keeps your packs sorted, and the two fight.");
|
||||||
ImGui.Checkbox("Combine Salvage Bags", ref _settings.EnableCombineSalvage);
|
ImGui.Checkbox("Combine Salvage Bags", ref _settings.EnableCombineSalvage);
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
ImGui.SetTooltip("After the salvage queue empties, move same-name bags together so the server merges them.");
|
ImGui.SetTooltip("After the salvage queue empties, move same-name bags together so the server merges them.");
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,15 @@ internal sealed partial class LegacyDashboardRenderer
|
||||||
// ── Per-character settings persistence ───────────────────────────────────
|
// ── Per-character settings persistence ───────────────────────────────────
|
||||||
private string _charFolder = string.Empty;
|
private string _charFolder = string.Empty;
|
||||||
private string _settingsFilePath = string.Empty;
|
private string _settingsFilePath = string.Empty;
|
||||||
|
// The character's profile is in memory (LoadSettings finished; cleared at logout). Until then the
|
||||||
|
// settings here are the built-in defaults, and they must never reach the engine or be taken back
|
||||||
|
// from it: after an engine hot reload the engine read them, and the next click in its dashboard
|
||||||
|
// sent the whole default copy back, which was applied and saved over the profile (2026-11-05, and
|
||||||
|
// the same way raycasting kept turning off).
|
||||||
|
private volatile bool _profileLoaded;
|
||||||
|
|
||||||
|
/// <summary>The character's profile is loaded: settings may be read and changed from outside.</summary>
|
||||||
|
public bool ProfileLoaded => _profileLoaded;
|
||||||
private string _lastSavedJson = string.Empty;
|
private string _lastSavedJson = string.Empty;
|
||||||
|
|
||||||
private Vector2 _expandedSize = new(430, 452);
|
private Vector2 _expandedSize = new(430, 452);
|
||||||
|
|
@ -505,6 +514,7 @@ internal sealed partial class LegacyDashboardRenderer
|
||||||
try { CaptureTransientUiState(); _lastSavedJson = JsonSerializer.Serialize(_settings, RynthAiJsonContext.Default.LegacyUiSettings); }
|
try { CaptureTransientUiState(); _lastSavedJson = JsonSerializer.Serialize(_settings, RynthAiJsonContext.Default.LegacyUiSettings); }
|
||||||
catch { _lastSavedJson = string.Empty; }
|
catch { _lastSavedJson = string.Empty; }
|
||||||
}
|
}
|
||||||
|
_profileLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -515,6 +525,7 @@ internal sealed partial class LegacyDashboardRenderer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ResetCharacterSession()
|
public void ResetCharacterSession()
|
||||||
{
|
{
|
||||||
|
_profileLoaded = false;
|
||||||
_charFolder = string.Empty;
|
_charFolder = string.Empty;
|
||||||
_settingsFilePath = string.Empty;
|
_settingsFilePath = string.Empty;
|
||||||
_lastSavedJson = string.Empty;
|
_lastSavedJson = string.Empty;
|
||||||
|
|
@ -613,6 +624,7 @@ internal sealed partial class LegacyDashboardRenderer
|
||||||
// DXVK change, the launcher's stuck-client kill) left a cut-off file that then loaded
|
// DXVK change, the launcher's stuck-client kill) left a cut-off file that then loaded
|
||||||
// as defaults.
|
// as defaults.
|
||||||
string tmp = path + "." + Environment.ProcessId + ".tmp";
|
string tmp = path + "." + Environment.ProcessId + ".tmp";
|
||||||
|
KeepDailyCopy(path);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File.WriteAllText(tmp, json);
|
File.WriteAllText(tmp, json);
|
||||||
|
|
@ -628,6 +640,31 @@ internal sealed partial class LegacyDashboardRenderer
|
||||||
/// <summary>The last good profile kept by each save (profile path + this).</summary>
|
/// <summary>The last good profile kept by each save (profile path + this).</summary>
|
||||||
internal const string BackupSuffix = ".bak";
|
internal const string BackupSuffix = ".bak";
|
||||||
|
|
||||||
|
/// <summary>Daily copies kept of each profile (profile path + ".yyyy-MM-dd.bak").</summary>
|
||||||
|
internal const int DailyCopiesKept = 7;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The first save of a day keeps the profile as it was (Default.json.2026-11-05.bak), the last
|
||||||
|
/// <see cref="DailyCopiesKept"/> days kept: .bak alone is the save before, so a reset that was saved
|
||||||
|
/// twice left nothing to go back to (2026-11-05). Best effort: a copy that fails never stops the save.
|
||||||
|
/// </summary>
|
||||||
|
internal static void KeepDailyCopy(string path)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!File.Exists(path)) return;
|
||||||
|
string today = path + "." + RynthClock.Now.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture) + BackupSuffix;
|
||||||
|
if (File.Exists(today)) return;
|
||||||
|
File.Copy(path, today);
|
||||||
|
string dir = Path.GetDirectoryName(path)!, name = Path.GetFileName(path);
|
||||||
|
var old = Directory.GetFiles(dir, name + ".????-??-??" + BackupSuffix);
|
||||||
|
Array.Sort(old, StringComparer.Ordinal);
|
||||||
|
for (int i = 0; i < old.Length - DailyCopiesKept; i++)
|
||||||
|
try { File.Delete(old[i]); } catch { }
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Reads and parses a settings profile; false (with the reason) when it's missing or doesn't parse.</summary>
|
/// <summary>Reads and parses a settings profile; false (with the reason) when it's missing or doesn't parse.</summary>
|
||||||
private static bool TryReadProfile(string path, out LegacyUiSettings? settings, out string json, out string error)
|
private static bool TryReadProfile(string path, out LegacyUiSettings? settings, out string json, out string error)
|
||||||
{
|
{
|
||||||
|
|
@ -1234,6 +1271,7 @@ internal sealed partial class LegacyDashboardRenderer
|
||||||
TargetFPSFocused = s.TargetFPSFocused,
|
TargetFPSFocused = s.TargetFPSFocused,
|
||||||
TargetFPSBackground = s.TargetFPSBackground,
|
TargetFPSBackground = s.TargetFPSBackground,
|
||||||
EnableAutocram = s.EnableAutocram,
|
EnableAutocram = s.EnableAutocram,
|
||||||
|
AutoSortOn = s.AutoSortOn,
|
||||||
PeaceModeWhenIdle = s.PeaceModeWhenIdle,
|
PeaceModeWhenIdle = s.PeaceModeWhenIdle,
|
||||||
RearmAfterVitals = s.RearmAfterVitals,
|
RearmAfterVitals = s.RearmAfterVitals,
|
||||||
StartMacroOnLogin = s.StartMacroOnLogin,
|
StartMacroOnLogin = s.StartMacroOnLogin,
|
||||||
|
|
@ -1465,6 +1503,13 @@ internal sealed partial class LegacyDashboardRenderer
|
||||||
public void ApplySettingsJson(string json)
|
public void ApplySettingsJson(string json)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(json)) return;
|
if (string.IsNullOrWhiteSpace(json)) return;
|
||||||
|
if (!_profileLoaded)
|
||||||
|
{
|
||||||
|
// Nothing from outside lands on the defaults held before the profile loads (they'd be saved
|
||||||
|
// over it once it does): the engine's copy then can only be the defaults it read.
|
||||||
|
try { _host.Log("[RynthAi] Settings: a settings change from the engine came before this character's profile loaded; ignored."); } catch { }
|
||||||
|
return;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Lay the sent fields over the current settings, so a field the sender leaves
|
// Lay the sent fields over the current settings, so a field the sender leaves
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,11 @@ public sealed class LegacyUiSettings
|
||||||
{
|
{
|
||||||
// ── Runtime-only state — never persisted ────────────────────────────────
|
// ── Runtime-only state — never persisted ────────────────────────────────
|
||||||
[JsonIgnore] public bool IsMacroRunning;
|
[JsonIgnore] public bool IsMacroRunning;
|
||||||
|
/// <summary>
|
||||||
|
/// RynthSort's auto-sort is on (read from RynthSort every couple of seconds): Auto Cram stands down and
|
||||||
|
/// its checkboxes are greyed out, as the two fought over the packs (owner, 2026-11-03). Never saved.
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore] public bool AutoSortOn;
|
||||||
/// <summary>Meta state — set only by meta actions (SetState, CallState, ReturnFromCall, UI, meta load).</summary>
|
/// <summary>Meta state — set only by meta actions (SetState, CallState, ReturnFromCall, UI, meta load).</summary>
|
||||||
[JsonIgnore] public string CurrentState = "Default";
|
[JsonIgnore] public string CurrentState = "Default";
|
||||||
/// <summary>Bot action state — what the bot is doing right now (Default, Combat, Looting, Navigating, Buffing).
|
/// <summary>Bot action state — what the bot is doing right now (Default, Combat, Looting, Navigating, Buffing).
|
||||||
|
|
@ -1172,6 +1177,8 @@ public sealed class SettingsBridgePayload
|
||||||
public int TargetFPSFocused { get; set; }
|
public int TargetFPSFocused { get; set; }
|
||||||
public int TargetFPSBackground { get; set; }
|
public int TargetFPSBackground { get; set; }
|
||||||
public bool EnableAutocram { get; set; }
|
public bool EnableAutocram { get; set; }
|
||||||
|
/// <summary>RynthSort's auto-sort is on: the engine greys out Auto Cram (sent, never read back).</summary>
|
||||||
|
public bool AutoSortOn { get; set; }
|
||||||
public bool PeaceModeWhenIdle { get; set; }
|
public bool PeaceModeWhenIdle { get; set; }
|
||||||
// Optional: an engine without the row doesn't send it, and that must not turn it off.
|
// Optional: an engine without the row doesn't send it, and that must not turn it off.
|
||||||
public bool? RearmAfterVitals { get; set; }
|
public bool? RearmAfterVitals { get; set; }
|
||||||
|
|
@ -1190,7 +1197,7 @@ public sealed class SettingsBridgePayload
|
||||||
public float? OutdoorHuntRadius { get; set; }
|
public float? OutdoorHuntRadius { get; set; }
|
||||||
// Absent from an older engine's payload: must not read as off.
|
// Absent from an older engine's payload: must not read as off.
|
||||||
public bool YieldToVTank { get; set; } = true;
|
public bool YieldToVTank { get; set; } = true;
|
||||||
public bool EnableRaycasting { get; set; }
|
public bool EnableRaycasting { get; set; } = true; // on unless the player turns it off (2026-11-05)
|
||||||
public bool UseArcs { get; set; }
|
public bool UseArcs { get; set; }
|
||||||
public float BowArcVelocity { get; set; }
|
public float BowArcVelocity { get; set; }
|
||||||
public float CrossbowArcVelocity { get; set; }
|
public float CrossbowArcVelocity { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,9 @@ public sealed class InventoryManager
|
||||||
|
|
||||||
private bool ProcessAutoCram(List<WorldObject> inv, int playerId)
|
private bool ProcessAutoCram(List<WorldObject> inv, int playerId)
|
||||||
{
|
{
|
||||||
if (!_settings.EnableAutocram && !ManualCram) return false;
|
// RynthSort's auto-sort on: it owns the packs, and Auto Cram moving items back out of the main pack
|
||||||
|
// fought it (owner, 2026-11-03). A cram asked for by hand (/ra cram) still runs.
|
||||||
|
if ((!_settings.EnableAutocram || _settings.AutoSortOn) && !ManualCram) return false;
|
||||||
|
|
||||||
int crammable = 0;
|
int crammable = 0;
|
||||||
foreach (var item in inv)
|
foreach (var item in inv)
|
||||||
|
|
|
||||||
|
|
@ -683,7 +683,11 @@ public static unsafe class PluginExports
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string json = Runtime.Plugin?.DashboardRenderer?.BuildSettingsJson() ?? "{}";
|
// Nothing until the character's profile is loaded (not "{}": the engine read that as a full
|
||||||
|
// settings copy of its own defaults, and its next save wrote them over the profile, 2026-11-05).
|
||||||
|
var renderer = Runtime.Plugin?.DashboardRenderer;
|
||||||
|
if (renderer == null || !renderer.ProfileLoaded) return IntPtr.Zero;
|
||||||
|
string json = renderer.BuildSettingsJson();
|
||||||
IntPtr newPtr = Marshal.StringToHGlobalAnsi(json);
|
IntPtr newPtr = Marshal.StringToHGlobalAnsi(json);
|
||||||
IntPtr oldPtr = Interlocked.Exchange(ref _settingsPtr, newPtr);
|
IntPtr oldPtr = Interlocked.Exchange(ref _settingsPtr, newPtr);
|
||||||
if (oldPtr != IntPtr.Zero)
|
if (oldPtr != IntPtr.Zero)
|
||||||
|
|
|
||||||
|
|
@ -105,10 +105,12 @@ public sealed partial class RynthAiPlugin
|
||||||
_dashboard?.RefreshDashboardVitals();
|
_dashboard?.RefreshDashboardVitals();
|
||||||
_dashFight = ReadFightTarget(_dashFight);
|
_dashFight = ReadFightTarget(_dashFight);
|
||||||
}
|
}
|
||||||
if (shown && now >= _nextDashSortMs)
|
if (now >= _nextDashSortMs)
|
||||||
{
|
{
|
||||||
_nextDashSortMs = now + 500;
|
// Twice a second for the dashboard's key; every 2 s otherwise, for Auto Cram (AutoSortOn).
|
||||||
|
_nextDashSortMs = now + (shown ? 500 : 2000);
|
||||||
_dashSort = ReadAutoSort();
|
_dashSort = ReadAutoSort();
|
||||||
|
if (_dashboard?.Settings is { } sortSettings) sortSettings.AutoSortOn = _dashSort == 1;
|
||||||
}
|
}
|
||||||
if (now >= _nextDashClassicMs)
|
if (now >= _nextDashClassicMs)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -459,9 +459,14 @@ internal static class AutoVendorPlanner
|
||||||
if (chosen.Count < 1)
|
if (chosen.Count < 1)
|
||||||
{
|
{
|
||||||
int newStack = unit > 0 ? (int)Math.Floor((p.FreeMainSlots - 2) * (double)Math.Max(1, p.PyrealStackSize) / unit) : 0;
|
int newStack = unit > 0 ? (int)Math.Floor((p.FreeMainSlots - 2) * (double)Math.Max(1, p.PyrealStackSize) / unit) : 0;
|
||||||
|
// A partial sold whole frees its own slot for the pyreals, so it may be one slot's worth
|
||||||
|
// bigger than a split: the stack a split just made took a slot, and judged against the
|
||||||
|
// split's own margin it no longer fitted, was merged back, and the split came again
|
||||||
|
// until the 8-try stop left the last stack of peas unsold (2026-11-05).
|
||||||
|
int sellWholeUpTo = unit > 0 ? (int)Math.Floor((p.FreeMainSlots - 1) * (double)Math.Max(1, p.PyrealStackSize) / unit) : 0;
|
||||||
newStack = Math.Min(newStack, stack - 1);
|
newStack = Math.Min(newStack, stack - 1);
|
||||||
if (newStack > 0)
|
if (newStack > 0)
|
||||||
return SplitClean(v, sells, item, newStack, "the pyreals for the whole stack won't fit");
|
return SplitClean(v, sells, item, newStack, "the pyreals for the whole stack won't fit", sellWholeUpTo);
|
||||||
return VendorPlan.Fatal($"AutoVendor Fatal - No inventory room to sell {item.Name}");
|
return VendorPlan.Fatal($"AutoVendor Fatal - No inventory room to sell {item.Name}");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -535,7 +540,10 @@ internal static class AutoVendorPlanner
|
||||||
/// fits, else split from it (nothing else partial for the new stack to join); with none, split as
|
/// fits, else split from it (nothing else partial for the new stack to join); with none, split as
|
||||||
/// asked. An unknown max stack size keeps the old plain split.
|
/// asked. An unknown max stack size keeps the old plain split.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static VendorPlan SplitClean(VendorView v, IReadOnlyList<SellItem> sells, SellItem item, int amount, string why)
|
/// <param name="sellWholeUpTo">The biggest partial that can be sold whole (its own slot counted free; at
|
||||||
|
/// least <paramref name="amount"/>), else <paramref name="amount"/>.</param>
|
||||||
|
internal static VendorPlan SplitClean(VendorView v, IReadOnlyList<SellItem> sells, SellItem item, int amount, string why,
|
||||||
|
int sellWholeUpTo = -1)
|
||||||
{
|
{
|
||||||
if (item.MaxStack <= 1)
|
if (item.MaxStack <= 1)
|
||||||
return VendorPlan.Split(item, amount, why);
|
return VendorPlan.Split(item, amount, why);
|
||||||
|
|
@ -547,7 +555,8 @@ internal static class AutoVendorPlanner
|
||||||
|
|
||||||
// A partial that fits is sold whole first: the stack a split just made, or any leftover. (Merging
|
// A partial that fits is sold whole first: the stack a split just made, or any leftover. (Merging
|
||||||
// it back instead looped split-merge-split three times a second, 2026-10-19.)
|
// it back instead looped split-merge-split three times a second, 2026-10-19.)
|
||||||
SellItem? fits = partials.FirstOrDefault(s => s.StackSize <= amount);
|
int wholeUpTo = Math.Max(amount, sellWholeUpTo);
|
||||||
|
SellItem? fits = partials.FirstOrDefault(s => s.StackSize <= wholeUpTo);
|
||||||
if (fits != null)
|
if (fits != null)
|
||||||
return new VendorPlan { Kind = PlanKind.Sell, Sells = new List<SellItem> { fits }, Total = VendorPays(v, fits.IsNote, fits.Value) };
|
return new VendorPlan { Kind = PlanKind.Sell, Sells = new List<SellItem> { fits }, Total = VendorPays(v, fits.IsNote, fits.Value) };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ internal sealed class SlopeOverlay
|
||||||
|
|
||||||
public void Submit(TickContext ctx)
|
public void Submit(TickContext ctx)
|
||||||
{
|
{
|
||||||
if (!_settings.ShowUnclimbableSlopes || ctx.Terrain == null || !ctx.OnLandscape)
|
if (!_settings.ShowUnclimbableSlopes || ctx.Terrain == null || !ctx.OnLandscape || ctx.Indoors)
|
||||||
return;
|
return;
|
||||||
if (!_host.HasNav3DTriangle) // requires API v60+
|
if (!_host.HasNav3DTriangle) // requires API v60+
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,12 @@ internal sealed class TickContext
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool OnLandscape;
|
public bool OnLandscape;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True inside a building or dungeon cell (EnvCell). The terrain under a building runs
|
||||||
|
/// through its floors, so the slope and water overlays stay off there.
|
||||||
|
/// </summary>
|
||||||
|
public bool Indoors => (CellId & 0xFFFF) >= 0x100;
|
||||||
|
|
||||||
/// <summary>The terrain around the player, or null while terrain data isn't loaded.</summary>
|
/// <summary>The terrain around the player, or null while terrain data isn't loaded.</summary>
|
||||||
public LandblockWindow? Terrain;
|
public LandblockWindow? Terrain;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ internal sealed class WaterOverlay
|
||||||
|
|
||||||
public void Submit(TickContext ctx)
|
public void Submit(TickContext ctx)
|
||||||
{
|
{
|
||||||
if (!_settings.ShowImpassableWater || ctx.Terrain == null || !ctx.OnLandscape)
|
if (!_settings.ShowImpassableWater || ctx.Terrain == null || !ctx.OnLandscape || ctx.Indoors)
|
||||||
return;
|
return;
|
||||||
if (!_host.HasNav3DTriangle) // requires API v60+
|
if (!_host.HasNav3DTriangle) // requires API v60+
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -410,6 +410,20 @@ internal static class Program
|
||||||
Eq(justSplit2.Kind, PlanKind.Sell, "same with a full stack first");
|
Eq(justSplit2.Kind, PlanKind.Sell, "same with a full stack first");
|
||||||
Eq(justSplit2.Sells.Single().Id, 3u, "the 38");
|
Eq(justSplit2.Sells.Single().Id, 3u, "the 38");
|
||||||
|
|
||||||
|
// 2026-11-05 (DreamWeave, Pyreal Peas at 50,000 each, two pyreal stacks a pea): the last full stack,
|
||||||
|
// 80 free slots: split 39 off ((80 - 2) * 25000 / 50000). The new stack takes a slot (79 free): it
|
||||||
|
// must still be sold whole (its slot frees for the pyreals), never merged back onto the 61.
|
||||||
|
SellItem PyPea(uint id, int stack) => new() { Id = id, Name = "Pyreal Pea", Value = 50_000 * stack, StackSize = stack,
|
||||||
|
Class = AcObjectClass.Misc, ItemType = 0x40000000, RuleName = "S: Peas", MaxStack = 100, Wcid = 9003 };
|
||||||
|
var lastStack = AutoVendorPlanner.PlanNext(v, none, new List<SellItem> { PyPea(1, 100) }, Pack(0, free: 80));
|
||||||
|
Eq(lastStack.Kind, PlanKind.Split, "the last full stack: split");
|
||||||
|
Eq(lastStack.SplitAmount, 39, "39 peas fit");
|
||||||
|
var afterSplit = AutoVendorPlanner.PlanNext(v, none, new List<SellItem> { PyPea(1, 61), PyPea(2, 39) }, Pack(0, free: 79));
|
||||||
|
Eq(afterSplit.Kind, PlanKind.Sell, "after the split: the 39 is sold, not merged back (the loop that left a stack)");
|
||||||
|
Eq(afterSplit.Sells.Single().Id, 2u, "the split-off 39");
|
||||||
|
var oneTooBig = AutoVendorPlanner.PlanNext(v, none, new List<SellItem> { PyPea(1, 61), PyPea(2, 41) }, Pack(0, free: 79));
|
||||||
|
Eq(oneTooBig.Kind, PlanKind.Merge, "a partial more than a slot's worth too big still merges first");
|
||||||
|
|
||||||
var onePartialFits = AutoVendorPlanner.PlanNext(v, none, new List<SellItem> { Pea(1, 100), Pea(2, 79) }, Pack(0, free: 88));
|
var onePartialFits = AutoVendorPlanner.PlanNext(v, none, new List<SellItem> { Pea(1, 100), Pea(2, 79) }, Pack(0, free: 88));
|
||||||
Eq(onePartialFits.Kind, PlanKind.Sell, "one partial that fits: sold whole, no split");
|
Eq(onePartialFits.Kind, PlanKind.Sell, "one partial that fits: sold whole, no split");
|
||||||
Eq(onePartialFits.Sells.Single().Id, 2u, "the partial");
|
Eq(onePartialFits.Sells.Single().Id, 2u, "the partial");
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,7 @@ internal static class Program
|
||||||
VTankHotkeyTests.Register(runner);
|
VTankHotkeyTests.Register(runner);
|
||||||
FightSelectedTests.Register(runner);
|
FightSelectedTests.Register(runner);
|
||||||
OneTouchHealTests.Register(runner);
|
OneTouchHealTests.Register(runner);
|
||||||
|
ItemHudCountTests.Register(runner);
|
||||||
SaveFailureTests.Register(runner);
|
SaveFailureTests.Register(runner);
|
||||||
EnvironmentImpactTests.Register(runner);
|
EnvironmentImpactTests.Register(runner);
|
||||||
SkCombatAddonTests.Register(runner);
|
SkCombatAddonTests.Register(runner);
|
||||||
|
|
|
||||||
|
|
@ -1157,6 +1157,7 @@ internal static class ActionPacingTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
var cache = new WorldObjectCache(host);
|
var cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ internal static class BlankLoadTests
|
||||||
Directory.CreateDirectory(Metas);
|
Directory.CreateDirectory(Metas);
|
||||||
|
|
||||||
Dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
Dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(Dash, true); // a stand-in with its profile in memory
|
||||||
var navFiles = new List<string>();
|
var navFiles = new List<string>();
|
||||||
Set("_settings", S);
|
Set("_settings", S);
|
||||||
Set("_host", FakeHost.Create());
|
Set("_host", FakeHost.Create());
|
||||||
|
|
|
||||||
|
|
@ -634,6 +634,7 @@ internal static class BuffTests
|
||||||
Check.True(payload != null && payload.CastBuffsOverItemBuffs == null, "an older engine's payload has no value");
|
Check.True(payload != null && payload.CastBuffsOverItemBuffs == null, "an older engine's payload has no value");
|
||||||
var s = new LegacyUiSettings { CastBuffsOverItemBuffs = false };
|
var s = new LegacyUiSettings { CastBuffsOverItemBuffs = false };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s)); // BuildSettingsJson reads its crafting state
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s)); // BuildSettingsJson reads its crafting state
|
||||||
|
|
@ -757,6 +758,7 @@ internal static class BuffTests
|
||||||
var s = new LegacyUiSettings();
|
var s = new LegacyUiSettings();
|
||||||
s.SetBuffEnabled("Frost Bane", false);
|
s.SetBuffEnabled("Frost Bane", false);
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
@ -2140,6 +2142,7 @@ internal static class BuffTests
|
||||||
Check.True(payload != null && payload.SkipUnusableBuffs == null, "an older engine's payload has no value");
|
Check.True(payload != null && payload.SkipUnusableBuffs == null, "an older engine's payload has no value");
|
||||||
var s = new LegacyUiSettings { SkipUnusableBuffs = false };
|
var s = new LegacyUiSettings { SkipUnusableBuffs = false };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ internal static class ChestLootTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ internal static class ChoresInFightTests
|
||||||
{
|
{
|
||||||
r.Add("chores: a fight is a monster in Monster Range or on top of us; never with the macro or combat off", FightSignal);
|
r.Add("chores: a fight is a monster in Monster Range or on top of us; never with the macro or combat off", FightSignal);
|
||||||
r.Add("chores: AutoCram waits while a monster is on us, and crams once the fight is over", CramWaitsForFight);
|
r.Add("chores: AutoCram waits while a monster is on us, and crams once the fight is over", CramWaitsForFight);
|
||||||
|
r.Add("chores: AutoCram stands down while RynthSort's auto-sort is on (they fought); off again, it crams; /ub autocram by hand still runs", CramOffWithAutoSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CombatManager.ScannedTarget At(double yards) =>
|
private static CombatManager.ScannedTarget At(double yards) =>
|
||||||
|
|
@ -87,4 +88,45 @@ internal static class ChoresInFightTests
|
||||||
}
|
}
|
||||||
finally { TickIsolationTests.Done(); }
|
finally { TickIsolationTests.Done(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Owner, 2026-11-03: "Auto sort and auto cram are fighting each other. When auto sort is on, auto
|
||||||
|
// cram should be disabled". RynthAi reads RynthSort's auto-sort (LegacyUiSettings.AutoSortOn).
|
||||||
|
private static void CramOffWithAutoSort()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var bot = new TickIsolationTests.Bot(combat: true, heal: false, arrange: () =>
|
||||||
|
{
|
||||||
|
FakeHost.Names[Gem] = "Black Opal";
|
||||||
|
FakeHost.ItemTypes[Gem] = ItemTypeGem;
|
||||||
|
FakeHost.Containers[Gem] = Player;
|
||||||
|
FakeHost.Names[SidePack] = "Backpack";
|
||||||
|
FakeHost.ItemTypes[SidePack] = ItemTypeContainer;
|
||||||
|
FakeHost.Ints[(SidePack, ItemsCapacityKey)] = 24;
|
||||||
|
FakeHost.Containers[SidePack] = Player;
|
||||||
|
});
|
||||||
|
_ = bot.Cache[unchecked((int)Gem)];
|
||||||
|
_ = bot.Cache[unchecked((int)SidePack)];
|
||||||
|
bot.S.EnableAutocram = true;
|
||||||
|
bot.S.AutoSortOn = true;
|
||||||
|
var inv = new InventoryManager(bot.Host, bot.S, bot.Cache);
|
||||||
|
bot.Set("_inventoryManager", inv);
|
||||||
|
for (int i = 0; i < 5; i++) bot.Call("TickCramStack", bot.S);
|
||||||
|
Check.Eq(FakeHost.Moves.Count, 0, "auto-sort on: Auto Cram moves nothing (the setting itself stays on)");
|
||||||
|
Check.True(bot.S.EnableAutocram, "the player's Auto Cram choice is kept");
|
||||||
|
|
||||||
|
inv.RunManual(cram: true, stack: false);
|
||||||
|
bot.Call("TickCramStack", bot.S);
|
||||||
|
Check.True(FakeHost.Moves.Any(m => m.Id == Gem && m.Pack == SidePack), "a cram asked for by hand still runs");
|
||||||
|
|
||||||
|
FakeHost.Moves.Clear();
|
||||||
|
FakeHost.Containers[Gem] = Player; // back in the main pack
|
||||||
|
bot.S.AutoSortOn = false;
|
||||||
|
var inv2 = new InventoryManager(bot.Host, bot.S, bot.Cache);
|
||||||
|
bot.Set("_inventoryManager", inv2);
|
||||||
|
bot.Call("TickCramStack", bot.S);
|
||||||
|
Check.True(FakeHost.Moves.Any(m => m.Id == Gem && m.Pack == SidePack), "auto-sort off: Auto Cram crams again");
|
||||||
|
}
|
||||||
|
finally { TickIsolationTests.Done(); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -452,6 +452,7 @@ internal static class CommandReplyTests
|
||||||
var host = FakeHost.Create(playerId: Player);
|
var host = FakeHost.Create(playerId: Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ internal static class CorpseCloseTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ internal static class DoorTests
|
||||||
|
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(Host);
|
Cache = new WorldObjectCache(Host);
|
||||||
|
|
|
||||||
|
|
@ -364,6 +364,7 @@ internal static class FightSelectedTests
|
||||||
// The engine Settings face: sent; a save without the field leaves it alone.
|
// The engine Settings face: sent; a save without the field leaves it alone.
|
||||||
var s = new LegacyUiSettings { FightSelectedTarget = true };
|
var s = new LegacyUiSettings { FightSelectedTarget = true };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", Any)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", Any)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
var sent = System.Text.Json.JsonSerializer.Deserialize(dash.BuildSettingsJson(), RynthAiJsonContext.Default.SettingsBridgePayload);
|
var sent = System.Text.Json.JsonSerializer.Deserialize(dash.BuildSettingsJson(), RynthAiJsonContext.Default.SettingsBridgePayload);
|
||||||
|
|
@ -404,6 +405,7 @@ internal static class FightSelectedTests
|
||||||
S = t.S;
|
S = t.S;
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Set("_objectCache", t.Cache);
|
Set("_objectCache", t.Cache);
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ internal static class GiveTests
|
||||||
var host = FakeHost.Create(playerId: Player);
|
var host = FakeHost.Create(playerId: Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ internal static class HazardEscapeTests
|
||||||
var host = FakeHost.Create(Player);
|
var host = FakeHost.Create(Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(P, dash);
|
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(P, dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
62
Tools/RynthCore.RynthAiHostTests/Tests/ItemHudCountTests.cs
Normal file
62
Tools/RynthCore.RynthAiHostTests/Tests/ItemHudCountTests.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using RynthCore.Plugin.RynthAi;
|
||||||
|
using RynthCore.Plugin.RynthAi.Huds;
|
||||||
|
using RynthCore.RynthAiHostTests.Fakes;
|
||||||
|
using RynthCore.RynthAiTests.Harness;
|
||||||
|
|
||||||
|
namespace RynthCore.RynthAiHostTests.Tests;
|
||||||
|
|
||||||
|
// The item count HUD and the Mini Remote's item slots (HudController.RebuildPack) count from the
|
||||||
|
// client's own pack walk. They read the cache's inventory set, kept up from object events, and after
|
||||||
|
// 10+ hours of macro it showed 1 healing kit of 4 and 4 mana stones of 6 (report
|
||||||
|
// R-20261103-125252-251c, 2026-11-03); the loot step's Keep # count already walked the pack.
|
||||||
|
internal static class ItemHudCountTests
|
||||||
|
{
|
||||||
|
private const uint Player = 0x50000D01;
|
||||||
|
private const uint Pack = 0x80004D10;
|
||||||
|
private const uint Kit1 = 0x80004D01, Kit2 = 0x80004D02, Kit3 = 0x80004D03, Kit4 = 0x80004D04;
|
||||||
|
private const uint Stone1 = 0x80004D05, Stone2 = 0x80004D06;
|
||||||
|
|
||||||
|
public static void Register(Runner r)
|
||||||
|
{
|
||||||
|
r.Add("item HUD: counts what the pack walk finds, not the cache's event-kept inventory set", CountsThePackWalk);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CountsThePackWalk()
|
||||||
|
{
|
||||||
|
FakeHost.Reset();
|
||||||
|
FakeHost.ContentsCalls = true; // GetContainerContents: the client's pack walk
|
||||||
|
FakeHost.Names[Pack] = "Pack";
|
||||||
|
FakeHost.ItemTypes[Pack] = 0x200; // Container
|
||||||
|
FakeHost.Containers[Pack] = Player;
|
||||||
|
foreach (uint k in new[] { Kit1, Kit2, Kit3, Kit4 })
|
||||||
|
{
|
||||||
|
FakeHost.Names[k] = "Treated Healing Kit";
|
||||||
|
FakeHost.Containers[k] = k == Kit4 ? Pack : Player; // one in a side pack
|
||||||
|
}
|
||||||
|
foreach (uint s in new[] { Stone1, Stone2 })
|
||||||
|
{
|
||||||
|
FakeHost.Names[s] = "Major Mana Stone";
|
||||||
|
FakeHost.Containers[s] = Player;
|
||||||
|
}
|
||||||
|
var host = FakeHost.Create(Player);
|
||||||
|
// The cache's own set heard of one kit and one stone only (the drift).
|
||||||
|
var cache = FakeHost.MakeCache(host, Player, new[] { Kit1, Stone1 });
|
||||||
|
Check.Eq(cache.GetInventory().Count(w => w.Name == "Treated Healing Kit"), 1, "the event-kept set is short (the report's case)");
|
||||||
|
|
||||||
|
string dir = Path.Combine(Path.GetTempPath(), "rynthai-hudcount-" + Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(dir);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var hud = new HudController(host, dir, () => cache, null!, () => null, new HudIconCache(host, () => null), () => 0);
|
||||||
|
typeof(HudController).GetMethod("RebuildPack", BindingFlags.Instance | BindingFlags.NonPublic)!.Invoke(hud, null);
|
||||||
|
Check.Eq(hud.Pack.CountOf("Treated Healing Kit"), 4L, "all four kits, the side pack's too");
|
||||||
|
Check.Eq(hud.Pack.CountOf("Major Mana Stone"), 2L, "both stones");
|
||||||
|
}
|
||||||
|
finally { try { Directory.Delete(dir, true); } catch { } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -627,6 +627,7 @@ internal static class ItemToolTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ internal static class LearnSpellsTests
|
||||||
S = s;
|
S = s;
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ internal static class LootAddItemTests
|
||||||
Host = host;
|
Host = host;
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = FakeHost.MakeCache(host, Player, new[] { Player, Opal, Taper, Coin }.Concat(extra));
|
Cache = FakeHost.MakeCache(host, Player, new[] { Player, Opal, Taper, Coin }.Concat(extra));
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ internal static class LootChatLineTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ internal static class LootClaimMismatchTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ internal static class LootCorpseTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ internal static class LootJumpTests
|
||||||
};
|
};
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(bot, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(bot, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
||||||
void Set(string f, object? v) => typeof(RynthAiPlugin).GetField(f, Any)!.SetValue(bot, v);
|
void Set(string f, object? v) => typeof(RynthAiPlugin).GetField(f, Any)!.SetValue(bot, v);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ internal static class LootLateIdTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ internal static class LootNothingLineTests
|
||||||
Host = host;
|
Host = host;
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ internal static class LootPacingTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,7 @@ internal static class LootRaresModeTests
|
||||||
S.LootMode = mode;
|
S.LootMode = mode;
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
Dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
Dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(Dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(Dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(Dash, S);
|
||||||
Set("_dashboard", Dash);
|
Set("_dashboard", Dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
@ -350,6 +351,7 @@ internal static class LootRaresModeTests
|
||||||
// The engine's Settings face: sent; a save without it leaves it alone.
|
// The engine's Settings face: sent; a save without it leaves it alone.
|
||||||
var s = new LegacyUiSettings { LootMode = LootModes.Rares };
|
var s = new LegacyUiSettings { LootMode = LootModes.Rares };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", Any)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", Any)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
var sent = JsonSerializer.Deserialize(dash.BuildSettingsJson(), RynthAiJsonContext.Default.SettingsBridgePayload);
|
var sent = JsonSerializer.Deserialize(dash.BuildSettingsJson(), RynthAiJsonContext.Default.SettingsBridgePayload);
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ internal static class LootRetryTimingTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ internal static class LootSpeedTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -275,6 +275,7 @@ internal static class LootWandTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ internal static class MetaAuditTests
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var s = new LegacyUiSettings();
|
var s = new LegacyUiSettings();
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Set("_initialized", true);
|
Set("_initialized", true);
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ internal static class MetaSampleCompatTests
|
||||||
FakeHost.Create(playerId: 0x50000F31);
|
FakeHost.Create(playerId: 0x50000F31);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, new LegacyUiSettings());
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, new LegacyUiSettings());
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Set("_initialized", true);
|
Set("_initialized", true);
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ internal static class MiniRemoteMoveTests
|
||||||
|
|
||||||
var s = new LegacyUiSettings();
|
var s = new LegacyUiSettings();
|
||||||
var dash = (LegacyDashboardRenderer)System.Runtime.CompilerServices.RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)System.Runtime.CompilerServices.RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
var flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance;
|
var flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance;
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", flags)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", flags)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", flags)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", flags)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,7 @@ internal static class NavMapEditTests
|
||||||
|
|
||||||
// RynthPluginGetNavJson reports the map edit version with the route.
|
// RynthPluginGetNavJson reports the map edit version with the route.
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, Settings(P(1, 2), P(3, 4)));
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, Settings(P(1, 2), P(3, 4)));
|
||||||
typeof(LegacyDashboardRenderer).GetField("_navFiles", Any)!.SetValue(dash, new System.Collections.Generic.List<string>());
|
typeof(LegacyDashboardRenderer).GetField("_navFiles", Any)!.SetValue(dash, new System.Collections.Generic.List<string>());
|
||||||
// Field initializers don't run on an uninitialized object; the route editor's status line.
|
// Field initializers don't run on an uninitialized object; the route editor's status line.
|
||||||
|
|
@ -174,6 +175,7 @@ internal static class NavMapEditTests
|
||||||
var nav = (LegacyNavigationUi)RuntimeHelpers.GetUninitializedObject(typeof(LegacyNavigationUi));
|
var nav = (LegacyNavigationUi)RuntimeHelpers.GetUninitializedObject(typeof(LegacyNavigationUi));
|
||||||
typeof(LegacyNavigationUi).GetField("_settings", Any)!.SetValue(nav, s);
|
typeof(LegacyNavigationUi).GetField("_settings", Any)!.SetValue(nav, s);
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_navigationUi", Any)!.SetValue(dash, nav);
|
typeof(LegacyDashboardRenderer).GetField("_navigationUi", Any)!.SetValue(dash, nav);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ internal static class NavOverlayTests
|
||||||
s.NavOverlay.TrackBreadcrumbs = false;
|
s.NavOverlay.TrackBreadcrumbs = false;
|
||||||
s.NavOverlay.ShowRouteMarkers = true;
|
s.NavOverlay.ShowRouteMarkers = true;
|
||||||
var dash = (LegacyDashboardRenderer)System.Runtime.CompilerServices.RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)System.Runtime.CompilerServices.RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
var flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance;
|
var flags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance;
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", flags)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", flags)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", flags)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", flags)!.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,7 @@ internal static class NavResumeTests
|
||||||
FakeHost.Reset(); At(0, 0);
|
FakeHost.Reset(); At(0, 0);
|
||||||
var s = new LegacyUiSettings { IsMacroRunning = true };
|
var s = new LegacyUiSettings { IsMacroRunning = true };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
void Set(string f, object v) => typeof(LegacyDashboardRenderer).GetField(f, Any)!.SetValue(dash, v);
|
void Set(string f, object v) => typeof(LegacyDashboardRenderer).GetField(f, Any)!.SetValue(dash, v);
|
||||||
Set("_settings", s);
|
Set("_settings", s);
|
||||||
Set("_host", FakeHost.Create());
|
Set("_host", FakeHost.Create());
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ internal static class OwnCorpseTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
@ -304,6 +305,7 @@ internal static class OwnCorpseTests
|
||||||
Check.True(payload != null && payload.LootOwnCorpse == null && payload.TravelToOwnCorpse == null, "an older engine's payload has no value");
|
Check.True(payload != null && payload.LootOwnCorpse == null && payload.TravelToOwnCorpse == null, "an older engine's payload has no value");
|
||||||
var s = new LegacyUiSettings { LootOwnCorpse = false, TravelToOwnCorpse = true };
|
var s = new LegacyUiSettings { LootOwnCorpse = false, TravelToOwnCorpse = true };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ internal static class PatrolModeTests
|
||||||
FakeHost.Create(Player);
|
FakeHost.Create(Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(P, dash);
|
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(P, dash);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,7 @@ internal static class PatrolPortalTests
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(plugin, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(plugin, new object[] { FakeHost.LastApi });
|
||||||
var settings = new LegacyUiSettings();
|
var settings = new LegacyUiSettings();
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, settings);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, settings);
|
||||||
void Set(string f, object? v) => typeof(RynthAiPlugin).GetField(f, Any)!.SetValue(plugin, v);
|
void Set(string f, object? v) => typeof(RynthAiPlugin).GetField(f, Any)!.SetValue(plugin, v);
|
||||||
object? Call(string m, params object?[] a) => typeof(RynthAiPlugin).GetMethod(m, Any)!.Invoke(plugin, a);
|
object? Call(string m, params object?[] a) => typeof(RynthAiPlugin).GetMethod(m, Any)!.Invoke(plugin, a);
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ internal static class PatrolSettingsTests
|
||||||
{
|
{
|
||||||
var s = new LegacyUiSettings { DunPatrolCoverage = 1, DunPatrolSkipDeadEnds = 6, DunPatrolAvoidFloors = false, DunPatrolWallDistance = 1.25f, DunPatrolLookInSize = 15f, DunPatrolSightYd = 30f };
|
var s = new LegacyUiSettings { DunPatrolCoverage = 1, DunPatrolSkipDeadEnds = 6, DunPatrolAvoidFloors = false, DunPatrolWallDistance = 1.25f, DunPatrolLookInSize = 15f, DunPatrolSightYd = 30f };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ internal static class PluginFixTests
|
||||||
Host = FakeHost.Create(playerId: Player);
|
Host = FakeHost.Create(playerId: Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
Dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
Dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(Dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(Dash, new LegacyUiSettings());
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(Dash, new LegacyUiSettings());
|
||||||
typeof(LegacyDashboardRenderer).GetField("_host", Any)!.SetValue(Dash, Host);
|
typeof(LegacyDashboardRenderer).GetField("_host", Any)!.SetValue(Dash, Host);
|
||||||
Cache = new WorldObjectCache(Host);
|
Cache = new WorldObjectCache(Host);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ internal static class ProfileLoadTests
|
||||||
public static void Register(Runner r)
|
public static void Register(Runner r)
|
||||||
{
|
{
|
||||||
r.Add("profile: every saved setting survives loading (CopySettings lists each serialized field)", EverySavedFieldIsCopied);
|
r.Add("profile: every saved setting survives loading (CopySettings lists each serialized field)", EverySavedFieldIsCopied);
|
||||||
|
r.Add("profile: nothing from the engine lands before the profile loads, or after logout (2026-11-05 settings reset)", NoEngineChangeWithoutProfile);
|
||||||
|
r.Add("profile: the first save of a day keeps a dated copy, the last 7 days kept", DailyCopiesKept);
|
||||||
r.Add("profile: Describe Items and the Item Info options survive a save and a reload", ItemInfoSurvivesReload);
|
r.Add("profile: Describe Items and the Item Info options survive a save and a reload", ItemInfoSurvivesReload);
|
||||||
r.Add("profile: a profile with null item info / nav overlay loads defaults, not null", NullNestedOptionsLoadDefaults);
|
r.Add("profile: a profile with null item info / nav overlay loads defaults, not null", NullNestedOptionsLoadDefaults);
|
||||||
r.Add("profile: a save is atomic (temp file swapped in, no temp left) and keeps the previous profile as .bak", SaveKeepsBackup);
|
r.Add("profile: a save is atomic (temp file swapped in, no temp left) and keeps the previous profile as .bak", SaveKeepsBackup);
|
||||||
|
|
@ -340,4 +342,51 @@ internal static class ProfileLoadTests
|
||||||
Check.Eq(File.ReadAllText(Path.Combine(dir, "Third.json")), goodJson, "and put back as the profile");
|
Check.Eq(File.ReadAllText(Path.Combine(dir, "Third.json")), goodJson, "and put back as the profile");
|
||||||
Check.Eq(Directory.GetFiles(dir, "Third.json.unreadable-*").Length, 1, "the empty file is kept too");
|
Check.Eq(Directory.GetFiles(dir, "Third.json.unreadable-*").Length, 1, "the empty file is kept too");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2026-11-05: after an engine hot reload the engine read RynthAi's built-in defaults (the profile wasn't
|
||||||
|
// loaded yet) and the next click in its dashboard sent the whole default copy back, saved over the profile.
|
||||||
|
private static void NoEngineChangeWithoutProfile()
|
||||||
|
{
|
||||||
|
string dir = NewCharDir("guard", out var dash);
|
||||||
|
var saved = new LegacyUiSettings { StartMacroOnLogin = true, TopOffHP = 77, EnableLooting = true };
|
||||||
|
File.WriteAllText(Path.Combine(dir, "Default.json"), Json(saved));
|
||||||
|
Check.False(dash.ProfileLoaded, "before LoadSettings: no profile in memory");
|
||||||
|
|
||||||
|
dash.ApplySettingsJson("{\"StartMacroOnLogin\":false,\"TopOffHP\":50,\"EnableLooting\":false}");
|
||||||
|
Check.True(File.Exists(Path.Combine(dir, "Default.json")) && File.ReadAllText(Path.Combine(dir, "Default.json")).Contains("\"TopOffHP\": 77"),
|
||||||
|
"an engine change before the profile loads doesn't touch the file");
|
||||||
|
|
||||||
|
dash.LoadSettings("Tester");
|
||||||
|
LegacyUiSettings live = SettingsOf(dash);
|
||||||
|
Check.True(dash.ProfileLoaded, "after LoadSettings: loaded");
|
||||||
|
Check.True(live.StartMacroOnLogin && live.TopOffHP == 77 && live.EnableLooting, "the profile's own values, not the early engine change");
|
||||||
|
|
||||||
|
dash.ApplySettingsJson("{\"TopOffHP\":80}");
|
||||||
|
Check.Eq(live.TopOffHP, 80, "loaded: an engine edit lands");
|
||||||
|
Check.True(live.StartMacroOnLogin && live.EnableLooting, "and only the field it sent");
|
||||||
|
|
||||||
|
dash.ResetCharacterSession();
|
||||||
|
Check.False(dash.ProfileLoaded, "logout: no profile in memory");
|
||||||
|
dash.ApplySettingsJson("{\"TopOffHP\":10}");
|
||||||
|
Check.Eq(live.TopOffHP, 80, "an engine change after logout is ignored");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DailyCopiesKept()
|
||||||
|
{
|
||||||
|
string dir = NewCharDir("daily", out var dash);
|
||||||
|
string path = Path.Combine(dir, "Default.json");
|
||||||
|
for (int d = 1; d <= 9; d++)
|
||||||
|
File.WriteAllText(path + ".2026-10-0" + d + LegacyDashboardRenderer.BackupSuffix, "{}");
|
||||||
|
File.WriteAllText(path, Json(new LegacyUiSettings { TopOffHP = 66 }));
|
||||||
|
dash.LoadSettings("Tester");
|
||||||
|
SettingsOf(dash).TopOffHP = 67;
|
||||||
|
dash.SaveSettings();
|
||||||
|
string today = path + "." + DateTime.Now.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture) + LegacyDashboardRenderer.BackupSuffix;
|
||||||
|
Check.True(File.Exists(today) && File.ReadAllText(today).Contains("\"TopOffHP\": 66"), "today's copy holds the profile from before the save");
|
||||||
|
Check.Eq(Directory.GetFiles(dir, "Default.json.????-??-??.bak").Length, LegacyDashboardRenderer.DailyCopiesKept, "seven days kept");
|
||||||
|
Check.False(File.Exists(path + ".2026-10-01" + LegacyDashboardRenderer.BackupSuffix), "the oldest went");
|
||||||
|
SettingsOf(dash).TopOffHP = 68;
|
||||||
|
dash.SaveSettings();
|
||||||
|
Check.True(File.ReadAllText(today).Contains("\"TopOffHP\": 66"), "a second save the same day leaves today's copy alone");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -285,6 +285,7 @@ internal static class RebuffWhenIdleTests
|
||||||
// The engine's Settings face: sent; a save without it (an engine that doesn't know it) leaves it alone.
|
// The engine's Settings face: sent; a save without it (an engine that doesn't know it) leaves it alone.
|
||||||
var s = new LegacyUiSettings { RebuffIdleMarginMinutes = 5 };
|
var s = new LegacyUiSettings { RebuffIdleMarginMinutes = 5 };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ internal static class ServerPluginForwardTests
|
||||||
var p = new RynthAiPlugin();
|
var p = new RynthAiPlugin();
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(p, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(p, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, new LegacyUiSettings());
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, new LegacyUiSettings());
|
||||||
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(p, dash);
|
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(p, dash);
|
||||||
var client = new ServerHubClient(host);
|
var client = new ServerHubClient(host);
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ internal static class ServerPolicyTests
|
||||||
Host = FakeHost.Create(Player);
|
Host = FakeHost.Create(Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(P, dash);
|
typeof(RynthAiPlugin).GetField("_dashboard", Any)!.SetValue(P, dash);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,7 @@ internal static class SkCombatAddonTests
|
||||||
private static LegacyDashboardRenderer Dash(LegacyUiSettings s)
|
private static LegacyDashboardRenderer Dash(LegacyUiSettings s)
|
||||||
{
|
{
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s));
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,7 @@ internal static class TargetingTests
|
||||||
// Engine Settings face: the payload carries them; an engine without the fields leaves them alone.
|
// Engine Settings face: the payload carries them; an engine without the fields leaves them alone.
|
||||||
s = new LegacyUiSettings { TargetSelection = 2, TargetLock = false };
|
s = new LegacyUiSettings { TargetSelection = 2, TargetLock = false };
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
typeof(LegacyDashboardRenderer).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)!.SetValue(dash, s);
|
||||||
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
typeof(LegacyDashboardRenderer).GetField("_advancedSettingsUi", BindingFlags.NonPublic | BindingFlags.Instance)!
|
||||||
.SetValue(dash, new LegacyAdvancedSettingsUi(s)); // BuildSettingsJson reads its crafting state
|
.SetValue(dash, new LegacyAdvancedSettingsUi(s)); // BuildSettingsJson reads its crafting state
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ internal static class TickIsolationTests
|
||||||
|
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
// As UseAtLoginTests: every empty collection/lock field of the dashboard gets an instance.
|
// As UseAtLoginTests: every empty collection/lock field of the dashboard gets an instance.
|
||||||
foreach (var f in typeof(LegacyDashboardRenderer).GetFields(Any))
|
foreach (var f in typeof(LegacyDashboardRenderer).GetFields(Any))
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ internal static class UbCompatTests
|
||||||
var host = FakeHost.Create(playerId: Player);
|
var host = FakeHost.Create(playerId: Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
var cache = new WorldObjectCache(host);
|
var cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ internal static class UbMtSafetyTests
|
||||||
var host = FakeHost.Create(playerId: Player);
|
var host = FakeHost.Create(playerId: Player);
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
var cache = new WorldObjectCache(host);
|
var cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ internal static class UseAtLoginTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
// The full OnTick reaches the dashboard's queues and lists: give every empty
|
// The full OnTick reaches the dashboard's queues and lists: give every empty
|
||||||
// collection/lock field a fresh instance (the constructor builds ImGui panels and
|
// collection/lock field a fresh instance (the constructor builds ImGui panels and
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,7 @@ internal static class UseRefusalTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = new WorldObjectCache(host);
|
Cache = new WorldObjectCache(host);
|
||||||
|
|
|
||||||
|
|
@ -231,6 +231,7 @@ internal static class VTankHotkeyTests
|
||||||
{
|
{
|
||||||
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
typeof(RynthPluginBase).GetMethod("Attach", Any)!.Invoke(P, new object[] { FakeHost.LastApi });
|
||||||
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
var dash = (LegacyDashboardRenderer)RuntimeHelpers.GetUninitializedObject(typeof(LegacyDashboardRenderer));
|
||||||
|
typeof(LegacyDashboardRenderer).GetField("_profileLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!.SetValue(dash, true); // a stand-in with its profile in memory
|
||||||
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
typeof(LegacyDashboardRenderer).GetField("_settings", Any)!.SetValue(dash, S);
|
||||||
Set("_dashboard", dash);
|
Set("_dashboard", dash);
|
||||||
Cache = cache ?? new WorldObjectCache(host);
|
Cache = cache ?? new WorldObjectCache(host);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue