RynthCore as of 2026-09-27 (internal d359eee): items past the old object-id range, no idle logoff, overlay popups without the panel flash, UI hidden at character select, vendor trading (API 67), Settings rows and Vendoring tab, release 2026.9.27.2

This commit is contained in:
Tom Bohar 2026-09-27 20:25:45 -04:00
commit 9b5e2765b7
43 changed files with 4216 additions and 62 deletions

View file

@ -68,6 +68,19 @@ internal static class AvaloniaOverlay
// Same slot pattern as radar, for chat's own Ctrl-gated click-through
// option (live-testing finding 2026-09-02).
private static PhysicalRect? _chatPanelRect;
// Open Flyout / ContextMenu / ComboBox dropdowns, embedded in the overlay
// window's OverlayLayer (Win32PlatformOptions.OverlayPopups). They can hang
// past their panel's rect, so they're published separately and are always
// interactive. ToolTips are left out: they never take clicks.
private static PhysicalRect[] _popupRects = Array.Empty<PhysicalRect>();
/// <summary>
/// True while a light-dismiss popup (Flyout, ContextMenu, ComboBox
/// dropdown) is open. A click on the game world is never forwarded to
/// Avalonia, so its own light-dismiss can't see it; Win32Backend checks
/// this and calls <see cref="DismissLightDismissPopups"/> instead.
/// </summary>
internal static volatile bool HasOpenLightDismissPopup;
[DllImport("user32.dll")]
private static extern short GetAsyncKeyState(int vKey);
@ -226,6 +239,13 @@ internal static class AvaloniaOverlay
lock (HitTestLock)
{
// Open popups sit above every panel and are always interactive.
foreach (PhysicalRect rect in _popupRects)
{
if (rect.Contains(gameClientX, gameClientY))
return true;
}
foreach (PhysicalRect rect in _panelRects)
{
if (rect.Contains(gameClientX, gameClientY))
@ -348,6 +368,37 @@ internal static class AvaloniaOverlay
Dispatcher.UIThread.Post(() => _window?.OnCustomFrameSubmitted(width, height), DispatcherPriority.Render);
}
/// <summary>
/// Publish the physical bounds (game client pixels) of every open
/// interactive popup in the overlay window's OverlayLayer. Empty = none.
/// </summary>
internal static void PublishPopupRects(List<(double Left, double Top, double Width, double Height)> rects)
{
var snapshots = new PhysicalRect[rects.Count];
for (int i = 0; i < rects.Count; i++)
{
snapshots[i] = new PhysicalRect(
(int)Math.Round(rects[i].Left),
(int)Math.Round(rects[i].Top),
(int)Math.Round(rects[i].Left + rects[i].Width),
(int)Math.Round(rects[i].Top + rects[i].Height));
}
lock (HitTestLock)
_popupRects = snapshots;
}
/// <summary>
/// Close every open light-dismiss popup (Flyout, ContextMenu, dropdown).
/// Called from the game thread when the user clicks the game world while
/// one is open; the click itself still goes to AC.
/// </summary>
internal static void DismissLightDismissPopups()
{
HasOpenLightDismissPopup = false;
Dispatcher.UIThread.Post(() => _window?.CloseLightDismissPopups(), DispatcherPriority.Input);
}
internal static void PublishPanelRects(params (double Left, double Top, double Width, double Height)[] rects)
{
var snapshots = new PhysicalRect[rects.Length];
@ -590,9 +641,11 @@ internal static class AvaloniaOverlay
_window = null;
_started = false;
AvaloniaHwnd = IntPtr.Zero;
HasOpenLightDismissPopup = false;
lock (HitTestLock)
{
_panelRects = Array.Empty<PhysicalRect>();
_popupRects = Array.Empty<PhysicalRect>();
_barButtonRects = new Dictionary<string, PhysicalRect>(StringComparer.OrdinalIgnoreCase);
}
}
@ -626,7 +679,19 @@ internal static class AvaloniaOverlay
[
Win32CompositionMode.RedirectionSurface
],
ShouldRenderOnUIThread = true
ShouldRenderOnUIThread = true,
// Popup flash fix: without this every ToolTip, Flyout,
// ContextMenu and ComboBox dropdown opens as its own PopupRoot
// TopLevel (a native popup HWND), which the custom producer
// path rendered through the overlay's one render target - a
// popup-only frame reached the game and every docked panel
// vanished until the overlay window drew again. With
// OverlayPopups the popups live in the overlay window's
// OverlayLayer and are drawn in the same frame as the panels
// (no extra HWND, readback or focus change). The software
// fallback renders each TopLevel into its own framebuffer, so it
// keeps native popups as before.
OverlayPopups = UseCustomSkiaBridge,
};
if (UseCustomSkiaBridge)
@ -1004,8 +1069,8 @@ internal class RynthOverlayWindow : Window
// working) but the canvas RTT clips it; the host renders the Border into
// its own RTT and pushes the pixels to the layered window via
// UpdateLayeredWindow. This sidesteps OverlaySkiaPlatformGraphics
// entirely — the bridge is a singleton with one shared render target,
// so a real visible Avalonia Window would thrash that target.
// entirely - only the overlay window's render target reaches the game, so
// a real Avalonia Window would get a detached target and draw nowhere.
private readonly Dictionary<string, FloatingPanelHost> _floatingPanels = new(StringComparer.OrdinalIgnoreCase);
private readonly Dictionary<string, Control> _panelContents = new(StringComparer.OrdinalIgnoreCase);
// Each floating panel parks its chrome Border past the right edge of
@ -1177,6 +1242,11 @@ internal class RynthOverlayWindow : Window
AvaloniaOverlay.RegisterWindow(this);
// Popups are embedded in this window's OverlayLayer (OverlayPopups).
// Track them for hit-testing, game-world light-dismiss and the
// popup-flash diagnostics (see the "Embedded popups" section).
InstallPopupTracking();
_captureTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(16), DispatcherPriority.Render, (_, _) =>
{
if (_captureDirty)
@ -3859,6 +3929,266 @@ internal class RynthOverlayWindow : Window
AvaloniaOverlay.PublishChatPanelRect(chatRect);
}
// ── Embedded popups ────────────────────────────────────────────────────
// With Win32PlatformOptions.OverlayPopups every Popup (ToolTip, Flyout,
// ContextMenu, ComboBox dropdown) is an OverlayPopupHost inside this
// window's OverlayLayer, so it is drawn in the same frame as the docked
// panels. Three things still need help from us:
// 1. hit-testing - a Flyout/menu can hang past its panel's rect, and
// Win32Backend only forwards clicks that land on published rects;
// 2. light-dismiss - a click on the game world never reaches Avalonia;
// 3. diagnostics - log whether a popup ever rebuilt the overlay surface
// or got its own TopLevel (the old "panel flash").
[DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow();
private sealed class PopupTrack
{
public int Serial;
public string Kind = "";
public string Host = "";
public bool Suppressed;
public int SurfaceCreatesAtOpen;
public int DetachedTargetsAtOpen;
}
private const int PopupLogNormalLineBudget = 40;
private const int PopupLogAnomalyLineBudget = 200;
private static RynthOverlayWindow? _popupOwner;
private static bool _popupClassHandlerInstalled;
private readonly Dictionary<Avalonia.Controls.Primitives.Popup, PopupTrack> _openPopups = new();
private int _popupSerial;
private int _popupNormalLines;
private int _popupAnomalyLines;
private bool _popupRectsPublished;
private void InstallPopupTracking()
{
_popupOwner = this;
if (!_popupClassHandlerInstalled)
{
_popupClassHandlerInstalled = true;
Avalonia.Controls.Primitives.Popup.IsOpenProperty.Changed.AddClassHandler<Avalonia.Controls.Primitives.Popup, bool>(
(popup, e) => _popupOwner?.OnAnyPopupIsOpenChanged(popup, e.NewValue.GetValueOrDefault()));
}
// Fires after every layout pass: keeps popup hit rects in step with
// Flyout content changes and repositioning. Returns at once when no
// popup is open.
LayoutUpdated += (_, _) => RefreshPopupHitRects();
}
private void OnAnyPopupIsOpenChanged(Avalonia.Controls.Primitives.Popup popup, bool isOpen)
{
try
{
if (isOpen)
{
if (_openPopups.ContainsKey(popup))
return;
var track = new PopupTrack
{
Serial = ++_popupSerial,
Kind = DescribePopup(popup),
Host = popup.Host?.GetType().Name ?? "none",
SurfaceCreatesAtOpen = OverlaySkiaRenderTarget.SurfaceCreateCount,
DetachedTargetsAtOpen = OverlaySkiaGpuContext.DetachedTargetCount,
};
_openPopups[popup] = track;
UpdateLightDismissFlag();
// A ToolTip for a control inside a popped-out panel: that
// control lives in the off-bounds canvas strip, so the embedded
// tooltip would be clamped onto the edge of the in-game overlay,
// nowhere near the floating window. Don't show it.
if (popup.Child is ToolTip && popup.PlacementTarget is Control tipTarget && !IsInsideOverlayClientArea(tipTarget))
{
track.Suppressed = true;
Dispatcher.UIThread.Post(() =>
{
try { ToolTip.SetIsOpen(tipTarget, false); } catch { }
}, DispatcherPriority.Send);
}
Dispatcher.UIThread.Post(() =>
{
RefreshPopupHitRects();
LogPopupOpened(track);
}, DispatcherPriority.Background);
}
else
{
if (!_openPopups.Remove(popup, out PopupTrack? track))
return;
UpdateLightDismissFlag();
RefreshPopupHitRects();
// The old flash rebuilt the overlay surface on the window's next
// frame after the popup closed, so check a moment later.
DispatcherTimer.RunOnce(() => LogPopupClosed(track), TimeSpan.FromMilliseconds(1000), DispatcherPriority.Background);
}
}
catch (Exception ex)
{
RynthLog.UI($"OverlayPopup: tracking threw {ex.GetType().Name}: {ex.Message}");
}
}
private static string DescribePopup(Avalonia.Controls.Primitives.Popup popup)
{
string child = popup.Child?.GetType().Name ?? "empty";
string? owner = popup.TemplatedParent?.GetType().Name;
return owner != null ? $"{owner}/{child}" : child;
}
private bool IsInsideOverlayClientArea(Control control)
{
Point? origin = control.TranslatePoint(default, this);
if (origin == null)
return true;
double width = Bounds.Width > 0 ? Bounds.Width : Width;
double height = Bounds.Height > 0 ? Bounds.Height : Height;
return origin.Value.X < width && origin.Value.Y < height &&
origin.Value.X + control.Bounds.Width > 0 && origin.Value.Y + control.Bounds.Height > 0;
}
private void UpdateLightDismissFlag()
{
bool any = false;
foreach (Avalonia.Controls.Primitives.Popup popup in _openPopups.Keys)
{
if (popup.IsLightDismissEnabled)
{
any = true;
break;
}
}
AvaloniaOverlay.HasOpenLightDismissPopup = any;
}
/// <summary>
/// Close open light-dismiss popups because the user clicked the game world.
/// Popup.Close is the same call Avalonia's own light-dismiss makes, so
/// Flyout/ContextMenu/ComboBox state stays in sync.
/// </summary>
internal void CloseLightDismissPopups()
{
foreach (Avalonia.Controls.Primitives.Popup popup in _openPopups.Keys.ToArray())
{
if (!popup.IsOpen || !popup.IsLightDismissEnabled)
continue;
try { popup.Close(); }
catch (Exception ex) { RynthLog.UI($"OverlayPopup: dismiss threw {ex.GetType().Name}: {ex.Message}"); }
}
UpdateLightDismissFlag();
}
private void RefreshPopupHitRects()
{
if (_openPopups.Count == 0)
{
if (_popupRectsPublished)
{
AvaloniaOverlay.PublishPopupRects(new List<(double, double, double, double)>());
_popupRectsPublished = false;
}
return;
}
float scale = (float)GetEffectiveRenderScale();
var rects = new List<(double Left, double Top, double Width, double Height)>(_openPopups.Count);
List<Avalonia.Controls.Primitives.Popup>? stale = null;
foreach ((Avalonia.Controls.Primitives.Popup popup, PopupTrack track) in _openPopups)
{
if (!popup.IsOpen)
{
(stale ??= new()).Add(popup);
continue;
}
// ToolTips never take clicks; a click over one must reach AC.
if (track.Suppressed || popup.Child is ToolTip)
continue;
// OverlayPopupHost is a control in this window's OverlayLayer. A
// native PopupRoot (not expected) would be its own root: skipped.
if (popup.Host is not Visual host || !host.IsVisible)
continue;
Point? origin = host.TranslatePoint(default, _desktopCanvas);
if (origin == null || host.Bounds.Width <= 0 || host.Bounds.Height <= 0)
continue;
rects.Add((origin.Value.X * scale, origin.Value.Y * scale, host.Bounds.Width * scale, host.Bounds.Height * scale));
}
if (stale != null)
{
foreach (Avalonia.Controls.Primitives.Popup popup in stale)
_openPopups.Remove(popup);
UpdateLightDismissFlag();
}
AvaloniaOverlay.PublishPopupRects(rects);
_popupRectsPublished = rects.Count > 0;
}
private bool TakePopupLogLine(bool anomaly)
{
if (anomaly)
return _popupAnomalyLines++ < PopupLogAnomalyLineBudget;
if (_popupNormalLines < PopupLogNormalLineBudget)
{
_popupNormalLines++;
return true;
}
if (_popupNormalLines == PopupLogNormalLineBudget)
{
_popupNormalLines++;
RynthLog.UI("OverlayPopup: normal popup open/close lines muted for this session; anomalies are still logged.");
}
return false;
}
private void LogPopupOpened(PopupTrack track)
{
// Expected: host=OverlayPopupHost (drawn in the overlay frame). A
// PopupRoot here means a native popup TopLevel - the flash path.
bool anomaly = !track.Suppressed && track.Host != "OverlayPopupHost";
if (!TakePopupLogLine(anomaly))
return;
IntPtr game = Win32Backend.GameHwnd;
string fg = game == IntPtr.Zero ? "?" : GetForegroundWindow() == game ? "game" : "other";
RynthLog.UI(
$"OverlayPopup: open #{track.Serial} {track.Kind} host={track.Host}" +
(track.Suppressed ? " (tooltip of a popped-out panel - not shown)" : "") +
$" surfaceCreates={track.SurfaceCreatesAtOpen} detachedTargets={track.DetachedTargetsAtOpen} foreground={fg}.");
}
private void LogPopupClosed(PopupTrack track)
{
int rebuilds = OverlaySkiaRenderTarget.SurfaceCreateCount - track.SurfaceCreatesAtOpen;
int detached = OverlaySkiaGpuContext.DetachedTargetCount - track.DetachedTargetsAtOpen;
bool anomaly = rebuilds != 0 || detached != 0;
if (!TakePopupLogLine(anomaly))
return;
IntPtr game = Win32Backend.GameHwnd;
string fg = game == IntPtr.Zero ? "?" : GetForegroundWindow() == game ? "game" : "other";
RynthLog.UI(
$"OverlayPopup: close #{track.Serial} {track.Kind} surfaceRebuilds=+{rebuilds} detachedTargets=+{detached} foreground={fg}" +
(anomaly ? " - overlay surface was rebuilt or a popup TopLevel appeared (panel flash / resize)." : " - no flash."));
}
private void QueueCapture()
{
if (AvaloniaOverlay.ShouldUseCustomSkiaProducer || _captureQueued)
@ -3882,6 +4212,16 @@ internal class RynthOverlayWindow : Window
/// </summary>
internal void TickFloatingPanels()
{
// The UI hides between characters: popped-out panels (and a floating bar) are
// real windows, so they're hidden outright while not in the world rather than
// left sitting over character select. SetShown only acts on a change.
bool inWorld = Compatibility.LoginLifecycleHooks.HasObservedLoginComplete;
foreach (FloatingPanelHost host in _floatingPanels.Values)
host.SetShown(inWorld);
_floatingBar?.SetShown(inWorld);
if (!inWorld)
return;
if (_floatingPanels.Count > 0)
{
foreach (FloatingPanelHost host in _floatingPanels.Values)
@ -3916,9 +4256,11 @@ internal class RynthOverlayWindow : Window
/// forwarded to the off-screen Avalonia HWND with translated coords so the
/// panel's buttons/scrollbars/etc. behave the same as when docked.
///
/// This deliberately does NOT use Avalonia's Window — a second Avalonia
/// top-level routes through OverlaySkiaPlatformGraphics' singleton render
/// target and thrashes the in-AC capture (the original "flashing" bug).
/// This deliberately does NOT use Avalonia's Window. A second Avalonia
/// top-level used to share OverlaySkiaPlatformGraphics' render target and
/// blank the in-AC capture (the original "flashing" bug); it now gets a
/// detached target (see OverlaySkiaGpuContext.TryCreateRenderTarget), so it
/// would draw nowhere at all.
/// </summary>
internal sealed unsafe class FloatingPanelHost : IDisposable
{
@ -4156,6 +4498,23 @@ internal sealed unsafe class FloatingPanelHost : IDisposable
/// RynthOverlayWindow's _captureTimer so render and panel state stay in
/// sync. Skips the heavy work if the panel hasn't been arranged yet.
/// </summary>
// Created shown (the constructor shows the window); SetShown tracks changes from there.
private volatile bool _windowShown = true;
/// <summary>
/// Hide or show the popped-out window (the UI hides between characters). Only acts
/// on a change; the window belongs to AC's thread, so the call is marshalled there.
/// </summary>
internal void SetShown(bool shown)
{
if (_disposed || _layered.Hwnd == IntPtr.Zero || _windowShown == shown) return;
_windowShown = shown;
ImGuiBackend.Win32Backend.RunOnGameThread(() =>
{
if (shown) _layered.Show(); else _layered.Hide();
});
}
public void Tick()
{
if (_disposed || _layered.Hwnd == IntPtr.Zero) return;

View file

@ -42,7 +42,8 @@ internal sealed unsafe class LayeredWindow : IDisposable
// class because its WndProc points into the unloaded DLL. So bake a
// per-DLL-load Guid into the name — each engine instance gets a fresh
// class atom backed by its own WndProc pointer.
private static readonly string ClassName = "RynthCoreLayeredPanel_" + Guid.NewGuid().ToString("N");
private const string ClassNamePrefix = "RynthCoreLayeredPanel_";
private static readonly string ClassName = ClassNamePrefix + Guid.NewGuid().ToString("N");
private const int WS_POPUP = unchecked((int)0x80000000);
private const int WS_EX_LAYERED = 0x00080000;
@ -273,6 +274,68 @@ internal sealed unsafe class LayeredWindow : IDisposable
return DefWindowProcW(hwnd, msg, wParam, lParam);
}
[DllImport("user32.dll")]
private static extern int EnumThreadWindows(uint dwThreadId, delegate* unmanaged[Stdcall]<IntPtr, IntPtr, int> lpfn, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern int GetClassNameW(IntPtr hWnd, char* lpClassName, int nMaxCount);
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })]
private static int CollectThreadWindow(IntPtr hwnd, IntPtr lParam)
{
if (GCHandle.FromIntPtr(lParam).Target is List<IntPtr> found)
found.Add(hwnd);
return 1;
}
/// <summary>
/// Destroys panel windows owned by the calling thread.
/// Must run on AC's game thread — the panels are created there (see
/// FloatingPanelHost's RunOnGameThread) and DestroyWindow only works on
/// the owning thread.
///
/// Dispose only posts the destroy, and Win32Backend.Shutdown unhooks the
/// game WndProc ~1 ms after the overlay stops — usually before the game
/// thread gets to the post. AC's own WndProc then drops it, and because
/// the engine module is never unloaded the panel lives on: frozen on its
/// last frame, deaf to input, and hidden under the next generation's copy
/// of it until that one is moved ("two RynthAi windows").
///
/// <paramref name="includeThisGeneration"/>=false spares this engine
/// load's own windows (class names carry a per-load Guid) and removes only
/// ones an earlier load left behind.
/// </summary>
internal static void DestroyThreadPanelWindows(bool includeThisGeneration)
{
var found = new List<IntPtr>();
GCHandle handle = GCHandle.Alloc(found);
try
{
EnumThreadWindows(GetCurrentThreadId(), &CollectThreadWindow, GCHandle.ToIntPtr(handle));
}
finally
{
handle.Free();
}
char* buffer = stackalloc char[128];
foreach (IntPtr hwnd in found)
{
int length = GetClassNameW(hwnd, buffer, 128);
if (length <= 0)
continue;
string className = new(buffer, 0, length);
if (!className.StartsWith(ClassNamePrefix, StringComparison.Ordinal))
continue;
bool thisGeneration = className == ClassName;
if (thisGeneration && !includeThisGeneration)
continue;
bool ok = DestroyWindow(hwnd);
RynthCore.Engine.RynthLog.Info($"LayeredWindow: DestroyWindow(0x{hwnd.ToInt64():X}) = {ok} — {(thisGeneration ? "still open at shutdown" : "left over from an earlier engine load")}.");
}
}
// ─── Instance state ────────────────────────────────────────────────────
public IntPtr Hwnd { get; private set; }
public int Width { get; private set; }

View file

@ -24,9 +24,18 @@ internal sealed class OverlaySkiaPlatformGraphics : IPlatformGraphicsWithFeature
internal sealed class OverlaySkiaGpuContext : ISkiaGpu
{
private static readonly IDisposable NoopLease = new NoopDisposable();
private static int _detachedTargetCount;
private readonly object _sync = new();
private OverlaySkiaRenderTarget? _renderTarget;
/// <summary>
/// How many TopLevels other than the overlay window asked for a render
/// target this session. Expected to stay 0: popups are embedded in the
/// overlay window (Win32PlatformOptions.OverlayPopups). Logged with every
/// popup open/close so a regression is visible in the per-pid log.
/// </summary>
internal static int DetachedTargetCount => Volatile.Read(ref _detachedTargetCount);
public bool IsLost => false;
public IDisposable EnsureCurrent() => NoopLease;
@ -37,11 +46,53 @@ internal sealed class OverlaySkiaGpuContext : ISkiaGpu
{
lock (_sync)
{
_renderTarget ??= new OverlaySkiaRenderTarget();
// Only the overlay window may own the render target whose frames go
// to the game. Every Avalonia TopLevel calls this - before the
// OverlayPopups fix each ToolTip/Flyout/ContextMenu/ComboBox opened
// a PopupRoot TopLevel that got this same target: its render cleared
// the shared surface and submitted a popup-only frame (every docked
// panel vanished), and closing it disposed the surface under the
// overlay window (rebuilt on its next frame). Any other TopLevel now
// gets a detached target that renders nowhere.
IntPtr hwnd = TryGetHwnd(surfaces);
IntPtr overlayHwnd = AvaloniaOverlay.AvaloniaHwnd;
bool isOverlayWindow = overlayHwnd != IntPtr.Zero && hwnd != IntPtr.Zero
? hwnd == overlayHwnd
: _renderTarget == null || _renderTarget.IsDisposed;
if (!isOverlayWindow)
{
int n = Interlocked.Increment(ref _detachedTargetCount);
RynthLog.UI($"OverlaySkiaGpuContext: TopLevel hwnd=0x{hwnd.ToInt64():X} is not the overlay window (0x{overlayHwnd.ToInt64():X}); gave it detached render target #{n} so it can't blank the docked panels.");
return new DetachedOverlayRenderTarget();
}
if (_renderTarget == null || _renderTarget.IsDisposed)
_renderTarget = new OverlaySkiaRenderTarget();
return _renderTarget;
}
}
private static IntPtr TryGetHwnd(IEnumerable<object> surfaces)
{
try
{
foreach (object surface in surfaces)
{
if (surface is IPlatformHandle handle &&
string.Equals(handle.HandleDescriptor, "HWND", StringComparison.OrdinalIgnoreCase))
{
return handle.Handle;
}
}
}
catch
{
}
return IntPtr.Zero;
}
public ISkiaSurface? TryCreateSurface(PixelSize size, ISkiaGpuRenderSession? session)
{
if (size.Width <= 0 || size.Height <= 0)
@ -85,6 +136,20 @@ internal sealed class OverlaySkiaRenderTarget : ISkiaGpuRenderTarget
private int _width;
private int _height;
private int _loggedSharedTextureDisabled;
private bool _disposed;
private static int _surfaceCreateCount;
/// <summary>
/// Full-size raster surfaces created this session (startup + resizes, and
/// the old popup-flash rebuilds). Popup open/close logging compares it
/// before and after each popup: anything other than +0 is the flash.
/// </summary>
internal static int SurfaceCreateCount => Volatile.Read(ref _surfaceCreateCount);
internal bool IsDisposed
{
get { lock (_sync) return _disposed; }
}
public bool IsCorrupted => false;
@ -105,10 +170,12 @@ internal sealed class OverlaySkiaRenderTarget : ISkiaGpuRenderTarget
{
lock (_sync)
{
_disposed = true;
_surface?.Dispose();
_surface = null;
_softwareBuffer = null;
_sharedTexturePublisher?.Dispose();
_sharedTexturePublisher = null;
_width = 0;
_height = 0;
}
@ -174,13 +241,22 @@ internal sealed class OverlaySkiaRenderTarget : ISkiaGpuRenderTarget
if (_surface != null && width == _width && height == _height)
return;
// Why the surface is being (re)built. "recreate-after-dispose" at an
// unchanged size is the old popup-flash signature: a TopLevel disposed
// this target and the overlay window had to rebuild it.
string reason = _surface != null
? $"resize {_width}x{_height}->{width}x{height}"
: _disposed ? "recreate-after-dispose" : "initial";
_disposed = false;
_surface?.Dispose();
_width = width;
_height = height;
var info = new SKImageInfo(width, height, SKColorType.Bgra8888, SKAlphaType.Premul);
_surface = SKSurface.Create(info);
RynthLog.UI($"OverlaySkiaRenderTarget: Created raster render surface {_width}x{_height}.");
int total = Interlocked.Increment(ref _surfaceCreateCount);
RynthLog.UI($"OverlaySkiaRenderTarget: Created raster render surface {_width}x{_height} (reason={reason}, total={total}).");
}
}
@ -259,6 +335,53 @@ internal sealed class OverlaySkiaRenderSession : ISkiaGpuRenderSession
}
}
/// <summary>
/// Render target for any Avalonia TopLevel that is not the overlay window.
/// Avalonia needs somewhere to draw, but only the overlay window's frames may
/// reach the game: this target draws into a private 1x1 raster surface and
/// never submits, reads back or clears anything shared.
/// </summary>
internal sealed class DetachedOverlayRenderTarget : ISkiaGpuRenderTarget
{
private readonly object _sync = new();
private SKSurface? _surface;
public bool IsCorrupted => false;
public ISkiaGpuRenderSession BeginRenderingSession()
{
lock (_sync)
{
_surface ??= SKSurface.Create(new SKImageInfo(1, 1, SKColorType.Bgra8888, SKAlphaType.Premul))
?? throw new InvalidOperationException("Detached overlay render surface could not be created.");
return new Session(_surface);
}
}
public void Dispose()
{
lock (_sync)
{
_surface?.Dispose();
_surface = null;
}
}
private sealed class Session : ISkiaGpuRenderSession
{
public Session(SKSurface surface) => SkSurface = surface;
public GRContext GrContext => null!;
public double ScaleFactor => 1.0d;
public SKSurface SkSurface { get; }
public GRSurfaceOrigin SurfaceOrigin => GRSurfaceOrigin.TopLeft;
public void Dispose()
{
}
}
}
internal sealed class OverlaySkiaSurface : ISkiaSurface
{
public OverlaySkiaSurface(int width, int height)

View file

@ -111,6 +111,20 @@ internal static class MetaPanel
// Composite condition indices: All=2, Any=3, Not=20
private static bool IsCompositeCondition(int idx) => idx is 2 or 3 or 20;
/// <summary>One condition as text, nested ones included: "Not No Monsters Within Dist: 5",
/// "Any(Chat Message: …, Navroute Empty)".</summary>
private static string CondText(MetaRuleDto c, int depth = 0)
{
string name = c.Condition >= 0 && c.Condition < ConditionNames.Length
? ConditionNames[c.Condition] : $"Cond({c.Condition})";
if (IsCompositeCondition(c.Condition) && c.Children.Count > 0 && depth < MaxSubConditionDepth)
{
if (c.Condition == 20) return $"Not {CondText(c.Children[0], depth + 1)}";
return $"{name}({string.Join(", ", c.Children.Select(x => CondText(x, depth + 1)))})";
}
return string.IsNullOrEmpty(c.ConditionData) ? name : $"{name}: {c.ConditionData}";
}
// All action index = 4
private static bool IsAllAction(int idx) => idx == 4;
@ -796,10 +810,7 @@ internal static class MetaPanel
string condText;
if (IsCompositeCondition(rule.Condition) && rule.Children.Count > 0)
{
var first = rule.Children[0];
string fn = first.Condition >= 0 && first.Condition < ConditionNames.Length
? ConditionNames[first.Condition] : $"Cond({first.Condition})";
string ft = string.IsNullOrEmpty(first.ConditionData) ? fn : $"{fn}: {first.ConditionData}";
string ft = CondText(rule.Children[0]);
condText = rule.Children.Count > 1
? $"{condName}: {ft} (+{rule.Children.Count - 1})"
: $"{condName}: {ft}";
@ -869,9 +880,7 @@ internal static class MetaPanel
});
foreach (var child in rule.Children)
{
string cn = child.Condition >= 0 && child.Condition < ConditionNames.Length
? ConditionNames[child.Condition] : $"Cond({child.Condition})";
string ct = string.IsNullOrEmpty(child.ConditionData) ? cn : $"{cn}: {child.ConditionData}";
string ct = CondText(child);
groupPanel.Children.Add(new TextBlock
{
Text = $" • {ct}", Foreground = ColMute, FontSize = 9,
@ -1133,7 +1142,9 @@ internal static class MetaPanel
}
else
{
BuildSubRuleSection(content, ps, picker, rebuild, r.Children, "Sub-Conditions", isAction: false);
BuildSubRuleSection(content, ps, picker, rebuild, r.Children,
r.Condition == 20 ? "Not (one condition):" : "Sub-Conditions", isAction: false,
maxCount: r.Condition == 20 ? 1 : int.MaxValue);
}
// ── Action ────────────────────────────────────────────────────────────
@ -1227,9 +1238,14 @@ internal static class MetaPanel
content.Children.Add(btnRow);
}
// Sub-conditions nest: a Not/All/Any sub-condition gets its own indented list below its
// row (a Not takes exactly one). They used to be single flat rows, so a Not under an All
// had nowhere to say what it negates. Deep enough for anything a meta writes.
private const int MaxSubConditionDepth = 4;
private static void BuildSubRuleSection(
StackPanel content, PanelState ps, PickerState picker, Action rebuild,
List<MetaRuleDto> subRules, string label, bool isAction)
List<MetaRuleDto> subRules, string label, bool isAction, int depth = 0, int maxCount = int.MaxValue)
{
content.Children.Add(new TextBlock
{
@ -1255,11 +1271,30 @@ internal static class MetaPanel
{
if (isAction) sub.Action = idx; else sub.Condition = idx;
typeBtn.Content = names[idx];
if (!isAction)
{
// Composite ↔ simple changes the row's shape: redraw it.
if (!IsCompositeCondition(idx)) sub.Children.Clear();
else if (idx == 20 && sub.Children.Count > 1) sub.Children.RemoveRange(1, sub.Children.Count - 1);
rebuild();
}
});
};
Grid.SetColumn(typeBtn, 0);
subRow.Children.Add(typeBtn);
bool nests = !isAction && IsCompositeCondition(sub.Condition) && depth < MaxSubConditionDepth;
if (nests)
{
subRow.Children.Add(new TextBlock
{
Text = sub.Condition == 20 ? "(the condition below)" : "(the conditions below)",
Foreground = ColTextDim, FontSize = 9, VerticalAlignment = VerticalAlignment.Center,
Margin = new Thickness(6, 0, 0, 0),
});
Grid.SetColumn(subRow.Children[^1], 1);
}
var dataBox = new TextBox
{
Text = isAction ? sub.ActionData : sub.ConditionData,
@ -1270,7 +1305,7 @@ internal static class MetaPanel
};
dataBox.TextChanged += (_, _) => { if (isAction) sub.ActionData = dataBox.Text ?? ""; else sub.ConditionData = dataBox.Text ?? ""; };
Grid.SetColumn(dataBox, 1);
subRow.Children.Add(dataBox);
if (!nests) subRow.Children.Add(dataBox);
var rmBtn = new Button
{
@ -1286,8 +1321,19 @@ internal static class MetaPanel
subRow.Children.Add(rmBtn);
content.Children.Add(subRow);
if (nests)
{
var nested = new StackPanel { Margin = new Thickness(14, 0, 0, 2) };
string nestedLabel = sub.Condition switch { 20 => "Not:", 2 => "All of:", _ => "Any of:" };
BuildSubRuleSection(nested, ps, picker, rebuild, sub.Children, nestedLabel, isAction: false,
depth + 1, maxCount: sub.Condition == 20 ? 1 : int.MaxValue);
content.Children.Add(nested);
}
}
if (subRules.Count >= maxCount) return; // a Not already has its one operand
var addSubBtn = new Button
{
Content = $"+ Add",

View file

@ -1148,10 +1148,11 @@ internal static partial class RadarPanel
HorizontalContentAlignment = HorizontalAlignment.Center,
VerticalContentAlignment = VerticalAlignment.Center,
};
// Tooltip parameter intentionally unused: ToolTip.SetTip() schedules
// an Avalonia ToolTip Popup whose hover-enter side effects flash the
// entire overlay capture pipeline (a one-frame invalidation that's
// very visible against AC's frame). Glyphs are self-descriptive.
// Tooltip parameter intentionally unused. It was dropped because a
// ToolTip popup used to blank every docked panel (the "panel flash").
// Popups are now drawn inside the overlay frame (OverlayPopups, see
// AvaloniaOverlay.ThreadMain), so ToolTip.SetTip would be safe here;
// the glyphs are self-descriptive, so they stay tooltip-less.
_ = tooltip;
// Eat pointer events so they don't bubble through to the radar
// surface's drag handler beneath.

View file

@ -487,7 +487,22 @@ internal static partial class RynthAiPanel
rightStack.Children.Add(BuildSelectorRow("Profile:", profileSelector));
rightStack.Children.Add(BuildSelectorRow("Nav:", navSelector));
rightStack.Children.Add(BuildSelectorRow("Loot:", lootSelector));
// ✎ opens the standalone Loot Editor on the loot profile in use - or, while a
// vendor is open, on that vendor's AutoVendor profile (both are .utl files).
var lootEditButton = new Button
{
Content = "✎",
FontSize = 10,
Padding = new Thickness(5, 0),
Margin = new Thickness(3, 0, 0, 0),
MinHeight = 0,
Background = new SolidColorBrush(Color.FromRgb(0x2D, 0x38, 0x47)),
Foreground = ColMute,
BorderThickness = new Thickness(0),
VerticalAlignment = VerticalAlignment.Stretch,
};
ToolTip.SetTip(lootEditButton, "Edit in the Loot Editor: the loot profile in use, or the open vendor's AutoVendor profile.");
rightStack.Children.Add(BuildSelectorRow("Loot:", lootSelector, lootEditButton));
rightStack.Children.Add(BuildSelectorRow("Meta:", metaSelector));
headerGrid.Children.Add(rightStack);
@ -835,6 +850,12 @@ internal static partial class RynthAiPanel
ShowPicker(navSelector, snap.NavProfiles, snap.SelectedNavIdx, idx => _selectProfile?.Invoke(0, idx));
lootSelector.Click += (_, _) =>
ShowPicker(lootSelector, snap.LootProfiles, snap.SelectedLootIdx, idx => _selectProfile?.Invoke(1, idx));
lootEditButton.Click += (_, _) =>
{
ClosePicker();
string path = !string.IsNullOrEmpty(snap.VendorProfilePath) ? snap.VendorProfilePath : snap.CurrentLootPath;
LaunchLootEditor(path);
};
metaSelector.Click += (_, _) =>
ShowPicker(metaSelector, snap.MetaProfiles, snap.SelectedMetaIdx, idx => _selectProfile?.Invoke(2, idx));
@ -1035,11 +1056,11 @@ internal static partial class RynthAiPanel
return stack;
}
private static Grid BuildSelectorRow(string label, Button selector)
private static Grid BuildSelectorRow(string label, Button selector, Button? trailing = null)
{
var row = new Grid
{
ColumnDefinitions = new ColumnDefinitions("36,*"),
ColumnDefinitions = new ColumnDefinitions(trailing == null ? "36,*" : "36,*,Auto"),
Margin = new Thickness(0, 0, 0, 0)
};
row.Children.Add(new TextBlock
@ -1051,9 +1072,52 @@ internal static partial class RynthAiPanel
});
row.Children.Add(selector);
Grid.SetColumn(selector, 1);
if (trailing != null)
{
row.Children.Add(trailing);
Grid.SetColumn(trailing, 2);
}
return row;
}
[DllImport("shell32.dll", CharSet = CharSet.Unicode, EntryPoint = "ShellExecuteW")]
private static extern IntPtr ShellExecuteW(IntPtr hwnd, string lpOperation, string lpFile,
string? lpParameters, string? lpDirectory, int nShowCmd);
/// <summary>
/// Starts the standalone Loot Editor on <paramref name="profilePath"/> (empty = no file).
/// The installer puts it in {app}\Tools\LootEditor next to Runtime\, so walk up from the
/// engine module (Runtime\ or Runtime\.engine_loads\) to find it. ShellExecute, not
/// Process.Start: the Process API is the documented AV hazard inside acclient.exe.
/// </summary>
private static void LaunchLootEditor(string? profilePath)
{
try
{
string? exe = null;
string? dir = EntryPoint.EngineDirectory;
for (int i = 0; i < 4 && !string.IsNullOrEmpty(dir) && exe == null; i++, dir = System.IO.Path.GetDirectoryName(dir))
{
string candidate = System.IO.Path.Combine(dir, "Tools", "LootEditor", "RynthCore.LootEditor.exe");
if (System.IO.File.Exists(candidate)) exe = candidate;
}
exe ??= @"C:\Games\RynthCore\Tools\LootEditor\RynthCore.LootEditor.exe";
if (!System.IO.File.Exists(exe))
{
RynthLog.Info($"RynthAiPanel: Loot Editor not found (looked for {exe}).");
return;
}
string? args = string.IsNullOrEmpty(profilePath) ? null : $"\"{profilePath}\"";
IntPtr r = ShellExecuteW(IntPtr.Zero, "open", exe, args, System.IO.Path.GetDirectoryName(exe), 1 /* SW_SHOWNORMAL */);
RynthLog.Info($"RynthAiPanel: Loot Editor {(r.ToInt64() > 32 ? "started" : $"failed to start (code {r.ToInt64()})")}: {exe} {args}");
}
catch (Exception ex)
{
RynthLog.Info($"RynthAiPanel: Loot Editor launch threw {ex.GetType().Name}: {ex.Message}");
}
}
private static Button CreateSelector(string text)
{
// ImGui dashboard pushes ImGuiCol.FrameBg = (0.18, 0.22, 0.28) → #2D3847
@ -1507,6 +1571,9 @@ internal static partial class RynthAiPanel
[JsonPropertyName("metaProfiles")] public string[] MetaProfiles { get; set; } = Array.Empty<string>();
[JsonPropertyName("currentNavName")] public string CurrentNavName { get; set; } = string.Empty;
[JsonPropertyName("currentLootName")] public string CurrentLootName { get; set; } = string.Empty;
[JsonPropertyName("currentLootPath")] public string CurrentLootPath { get; set; } = string.Empty;
// Set while a vendor is open: the AutoVendor profile it would use (may not exist yet).
[JsonPropertyName("vendorProfilePath")] public string VendorProfilePath { get; set; } = string.Empty;
[JsonPropertyName("currentMetaName")] public string CurrentMetaName { get; set; } = string.Empty;
[JsonPropertyName("selectedNavIdx")] public int SelectedNavIdx { get; set; }
[JsonPropertyName("selectedLootIdx")] public int SelectedLootIdx { get; set; }

View file

@ -61,7 +61,7 @@ internal static class SettingsPanel
private static readonly string[] Tabs =
{ "Display", "UI", "Misc", "Recharge", "Melee Combat", "Spell Combat",
"Ranges", "Navigation", "Buffing", "Crafting", "Looting" };
"Ranges", "Navigation", "Buffing", "Crafting", "Looting", "Vendoring" };
private static readonly string[] AttackHeights = { "Low", "Medium", "High" };
private static readonly string[] LootOwnershipModes = { "My Kills Only", "Fellowship Kills", "All Corpses" };
@ -93,11 +93,27 @@ internal static class SettingsPanel
public bool EnableRaycasting { get; set; }
public bool UseArcs { get; set; }
public float BowArcVelocity { get; set; } = 25f;
public float MissileArcClearance { get; set; } = 0.5f;
// Vendoring (RynthAi AutoVendor; defaults match LegacyUiSettings)
public bool AutoVendorEnabled { get; set; }
public bool AutoVendorEnableBuying { get; set; } = true;
public bool AutoVendorEnableSelling { get; set; } = true;
public bool AutoVendorTestMode { get; set; } = true;
public bool AutoVendorThink { get; set; }
public bool AutoVendorShowMerchantInfo { get; set; } = true;
public bool AutoVendorOnlyFromMainPack { get; set; }
public int AutoVendorTries { get; set; } = 4;
public int AutoVendorTriesTime { get; set; } = 5000;
public bool LosDebugLog { get; set; }
public float CrossbowArcVelocity { get; set; } = 40f;
public float AtlatlArcVelocity { get; set; } = 22f;
public float MagicArcVelocity { get; set; } = 25f;
public int BlacklistAttempts { get; set; } = 3;
public int BlacklistTimeoutSec { get; set; } = 30;
// Not shown in this panel, but carried so a save doesn't send them missing:
// RynthAi applied the missing value as 0 on every panel click (2026-09-27).
public int BlacklistCastSettleMs { get; set; } = 1500;
public int MonsterDisengageRange { get; set; }
public int TargetNoProgressTimeoutSec { get; set; }
public int GiveQueueIntervalMs { get; set; } = 150;
// Recharge
@ -155,6 +171,7 @@ internal static class SettingsPanel
public float NavDeadZone { get; set; } = 4f;
public float NavSweepMult { get; set; } = 2.5f;
public float NavLookaheadYards { get; set; } = 4f;
public float NavShortcutYards { get; set; } = 1f;
public float NavTurnRateDegPerSec { get; set; } = 270f;
public float NavTier1TurnSpeed { get; set; } = 3f;
public float PostPortalDelaySec { get; set; } = 4f;
@ -168,6 +185,7 @@ internal static class SettingsPanel
public bool EnableBuffing { get; set; } = true;
public bool RebuffWhenIdle { get; set; }
public int RebuffSecondsRemaining { get; set; } = 300;
public int RebuffTopOffSecondsRemaining { get; set; } = 1200;
public int BuffMinSkillLevelTier1 { get; set; } = 35;
public int BuffMinSkillLevelTier2 { get; set; } = 85;
public int BuffMinSkillLevelTier3 { get; set; } = 135;
@ -480,6 +498,7 @@ internal static class SettingsPanel
case 8: BuildBuffingTab(state, panel, picker); break;
case 9: BuildCraftingTab(state, panel, picker); break;
case 10: BuildLootingTab(state, panel, picker); break;
case 11: BuildVendoringTab(state, panel, picker); break;
}
}
@ -558,14 +577,20 @@ internal static class SettingsPanel
p.Children.Add(SectionHeader("Missile Arc Velocities (m/s)"));
p.Children.Add(BoolRow("Use Arcs for Missile LoS", state.Data.UseArcs,
v => { state.Data.UseArcs = v; Push(state); state.Rebuild?.Invoke(); },
"When off, all missile LoS checks are linear (eye-to-eye)."));
"A missile target must pass both the straight line and the real arrow arc, ceilings included (dungeons too).\nWhen off, all missile LoS checks are linear (eye-to-eye)."));
if (state.Data.UseArcs)
{
p.Children.Add(FloatRow("Bow", state.Data.BowArcVelocity, 10f, 60f, 0.5f, v => { state.Data.BowArcVelocity = v; Push(state); }, "Bow projectile speed (m/s). Lower = higher arc."));
p.Children.Add(FloatRow("Crossbow", state.Data.CrossbowArcVelocity, 10f, 80f, 0.5f, v => { state.Data.CrossbowArcVelocity = v; Push(state); }));
p.Children.Add(FloatRow("Atlatl", state.Data.AtlatlArcVelocity, 10f, 60f, 0.5f, v => { state.Data.AtlatlArcVelocity = v; Push(state); }));
p.Children.Add(FloatRow("Magic Arc", state.Data.MagicArcVelocity, 10f, 60f, 0.5f, v => { state.Data.MagicArcVelocity = v; Push(state); }));
p.Children.Add(FloatRow("Arc Clearance (m)", state.Data.MissileArcClearance, 0f, 3f, 0.1f,
v => { state.Data.MissileArcClearance = MathF.Max(0f, v); Push(state); },
"Extra headroom the arc must have at mid-flight. Raise it if arrows still hit ceilings; lower it if reachable mobs get skipped."));
}
p.Children.Add(BoolRow("LoS Debug Log", state.Data.LosDebugLog,
v => { state.Data.LosDebugLog = v; Push(state); },
"Log each blocked missile target and why (arc peak, where it hits) to the RynthCore log. /ra lostest bow tests the selected mob."));
p.Children.Add(Spacer());
p.Children.Add(SectionHeader("Monster Blacklist"));
@ -772,6 +797,9 @@ internal static class SettingsPanel
p.Children.Add(FloatRow("Lookahead (yd)", state.Data.NavLookaheadYards, 0f, 30f, 0.5f,
v => { state.Data.NavLookaheadYards = MathF.Max(0f, v); Push(state); },
"Within this distance of a waypoint, blend the aim point toward the next one to cut corners smoothly. 0 = off."));
p.Children.Add(FloatRow("Shortcut Tolerance (yd)", state.Data.NavShortcutYards, 0f, 10f, 0.5f,
v => { state.Data.NavShortcutYards = MathF.Max(0f, v); Push(state); },
"On reaching a waypoint, skip ahead only past points that all lie within this distance of the straight line to the new target. 0 = visit every waypoint."));
p.Children.Add(FloatRow("Turn Rate (deg/s)", state.Data.NavTurnRateDegPerSec, 30f, 720f, 15f,
v => { state.Data.NavTurnRateDegPerSec = v; Push(state); },
"Legacy / Mode 0 heading-servo max turn speed. Ignored by Tier 1 and Tier 2."));
@ -804,6 +832,9 @@ internal static class SettingsPanel
p.Children.Add(IntRow("Rebuff With (seconds left)", state.Data.RebuffSecondsRemaining, 30, 1800, 30,
v => { state.Data.RebuffSecondsRemaining = v; Push(state); },
"Recast a self buff when its remaining duration drops below this value.\nDefault 300 (5 minutes). Lower values rebuff more eagerly."));
p.Children.Add(IntRow("Also Refresh Under (seconds left)", state.Data.RebuffTopOffSecondsRemaining, 30, 3600, 60,
v => { state.Data.RebuffTopOffSecondsRemaining = v; Push(state); },
"When a buff is due, also recast every other buff with less than this much time left,\nso they land together. Buffs with more time are left alone. Default 1200 (20 minutes).\nAt or below 'Rebuff With', only the expiring buff is recast."));
p.Children.Add(Spacer());
p.Children.Add(SectionHeader("Buff Difficulty (Min Buffed Skill)"));
@ -859,6 +890,43 @@ internal static class SettingsPanel
}
}
private static void BuildVendoringTab(PanelState state, StackPanel p, PickerState picker)
{
p.Children.Add(SectionHeader("AutoVendor"));
p.Children.Add(BoolRow("Enabled", state.Data.AutoVendorEnabled,
v => { state.Data.AutoVendorEnabled = v; Push(state); },
"Buy and sell by a loot profile when a vendor opens (and allow /ub autovendor).\nProfile: <Vendor Name>.utl, else default.utl, in the AutoVendor folder."));
p.Children.Add(BoolRow("Test Mode (only print what it would do)", state.Data.AutoVendorTestMode,
v => { state.Data.AutoVendorTestMode = v; Push(state); },
"Lists what would be bought and sold without trading. Leave this on until the lists look right."));
p.Children.Add(BoolRow("Buy", state.Data.AutoVendorEnableBuying,
v => { state.Data.AutoVendorEnableBuying = v; Push(state); }));
p.Children.Add(BoolRow("Sell", state.Data.AutoVendorEnableSelling,
v => { state.Data.AutoVendorEnableSelling = v; Push(state); }));
p.Children.Add(BoolRow("Only Sell From Main Pack", state.Data.AutoVendorOnlyFromMainPack,
v => { state.Data.AutoVendorOnlyFromMainPack = v; Push(state); }));
p.Children.Add(BoolRow("Show Merchant Info", state.Data.AutoVendorShowMerchantInfo,
v => { state.Data.AutoVendorShowMerchantInfo = v; Push(state); },
"Print the vendor's buy/sell rates and max value when it opens."));
p.Children.Add(BoolRow("Think When Finished", state.Data.AutoVendorThink,
v => { state.Data.AutoVendorThink = v; Push(state); },
"Send 'AutoVendor finished: <vendor>' (and failures) as a /tell to yourself, for metas."));
p.Children.Add(Spacer());
p.Children.Add(SectionHeader("/ub vendor open"));
p.Children.Add(IntRow("Tries", state.Data.AutoVendorTries, 1, 20, 1,
v => { state.Data.AutoVendorTries = v; Push(state); }));
p.Children.Add(IntRow("Time Between Tries (ms)", state.Data.AutoVendorTriesTime, 500, 30000, 250,
v => { state.Data.AutoVendorTriesTime = v; Push(state); }));
p.Children.Add(Spacer());
p.Children.Add(new TextBlock
{
Text = "Never sold: equipped, attuned, bonded, retained, tinkered, imbued, inscribed, rare, zero value, packs, or anything a Keep rule could match.",
Foreground = ColMute, FontSize = 10, TextWrapping = Avalonia.Media.TextWrapping.Wrap, Margin = new Thickness(0, 2, 0, 0),
});
}
private static void BuildLootingTab(PanelState state, StackPanel p, PickerState picker)
{
p.Children.Add(BoolRow("Enable Looting", state.Data.EnableLooting,