RynthCore as of 2026-11-12 (internal eb12118): release 2026.11.12.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
55e15c0ac4
commit
7f1e7d5039
71 changed files with 3413 additions and 587 deletions
|
|
@ -379,7 +379,7 @@ internal static class EngineFrameController
|
|||
MainThreadHangWatchdog.Step = "EndScene: engine pipeline (layout, prefetches, queues)";
|
||||
EnsureCore(pDevice);
|
||||
|
||||
// Settings > Display: borderless windowed + AC window placement. Throttled; reads only
|
||||
// Settings > Game Client: borderless windowed + AC window placement. Throttled; reads only
|
||||
// here - the window itself is changed from the game WndProc (AcWindowChrome).
|
||||
try { UI.AcWindowChrome.Tick(_gameHwnd); }
|
||||
catch (Exception ex) { RynthLog.UI($"AcWindowChrome.Tick threw {ex.GetType().Name}: {ex.Message}"); }
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
//
|
||||
// The bar's size is its own text size step (PanelTextScale chrome row): the bar's
|
||||
// fonts come from that baked set and its metrics scale by the step's factor. Set it
|
||||
// from the grip's right-click menu, Ctrl+wheel over the bar, Settings > Display or
|
||||
// from the grip's right-click menu, Ctrl+wheel over the bar, Settings > Interface or
|
||||
// /rc ui barsize.
|
||||
//
|
||||
// Rows (BarLayout): the player picks how many rows the bar has (1-6) and the most
|
||||
|
|
@ -182,18 +182,21 @@ internal static class ImGuiBar
|
|||
private static string[] _scriptKeys = Array.Empty<string>();
|
||||
private static string _tooltip = "";
|
||||
private static bool _placed;
|
||||
private static Vector2 _pos, _persistedPos;
|
||||
// What may write a new position to the bar= row: the user dragging the grip, or the bar being
|
||||
// pulled back on screen by a size change (a few frames: the window grows a frame late). A clamp
|
||||
// from a smaller AC window leaves the saved position alone.
|
||||
private static bool _userMoved;
|
||||
private static int _lastStep, _sizeWatch;
|
||||
private static Vector2 _pos;
|
||||
// The bar's home (the bar= row, or where the player dragged it) and where that draws: pulled onto
|
||||
// the screen for the bar's size and the display, worked out again from the home whenever either
|
||||
// changes (UI/PanelPlacement). Only the player's drag writes the bar= row (2026-11-12: a pull from
|
||||
// a size change - a text size step, new rows, icons added as plugins load, a font re-bake - stayed
|
||||
// for the session and was saved, so the bar came back moved after a reload or login).
|
||||
private static readonly HomePlace Place = new();
|
||||
private static Vector2 _savedHome; // the home the bar= row holds (logical units)
|
||||
private static bool _userMoved, _pullLogged;
|
||||
|
||||
// The bar's rows and icons-per-row limit (BarLayout). Read from panel_state once, then kept
|
||||
// here so a change shows at once (the file is written in the background); one reference, so
|
||||
// a reader on another thread never sees half a change.
|
||||
private sealed record RowSettings(int Rows, int MaxPerRow);
|
||||
private static RowSettings? _rowSettings, _lastRowSettings;
|
||||
private static RowSettings? _rowSettings;
|
||||
// Icons per row as last drawn: where the icons-per-row "-" starts from when there is no limit.
|
||||
private static int _shownPerRow = 1;
|
||||
|
||||
|
|
@ -385,17 +388,18 @@ internal static class ImGuiBar
|
|||
{
|
||||
var saved = PanelStateStore.BarPosition;
|
||||
Vector2 logical = saved.HasValue ? new Vector2((float)saved.Value.Left, (float)saved.Value.Top) : new Vector2(50, 5);
|
||||
_pos = _persistedPos = logical * place;
|
||||
_savedHome = logical;
|
||||
// The size isn't known before its first frame: KeepOnScreen fits it once the window has one.
|
||||
Place.Set(logical * place, Vector2.Zero, ImGuiNET.ImGui.GetIO().DisplaySize);
|
||||
_pos = Place.Drawn;
|
||||
ImGuiNET.ImGui.SetNextWindowPos(_pos, ImGuiCond.Always);
|
||||
_placed = true;
|
||||
_lastStep = step; // the size the bar loads at is the baseline, not a change
|
||||
_lastRowSettings = RowLayout;
|
||||
_userMoved = false;
|
||||
_pullLogged = false;
|
||||
RynthLog.UI("ImGuiBar: " + Place.Describe("the bar", saved.HasValue ? "its saved bar row" : "the default spot (no bar row)")
|
||||
+ $" Layout {PanelStateStore.CurrentPath}.");
|
||||
}
|
||||
|
||||
if (step != _lastStep) { _lastStep = step; _sizeWatch = 4; }
|
||||
// New rows reshape the bar (wider or taller): the same pull back on screen as a new size.
|
||||
RowSettings rowsNow = RowLayout;
|
||||
if (!ReferenceEquals(rowsNow, _lastRowSettings)) { _lastRowSettings = rowsNow; _sizeWatch = 4; }
|
||||
PushBarWindowStyle(s);
|
||||
ImGuiNET.ImGui.Begin("##rc_bar", BarFlags);
|
||||
try
|
||||
|
|
@ -414,29 +418,36 @@ internal static class ImGuiBar
|
|||
PopBarWindowStyle();
|
||||
}
|
||||
|
||||
if (!ImGuiNET.ImGui.IsMouseDown(ImGuiMouseButton.Left) && _pos != _persistedPos)
|
||||
// Only the player's drag moves the bar's home and writes the bar= row (once the mouse is up).
|
||||
if (_userMoved && !ImGuiNET.ImGui.IsMouseDown(ImGuiMouseButton.Left))
|
||||
{
|
||||
_persistedPos = _pos;
|
||||
if (_userMoved || _sizeWatch > 0)
|
||||
_userMoved = false;
|
||||
Vector2 logical = Place.Home / place;
|
||||
if (logical != _savedHome)
|
||||
{
|
||||
Vector2 logical = _pos / place;
|
||||
_savedHome = logical;
|
||||
double left = logical.X, top = logical.Y;
|
||||
UiBackgroundWriter.Enqueue("persist bar", () => PanelStateStore.SetBarPosition(left, top));
|
||||
AvaloniaOverlay.SyncDockedBarPosition(left, top);
|
||||
}
|
||||
_userMoved = false;
|
||||
}
|
||||
if (_sizeWatch > 0) _sizeWatch--;
|
||||
}
|
||||
|
||||
/// <summary>A bigger size or new rows can push the bar's right or bottom end off the screen: pull it back (not while it is being dragged).</summary>
|
||||
/// <summary>
|
||||
/// A bigger size, new rows, icons added as plugins load or a smaller display can push the bar's right or
|
||||
/// bottom end off the screen: drawn from its home, pulled back only as far as needed, and back home once
|
||||
/// it fits again (UI/PanelPlacement). Never saved. Not while it is being dragged.
|
||||
/// </summary>
|
||||
private static void KeepOnScreen()
|
||||
{
|
||||
Vector2 display = ImGuiNET.ImGui.GetIO().DisplaySize;
|
||||
if (display.X <= 1 || ImGuiNET.ImGui.IsMouseDown(ImGuiMouseButton.Left)) return;
|
||||
Vector2 pos = ImGuiNET.ImGui.GetWindowPos();
|
||||
Vector2 next = Vector2.Clamp(pos, Vector2.Zero, Vector2.Max(Vector2.Zero, display - ImGuiNET.ImGui.GetWindowSize()));
|
||||
if (next != pos) ImGuiNET.ImGui.SetWindowPos(next);
|
||||
if (ImGuiNET.ImGui.IsMouseDown(ImGuiMouseButton.Left) && _userMoved) return;
|
||||
if (!Place.Fit(ImGuiNET.ImGui.GetWindowSize(), ImGuiNET.ImGui.GetIO().DisplaySize)) return;
|
||||
ImGuiNET.ImGui.SetWindowPos(Place.Drawn);
|
||||
if (Place.Pulled && !_pullLogged)
|
||||
{
|
||||
_pullLogged = true;
|
||||
RynthLog.UI("ImGuiBar: " + Place.DescribePull("the bar") + $" (bar row {HomePlace.Xy(_savedHome)}).");
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawContent(float s, bool popped)
|
||||
|
|
@ -468,6 +479,7 @@ internal static class ImGuiBar
|
|||
if (display.X > 1)
|
||||
next = Vector2.Clamp(next, Vector2.Zero, Vector2.Max(Vector2.Zero, display - size));
|
||||
ImGuiNET.ImGui.SetWindowPos(next);
|
||||
Place.MoveTo(next, size, display); // the player's spot: the bar's home
|
||||
_userMoved = true;
|
||||
}
|
||||
SafeImGui.SetItemTooltip(_tooltip);
|
||||
|
|
|
|||
|
|
@ -170,12 +170,13 @@ internal static class ImGuiPanelHost
|
|||
public bool NeedsPlacement;
|
||||
public Vector2 Pos, Size; // client pixels, as last drawn
|
||||
public Vector2 PersistedPos, PersistedSize;
|
||||
// The saved spot when the client was too small for it at placement (AC's 800x600
|
||||
// character select): re-applied as the display grows, dropped once it fits or the
|
||||
// player moves the panel. Without this a panel saved near the right or bottom edge
|
||||
// came back pulled inwards on every restart.
|
||||
public Vector2? DesiredPos;
|
||||
public Vector2 DesiredForDisplay;
|
||||
// Docked: the panel's home (the saved spot, or where the player / a request put it) and
|
||||
// where that draws, pulled onto the screen for its size and the display (UI/PanelPlacement).
|
||||
// Worked out again whenever either changes, from the home, and the home is what is saved:
|
||||
// a pull from a moment's smaller client (AC's 800x600 character select) or a taller first
|
||||
// frame (a fit-height window at its saved height) is undone once it fits and never saved.
|
||||
public readonly HomePlace Place = new();
|
||||
public bool PullLogged; // the first pull after this load's placement is logged
|
||||
public Vector2? RequestedSize; // logical units, applied next frame (under Sync)
|
||||
public Vector2? RequestedPos; // logical units, applied next frame (under Sync)
|
||||
public volatile bool HasRequest; // RequestedSize or RequestedPos is set
|
||||
|
|
@ -514,7 +515,7 @@ internal static class ImGuiPanelHost
|
|||
foreach (Entry e in order)
|
||||
{
|
||||
if (!e.Shown && !IsOpen(e.Title)) continue;
|
||||
lines.Add($"face {e.Title}: requested={IsOpen(e.Title)} shown={e.Shown} pos=({e.Pos.X:0},{e.Pos.Y:0}) size=({e.Size.X:0}x{e.Size.Y:0}) failures={e.Failures}{(e.Error != null ? " error=" + e.Error : "")}");
|
||||
lines.Add($"face {e.Title}: requested={IsOpen(e.Title)} shown={e.Shown} pos=({e.Pos.X:0},{e.Pos.Y:0}){(e.Place.Pulled ? $" home=({e.Place.Home.X:0},{e.Place.Home.Y:0})" : "")} size=({e.Size.X:0}x{e.Size.Y:0}) failures={e.Failures}{(e.Error != null ? " error=" + e.Error : "")}");
|
||||
}
|
||||
if (lines.Count == 0) lines.Add("faces: none open");
|
||||
return lines;
|
||||
|
|
@ -734,7 +735,7 @@ internal static class ImGuiPanelHost
|
|||
{
|
||||
if (_restored) return;
|
||||
_restored = true;
|
||||
// Settings > Display "Remember Open Windows and Positions" (default on).
|
||||
// Settings > Interface "Remember Open Windows and Positions" (default on).
|
||||
if (!Plugins.EngineSettings.RememberWindowLayout) return;
|
||||
OpenSavedOpen();
|
||||
}
|
||||
|
|
@ -978,28 +979,34 @@ internal static class ImGuiPanelHost
|
|||
{
|
||||
Vector2 size = entry.Spec.DefaultSize;
|
||||
Vector2 pos;
|
||||
string source;
|
||||
if (PanelStateStore.TryGetPanel(entry.Title, out PanelStateStore.PanelEntry saved) && (saved.Width > 0 || saved.Left != 0 || saved.Top != 0))
|
||||
{
|
||||
pos = new Vector2((float)saved.Left, (float)saved.Top);
|
||||
if (saved.Width > 0 && saved.Height > 0) size = new Vector2((float)saved.Width, (float)saved.Height);
|
||||
source = "its saved place";
|
||||
}
|
||||
else if (entry.Spec.DefaultPos is Vector2 defaultPos)
|
||||
{
|
||||
pos = defaultPos; // the face's own first spot (a script window's FirstUseEver position)
|
||||
source = "its first-open spot";
|
||||
}
|
||||
else if (entry.Spec.OpenCorner != PanelCorner.None && CornerLogicalPos(entry.Spec.OpenCorner, size, placeScale) is Vector2 corner)
|
||||
{
|
||||
pos = corner;
|
||||
source = "its first-open corner";
|
||||
}
|
||||
else if (entry.Spec.OpenCentered && CenteredLogicalPos(size, placeScale) is Vector2 centered)
|
||||
{
|
||||
pos = centered;
|
||||
source = "the centre";
|
||||
}
|
||||
else
|
||||
{
|
||||
int shown = 0;
|
||||
lock (Sync) foreach (Entry e in DrawOrder) if (e.Shown) shown++;
|
||||
pos = new Vector2(100 + shown * 20, 100 + shown * 20); // Avalonia's cascade
|
||||
source = "the cascade";
|
||||
}
|
||||
|
||||
size = Vector2.Max(size, entry.Spec.MinSize);
|
||||
|
|
@ -1007,25 +1014,43 @@ internal static class ImGuiPanelHost
|
|||
if (PanelRouter.ResolveDockedFace(entry.Title) == PanelFace.Both)
|
||||
pos += new Vector2(24, 24);
|
||||
|
||||
entry.Pos = ClampToDisplay(pos * placeScale, size * placeScale);
|
||||
// Its home is the saved spot; where it draws is that pulled onto the screen (HomePlace), and
|
||||
// DrawPanel lets go of the pull once the panel fits (a bigger display, its real height).
|
||||
Vector2 display = ImGuiNET.ImGui.GetIO().DisplaySize;
|
||||
entry.Size = size * placeScale;
|
||||
entry.Place.Set(pos * placeScale, entry.Size, display);
|
||||
entry.Pos = entry.Place.Drawn;
|
||||
entry.PersistedPos = entry.Pos;
|
||||
entry.PersistedSize = entry.Size;
|
||||
entry.NeedsPlacement = true;
|
||||
entry.DesiredPos = entry.Pos != pos * placeScale ? pos * placeScale : null;
|
||||
entry.DesiredForDisplay = ImGuiNET.ImGui.GetIO().DisplaySize;
|
||||
entry.PullLogged = false;
|
||||
|
||||
// Popped-out windows sit above the game frame, so a docked panel opening under
|
||||
// one would be invisible. The new spot is saved by the open's Persist, so the
|
||||
// panel comes back where it could be seen.
|
||||
// one would be invisible. The new spot is its home now and is saved by the open's
|
||||
// Persist, so the panel comes back where it could be seen.
|
||||
if (ClearOfPopOuts(entry.Pos, entry.Size) is Vector2 clear)
|
||||
{
|
||||
RynthLog.UI($"ImGuiPanelHost: {entry.Title} would open under a popped-out window; " +
|
||||
$"moved from ({entry.Pos.X:0},{entry.Pos.Y:0}) to ({clear.X:0},{clear.Y:0}).");
|
||||
entry.Place.MoveTo(clear, entry.Size, display);
|
||||
entry.Pos = clear;
|
||||
entry.PersistedPos = clear;
|
||||
entry.DesiredPos = null; // don't pull it back under the pop-out as the display grows
|
||||
source = "a spot clear of popped-out windows";
|
||||
}
|
||||
LogPlacement(entry, source);
|
||||
}
|
||||
|
||||
// Titles whose placement this engine load has logged (AC's render thread).
|
||||
private static readonly HashSet<string> PlacementLogged = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>
|
||||
/// One line per panel per engine load (its first placement: the login's or the hot reload's), and every
|
||||
/// placement that pulls it off its saved spot: where it draws, from what, and why. AC thread.
|
||||
/// </summary>
|
||||
private static void LogPlacement(Entry entry, string source)
|
||||
{
|
||||
if (!PlacementLogged.Add(entry.Title) && !entry.Place.Pulled) return;
|
||||
RynthLog.UI("ImGuiPanelHost: " + entry.Place.Describe(entry.Title, source) + $" Layout {PanelStateStore.CurrentPath}.");
|
||||
}
|
||||
|
||||
/// <summary>Above this share of a docked panel hidden by popped-out windows, it opens elsewhere.</summary>
|
||||
|
|
@ -1176,28 +1201,28 @@ internal static class ImGuiPanelHost
|
|||
// A script's size request is its own, not the player's: not saved.
|
||||
if (entry.Dynamic) entry.PersistedSize = entry.Size;
|
||||
}
|
||||
if (reqPos is Vector2 requestedPos)
|
||||
// A face asking for the spot it is drawn at (PluginWindowFace / RynthAiFace after a text
|
||||
// size change: "clamped to the screen at the new size") changes nothing here: the fit
|
||||
// below pulls it onto the screen from its home. Any other spot is its new home.
|
||||
if (reqPos is Vector2 requestedPos && !HomePlace.Near(requestedPos * placeScale, entry.Pos))
|
||||
{
|
||||
entry.Pos = ClampToDisplay(requestedPos * placeScale, entry.Size);
|
||||
entry.PersistedPos = entry.Pos; // not a move by the player: nothing to save
|
||||
entry.DesiredPos = null;
|
||||
entry.Place.MoveTo(requestedPos * placeScale, entry.Size, ImGuiNET.ImGui.GetIO().DisplaySize);
|
||||
entry.Pos = entry.Place.Drawn;
|
||||
entry.PersistedPos = entry.Pos; // not a move by the player: nothing to save now
|
||||
entry.NeedsPlacement = true;
|
||||
}
|
||||
}
|
||||
if (entry.DesiredPos is Vector2 want)
|
||||
// Its size or the display changed: drawn from its home again, pulled onto the screen only
|
||||
// as far as needed (UI/PanelPlacement). Not a move by the player: nothing is saved.
|
||||
if (entry.Place.Fit(entry.Size, ImGuiNET.ImGui.GetIO().DisplaySize))
|
||||
{
|
||||
Vector2 display = ImGuiNET.ImGui.GetIO().DisplaySize;
|
||||
if (display != entry.DesiredForDisplay)
|
||||
entry.Pos = entry.Place.Drawn;
|
||||
entry.PersistedPos = entry.Pos;
|
||||
entry.NeedsPlacement = true;
|
||||
if (entry.Place.Pulled && !entry.PullLogged)
|
||||
{
|
||||
entry.DesiredForDisplay = display;
|
||||
Vector2 p = ClampToDisplay(want, entry.Size);
|
||||
if (p != entry.Pos)
|
||||
{
|
||||
entry.Pos = p;
|
||||
entry.PersistedPos = p; // not a move by the player: nothing to save
|
||||
entry.NeedsPlacement = true;
|
||||
}
|
||||
if (p == want) entry.DesiredPos = null; // back where it was saved
|
||||
entry.PullLogged = true;
|
||||
RynthLog.UI("ImGuiPanelHost: " + entry.Place.DescribePull(entry.Title));
|
||||
}
|
||||
}
|
||||
if (entry.NeedsPlacement)
|
||||
|
|
@ -1251,7 +1276,7 @@ internal static class ImGuiPanelHost
|
|||
return; // closed, popped out or docked back this frame
|
||||
|
||||
ImGuiNET.ImGui.SetCursorPos(new Vector2(0, header));
|
||||
// Per-panel text size (Settings > Display): the face's fonts come from the
|
||||
// Per-panel text size (Settings > Interface): the face's fonts come from the
|
||||
// set baked at that size (ImGuiFonts.Get); the header above keeps its size.
|
||||
// (Until a size change has been re-baked, the nearest size that is.)
|
||||
ImGuiFonts.CurrentStep = ImGuiFonts.BakedStepNear(PanelTextScale.Get(entry.Title));
|
||||
|
|
@ -1294,6 +1319,8 @@ internal static class ImGuiPanelHost
|
|||
Vector2 maxSize = display.X > 1 ? display - outerPos : new Vector2(float.MaxValue, float.MaxValue);
|
||||
Vector2 next = Vector2.Clamp(_resizeStartSize + (mouse - _resizeStartMouse), minSize, Vector2.Max(minSize, maxSize));
|
||||
if (next != outerSize) ImGuiNET.ImGui.SetWindowSize(next);
|
||||
// Resized where it draws: that spot is the player's now (a pulled window doesn't jump back mid-drag).
|
||||
entry.Place.MoveTo(outerPos, next, display);
|
||||
}
|
||||
gHot = over || resizing;
|
||||
if (gHot) ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.ResizeNWSE);
|
||||
|
|
@ -1366,7 +1393,9 @@ internal static class ImGuiPanelHost
|
|||
if (popped) _pendingDragDelta = Vector2.Zero;
|
||||
if (_pendingDragDelta != Vector2.Zero)
|
||||
{
|
||||
ImGuiNET.ImGui.SetWindowPos(ClampToDisplay(ImGuiNET.ImGui.GetWindowPos() + _pendingDragDelta, ImGuiNET.ImGui.GetWindowSize()));
|
||||
Vector2 next = ClampToDisplay(ImGuiNET.ImGui.GetWindowPos() + _pendingDragDelta, ImGuiNET.ImGui.GetWindowSize());
|
||||
ImGuiNET.ImGui.SetWindowPos(next);
|
||||
entry.Place.MoveTo(next, ImGuiNET.ImGui.GetWindowSize(), ImGuiNET.ImGui.GetIO().DisplaySize); // the player's spot
|
||||
_pendingDragDelta = Vector2.Zero;
|
||||
}
|
||||
}
|
||||
|
|
@ -1390,8 +1419,7 @@ internal static class ImGuiPanelHost
|
|||
{
|
||||
entry.PersistedPos = entry.Pos;
|
||||
entry.PersistedSize = entry.Size;
|
||||
entry.DesiredPos = null; // the player placed it: that is the spot now
|
||||
Persist(entry, open: true, placeScale);
|
||||
Persist(entry, open: true, placeScale); // its home (a drag made that the new spot)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1594,6 +1622,7 @@ internal static class ImGuiPanelHost
|
|||
{
|
||||
Vector2 next = ClampToDisplay(winPos + ImGuiNET.ImGui.GetIO().MouseDelta, ImGuiNET.ImGui.GetWindowSize());
|
||||
ImGuiNET.ImGui.SetWindowPos(next);
|
||||
entry.Place.MoveTo(next, ImGuiNET.ImGui.GetWindowSize(), ImGuiNET.ImGui.GetIO().DisplaySize); // the player's spot
|
||||
}
|
||||
|
||||
// Grip dots + DRAG (teal, 9) + title (10), vertically centred.
|
||||
|
|
@ -1641,7 +1670,7 @@ internal static class ImGuiPanelHost
|
|||
}
|
||||
}
|
||||
|
||||
// Text size (the same per-panel setting as Settings > Display).
|
||||
// Text size (the same per-panel setting as Settings > Interface).
|
||||
float tsX = x - (canPopOut ? btn + 2 * s : 0) - 2 * s - btn;
|
||||
ImGuiNET.ImGui.SetCursorPos(new Vector2(tsX, y));
|
||||
int step = PanelTextScale.Get(entry.Title);
|
||||
|
|
@ -1755,11 +1784,11 @@ internal static class ImGuiPanelHost
|
|||
if (ImGuiNET.ImGui.Button(PhosphorIcons.ArrowCounterClockwise + " Reset"))
|
||||
PanelTextScale.ResetWindow(title);
|
||||
ImGuiNET.ImGui.EndDisabled();
|
||||
SafeImGui.SetItemTooltip(all == 0 ? "Back to normal size" : "Back to the All Panels size (Settings > Display)");
|
||||
SafeImGui.SetItemTooltip(all == 0 ? "Back to normal size" : "Back to the All Panels size (Settings > Interface)");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
if (ImGuiNET.ImGui.Button("Use for all windows"))
|
||||
PanelTextScale.UseForAll(step);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Every in-game window at this size (Settings > Display > All Panels)");
|
||||
ImGuiNET.ImGui.SetItemTooltip("Every in-game window at this size (Settings > Interface > All Panels)");
|
||||
}
|
||||
|
||||
private const string DragLabel = PhosphorIcons.DotsSixVertical + "DRAG";
|
||||
|
|
@ -1819,6 +1848,8 @@ internal static class ImGuiPanelHost
|
|||
Vector2 next = Vector2.Clamp(winSize + ImGuiNET.ImGui.GetIO().MouseDelta, minSize, Vector2.Max(minSize, maxSize));
|
||||
if (windowName != null) ImGuiNET.ImGui.SetWindowSize(windowName, next);
|
||||
else ImGuiNET.ImGui.SetWindowSize(next);
|
||||
// Resized where it draws: that spot is the player's now (a pulled window doesn't jump back mid-drag).
|
||||
entry.Place.MoveTo(winPos, next, display);
|
||||
}
|
||||
return hot;
|
||||
}
|
||||
|
|
@ -1848,7 +1879,7 @@ internal static class ImGuiPanelHost
|
|||
private static void PersistPopped(Entry entry, bool open, int left, int top, int width, int height, float placeScale, bool keepSize = false)
|
||||
{
|
||||
string title = entry.Title;
|
||||
Vector2 docked = entry.Pos / placeScale;
|
||||
Vector2 docked = DockedHome(entry) / placeScale;
|
||||
Vector2 size = new Vector2(width, height) / placeScale;
|
||||
UiBackgroundWriter.Enqueue($"persist {title}", () =>
|
||||
{
|
||||
|
|
@ -1860,10 +1891,16 @@ internal static class ImGuiPanelHost
|
|||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The docked spot to save (client px): the panel's home (HomePlace), not where it draws: a pull onto
|
||||
/// a smaller screen or for a taller moment is never written over the saved spot.
|
||||
/// </summary>
|
||||
private static Vector2 DockedHome(Entry entry) => entry.Place.IsSet ? entry.Place.Home : entry.Pos;
|
||||
|
||||
private static void Persist(Entry entry, bool open, float placeScale, bool floating = false)
|
||||
{
|
||||
string title = entry.Title;
|
||||
Vector2 pos = entry.Pos / placeScale;
|
||||
Vector2 pos = DockedHome(entry) / placeScale;
|
||||
Vector2 size = entry.Size / placeScale;
|
||||
if (PanelRouter.ResolveDockedFace(title) == PanelFace.Both)
|
||||
pos -= new Vector2(24, 24); // don't let the side-by-side offset drift the Avalonia face
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ internal static class MonsterHudSettingsUi
|
|||
bool locked = MonsterHudSettings.SelfLocked;
|
||||
if (Toggle("Lock position", ref locked,
|
||||
"Locked, the plate can't be grabbed or clicked, so play never moves it. " +
|
||||
"Untick it, then drag the plate (it shows a frame) and tick it again. Also in Settings > UI > Vitals. " +
|
||||
"Untick it, then drag the plate (it shows a frame) and tick it again. Also in Settings > Interface > Your Vitals. " +
|
||||
"Chat: /rv plates self lock on|off.", indent: 32))
|
||||
{
|
||||
MonsterHudSettings.SetSelfLocked(locked);
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ internal static class PlayerPlate
|
|||
_wantsMouse = _hover || _dragging;
|
||||
}
|
||||
|
||||
private const string DragTip = "Drag to move your plate.\nLock it again in Settings > UI > Vitals or Vision > Nameplates > Your plate (or /rv plates self lock).";
|
||||
private const string DragTip = "Drag to move your plate.\nLock it again in Settings > Interface > Your Vitals or Vision > Nameplates > Your plate (or /rv plates self lock).";
|
||||
|
||||
/// <summary>Fades the plate in / out and steps the bars; false when nothing should be painted.</summary>
|
||||
private static bool Advance(ref MonsterHud.Frame f, bool show)
|
||||
|
|
|
|||
|
|
@ -636,7 +636,8 @@ internal sealed class ChatView
|
|||
private void MeasureLine(ImFontPtr font, int i, float textW)
|
||||
{
|
||||
ChatLine line = _vis[i];
|
||||
ChatSpan[]? spans = line.Route.Spans;
|
||||
// The rules' match colours over the plugin's own colour runs (per-part item info).
|
||||
ChatSpan[]? spans = ChatOwnColors.EffectiveSpans(line.OwnSpans, line.Route.Spans, line.Route.LineArgb != null);
|
||||
// Map coordinates ("82.3N, 34.2E") become links. Found here, when the line is measured,
|
||||
// never per frame; a line without any keeps the plain (or highlighted) path.
|
||||
List<ChatCoord> coords = ChatCoords.MayHaveCoords(line.Text) ? ChatCoords.Find(line.Text) : NoCoords;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
//
|
||||
// RynthAiFace draws this instead of the dashboard while
|
||||
// RynthAiDashboardState.Classic is on; the title bar's Modern button and
|
||||
// Settings > Display switch back. Minimized (the dashboard's shared flag)
|
||||
// Settings > Interface switch back. Minimized (the dashboard's shared flag)
|
||||
// shows the title bar over a compact strip: the systems, Stop/Start and the
|
||||
// three vitals meters.
|
||||
//
|
||||
|
|
@ -166,8 +166,8 @@ internal sealed class ClassicDashboard
|
|||
_fittedH = wantH;
|
||||
_fittedW = wantW;
|
||||
ImGuiPanelHost.RequestSize(RynthAiFace.Title, new Vector2(wantW / place, wantH / place));
|
||||
// Applied after the size, clamped to the screen at it (the dashboard's MeasureAndFit does the same):
|
||||
// a taller tab near the bottom of the screen moves the window up instead of running off it.
|
||||
// A taller tab near the bottom of the screen moves the window up instead of running off it: the host
|
||||
// pulls it onto the screen from its home at the new size (UI/PanelPlacement), and back once it fits.
|
||||
ImGuiPanelHost.RequestPos(RynthAiFace.Title, ImGuiNET.ImGui.GetWindowPos() / place);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
? "Pull-away for every monster without its own. Default = Off (fight in place).\n"
|
||||
: "Pull-away for the monsters it covers. Default = the DEFAULT line's.\n") +
|
||||
"Off = kill where it stands. PullAway = tag, run until it has been dragged\n" +
|
||||
"Kite Pull Distance metres from its lock spot (Settings > Melee Combat), then kill.");
|
||||
"Kite Pull Distance metres from its lock spot (Settings > Combat), then kill.");
|
||||
|
||||
// The DEFAULT line's own choice is the Prefer chip in the Damage panel's top bar.
|
||||
if (!isDefault)
|
||||
|
|
|
|||
|
|
@ -212,7 +212,8 @@ internal sealed unsafe class LogFace : IImGuiPanel
|
|||
|
||||
/// <summary>
|
||||
/// Tracker: the session-stat rows (TrackerSource) over an adjustable-opacity background, or text only
|
||||
/// (TrackerSettings.TextOnly: bare, the rows shadowed, clicks pass through except over them).
|
||||
/// (TrackerSettings.TextOnly: bare, the Ledger, clicks pass through except over it, or everywhere with
|
||||
/// TrackerSettings.ClickThrough unless Ctrl is held). Rows can be hidden (the gear menu, TrackerSettings.Stats).
|
||||
/// </summary>
|
||||
internal sealed class TrackerFace : IImGuiPanel
|
||||
{
|
||||
|
|
@ -220,20 +221,60 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
private static readonly Vector4 LabelColor = RynthTheme.Vec(0xFF999999);
|
||||
private static readonly uint ResetBg = RynthTheme.Argb(0xFF1A2E40);
|
||||
private static uint ResetBorder => RynthTheme.AccentFill;
|
||||
// Text only: no background behind it, so brighter than the framed look, each with a shadow.
|
||||
private static readonly uint BareLabel = RynthTheme.Argb(0xFFCFCFCF);
|
||||
private static readonly uint BareValue = RynthTheme.Argb(0xFFFFFFFF);
|
||||
private static readonly uint BareShadow = RynthTheme.Argb(0xD0000000);
|
||||
|
||||
// Text only, the Ledger (2026-11-12, the owner: "something similar to how our Lua script works for
|
||||
// item tracking ... no windows or background. Just text"; picked "Ledger", tinted, from the
|
||||
// artifact "Bare Tracker"). Each label right-aligned beside its number, the rates, a gap, then the
|
||||
// totals; numbers of a thousand and up shortened (3.12M, 148k); the rates tinted by what they
|
||||
// count, deaths green at 0 and red above; every letter in a dark halo so it reads on any ground.
|
||||
private static readonly uint LedgerLabel = RynthTheme.Argb(0xFFD8D8D8);
|
||||
private static readonly uint LedgerValue = RynthTheme.Argb(0xFFFFFFFF);
|
||||
private static readonly uint LedgerDim = RynthTheme.Argb(0xFFBDBDBD);
|
||||
private static readonly uint LedgerXp = RynthTheme.Argb(0xFFEFC054);
|
||||
private static readonly uint LedgerLum = RynthTheme.Argb(0xFF7FB9F9);
|
||||
private static readonly uint LedgerKill = RynthTheme.Argb(0xFFF98075);
|
||||
private static readonly uint LedgerPass = RynthTheme.Argb(0xFFC5ABF4);
|
||||
private static readonly uint LedgerRad = RynthTheme.Argb(0xFF62D5C8);
|
||||
private static readonly uint LedgerOk = RynthTheme.Argb(0xFF73D885);
|
||||
// The halo: the four sides firm, the corners soft.
|
||||
private static readonly uint HaloNear = RynthTheme.Argb(0xE6000000);
|
||||
private static readonly uint HaloFar = RynthTheme.Argb(0x8C000000);
|
||||
private static readonly Vector2[] HaloSides = { new(1, 0), new(-1, 0), new(0, 1), new(0, -1) };
|
||||
private static readonly Vector2[] HaloCorners = { new(1, 1), new(-1, -1), new(1, -1), new(-1, 1) };
|
||||
private const float LedgerGap = 8f, LedgerGroupGap = 5f, ToolsGap = 10f;
|
||||
|
||||
// The Ledger's rows, worked out when the snapshot or the hidden set changes (not per frame).
|
||||
private TrackerSnapshot? _ledgerFor;
|
||||
private bool _ledgerBuilt;
|
||||
private int _ledgerHiddenVersion;
|
||||
private string[] _ledgerLabels = Array.Empty<string>(), _ledgerValues = Array.Empty<string>();
|
||||
private uint[] _ledgerColors = Array.Empty<uint>();
|
||||
private int _ledgerTotalsAt = -1; // the first shown total's row (the gap goes above it)
|
||||
private int _opacity;
|
||||
private const string StatsMenuId = "##tracker_stats";
|
||||
private static readonly string AllHiddenText = "All stats hidden (" + PhosphorIcons.Gear + ")";
|
||||
|
||||
// Text only: the mouse is over what the last frame drew, so the window takes input (to drag it, or
|
||||
// for the frame button); elsewhere clicks reach the game. A press that began there keeps it.
|
||||
// for the buttons); elsewhere clicks reach the game. A press that began while it took input keeps it.
|
||||
// With full click-through (TrackerSettings.ClickThrough) it takes input only while Ctrl is held.
|
||||
private bool _hot, _pressHot;
|
||||
|
||||
/// <summary>Text only is bare: docked, no frame, title, background or grip (popped out it is framed as usual).</summary>
|
||||
public bool Bare => TrackerSettings.TextOnly;
|
||||
|
||||
public bool ClickThrough => Bare && !_hot && !_pressHot;
|
||||
public bool ClickThrough
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Bare) return false;
|
||||
if (_pressHot) return false; // a press of ours: keep the mouse until the button is up
|
||||
if (!TrackerSettings.ClickThrough) return !_hot;
|
||||
// Full click-through (2026-11-12): only Ctrl over the Ledger takes the mouse, and not in the
|
||||
// middle of a press the game already has (Ctrl pressed while holding a game click).
|
||||
if (!_hot || !ImGuiNET.ImGui.GetIO().KeyCtrl) return true;
|
||||
return ImGuiNET.ImGui.IsMouseDown(ImGuiMouseButton.Left) && !ImGuiNET.ImGui.IsMouseClicked(ImGuiMouseButton.Left);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnShown()
|
||||
{
|
||||
|
|
@ -256,9 +297,10 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Text only: each row's label and value with a 1 px shadow, nothing behind them. The rows are a
|
||||
/// drag handle; the button at the end of the first row (faint until the mouse is on the rows)
|
||||
/// brings the frame back.
|
||||
/// Text only, the Ledger: each row's label right-aligned beside its number, in a dark halo, nothing
|
||||
/// behind them. The rows are a drag handle. While the mouse is on them four small buttons show at
|
||||
/// the end of the first row, Reset, click-through, the stats menu and the frame; the rest of the time
|
||||
/// it is only the text. With full click-through the rows and buttons need Ctrl held.
|
||||
/// </summary>
|
||||
private void DrawTextOnly()
|
||||
{
|
||||
|
|
@ -266,65 +308,233 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
Vector2 origin = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
float width = Math.Max(60, ImGuiNET.ImGui.GetContentRegionAvail().X);
|
||||
Vector2 mouse = ImGuiNET.ImGui.GetIO().MousePos;
|
||||
bool wasHot = _hot;
|
||||
bool locked = TrackerSettings.ClickThrough;
|
||||
// Whether the host gave this window the mouse this frame (the same test it made before Begin).
|
||||
bool takingInput = !ClickThrough;
|
||||
bool showTools = locked ? takingInput : _hot || _pressHot;
|
||||
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9));
|
||||
float rowH = ImGuiNET.ImGui.GetTextLineHeight() + 1;
|
||||
float buttonW = rowH + 4;
|
||||
TrackerSnapshot? snap = UiSources.Tracker.Current?.Value;
|
||||
string[]? values = snap?.Values;
|
||||
string[] labels = snap?.Labels ?? TrackerSnapshot.DefaultLabels;
|
||||
BuildLedger(snap);
|
||||
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Narrow10));
|
||||
ImFontPtr labelFont = ImGuiNET.ImGui.GetFont();
|
||||
float labelSize = ImGuiNET.ImGui.GetFontSize();
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Mono9));
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Mono10));
|
||||
ImFontPtr valueFont = ImGuiNET.ImGui.GetFont();
|
||||
float valueSize = ImGuiNET.ImGui.GetFontSize();
|
||||
float y = origin.Y;
|
||||
for (int i = 0; i < labels.Length; i++)
|
||||
float rowH = Math.Max(labelSize, valueSize) + 1;
|
||||
float labelDrop = MathF.Round((valueSize - labelSize) * 0.6f); // the labels sit on the numbers' baseline
|
||||
|
||||
float labelW = 0, valueW = 0;
|
||||
for (int i = 0; i < _ledgerLabels.Length; i++)
|
||||
{
|
||||
// The first row stops short of the frame button.
|
||||
float right = origin.X + width - (i == 0 ? buttonW + 2 : 0);
|
||||
Shadowed(dl, labelFont, labelSize, new Vector2(origin.X, y), BareLabel, labels[i]);
|
||||
string value = values != null && i < values.Length ? values[i] : "—";
|
||||
float w = ImGuiNET.ImGui.CalcTextSize(value).X;
|
||||
Shadowed(dl, valueFont, valueSize, new Vector2(Math.Max(origin.X, right - w), y), BareValue, value);
|
||||
labelW = Math.Max(labelW, labelFont.CalcTextSizeA(labelSize, float.MaxValue, 0f, _ledgerLabels[i]).X);
|
||||
valueW = Math.Max(valueW, valueFont.CalcTextSizeA(valueSize, float.MaxValue, 0f, _ledgerValues[i]).X);
|
||||
}
|
||||
float valueX = origin.X + MathF.Ceiling(labelW) + LedgerGap;
|
||||
float y = origin.Y;
|
||||
for (int i = 0; i < _ledgerLabels.Length; i++)
|
||||
{
|
||||
if (i == _ledgerTotalsAt && i > 0) y += LedgerGroupGap;
|
||||
float lw = labelFont.CalcTextSizeA(labelSize, float.MaxValue, 0f, _ledgerLabels[i]).X;
|
||||
Haloed(dl, labelFont, labelSize, new Vector2(MathF.Round(origin.X + labelW - lw), y + labelDrop), LedgerLabel, _ledgerLabels[i]);
|
||||
Haloed(dl, valueFont, valueSize, new Vector2(valueX, y), _ledgerColors[i], _ledgerValues[i]);
|
||||
y += rowH;
|
||||
}
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
float blockW = Math.Max(1, valueX + valueW - origin.X);
|
||||
float height = Math.Max(rowH, y - origin.Y);
|
||||
|
||||
// The rows: a drag handle (the window has no title bar to hold).
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(origin);
|
||||
ImGuiNET.ImGui.InvisibleButton("##tracker_textonly_drag", new Vector2(Math.Max(1, width - buttonW - 2), height));
|
||||
ImGuiNET.ImGui.InvisibleButton("##tracker_textonly_drag", new Vector2(blockW, height));
|
||||
ImGuiPanelHost.DragWindowWithLastItem();
|
||||
if (ImGuiNET.ImGui.IsItemHovered() && !ImGuiNET.ImGui.IsItemActive())
|
||||
ImGuiNET.ImGui.SetTooltip("Drag to move the Tracker.");
|
||||
ImGuiNET.ImGui.SetTooltip(locked ? "Ctrl-drag to move the Tracker (click-through is on)." : "Drag to move the Tracker.");
|
||||
|
||||
// Frame button: faint until the mouse is on the rows.
|
||||
Vector2 bp = new(origin.X + width - buttonW, origin.Y);
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(bp);
|
||||
float alpha = wasHot ? 1f : 0.35f;
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.Alpha, alpha);
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(1, 0));
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Button, ResetBg);
|
||||
if (ImGuiNET.ImGui.Button(PhosphorIcons.SquaresFour + "##tracker_frame", new Vector2(buttonW, rowH)))
|
||||
TrackerSettings.SetTextOnly(false);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Show the Tracker's frame and background again.");
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.PopStyleVar(2);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
// Reset, click-through, the stats menu and the frame, only while the mouse is on the Tracker
|
||||
// (with click-through, while Ctrl is held there): at the end of the first row (inside the
|
||||
// window when it is narrower than that).
|
||||
float buttonW = rowH + 4;
|
||||
const int ToolCount = 4;
|
||||
float toolsW = ToolCount * buttonW + (ToolCount - 1) * 2;
|
||||
float toolsX = Math.Max(origin.X, Math.Min(origin.X + blockW + ToolsGap, origin.X + width - toolsW));
|
||||
if (showTools)
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9)); // the icons' font, as the framed look's buttons
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(1, 0));
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Button, ResetBg);
|
||||
var size = new Vector2(buttonW, rowH);
|
||||
float x = toolsX;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, origin.Y));
|
||||
if (ImGuiNET.ImGui.Button(PhosphorIcons.ArrowCounterClockwise + "##tracker_reset", size))
|
||||
UiSources.Tracker.RequestReset();
|
||||
ImGuiNET.ImGui.SetItemTooltip("Reset the session stats");
|
||||
x += buttonW + 2;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, origin.Y));
|
||||
if (locked) ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Button, RynthTheme.AccentFill);
|
||||
bool lockClicked = ImGuiNET.ImGui.Button((locked ? PhosphorIcons.Lock : PhosphorIcons.LockOpen) + "##tracker_clickthrough", size);
|
||||
if (locked) ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.SetItemTooltip(locked ? ClickThroughOnTip : ClickThroughOffTip);
|
||||
if (lockClicked) TrackerSettings.SetClickThrough(!locked);
|
||||
x += buttonW + 2;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, origin.Y));
|
||||
if (ImGuiNET.ImGui.Button(PhosphorIcons.Gear + "##tracker_statsbtn", size))
|
||||
ImGuiNET.ImGui.OpenPopup(StatsMenuId);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Choose which stats the Tracker shows");
|
||||
x += buttonW + 2;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, origin.Y));
|
||||
if (ImGuiNET.ImGui.Button(PhosphorIcons.SquaresFour + "##tracker_frame", size))
|
||||
TrackerSettings.SetTextOnly(false);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Show the Tracker's frame again (its background and opacity).");
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
DrawStatsMenu();
|
||||
|
||||
// Hot for the next frame: the mouse over the rows or the button.
|
||||
bool over = mouse.X >= origin.X && mouse.X <= origin.X + width && mouse.Y >= origin.Y && mouse.Y <= origin.Y + height;
|
||||
// Hot for the next frame: the mouse over the rows, or over the buttons while they show.
|
||||
bool overRows = mouse.X >= origin.X && mouse.X <= origin.X + blockW && mouse.Y >= origin.Y && mouse.Y <= origin.Y + height;
|
||||
bool overTools = showTools && mouse.X >= origin.X + blockW && mouse.X <= toolsX + toolsW && mouse.Y >= origin.Y && mouse.Y <= origin.Y + rowH;
|
||||
bool over = overRows || overTools;
|
||||
_hot = over;
|
||||
bool down = ImGuiNET.ImGui.IsMouseDown(ImGuiMouseButton.Left);
|
||||
if (!down) _pressHot = false;
|
||||
else if (over && ImGuiNET.ImGui.IsMouseClicked(ImGuiMouseButton.Left)) _pressHot = true;
|
||||
// Only a press this window took (a game click over the text never grabs the mouse mid-press).
|
||||
else if (over && takingInput && ImGuiNET.ImGui.IsMouseClicked(ImGuiMouseButton.Left)) _pressHot = true;
|
||||
}
|
||||
|
||||
private static void Shadowed(ImDrawListPtr dl, ImFontPtr font, float size, Vector2 p, uint color, string text)
|
||||
private const string ClickThroughOffTip =
|
||||
"Click-through: every click reaches the game, even over the numbers.\nHold Ctrl to move it or reach these buttons.";
|
||||
private const string ClickThroughOnTip =
|
||||
"Click-through is on: every click reaches the game, even over the numbers.\nHold Ctrl to move it or reach these buttons. Click to turn it off.";
|
||||
|
||||
/// <summary>
|
||||
/// The stats menu (2026-11-12, the owner: "a small settings menu to show/hide some of the stats"): a
|
||||
/// box per row the Tracker can show, Show all, and click-through. Opened by the gear in either look.
|
||||
/// </summary>
|
||||
private static void DrawStatsMenu()
|
||||
{
|
||||
dl.AddText(font, size, p + new Vector2(1, 1), BareShadow, text);
|
||||
if (!ImGuiNET.ImGui.BeginPopup(StatsMenuId)) return;
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui11));
|
||||
ImGuiNET.ImGui.TextColored(TitleColor, "Show on the Tracker");
|
||||
foreach (TrackerStat s in TrackerSettings.Stats)
|
||||
{
|
||||
bool shown = !TrackerSettings.IsHidden(s.Id);
|
||||
ImGuiNET.ImGui.PushID(s.Id);
|
||||
if (ImGuiNET.ImGui.Checkbox(s.Name, ref shown))
|
||||
TrackerSettings.SetHidden(s.Id, !shown);
|
||||
if (s.Note != null)
|
||||
ImGuiNET.ImGui.SetItemTooltip(s.Note);
|
||||
ImGuiNET.ImGui.PopID();
|
||||
}
|
||||
if (ImGuiNET.ImGui.Button("Show all"))
|
||||
TrackerSettings.ShowAll();
|
||||
ImGuiNET.ImGui.Separator();
|
||||
bool clickThrough = TrackerSettings.ClickThrough;
|
||||
if (ImGuiNET.ImGui.Checkbox("Click-through (text only)", ref clickThrough))
|
||||
TrackerSettings.SetClickThrough(clickThrough);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Text only, every click reaches the game, even over the numbers.\nHold Ctrl to move it or reach its buttons.");
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
ImGuiNET.ImGui.EndPopup();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Ledger's labels, numbers and colours for <paramref name="snap"/> without the hidden rows;
|
||||
/// only when the snapshot or the hidden set changed. Every row hidden leaves one dim line saying so.
|
||||
/// </summary>
|
||||
private void BuildLedger(TrackerSnapshot? snap)
|
||||
{
|
||||
int hiddenVersion = TrackerSettings.HiddenVersion;
|
||||
if (_ledgerBuilt && ReferenceEquals(snap, _ledgerFor) && hiddenVersion == _ledgerHiddenVersion) return;
|
||||
_ledgerBuilt = true;
|
||||
_ledgerFor = snap;
|
||||
_ledgerHiddenVersion = hiddenVersion;
|
||||
string[] labels = snap?.Labels ?? TrackerSnapshot.DefaultLabels;
|
||||
string[]? values = snap?.Values;
|
||||
var names = new List<string>(labels.Length);
|
||||
var shownValues = new List<string>(labels.Length);
|
||||
var colors = new List<uint>(labels.Length);
|
||||
int totalsFrom = Array.IndexOf(labels, "XP"); // the rates come before XP, the totals from it
|
||||
_ledgerTotalsAt = -1;
|
||||
for (int i = 0; i < labels.Length; i++)
|
||||
{
|
||||
if (TrackerSettings.IsLabelHidden(labels[i])) continue;
|
||||
string value = values != null && i < values.Length ? values[i] : "—";
|
||||
// The gap goes above the first total shown, and only with a rate shown above it.
|
||||
if (_ledgerTotalsAt < 0 && totalsFrom >= 0 && i >= totalsFrom) _ledgerTotalsAt = names.Count;
|
||||
names.Add(LedgerName(labels[i]));
|
||||
shownValues.Add(Shorten(value));
|
||||
colors.Add(LedgerColor(labels[i], value));
|
||||
}
|
||||
if (names.Count == 0)
|
||||
{
|
||||
names.Add("TRACKER");
|
||||
shownValues.Add("all stats hidden");
|
||||
colors.Add(LedgerDim);
|
||||
}
|
||||
_ledgerLabels = names.ToArray();
|
||||
_ledgerValues = shownValues.ToArray();
|
||||
_ledgerColors = colors.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>The Ledger's name for a row: in capitals, with the framed look's abbreviations spelled out.</summary>
|
||||
internal static string LedgerName(string label) => label switch
|
||||
{
|
||||
"Kls/hr" => "KILLS/HR",
|
||||
"XP/kl" => "XP/KILL",
|
||||
_ => label.ToUpperInvariant(),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// A number of a thousand and up as three figures and a unit (1.23k, 12.3k, 148k, 3.12M, 1.05B);
|
||||
/// anything else (the session clock, a rate with a decimal, "max level", "—") as it is.
|
||||
/// </summary>
|
||||
internal static string Shorten(string value)
|
||||
{
|
||||
if (value.IndexOf(',') < 0 || !long.TryParse(value.Replace(",", ""), System.Globalization.NumberStyles.AllowLeadingSign,
|
||||
System.Globalization.CultureInfo.InvariantCulture, out long n))
|
||||
return value;
|
||||
string[] units = { "", "k", "M", "B", "T" };
|
||||
double x = n;
|
||||
int u = 0;
|
||||
while (Math.Abs(x) >= 1000 && u < units.Length - 1) { x /= 1000; u++; }
|
||||
string s = Three(x);
|
||||
if (Math.Abs(double.Parse(s, System.Globalization.CultureInfo.InvariantCulture)) >= 1000 && u < units.Length - 1)
|
||||
{
|
||||
x /= 1000; // 999,999 rounds to 1000k: one unit up instead
|
||||
u++;
|
||||
s = Three(x);
|
||||
}
|
||||
return s + units[u];
|
||||
|
||||
static string Three(double v)
|
||||
{
|
||||
double a = Math.Abs(v);
|
||||
string format = a < 10 ? "0.##" : a < 100 ? "0.#" : "0";
|
||||
return v.ToString(format, System.Globalization.CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A row's colour: the rates by what they count, deaths green at 0 and red above, the clock dim, totals white.</summary>
|
||||
private static uint LedgerColor(string label, string value) => label switch
|
||||
{
|
||||
"Session" => LedgerDim,
|
||||
"XP/hr" => LedgerXp,
|
||||
"Lum/hr" or "Lum/5m" => LedgerLum,
|
||||
"Kls/hr" => LedgerKill,
|
||||
"Pass/hr" => LedgerPass,
|
||||
"Rad/hr" => LedgerRad,
|
||||
"Deaths" => value == "0" ? LedgerOk : LedgerKill,
|
||||
_ => LedgerValue,
|
||||
};
|
||||
|
||||
/// <summary>Text in a dark halo: the four sides firm, the corners soft, then the text.</summary>
|
||||
private static void Haloed(ImDrawListPtr dl, ImFontPtr font, float size, Vector2 p, uint color, string text)
|
||||
{
|
||||
foreach (Vector2 o in HaloCorners) dl.AddText(font, size, p + o, HaloFar, text);
|
||||
foreach (Vector2 o in HaloSides) dl.AddText(font, size, p + o, HaloNear, text);
|
||||
dl.AddText(font, size, p, color, text);
|
||||
}
|
||||
|
||||
|
|
@ -340,12 +550,14 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9));
|
||||
|
||||
// Title row: [Tracker] [===slider===] [text only] [reset]
|
||||
// Title row: [Tracker] [===slider===] [text only] [stats menu] [reset]
|
||||
ImGuiNET.ImGui.TextColored(TitleColor, "Tracker");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
float resetW = ImGuiNET.ImGui.CalcTextSize(PhosphorIcons.ArrowCounterClockwise).X + 8;
|
||||
float textOnlyW = ImGuiNET.ImGui.CalcTextSize(PhosphorIcons.TextAa).X + 8;
|
||||
ImGuiNET.ImGui.SetNextItemWidth(Math.Max(10, ImGuiNET.ImGui.GetContentRegionAvail().X - resetW - textOnlyW - 8));
|
||||
float gearW = ImGuiNET.ImGui.CalcTextSize(PhosphorIcons.Gear).X + 8;
|
||||
float spacing = ImGuiNET.ImGui.GetStyle().ItemSpacing.X;
|
||||
ImGuiNET.ImGui.SetNextItemWidth(Math.Max(10, ImGuiNET.ImGui.GetContentRegionAvail().X - resetW - textOnlyW - gearW - 8 - spacing));
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, new Vector2(2, 0));
|
||||
if (ImGuiNET.ImGui.SliderInt("##opacity", ref _opacity, 0, 100, ""))
|
||||
TrackerSettings.SetBgAlpha((byte)Math.Round(_opacity * 2.55), save: false);
|
||||
|
|
@ -363,9 +575,15 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
TrackerSettings.SetTextOnly(true);
|
||||
ImGuiNET.ImGui.EndDisabled();
|
||||
ImGuiNET.ImGui.SetItemTooltip(canBare
|
||||
? "Text only: hide the frame and background, just the numbers (clicks pass through to the game).\nThe button at the end of its first row brings the frame back."
|
||||
? (TrackerSettings.ClickThrough
|
||||
? "Text only: just the numbers, no frame or background. Click-through is on: every click reaches the game,\neven over the numbers; hold Ctrl over them to move it or for its buttons (Reset, click-through, stats, frame)."
|
||||
: "Text only: just the numbers, no frame or background (clicks pass through to the game except over the numbers).\nHover them for Reset, click-through, the stats menu and the button that brings the frame back.")
|
||||
: "Text only works while the Tracker is docked (not popped out).");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
if (ImGuiNET.ImGui.Button(PhosphorIcons.Gear + "##stats"))
|
||||
ImGuiNET.ImGui.OpenPopup(StatsMenuId);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Choose which stats the Tracker shows, and click-through for text only");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
if (ImGuiNET.ImGui.Button(PhosphorIcons.ArrowCounterClockwise + "##reset"))
|
||||
UiSources.Tracker.RequestReset();
|
||||
ImGuiNET.ImGui.SetItemTooltip("Reset the session stats");
|
||||
|
|
@ -380,8 +598,11 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
float grip = ImGuiPanelHost.BodyGripReserve;
|
||||
float gripTop = grip > 0 ? ImGuiNET.ImGui.GetWindowPos().Y + ImGuiNET.ImGui.GetWindowHeight() - grip : float.MaxValue;
|
||||
float rowH = ImGuiNET.ImGui.GetTextLineHeight();
|
||||
int drawn = 0;
|
||||
for (int i = 0; i < labels.Length; i++)
|
||||
{
|
||||
if (TrackerSettings.IsLabelHidden(labels[i])) continue;
|
||||
drawn++;
|
||||
float rowRight = ImGuiNET.ImGui.GetCursorPosX() + ImGuiNET.ImGui.GetContentRegionAvail().X;
|
||||
if (ImGuiNET.ImGui.GetCursorScreenPos().Y + rowH > gripTop) rowRight -= grip;
|
||||
SafeImGui.TextColored(LabelColor, labels[i]);
|
||||
|
|
@ -396,6 +617,8 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.TextUnformatted(value);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
if (drawn == 0)
|
||||
ImGuiNET.ImGui.TextDisabled(AllHiddenText);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
|
||||
float bottom = ImGuiNET.ImGui.GetCursorScreenPos().Y;
|
||||
|
|
@ -403,5 +626,6 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
uint bg = RynthTheme.Argb(((uint)TrackerSettings.BgAlpha << 24) | 0x0A121A);
|
||||
dl.AddRectFilled(top, new Vector2(top.X + width, bottom), bg);
|
||||
dl.ChannelsMerge();
|
||||
DrawStatsMenu();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,8 @@ internal sealed class PluginWindowFace : IImGuiPanel
|
|||
float screenW = ImGuiNET.ImGui.GetIO().DisplaySize.X / place;
|
||||
if (screenW > 1f) width = MathF.Min(width, screenW);
|
||||
ImGuiPanelHost.RequestSize(_title, new Vector2(width, height));
|
||||
// Clamped to the screen at the new size: near the right or bottom edge it moves in.
|
||||
// Near the right or bottom edge it moves in at the new size: the host pulls it onto the screen
|
||||
// from its home (UI/PanelPlacement; this spot is where it draws, so it changes nothing there).
|
||||
ImGuiPanelHost.RequestPos(_title, ImGuiNET.ImGui.GetWindowPos() / place);
|
||||
}
|
||||
else if (mouseUp && MathF.Abs(shownHeight - height) > 0.5f)
|
||||
|
|
|
|||
|
|
@ -953,7 +953,7 @@ internal sealed class RadarFace : IImGuiPanel
|
|||
|
||||
/// <summary>
|
||||
/// "Hide the retail radar": RynthAi's own SuppressRetailRadar setting (RynthAi pushes it to the engine every
|
||||
/// tick), the same switch as Settings > UI > Hide retail radar. This reads it from RynthAi's settings payload
|
||||
/// tick), the same switch as Settings > Interface > Hide retail radar. This reads it from RynthAi's settings payload
|
||||
/// and saves it back through the same command, so the two always agree whichever is changed; saved with the
|
||||
/// character's RynthAi settings. Greyed out until RynthAi has answered. The box shows the new value at once,
|
||||
/// until RynthAi's answer catches up.
|
||||
|
|
@ -976,7 +976,7 @@ internal sealed class RadarFace : IImGuiPanel
|
|||
}
|
||||
ImGuiNET.ImGui.EndDisabled();
|
||||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
ImGuiNET.ImGui.SetTooltip("Hides the game's built-in radar (bezel, compass, coordinates, blips).\nThe same switch as RynthAi's Settings > UI > Hide retail radar: change it in either place.");
|
||||
ImGuiNET.ImGui.SetTooltip("Hides the game's built-in radar (bezel, compass, coordinates, blips).\nThe same switch as Settings > Interface > Hide retail radar: change it in either place.");
|
||||
if (ra == null)
|
||||
{
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
// Chromeless (like the Avalonia face): the title row is the drag surface.
|
||||
//
|
||||
// Size: the dashboard's panel text size (PanelTextScale.Get(Title): its own
|
||||
// row in Settings > Display, else All Panels). The host draws the face with
|
||||
// row in Settings > Interface, else All Panels). The host draws the face with
|
||||
// the fonts baked for that step (ImGuiFonts.CurrentStep, the nearest baked
|
||||
// one until a re-bake lands) and every box here is multiplied by that same
|
||||
// step's factor (Px), so text, icons and boxes grow together; size 0 is the
|
||||
|
|
@ -176,7 +176,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
|
||||
/// <summary>
|
||||
/// Switches the dashboard between its Modern (compact) and Classic (retail) looks: the title bar
|
||||
/// buttons of either look and Settings > Display. The window refits on the next frame. AC thread.
|
||||
/// buttons of either look and Settings > Interface. The window refits on the next frame. AC thread.
|
||||
/// </summary>
|
||||
internal static void SwitchLook(bool classic) => RynthAiDashboardState.SetClassic(classic);
|
||||
|
||||
|
|
@ -289,8 +289,9 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
if (screenW > 1) width = MathF.Min(width, screenW);
|
||||
width = MathF.Max(width, MinWidth * _k);
|
||||
ImGuiPanelHost.RequestSize(Title, new Vector2(width, _contentHeight));
|
||||
// Applied after the size, clamped to the screen at it: a bigger dashboard near the right or
|
||||
// bottom edge moves in rather than running off (saved with the new size, like the bar's clamp).
|
||||
// A bigger dashboard near the right or bottom edge moves in rather than running off: the host
|
||||
// pulls it onto the screen from its home at the new size (UI/PanelPlacement; the spot asked for
|
||||
// here is where it draws, so it changes nothing), and the home stays the saved spot.
|
||||
ImGuiPanelHost.RequestPos(Title, ImGuiNET.ImGui.GetWindowPos() / place);
|
||||
}
|
||||
else if (_fit)
|
||||
|
|
@ -422,7 +423,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
|
||||
/// <summary>
|
||||
/// The title row's right-click popup: the dashboard's size (its panel text size, the same
|
||||
/// setting as Settings > Display > RynthAi Dashboard, or All Panels until it is set on its own).
|
||||
/// setting as Settings > Interface > RynthAi Dashboard, or All Panels until it is set on its own).
|
||||
/// </summary>
|
||||
private static void SizePopup()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// ============================================================================
|
||||
// RynthCore.Engine - ImGui/Panels/ServerPickSettingsUi.cs
|
||||
// Settings > Diagnostics > Server: which server this character counts as.
|
||||
// Settings > Game Client > Server: which server this character counts as.
|
||||
//
|
||||
// A picker (Auto, or one of the servers the engine knows: the built-in ones
|
||||
// and every server a loaded plugin declares), what is active and why, and the
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
// the other plugins ask for that server's settings. Picking a server forces it
|
||||
// on and every other server off for this character (ServerSelectionStore);
|
||||
// the menus, the "servermenu" push and plugin API v85 follow on the next frame.
|
||||
// Drawn by SettingsFace for the Diagnostics tab's ServerPick row, in its look.
|
||||
// Drawn by SettingsFace for the Game Client tab's ServerPick row, in its look.
|
||||
// ============================================================================
|
||||
|
||||
using System;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,9 @@ internal sealed class SettingsFace : IImGuiPanel
|
|||
if (_requestedTab is { } wanted)
|
||||
{
|
||||
_requestedTab = null;
|
||||
int idx = Array.FindIndex(SettingsSchema.Tabs, t => t.Name.Equals(wanted, StringComparison.OrdinalIgnoreCase));
|
||||
// FindTab also takes the names from before the 2026-11-11 regroup (Misc = General).
|
||||
SettingsTab? found = SettingsSchema.FindTab(wanted);
|
||||
int idx = found == null ? -1 : Array.IndexOf(SettingsSchema.Tabs, found);
|
||||
if (idx >= 0) _tab = idx;
|
||||
}
|
||||
|
||||
|
|
@ -107,6 +109,14 @@ internal sealed class SettingsFace : IImGuiPanel
|
|||
for (int i = 0; i < tabs.Length; i++)
|
||||
{
|
||||
string tabName = tabs[i].Name;
|
||||
// A group's heading above its first tab (RynthCore · this PC, RynthAi · saved in the profile, Support).
|
||||
if (tabs[i].Group is { } group)
|
||||
{
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, i == 0 ? 2 : 8));
|
||||
Vector2 gp = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
dl.AddText(new Vector2(gp.X + 4, gp.Y), Mute, group);
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, ImGuiNET.ImGui.GetFontSize() + 1));
|
||||
}
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 1));
|
||||
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
ImGuiNET.ImGui.PushID(i);
|
||||
|
|
@ -184,18 +194,18 @@ internal sealed class SettingsFace : IImGuiPanel
|
|||
// Tab icons by tab name (SettingsSchema); a tab not listed shows its name alone.
|
||||
private static readonly System.Collections.Generic.Dictionary<string, string> TabIcons = new()
|
||||
{
|
||||
["Display"] = PhosphorIcons.Monitor,
|
||||
["UI"] = PhosphorIcons.AppWindow,
|
||||
["Interface"] = PhosphorIcons.AppWindow,
|
||||
["Game Client"] = PhosphorIcons.Monitor,
|
||||
["Hotkeys"] = PhosphorIcons.Keyboard,
|
||||
["Misc"] = PhosphorIcons.DotsThree,
|
||||
["General"] = PhosphorIcons.SlidersHorizontal,
|
||||
["Recharge"] = PhosphorIcons.BatteryCharging,
|
||||
["Melee Combat"] = PhosphorIcons.Sword,
|
||||
["Combat"] = PhosphorIcons.Sword,
|
||||
["Spell Combat"] = PhosphorIcons.MagicWand,
|
||||
["Ranges"] = PhosphorIcons.Ruler,
|
||||
["Navigation"] = PhosphorIcons.SneakerMove,
|
||||
["Buffing"] = PhosphorIcons.Sparkle,
|
||||
["Crafting"] = PhosphorIcons.Hammer,
|
||||
["Looting"] = PhosphorIcons.Bag,
|
||||
["Inventory"] = PhosphorIcons.Backpack,
|
||||
["Vendoring"] = PhosphorIcons.Storefront,
|
||||
["Diagnostics"] = PhosphorIcons.Wrench,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,9 +14,11 @@
|
|||
// three vital maximums.
|
||||
// - Raise: "+1" raises one rank at once; the caret beside it drops down +10,
|
||||
// +100 and Max (each with its XP cost; Max asks first only when it spends
|
||||
// over half the unassigned XP). PlayerTraining.Raise(defer) queues it for
|
||||
// AC's main thread outside the ImGui frame; raise buttons stay locked until
|
||||
// the new values arrive (or 5 s pass). Train (skill credits) always asks first.
|
||||
// over half the unassigned XP, and says when it stops short of the top).
|
||||
// PlayerTraining.Raise(defer) queues it for AC's main thread outside the
|
||||
// ImGui frame; raise buttons stay locked until the new values arrive (or 5 s
|
||||
// pass: then the panel says the server hasn't taken it). Train (skill
|
||||
// credits) always asks first.
|
||||
// - Aelrynth only (ServerInfo.IsAelrynth): skill mastery from the SkillMastery
|
||||
// mod's /mastery-data reply (MasteryFeed). A crown badge with the mastery
|
||||
// points on trained rows that have any; the open row shows points, bonus,
|
||||
|
|
@ -169,6 +171,11 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
private long _pendingUnassigned;
|
||||
private int _pendingCredits;
|
||||
private int _pendingVersion;
|
||||
// The raise in flight (-1 key: a train), to tell the player when the server never took it.
|
||||
private int _pendingKey = -1;
|
||||
private uint _pendingRanks, _pendingSpent;
|
||||
private long _pendingCost;
|
||||
private string _pendingWhat = "";
|
||||
|
||||
private string _status = "";
|
||||
private uint _statusColor;
|
||||
|
|
@ -350,10 +357,19 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
Order();
|
||||
}
|
||||
|
||||
if (_pending && (now > _pendingUntilMs
|
||||
|| (snap != null && snap.Version != _pendingVersion
|
||||
&& (snap.UnassignedXp != _pendingUnassigned || snap.SkillCredits != _pendingCredits))))
|
||||
_pending = false;
|
||||
if (_pending)
|
||||
{
|
||||
if (snap != null && snap.Version != _pendingVersion
|
||||
&& (snap.UnassignedXp != _pendingUnassigned || snap.SkillCredits != _pendingCredits))
|
||||
_pending = false;
|
||||
else if (now > _pendingUntilMs)
|
||||
{
|
||||
_pending = false;
|
||||
// Only while the panel kept drawing (its numbers kept coming): not on a reopen much later.
|
||||
if (now - _pendingUntilMs < 2000) NoteUnanswered(snap);
|
||||
else _pendingKey = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// The open row's time-left text, once a second.
|
||||
if (second != _detailSecond && _byKey.TryGetValue(_expandedKey, out Row? open))
|
||||
|
|
@ -1278,14 +1294,17 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
}
|
||||
PlayerProgress s = _snap;
|
||||
long have = s.UnassignedXp;
|
||||
int maxLeft = Math.Max(0, r.Table.Length - 1 - (int)Math.Min(r.Ranks, (uint)int.MaxValue));
|
||||
int affordable = SkillDat.Affordable(r.Table, r.Ranks, r.Spent, have);
|
||||
MaxRaisePlan plan = TrainingCosts.PlanMax(r.Table, r.Ranks, r.Spent, have);
|
||||
int maxLeft = plan.RanksLeft;
|
||||
int affordable = plan.Ranks;
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui10));
|
||||
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
float y = p.Y;
|
||||
MultiItem(r, s, "##m10", "+10", 10, maxLeft, have, p.X, ref y);
|
||||
MultiItem(r, s, "##m100", "+100", 100, maxLeft, have, p.X, ref y);
|
||||
MultiItem(r, s, "##mmax", affordable > 0 ? $"Max (+{affordable})" : "Max", affordable, maxLeft, have, p.X, ref y);
|
||||
// Max says when the XP doesn't reach the top ("+150 of 208"), and the tooltip how much more it needs.
|
||||
string maxLabel = affordable <= 0 ? "Max" : plan.ReachesTop ? $"Max (+{affordable})" : $"Max (+{affordable} of {maxLeft})";
|
||||
MultiItem(r, s, "##mmax", maxLabel, affordable, maxLeft, have, p.X, ref y, plan);
|
||||
NextLine(p, y - p.Y);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
|
@ -1296,7 +1315,8 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
}
|
||||
|
||||
/// <summary>One drop-down line: label left, XP cost right; greyed with the reason when it can't act.</summary>
|
||||
private void MultiItem(Row r, PlayerProgress s, string id, string label, int n, int maxLeft, long have, float x, ref float y)
|
||||
private void MultiItem(Row r, PlayerProgress s, string id, string label, int n, int maxLeft, long have, float x, ref float y,
|
||||
MaxRaisePlan plan = default)
|
||||
{
|
||||
const float h = 22;
|
||||
long cost = n > 0 && n <= maxLeft ? SkillDat.CostOf(r.Table!, r.Ranks, r.Spent, n) : -1;
|
||||
|
|
@ -1319,7 +1339,10 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
right = Compact(cost) + " XP";
|
||||
ok = !_pending && PlayerTraining.Available;
|
||||
why = $"Raise {r.Name} {r.Base} → {r.Base + n} for {cost:N0} XP"
|
||||
+ (isMax && cost * 2 > have ? " (asks first: over half your unassigned XP)" : "");
|
||||
+ (isMax && cost * 2 > have ? " (asks first: over half your unassigned XP)" : "")
|
||||
+ (isMax && !plan.ReachesTop && plan.Missing > 0
|
||||
? $"\nThe top rank is {maxLeft} ranks away and costs {plan.CostToTop:N0} XP: {plan.Missing:N0} more than you have."
|
||||
: "");
|
||||
}
|
||||
var pos = new Vector2(x, y);
|
||||
var size = new Vector2(MultiW - 6, h);
|
||||
|
|
@ -1403,6 +1426,12 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
Label(cost >= 0 && cost <= have
|
||||
? $"Unassigned: {have:N0} → {have - cost:N0}"
|
||||
: $"Unassigned: {have:N0} (not enough)", Mute);
|
||||
if (n < maxLeft && cost >= 0)
|
||||
{
|
||||
long toTop = SkillDat.CostOf(table, r.Ranks, r.Spent, maxLeft);
|
||||
int gap = maxLeft - n;
|
||||
Label($"Stops {gap} rank{(gap == 1 ? "" : "s")} short of the top: that needs {Math.Max(0L, toTop - have):N0} more XP.", Amber);
|
||||
}
|
||||
ImFontPtr f9 = ImGuiFonts.Get(UiFont.Ui9);
|
||||
ImGuiNET.ImGui.PushFont(f9);
|
||||
Label("That is more than half of your unassigned XP. Spent XP can't be taken back.", Dim);
|
||||
|
|
@ -1458,7 +1487,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
{
|
||||
if (PlayerTraining.TrainSkill(r.Stype, (uint)r.TrainCost, defer: true))
|
||||
{
|
||||
MarkPending(s);
|
||||
MarkPending(s, null, 0);
|
||||
SetStatus($"Sent: train {r.Name} for {Credits(r.TrainCost)}.", Teal);
|
||||
}
|
||||
else
|
||||
|
|
@ -1467,16 +1496,42 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
}
|
||||
}
|
||||
|
||||
private void MarkPending(PlayerProgress s)
|
||||
/// <summary>Locks the buttons until the server answers; <paramref name="raised"/> is the raise's row (null for a train).</summary>
|
||||
private void MarkPending(PlayerProgress s, Row? raised, long cost)
|
||||
{
|
||||
_pending = true;
|
||||
_pendingUntilMs = Environment.TickCount64 + 5000;
|
||||
_pendingUnassigned = s.UnassignedXp;
|
||||
_pendingCredits = s.SkillCredits;
|
||||
_pendingVersion = s.Version;
|
||||
_pendingKey = raised?.Key ?? -1;
|
||||
_pendingRanks = raised?.Ranks ?? 0;
|
||||
_pendingSpent = raised?.Spent ?? 0;
|
||||
_pendingCost = cost;
|
||||
_pendingWhat = raised?.Name ?? "";
|
||||
PlayerProgressHooks.RefreshSoon();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The 5 s lock ran out with nothing changed. ACE turns a raise down without a word (more XP
|
||||
/// than it thinks is left to the top, or than you have), so say so here and log the numbers
|
||||
/// the raise was worked out from.
|
||||
/// </summary>
|
||||
private void NoteUnanswered(PlayerProgress? snap)
|
||||
{
|
||||
int key = _pendingKey;
|
||||
_pendingKey = -1;
|
||||
if (key < 0 || snap == null || !_byKey.TryGetValue(key, out Row? r) || r.Table == null) return;
|
||||
if (r.Ranks != _pendingRanks || r.Spent != _pendingSpent || snap.UnassignedXp != _pendingUnassigned) return;
|
||||
SetStatus($"{_pendingWhat}: the server hasn't taken the raise ({_pendingCost:N0} XP) after 5 s; nothing was spent.", Red);
|
||||
RynthLog.Compat($"Skills panel: {_pendingWhat} raise for {_pendingCost:N0} XP got no answer in 5 s " +
|
||||
$"(rank {r.Ranks}, XP spent {r.Spent:N0}, unassigned {snap.UnassignedXp:N0}, class {RowClass(r, snap)}, " +
|
||||
$"top rank {r.Table.Length - 1} at {r.Table[^1]:N0} XP)");
|
||||
}
|
||||
|
||||
private static uint RowClass(Row r, PlayerProgress s) =>
|
||||
r.Kind == RowKind.Skill && r.Stype <= PlayerProgress.MaxSkill ? s.SkillClass[r.Stype] : 0;
|
||||
|
||||
/// <summary>
|
||||
/// Raises <paramref name="n"/> ranks at once: the XP is worked out from the current
|
||||
/// snapshot, checked against the unassigned XP and the top rank, then queued for AC's
|
||||
|
|
@ -1500,7 +1555,9 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
uint stype = r.Kind == RowKind.Vital ? r.Stype * 2 - 1 : r.Stype; // vitals by their maximum
|
||||
if (PlayerTraining.Raise(kind, stype, (uint)cost, defer: true))
|
||||
{
|
||||
MarkPending(s);
|
||||
RynthLog.Compat($"Skills panel: raise {r.Name} +{n} from rank {r.Ranks} (XP spent {r.Spent:N0}, " +
|
||||
$"unassigned {s.UnassignedXp:N0}) for {cost:N0} XP");
|
||||
MarkPending(s, r, cost);
|
||||
SetStatus($"Sent: raise {r.Name} +{n} for {cost:N0} XP.", Teal);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
// (ImGui.GetColorU32 order) built from the Avalonia #AARRGGBB literals.
|
||||
//
|
||||
// Colour themes (Tom 2026-10-14): the structural colours come from a palette
|
||||
// the player can change in Settings > Display: a preset (RynthCore, Ember,
|
||||
// the player can change in Settings > Interface: a preset (RynthCore, Ember,
|
||||
// Verdant, Amethyst, Crimson, Slate, and since 2026-10-21 Brass, Volt and
|
||||
// Ivory, the instrument dashboard's three) or their own eight colours (accent,
|
||||
// highlight, background, title bars, buttons, borders, text, muted text).
|
||||
|
|
@ -277,7 +277,7 @@ internal static class RynthTheme
|
|||
public static readonly uint RadarGripIdle = Argb(0x400A121A);
|
||||
public static readonly uint RadarGripHover = Argb(0xA00A121A);
|
||||
|
||||
// ── Choosing a theme (Settings > Display) ───────────────────────────
|
||||
// ── Choosing a theme (Settings > Interface) ───────────────────────────
|
||||
//
|
||||
// Three kinds of theme (Tom 2026-10-22: a new preset must never cost a player the colours they
|
||||
// made, and players can keep their own schemes):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
// save their color schemes"): named sets of the theme's eight colours, one
|
||||
// file each in %AppData%\RynthCore\themes\ ("name=", then the eight colours
|
||||
// as theme.txt writes them), for the PC, so every client lists the same ones.
|
||||
// RynthTheme puts them in Settings > Display's Theme picker between the
|
||||
// RynthTheme puts them in Settings > Interface's Theme picker between the
|
||||
// presets and Custom; "Save colours as" adds one, Delete removes the one in
|
||||
// use.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace RynthCore.Engine.ImGuiBackend;
|
|||
internal static class VideoPatchBanner
|
||||
{
|
||||
private const string Line1 = "Rendering paused (video patch: all)";
|
||||
private const string Line2 = "Type /rc video off, or Settings > Misc > Video patch";
|
||||
private const string Line2 = "Type /rc video off, or Settings > Game Client > Video patch";
|
||||
|
||||
private static readonly uint Back = RynthTheme.Argb(0xC0101820);
|
||||
private static uint Border => RynthTheme.Border;
|
||||
|
|
|
|||
|
|
@ -712,7 +712,7 @@ internal static unsafe class Win32Backend
|
|||
// GetAsyncKeyState reads the physical key whatever window has focus: without
|
||||
// the focus test, Insert (or Shift/Ctrl+Insert paste/copy) pressed in another
|
||||
// client or app flipped this client's capture off unseen. Not while typing in
|
||||
// RynthChat: there Shift/Ctrl+Insert are paste/copy. Opt-in (Settings > Display,
|
||||
// RynthChat: there Shift/Ctrl+Insert are paste/copy. Opt-in (Settings > Hotkeys,
|
||||
// EngineSettings.InsertReleasesUi): off, Insert does nothing.
|
||||
if (insertDown && !_insertWasDown && _hasFocus && !ChatCaptureActive
|
||||
&& Plugins.EngineSettings.InsertReleasesUi)
|
||||
|
|
|
|||
Loading…
Reference in a new issue