Snapshot for release 2026.10.15.2 (internal 9094d68)
This commit is contained in:
parent
8bb1c3aa23
commit
516ad2bdf2
121 changed files with 6486 additions and 781 deletions
|
|
@ -771,6 +771,10 @@ internal static class EngineFrameController
|
|||
Hud.MonsterHud.Draw(_uiScale, worldVisible: !D3D9.VideoPatch.SkipWorldThisFrame);
|
||||
// Video patch "all": the "rendering paused" banner (background list, under the panels).
|
||||
VideoPatchBanner.Draw();
|
||||
// Server verdicts, the plugins' section manifests and the servermenu push. Every
|
||||
// frame, bar or not: with the bar hidden (the rail instead) nothing else ticks them,
|
||||
// so Options > Diagnostics listed no servers and no server plugin was told it is active.
|
||||
RynthCore.Engine.UI.ServerMenus.Tick();
|
||||
if (ImGuiBar.Visible)
|
||||
ImGuiBar.Draw(_uiScale);
|
||||
ImGuiPanelHost.DrawAll(_uiScale);
|
||||
|
|
|
|||
|
|
@ -318,8 +318,7 @@ internal static class ImGuiBar
|
|||
|
||||
public static void Draw(float s)
|
||||
{
|
||||
// The bar draws every frame the ImGui shell is up: keep RynthAi's server menu current.
|
||||
RynthCore.Engine.UI.ServerMenus.Tick();
|
||||
// ServerMenus.Tick runs from EngineFrameController every frame, bar shown or not.
|
||||
EnsureButtons();
|
||||
int step = ChromeStep(out float factor);
|
||||
s *= factor;
|
||||
|
|
@ -414,7 +413,7 @@ internal static class ImGuiBar
|
|||
ImGuiNET.ImGui.SetWindowPos(next);
|
||||
_userMoved = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(_tooltip);
|
||||
SafeImGui.SetItemTooltip(_tooltip);
|
||||
if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||
ImGuiNET.ImGui.OpenPopup("##bar_menu");
|
||||
PhosphorIcons.DrawCentered(dl, iconFont, PhosphorIcons.DotsSixVertical, rcPos, new Vector2(square.X * 0.8f, square.Y), RynthTheme.RcLabel);
|
||||
|
|
@ -428,7 +427,7 @@ internal static class ImGuiBar
|
|||
if (ImGuiNET.ImGui.InvisibleButton("##barcollapse", caretSize))
|
||||
RynthAiDashboardState.SetBarCollapsed(!collapsed);
|
||||
bool caretHot = ImGuiNET.ImGui.IsItemHovered();
|
||||
ImGuiNET.ImGui.SetItemTooltip(collapsed ? "Show the bar" : "Fold the bar to this button");
|
||||
SafeImGui.SetItemTooltip(collapsed ? "Show the bar" : "Fold the bar to this button");
|
||||
PhosphorIcons.DrawCentered(dl, iconFont, collapsed ? PhosphorIcons.CaretRight : PhosphorIcons.CaretLeft, cPos, caretSize,
|
||||
caretHot ? RynthTheme.RcLabel : 0xFF9A9A9Au);
|
||||
if (collapsed) return;
|
||||
|
|
@ -456,7 +455,7 @@ internal static class ImGuiBar
|
|||
if (b.Window != null) ScriptWindowRegistry.PlayerSetVisible(b.Window, !ImGuiPanelHost.IsOpen(b.Window.PanelKey));
|
||||
else PanelRouter.Toggle(b.Title);
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(b.Tooltip); // a plugin window's title arrives with '%' doubled (EnsureButtons)
|
||||
SafeImGui.SetItemTooltip(b.Tooltip);
|
||||
}
|
||||
|
||||
// The ILT section: one button, only on Infinite Leaftide with ILT panels registered
|
||||
|
|
@ -470,7 +469,7 @@ internal static class ImGuiBar
|
|||
if (only != null) PanelRouter.Toggle(only);
|
||||
else ImGuiNET.ImGui.OpenPopup("##ilt_menu");
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(only != null ? "Infinite Leaftide: " + only : "Infinite Leaftide");
|
||||
SafeImGui.SetItemTooltip(only != null ? "Infinite Leaftide: " + only : "Infinite Leaftide");
|
||||
}
|
||||
|
||||
// Script windows (decision 2): one button with a menu, only while a ShowInBar
|
||||
|
|
@ -530,7 +529,7 @@ internal static class ImGuiBar
|
|||
ImGuiNET.ImGui.SameLine();
|
||||
if (IconButton("##popout", iconFont, popped ? PhosphorIcons.ArrowSquareIn : PhosphorIcons.ArrowSquareOut, square, RynthTheme.PopOutLabel))
|
||||
SetPoppedOut(!popped);
|
||||
ImGuiNET.ImGui.SetItemTooltip(popped ? "Dock the bar back into the game window." : "Pop the bar out into its own floating window.");
|
||||
SafeImGui.SetItemTooltip(popped ? "Dock the bar back into the game window." : "Pop the bar out into its own floating window.");
|
||||
}
|
||||
|
||||
/// <summary>The ILT panels the bar offers now: 0 off Infinite Leaftide or without RynthILT. AC thread.</summary>
|
||||
|
|
@ -686,12 +685,12 @@ internal static class ImGuiBar
|
|||
ImGuiNET.ImGui.BeginDisabled(!canDown);
|
||||
if (IconButton(id + "_down", iconFont, PhosphorIcons.Minus, new Vector2(btn, btn), text)) delta = -1;
|
||||
ImGuiNET.ImGui.EndDisabled();
|
||||
ImGuiNET.ImGui.SetItemTooltip(downTip);
|
||||
SafeImGui.SetItemTooltip(downTip);
|
||||
ImGuiNET.ImGui.SameLine(0, 4 * s);
|
||||
ImGuiNET.ImGui.BeginDisabled(!canUp);
|
||||
if (IconButton(id + "_up", iconFont, PhosphorIcons.Plus, new Vector2(btn, btn), text)) delta = 1;
|
||||
ImGuiNET.ImGui.EndDisabled();
|
||||
ImGuiNET.ImGui.SetItemTooltip(upTip);
|
||||
SafeImGui.SetItemTooltip(upTip);
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
ImGuiNET.ImGui.SameLine(0, 8 * s);
|
||||
ImGuiNET.ImGui.AlignTextToFramePadding();
|
||||
|
|
@ -769,8 +768,7 @@ internal static class ImGuiBar
|
|||
string title = w.Title.Length > 0 ? w.Title : w.Key;
|
||||
string icon = IconFor(title, out bool letter);
|
||||
string id = "##bar_sw" + w.Hash.ToString("X8");
|
||||
// The tooltip goes through SetItemTooltip, a format function: the plugin's text with '%' doubled.
|
||||
list.Add(new ButtonInfo(title, id, icon, letter, title.Replace("%", "%%"), Window: w));
|
||||
list.Add(new ButtonInfo(title, id, icon, letter, title, Window: w));
|
||||
}
|
||||
_buttons = list.ToArray();
|
||||
_tooltip = $"RynthCore {EntryPoint.BuildStamp}\nDrag here to move the bar. Right-click: bar size and rows. Ctrl+wheel over the bar: size.";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ internal static class ImGuiFontTest
|
|||
ImGuiNET.ImGui.SetNextWindowSize(new Vector2(560, 520) * scale, ImGuiCond.FirstUseEver);
|
||||
if (ImGuiNET.ImGui.Begin("RynthCore font test##fonttest"))
|
||||
{
|
||||
ImGuiNET.ImGui.TextDisabled($"scale {scale:0.##} atlas {ImGuiNET.ImGui.GetIO().Fonts.TexWidth}x{ImGuiNET.ImGui.GetIO().Fonts.TexHeight}");
|
||||
SafeImGui.TextDisabled($"scale {scale:0.##} atlas {ImGuiNET.ImGui.GetIO().Fonts.TexWidth}x{ImGuiNET.ImGui.GetIO().Fonts.TexHeight}");
|
||||
for (UiFont f = 0; f < UiFont.Count; f++)
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(f));
|
||||
|
|
@ -54,7 +54,7 @@ internal static class ImGuiFontTest
|
|||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.TextColored(ImGuiNET.ImGui.ColorConvertU32ToFloat4(RynthTheme.ReloadLabel), "RL");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.TextColored(ImGuiNET.ImGui.ColorConvertU32ToFloat4(RynthTheme.PopOutLabel), PhosphorIcons.ArrowSquareOut);
|
||||
SafeImGui.TextColored(ImGuiNET.ImGui.ColorConvertU32ToFloat4(RynthTheme.PopOutLabel), PhosphorIcons.ArrowSquareOut);
|
||||
}
|
||||
ImGuiNET.ImGui.End();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -379,6 +379,7 @@ internal static class ImGuiPanelHost
|
|||
/// </summary>
|
||||
public static void DragWindowWithLastItem()
|
||||
{
|
||||
if (_inEmbed) return; // embedded in another panel: that panel's window isn't this face's to move
|
||||
if (ImGuiPopOuts.InPopOutFrame)
|
||||
{
|
||||
// Popped out: the OS window moves (it follows the cursor from here on).
|
||||
|
|
@ -394,6 +395,7 @@ internal static class ImGuiPanelHost
|
|||
/// <summary>Asks for a new window size (logical units), applied on the next frame it draws. Any thread.</summary>
|
||||
public static void RequestSize(string title, Vector2 logicalSize)
|
||||
{
|
||||
if (_inEmbed) return; // an embedded copy must not resize the face's own window
|
||||
lock (Sync)
|
||||
{
|
||||
if (!Entries.TryGetValue(title, out Entry? entry)) return;
|
||||
|
|
@ -409,6 +411,7 @@ internal static class ImGuiPanelHost
|
|||
/// </summary>
|
||||
public static void RequestPos(string title, Vector2 logicalPos)
|
||||
{
|
||||
if (_inEmbed) return;
|
||||
lock (Sync)
|
||||
{
|
||||
if (!Entries.TryGetValue(title, out Entry? entry)) return;
|
||||
|
|
@ -450,10 +453,12 @@ internal static class ImGuiPanelHost
|
|||
/// </summary>
|
||||
public static void DrawAll(float uiScale)
|
||||
{
|
||||
_frameScale = uiScale;
|
||||
float placeScale = PlacementScale();
|
||||
while (Requests.TryDequeue(out var req))
|
||||
Apply(req.Title, req.Kind, placeScale);
|
||||
RemoveUnregistered();
|
||||
SweepEmbedded();
|
||||
|
||||
List<Entry> order;
|
||||
lock (Sync) order = DrawOrder;
|
||||
|
|
@ -485,6 +490,7 @@ internal static class ImGuiPanelHost
|
|||
Entry? entry;
|
||||
lock (Sync) Entries.TryGetValue(title, out entry);
|
||||
if (entry == null || !entry.Shown || !entry.Popped) return;
|
||||
_frameScale = uiScale;
|
||||
DrawPanel(entry, uiScale, PlacementScale(), display);
|
||||
}
|
||||
|
||||
|
|
@ -1025,6 +1031,148 @@ internal static class ImGuiPanelHost
|
|||
/// <summary>The panel whose face is drawing right now (names a text box's owner in the input log). AC thread.</summary>
|
||||
internal static string? DrawingTitle { get; private set; }
|
||||
|
||||
// ── Embedding: a face drawn inside another panel (the Mini Remote's sections) ──
|
||||
|
||||
/// <summary>An embedded copy of a face: its own instance, so the face's own window is unaffected.</summary>
|
||||
private sealed class EmbeddedFace
|
||||
{
|
||||
public required string Title;
|
||||
public required IImGuiPanel Instance;
|
||||
public long LastDrawnMs;
|
||||
public int Failures;
|
||||
public string? Error;
|
||||
}
|
||||
|
||||
/// <summary>Embedded copies by host + title. AC thread only (docked and pop-out frames both run there).</summary>
|
||||
private static readonly Dictionary<string, EmbeddedFace> EmbeddedFaces = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>An embedded copy not drawn for this long is hidden and dropped (its section was left).</summary>
|
||||
private const long EmbedIdleMs = 750;
|
||||
|
||||
/// <summary>Faces that can't be embedded: the hosts themselves.</summary>
|
||||
private static readonly HashSet<string> NotEmbeddable = new(StringComparer.OrdinalIgnoreCase) { "Mini Remote" };
|
||||
|
||||
/// <summary>The UI scale of the frame being drawn (docked or popped). AC thread.</summary>
|
||||
private static float _frameScale = 1f;
|
||||
|
||||
/// <summary>True while an embedded copy draws: its window moves and size requests are ignored.</summary>
|
||||
[ThreadStatic] private static bool _inEmbed;
|
||||
|
||||
/// <summary>True when <paramref name="title"/> is registered and may be drawn inside another panel. Any thread.</summary>
|
||||
public static bool CanEmbed(string title) => !NotEmbeddable.Contains(title) && HasFace(title);
|
||||
|
||||
/// <summary>A registered face's default window size (logical units). Any thread.</summary>
|
||||
public static bool TryGetDefaultSize(string title, out Vector2 size)
|
||||
{
|
||||
Entry? entry;
|
||||
lock (Sync) Entries.TryGetValue(title, out entry);
|
||||
size = entry?.Spec.DefaultSize ?? Vector2.Zero;
|
||||
return entry != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws a copy of the face <paramref name="title"/> into the current window, in a child of
|
||||
/// <paramref name="size"/> (pixels; 0 = fill). <paramref name="hostKey"/> separates the copies
|
||||
/// of different hosts. The copy is created on first draw and dropped (OnHidden) once it
|
||||
/// hasn't drawn for <see cref="EmbedIdleMs"/>. AC thread, inside a window.
|
||||
/// </summary>
|
||||
public static void DrawEmbedded(string hostKey, string title, Vector2 size)
|
||||
{
|
||||
Entry? entry;
|
||||
lock (Sync) Entries.TryGetValue(title, out entry);
|
||||
if (entry == null || NotEmbeddable.Contains(title))
|
||||
{
|
||||
ImGuiNET.ImGui.TextDisabled("Not available.");
|
||||
return;
|
||||
}
|
||||
|
||||
string key = hostKey + "\u001f" + title;
|
||||
if (!EmbeddedFaces.TryGetValue(key, out EmbeddedFace? face))
|
||||
{
|
||||
try
|
||||
{
|
||||
IImGuiPanel instance = entry.Factory();
|
||||
instance.OnShown();
|
||||
face = new EmbeddedFace { Title = title, Instance = instance };
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
RynthLog.UI($"ImGuiPanelHost: embedding {title} failed - {ex.GetType().Name}: {ex.Message}");
|
||||
face = new EmbeddedFace { Title = title, Instance = new NullFace(), Error = $"{title} failed to open: {ex.Message}" };
|
||||
}
|
||||
EmbeddedFaces[key] = face;
|
||||
}
|
||||
face.LastDrawnMs = Environment.TickCount64;
|
||||
|
||||
PanelSpec spec = entry.Spec;
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, spec.EdgeToEdge ? Vector2.Zero : new Vector2(6, 4) * _frameScale);
|
||||
ImGuiWindowFlags flags = ImGuiWindowFlags.NoBackground | spec.BodyFlags;
|
||||
if (spec.EdgeToEdge) flags |= ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse;
|
||||
bool open = ImGuiNET.ImGui.BeginChild("##embed_" + title, size, ImGuiChildFlags.AlwaysUseWindowPadding, flags);
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
try
|
||||
{
|
||||
if (!open) return;
|
||||
if (face.Error != null)
|
||||
{
|
||||
// Never a format string: the error carries an exception message.
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(1f, 0.4f, 0.3f, 1f));
|
||||
ImGuiNET.ImGui.PushTextWrapPos(0f);
|
||||
ImGuiNET.ImGui.TextUnformatted(face.Error);
|
||||
ImGuiNET.ImGui.PopTextWrapPos();
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
return;
|
||||
}
|
||||
string? outer = DrawingTitle;
|
||||
_inEmbed = true;
|
||||
DrawingTitle = title;
|
||||
try
|
||||
{
|
||||
face.Instance.Draw();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
face.Failures++;
|
||||
RynthLog.UI($"ImGuiPanelHost: embedded {title}.Draw threw {ex.GetType().Name}: {ex.Message} ({face.Failures}/{MaxFailures})");
|
||||
if (face.Failures >= MaxFailures)
|
||||
face.Error = $"{title} stopped drawing after repeated errors: {ex.Message}";
|
||||
}
|
||||
finally
|
||||
{
|
||||
_inEmbed = false;
|
||||
DrawingTitle = outer;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.EndChild();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Hides and drops embedded copies whose host stopped drawing them. AC thread.</summary>
|
||||
private static void SweepEmbedded()
|
||||
{
|
||||
if (EmbeddedFaces.Count == 0) return;
|
||||
long now = Environment.TickCount64;
|
||||
List<string>? stale = null;
|
||||
foreach (var kv in EmbeddedFaces)
|
||||
if (now - kv.Value.LastDrawnMs > EmbedIdleMs) (stale ??= new List<string>()).Add(kv.Key);
|
||||
if (stale == null) return;
|
||||
foreach (string key in stale)
|
||||
{
|
||||
EmbeddedFace face = EmbeddedFaces[key];
|
||||
EmbeddedFaces.Remove(key);
|
||||
try { face.Instance.OnHidden(); }
|
||||
catch (Exception ex) { RynthLog.UI($"ImGuiPanelHost: embedded {face.Title}.OnHidden threw {ex.GetType().Name}: {ex.Message}"); }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Stands in for a face that failed to open, so its error line can draw.</summary>
|
||||
private sealed class NullFace : IImGuiPanel
|
||||
{
|
||||
public void Draw() { }
|
||||
}
|
||||
|
||||
private static void DrawBody(Entry entry)
|
||||
{
|
||||
DrawingTitle = entry.Title;
|
||||
|
|
@ -1247,7 +1395,7 @@ internal static class ImGuiPanelHost
|
|||
if (ImGuiNET.ImGui.Button(PhosphorIcons.ArrowCounterClockwise + " Reset"))
|
||||
PanelTextScale.ResetWindow(title);
|
||||
ImGuiNET.ImGui.EndDisabled();
|
||||
ImGuiNET.ImGui.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 > Display)");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
if (ImGuiNET.ImGui.Button("Use for all windows"))
|
||||
PanelTextScale.UseForAll(step);
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ internal static class MonsterHudSettingsUi
|
|||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
{
|
||||
ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
||||
if (tip != null) ImGuiNET.ImGui.SetTooltip(tip);
|
||||
if (tip != null) SafeImGui.SetTooltip(tip);
|
||||
}
|
||||
if (clicked) value = radio || !value;
|
||||
dl.AddRectFilled(p + new Vector2(0, 2), p + new Vector2(12, 14), value ? ToggleOn : ToggleOff, 2);
|
||||
|
|
@ -274,7 +274,7 @@ internal static class MonsterHudSettingsUi
|
|||
{
|
||||
BeginSliderRow(label, w);
|
||||
bool changed = ImGuiNET.ImGui.SliderFloat("##v", ref value, min, max, "%.2fx", ImGuiSliderFlags.AlwaysClamp);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(tip);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) SafeImGui.SetTooltip(tip);
|
||||
return EndSliderRow(changed);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ internal static class PlayerPlate
|
|||
{
|
||||
ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.ResizeAll);
|
||||
if (_hover && !_dragging)
|
||||
ImGuiNET.ImGui.SetTooltip(DragTip);
|
||||
SafeImGui.SetTooltip(DragTip);
|
||||
}
|
||||
_wantsMouse = _hover || _dragging;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ internal sealed class BountiesFace : IImGuiPanel
|
|||
if (Button("##bounty_hideqb", hideLabel, new Vector2(x, p.Y), new Vector2(hw, 22),
|
||||
d.HideQbLocked ? OnText : Mute, d.HideQbLocked ? OnBg : BtnFill))
|
||||
BountiesCommands.Set("hideqblocked", !d.HideQbLocked);
|
||||
if (d.HiddenCount > 0) ImGuiNET.ImGui.SetItemTooltip($"{d.HiddenCount} hidden");
|
||||
if (d.HiddenCount > 0) SafeImGui.SetItemTooltip($"{d.HiddenCount} hidden");
|
||||
|
||||
x += hw + 4;
|
||||
const string sortLabel = "Closest first";
|
||||
|
|
@ -263,7 +263,7 @@ internal sealed class BountiesFace : IImGuiPanel
|
|||
BountyRowStatus.NeedsQb => $"\nNeeds {N0(r.QbRequired)} QB; you have {N0(r.QbHave)}.",
|
||||
_ => string.Empty,
|
||||
};
|
||||
ImGuiNET.ImGui.SetTooltip($"{r.Where}: {N0(r.Amount)} {r.Item}\n{every}{detail}");
|
||||
SafeImGui.SetTooltip($"{r.Where}: {N0(r.Amount)} {r.Item}\n{every}{detail}");
|
||||
}
|
||||
NextLine(p, RowH);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -369,23 +369,23 @@ internal sealed class CharactersFace : IImGuiPanel
|
|||
bool canFollow = me.Length > 0;
|
||||
if (!_menuSelf && !_menuLoggedOut)
|
||||
{
|
||||
ImGuiNET.ImGui.TextDisabled(_menuName);
|
||||
SafeImGui.TextDisabled(_menuName);
|
||||
if (ImGuiNET.ImGui.MenuItem("Select", "", false, _menuInView && _menuId != 0))
|
||||
AcMainThreadQueue.EnqueueOverlaySelect(_menuId);
|
||||
ImGuiNET.ImGui.Separator();
|
||||
if (ImGuiNET.ImGui.MenuItem("Follow me", "", false, canFollow && !_menuOtherWorld))
|
||||
CharactersCommands.Tell(_menuName, "/ra follow " + me);
|
||||
ImGuiNET.ImGui.SetItemTooltip($"/rn tell {_menuName}, /ra follow {me}");
|
||||
SafeImGui.SetItemTooltip($"/rn tell {_menuName}, /ra follow {me}");
|
||||
if (ImGuiNET.ImGui.MenuItem("Stop following"))
|
||||
CharactersCommands.Tell(_menuName, "/ra follow off");
|
||||
ImGuiNET.ImGui.SetItemTooltip($"/rn tell {_menuName}, /ra follow off");
|
||||
SafeImGui.SetItemTooltip($"/rn tell {_menuName}, /ra follow off");
|
||||
ImGuiNET.ImGui.Separator();
|
||||
if (ImGuiNET.ImGui.MenuItem("Start macro"))
|
||||
CharactersCommands.Tell(_menuName, "/ra start");
|
||||
ImGuiNET.ImGui.SetItemTooltip($"/rn tell {_menuName}, /ra start");
|
||||
SafeImGui.SetItemTooltip($"/rn tell {_menuName}, /ra start");
|
||||
if (ImGuiNET.ImGui.MenuItem("Stop macro"))
|
||||
CharactersCommands.Tell(_menuName, "/ra stop");
|
||||
ImGuiNET.ImGui.SetItemTooltip($"/rn tell {_menuName}, /ra stop");
|
||||
SafeImGui.SetItemTooltip($"/rn tell {_menuName}, /ra stop");
|
||||
ImGuiNET.ImGui.Separator();
|
||||
}
|
||||
if (ImGuiNET.ImGui.MenuItem("Everyone: follow me", "", false, canFollow))
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ internal sealed class ChatFace : IImGuiPanel
|
|||
else _drawers.Toggle(_channels);
|
||||
}
|
||||
if (ImGuiNET.ImGui.IsItemHovered(ImGuiHoveredFlags.ForTooltip))
|
||||
ImGuiNET.ImGui.SetTooltip(mention ? "Channels (someone mentioned you)" : "Channels: pick a tab, see what's unread");
|
||||
SafeImGui.SetTooltip(mention ? "Channels (someone mentioned you)" : "Channels: pick a tab, see what's unread");
|
||||
float ty = start.Y + (h - ImGuiNET.ImGui.GetFontSize()) * 0.5f;
|
||||
dl.PushClipRect(start, start + new Vector2(bw - caretW - 6 - (badge != null ? badgeW + 4 : 0), h), true);
|
||||
dl.AddText(new Vector2(start.X + 6, ty), Text, label);
|
||||
|
|
@ -1139,7 +1139,7 @@ internal sealed class ChatFace : IImGuiPanel
|
|||
}
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
Label(kind.Label, RynthTheme.Argb(argb));
|
||||
ImGuiNET.ImGui.SetItemTooltip(kind.Hint + (set ? "" : kind.Key.StartsWith(ChatLineColors.TabPrefix, StringComparison.Ordinal)
|
||||
SafeImGui.SetItemTooltip(kind.Hint + (set ? "" : kind.Key.StartsWith(ChatLineColors.TabPrefix, StringComparison.Ordinal)
|
||||
? "\nThe built-in colour." : $"\nNot set: the {kind.Tab} tab's colour."));
|
||||
if (set)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ internal sealed class ChatFiltersFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.PushID(p.Id);
|
||||
bool enabled = p.Enabled;
|
||||
if (ImGuiNET.ImGui.Checkbox(p.Label, ref enabled)) { p.Enabled = enabled; ChatModel.FiltersChanged(); }
|
||||
ImGuiNET.ImGui.SetItemTooltip(p.Description + "\nExample: " + p.Example);
|
||||
SafeImGui.SetItemTooltip(p.Description + "\nExample: " + p.Example);
|
||||
ImGuiNET.ImGui.SameLine(Math.Max(ImGuiNET.ImGui.GetCursorPosX() + 8, rowW * 0.6f));
|
||||
string tabText = (p.Tab.Length == 0 ? "hide" : "to " + p.Tab) + Caret;
|
||||
if (ImGuiNET.ImGui.SmallButton(tabText))
|
||||
|
|
@ -260,7 +260,7 @@ internal sealed class ChatFiltersFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X + 16, p.Y + 1));
|
||||
bool on = r.Enabled;
|
||||
if (ImGuiNET.ImGui.Checkbox("##on", ref on)) { r.Enabled = on; ChatModel.FiltersChanged(); }
|
||||
ImGuiNET.ImGui.SetItemTooltip(on ? "Rule on (click to turn off)" : "Rule off (click to turn on)");
|
||||
SafeImGui.SetItemTooltip(on ? "Rule on (click to turn off)" : "Rule off (click to turn on)");
|
||||
|
||||
const float btn = 22;
|
||||
float x = p.X + 42;
|
||||
|
|
@ -275,7 +275,7 @@ internal sealed class ChatFiltersFace : IImGuiPanel
|
|||
moded.Recompile();
|
||||
ChatModel.FiltersChanged();
|
||||
}, 120);
|
||||
ImGuiNET.ImGui.SetItemTooltip(ModeHelp[modeIdx]);
|
||||
SafeImGui.SetItemTooltip(ModeHelp[modeIdx]);
|
||||
x += modeW + 4;
|
||||
float patW = Math.Max(80, card.X + rowW - 4 - 3 * (btn + 2) - 4 - x);
|
||||
if (TextBox("##pat", b.Pattern, new Vector2(x, p.Y), patW, ModeHints[modeIdx], out bool patActive))
|
||||
|
|
@ -323,7 +323,7 @@ internal sealed class ChatFiltersFace : IImGuiPanel
|
|||
if (rule.Action == ChatRuleAction.Color && rule.ColorMode == ChatColorMode.None) rule.ColorMode = ChatColorMode.Line;
|
||||
ChatModel.FiltersChanged();
|
||||
}, 140);
|
||||
ImGuiNET.ImGui.SetItemTooltip(ActionHelp[action]);
|
||||
SafeImGui.SetItemTooltip(ActionHelp[action]);
|
||||
|
||||
if (r.Action is ChatRuleAction.Move or ChatRuleAction.Copy)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
// ── Header ───────────────────────────────────────────────────────
|
||||
string name = d != null && d.Name.Length > 0 ? d.Name : _selectedName;
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
|
||||
ImGuiNET.ImGui.TextColored(Vec(Teal), isDefault ? "DEFAULT" : name);
|
||||
SafeImGui.TextColored(Vec(Teal), isDefault ? "DEFAULT" : name);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
if (isDefault)
|
||||
{
|
||||
|
|
@ -128,17 +128,17 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
}
|
||||
else if (d == null)
|
||||
{
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), _detail != null && !_detail.Bound ? "Waiting for RynthAi…" : "Loading…");
|
||||
SafeImGui.TextColored(Vec(Dim), _detail != null && !_detail.Bound ? "Waiting for RynthAi…" : "Loading…");
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), "wcid " + wcid.ToString(CultureInfo.InvariantCulture));
|
||||
SafeImGui.TextColored(Vec(Dim), "wcid " + wcid.ToString(CultureInfo.InvariantCulture));
|
||||
// Aelrynth only: which difficulty tier these numbers are (the Damage panel's chip picks it).
|
||||
if (UiSources.Damage.Current?.Value.Tier is { Show: true } tier)
|
||||
{
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.TextColored(Vec(tier.View == tier.Current ? Teal : Gold),
|
||||
SafeImGui.TextColored(Vec(tier.View == tier.Current ? Teal : Gold),
|
||||
tier.View <= 0 ? "· Tier 0 (real Dereth)" : "· Tier " + tier.View.ToString(CultureInfo.InvariantCulture));
|
||||
ImGuiNET.ImGui.SetItemTooltip("HP, casts to kill, seconds per kill, hits and damage taken are this difficulty tier's.\n" +
|
||||
"Damage per cast and weaknesses are the same at every tier. Change it on the Damage panel.");
|
||||
|
|
@ -146,7 +146,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
string hp = d.Hp > 0 ? $"HP {d.Hp:N0} ({d.HpSrc})" : "HP unknown";
|
||||
string sec = d.SecKill > 0 ? $"{d.SecKill:0.0} s per kill" : "no timed kills yet";
|
||||
string hit = d.HitRate >= 0 ? $"{d.HitRate * 100:0}% hits" : "no hits yet";
|
||||
ImGuiNET.ImGui.TextColored(Vec(White), $"{hp} · {sec} · {hit}");
|
||||
SafeImGui.TextColored(Vec(White), $"{hp} · {sec} · {hit}");
|
||||
|
||||
float bw = ImGuiNET.ImGui.CalcTextSize(RemoveLabel).X + 16;
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
|
|
@ -158,7 +158,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SetItemTooltip("Take this monster off the Damage panel: its learned numbers and your settings for it. It comes back if you meet it again.");
|
||||
if (_confirmRemove)
|
||||
{
|
||||
ImGuiNET.ImGui.TextColored(Vec(Gold), "Remove " + name + " and everything learned about it?");
|
||||
SafeImGui.TextColored(Vec(Gold), "Remove " + name + " and everything learned about it?");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
if (ImGuiNET.ImGui.SmallButton("Remove##yes"))
|
||||
{
|
||||
|
|
@ -191,7 +191,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
Rule? rule = _rules?.FindRule(name);
|
||||
if (rule != null) _renaming = null;
|
||||
ImGuiNET.ImGui.PushTextWrapPos(0);
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), rule == null
|
||||
SafeImGui.TextColored(Vec(Dim), rule == null
|
||||
? (_rules == null || _renaming == name ? "Loading…" : "There is no rule with this name (deleted?).")
|
||||
: "A name rule: used for every monster whose name contains \"" + name + "\""
|
||||
+ (string.IsNullOrWhiteSpace(rule.MatchExpression) ? "" : " and its match expression is true")
|
||||
|
|
@ -205,7 +205,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
_confirmRemove = true;
|
||||
ImGuiNET.ImGui.SetItemTooltip("Delete this rule. Monsters it covered go back to Default (or another rule that matches).");
|
||||
if (!_confirmRemove) return;
|
||||
ImGuiNET.ImGui.TextColored(Vec(Gold), "Delete the rule " + name + "?");
|
||||
SafeImGui.TextColored(Vec(Gold), "Delete the rule " + name + "?");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
if (ImGuiNET.ImGui.SmallButton("Delete##yes"))
|
||||
{
|
||||
|
|
@ -237,7 +237,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.TextColored(Vec(Dim), "Nothing known yet: not in the server data, no creature type, nothing learned.");
|
||||
return;
|
||||
}
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), "Damage it takes from each element (1.0 = full, 0.5 = half), from " + d.WeakSrc + ".");
|
||||
SafeImGui.TextColored(Vec(Dim), "Damage it takes from each element (1.0 = full, 0.5 = half), from " + d.WeakSrc + ".");
|
||||
float labelW = ImGuiNET.ImGui.CalcTextSize("Lightning ").X;
|
||||
float barW = Math.Max(80, ImGuiNET.ImGui.GetContentRegionAvail().X - labelW - ImGuiNET.ImGui.CalcTextSize(" 0.00x").X - 8);
|
||||
double top = 1.0;
|
||||
|
|
@ -356,9 +356,9 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
|
||||
if (!nameRule)
|
||||
{
|
||||
ImGuiNET.ImGui.TextColored(Vec(custom || isDefault ? Gold : Dim),
|
||||
SafeImGui.TextColored(Vec(custom || isDefault ? Gold : Dim),
|
||||
isDefault ? "Applies to every monster set to Default." : custom ? "Custom settings for this monster." : "Following Default (a change here gives it its own settings).");
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), DebuffsHint);
|
||||
SafeImGui.TextColored(Vec(Dim), DebuffsHint);
|
||||
if (custom)
|
||||
{
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
|
|
@ -439,7 +439,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
{
|
||||
ImGuiNET.ImGui.SameLine(0, 10);
|
||||
ImGuiNET.ImGui.AlignTextToFramePadding();
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), "casts " + casts + (view.UseRing ? ", Ring when enough are near" : ""));
|
||||
SafeImGui.TextColored(Vec(Dim), "casts " + casts + (view.UseRing ? ", Ring when enough are near" : ""));
|
||||
ImGuiNET.ImGui.SetItemTooltip("With several shapes on, the first of Arc, Streak, Blast, Bolt is cast.\n" +
|
||||
"Ring replaces it when at least Min Ring Targets monsters are within Ring Range (Settings).");
|
||||
}
|
||||
|
|
@ -486,7 +486,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
private static void Combo(string label, string id, string[] items, string current, Action<string> onPick, string tip)
|
||||
{
|
||||
ImGuiNET.ImGui.AlignTextToFramePadding();
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), label);
|
||||
SafeImGui.TextColored(Vec(Dim), label);
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.SetNextItemWidth(ImGuiNET.ImGui.CalcTextSize("Dual wield").X + 34);
|
||||
if (ImGuiNET.ImGui.BeginCombo(id, current))
|
||||
|
|
@ -497,7 +497,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
onPick(v);
|
||||
ImGuiNET.ImGui.EndCombo();
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
}
|
||||
|
||||
private const string RemoveLabel = PhosphorIcons.Trash + " Remove monster";
|
||||
|
|
@ -506,7 +506,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
|
||||
private static void ToggleRow(string label, (string Field, string Label, string Tip)[] defs, Rule view, string name)
|
||||
{
|
||||
ImGuiNET.ImGui.TextColored(Vec(Dim), label);
|
||||
SafeImGui.TextColored(Vec(Dim), label);
|
||||
float h = ImGuiNET.ImGui.GetFrameHeight();
|
||||
foreach (var (field, text, tip) in defs)
|
||||
{
|
||||
|
|
@ -518,7 +518,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
if (ImGuiNET.ImGui.InvisibleButton("##t_" + field, size))
|
||||
DamageCommands.EditRule(name, rule => DamageCommands.FlipToggle(rule, field));
|
||||
bool hot = ImGuiNET.ImGui.IsItemHovered();
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
var dl = ImGuiNET.ImGui.GetWindowDrawList();
|
||||
dl.AddRectFilled(p, p + size, hot ? FaceKit.Lighten(EntryBg) : EntryBg, 2);
|
||||
dl.AddRect(p, p + size, EntryBorder, 2);
|
||||
|
|
@ -545,7 +545,7 @@ internal sealed class DamageDetailFace : IImGuiPanel
|
|||
private static void Cell(string text)
|
||||
{
|
||||
ImGuiNET.ImGui.TableNextColumn();
|
||||
ImGuiNET.ImGui.TextColored(Vec(White), text);
|
||||
SafeImGui.TextColored(Vec(White), text);
|
||||
}
|
||||
|
||||
private static Vector4 Vec(uint abgr) => ImGuiNET.ImGui.ColorConvertU32ToFloat4(abgr);
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
OpenPicker(new Vector2(x, y + 22), t.Following ? FollowTier : (uint)t.View, id =>
|
||||
DamageCommands.SetViewTier(id == FollowTier ? -1 : (int)id));
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(
|
||||
SafeImGui.SetItemTooltip(
|
||||
"Aelrynth's awakened worlds and scaled dungeons have the same monsters, with " +
|
||||
$"{t.Percent.ToString("0.#", CultureInfo.InvariantCulture)}% more health, skills and damage per tier.\n" +
|
||||
"HP, kills, casts to kill, seconds per kill and hit rate here are this tier's; damage per cast,\n" +
|
||||
|
|
@ -527,7 +527,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
if (all == null || count == 0)
|
||||
{
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 3));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), all == null
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), all == null
|
||||
? " Monster rules not loaded yet." : " No name rules yet: add one below.");
|
||||
}
|
||||
else
|
||||
|
|
@ -559,7 +559,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
string name = r.Name;
|
||||
if (NameLink("##rn", name, new Vector2(p.X + 4, p.Y), nameW - 8, met ? White : Gold, ImGuiFonts.Get(UiFont.Ui11)))
|
||||
OpenRule(name);
|
||||
ImGuiNET.ImGui.SetItemTooltip(met
|
||||
SafeImGui.SetItemTooltip(met
|
||||
? "This monster's own settings (wcid " + wcid.ToString(CultureInfo.InvariantCulture) + "). Click for its details."
|
||||
: "Click to edit this rule.");
|
||||
float x = p.X + nameW;
|
||||
|
|
@ -576,7 +576,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
{
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, p.Y));
|
||||
ImGuiNET.ImGui.InvisibleButton("##rx", new Vector2(exprW, RowH));
|
||||
ImGuiNET.ImGui.SetItemTooltip("Match expression: " + r.MatchExpression);
|
||||
SafeImGui.SetItemTooltip("Match expression: " + r.MatchExpression);
|
||||
}
|
||||
x += exprW;
|
||||
|
||||
|
|
@ -592,7 +592,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
if (armed) { DamageCommands.ResetRule(name); _armedDelete = ""; }
|
||||
else _armedDelete = name;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(armed ? "Click again to delete " + name : "Delete this rule (click twice)");
|
||||
SafeImGui.SetItemTooltip(armed ? "Click again to delete " + name : "Delete this rule (click twice)");
|
||||
|
||||
ImGuiNET.ImGui.PopID();
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X, p.Y + RowH));
|
||||
|
|
@ -686,7 +686,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
SortShown();
|
||||
}
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Sort by " + Headers[c]);
|
||||
SafeImGui.SetItemTooltip("Sort by " + Headers[c]);
|
||||
string label = Headers[c] + (_sortCol == c ? (_sortDesc ? SortDown : SortUp) : "");
|
||||
dl.AddText(bold, bold.FontSize, new Vector2(p.X + ColX[c] + 4, p.Y + (RowH - bold.FontSize) * 0.5f),
|
||||
_sortCol == c ? Teal : White, label);
|
||||
|
|
@ -714,7 +714,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
bool filtering = _filterWid != 0 || _searchText.Length > 0;
|
||||
bool anyData = _view.Rows.Exists(r => !r.IsDefault);
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), anyData && filtering
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), anyData && filtering
|
||||
? " No monsters match the current filter."
|
||||
: " No monsters yet: fight some and they show up here.");
|
||||
}
|
||||
|
|
@ -788,7 +788,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
if (NameLink("##name", t.NameShown, new Vector2(p.X + ColX[ColMonster] + 22, p.Y), ColW[ColMonster] - 24, custom ? Gold : White,
|
||||
ImGuiFonts.Get(UiFont.Ui11)))
|
||||
DamageDetailFace.Show(r.Wcid, r.Name);
|
||||
ImGuiNET.ImGui.SetItemTooltip(t.NameTip);
|
||||
SafeImGui.SetItemTooltip(t.NameTip);
|
||||
|
||||
PrioCell(r.Key, r.Name, t.PrioCopyFrom, t, p);
|
||||
HpCell(r, p);
|
||||
|
|
@ -798,7 +798,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
dl.AddText(new Vector2(p.X + ColX[ColWeak] + 4, ty), White, Fit(t.WeakTop, ColW[ColWeak] - 8));
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X + ColX[ColWeak], p.Y));
|
||||
ImGuiNET.ImGui.InvisibleButton("##weak", new Vector2(ColW[ColWeak], RowH));
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Weak + "\nDamage taken: 1.0 = full, 0.5 = half. From " + r.WeakSrc
|
||||
SafeImGui.SetItemTooltip(r.Weak + "\nDamage taken: 1.0 = full, 0.5 = half. From " + r.WeakSrc
|
||||
+ ".\nAuto spells, weapons and summons use the first element this character has.");
|
||||
}
|
||||
else
|
||||
|
|
@ -841,7 +841,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
dl.AddText(new Vector2(p.X + ColX[ColSec] + 4, ty), r.SecKill > 0 ? White : Dim, t.Sec);
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X + ColX[ColSec], p.Y));
|
||||
ImGuiNET.ImGui.InvisibleButton("##sec", new Vector2(ColW[ColSec], RowH));
|
||||
ImGuiNET.ImGui.SetItemTooltip(t.SecTip);
|
||||
SafeImGui.SetItemTooltip(t.SecTip);
|
||||
|
||||
DebuffCell(r.Name, p, ty);
|
||||
|
||||
|
|
@ -851,7 +851,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
_removeName = r.Name;
|
||||
_removeOpen = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip("Remove " + r.Name + " from this list (asks first).");
|
||||
SafeImGui.SetItemTooltip("Remove " + r.Name + " from this list (asks first).");
|
||||
|
||||
ImGuiNET.ImGui.PopID();
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X, p.Y + RowH));
|
||||
|
|
@ -967,7 +967,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
WriteUtf8(_customBuf, view.CustomDebuffs ?? "");
|
||||
_debuffOpen = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip("Debuffs to cast on " + name);
|
||||
SafeImGui.SetItemTooltip("Debuffs to cast on " + name);
|
||||
if (view == null) return;
|
||||
string marks = DamageCommands.DebuffMarks(view);
|
||||
var dl = ImGuiNET.ImGui.GetWindowDrawList();
|
||||
|
|
@ -976,7 +976,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
{
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(bp.X + 22, p.Y));
|
||||
ImGuiNET.ImGui.InvisibleButton("##dmarks", new Vector2(Math.Max(1, ColW[ColDebuffs] - 26), RowH));
|
||||
ImGuiNET.ImGui.SetItemTooltip(DebuffTip(view));
|
||||
SafeImGui.SetItemTooltip(DebuffTip(view));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1012,7 +1012,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
Rule? view = RuleFor(name, out bool custom);
|
||||
bool isDefault = name.Equals("Default", StringComparison.OrdinalIgnoreCase);
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), "Debuffs · " + name);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), "Debuffs · " + name);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
if (view == null)
|
||||
{
|
||||
|
|
@ -1021,7 +1021,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
return;
|
||||
}
|
||||
ImGuiNET.ImGui.PushTextWrapPos(0);
|
||||
ImGuiNET.ImGui.TextColored((custom || isDefault ? RynthTheme.Vec(0xFFFFD16A) : RynthTheme.VecOf(RynthTheme.MuteAlt)),
|
||||
SafeImGui.TextColored((custom || isDefault ? RynthTheme.Vec(0xFFFFD16A) : RynthTheme.VecOf(RynthTheme.MuteAlt)),
|
||||
isDefault ? "Every monster set to Default uses these." : custom ? "This monster's own debuffs." : "Following Default: a change here gives it its own.");
|
||||
ImGuiNET.ImGui.PopTextWrapPos();
|
||||
|
||||
|
|
@ -1034,7 +1034,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
string f = field;
|
||||
DamageCommands.EditRule(name, rule => rule.SetToggle(f, v));
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
}
|
||||
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), "Extra Vuln");
|
||||
|
|
@ -1173,7 +1173,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
bool commit = enter || ImGuiNET.ImGui.IsItemDeactivatedAfterEdit();
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
ImGuiNET.ImGui.PopStyleColor(2);
|
||||
ImGuiNET.ImGui.SetItemTooltip(t.PrioTip + "\nType a number, Enter to save.");
|
||||
SafeImGui.SetItemTooltip(t.PrioTip + "\nType a number, Enter to save.");
|
||||
if (!commit) return;
|
||||
|
||||
if (int.TryParse(Utf8(e.Buffer).Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out int typed))
|
||||
|
|
@ -1322,7 +1322,7 @@ internal sealed class DamageFace : IImGuiPanel
|
|||
if (ropen)
|
||||
{
|
||||
ImGuiNET.ImGui.PushTextWrapPos(0);
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), "Remove " + _removeName + "?");
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), "Remove " + _removeName + "?");
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text),
|
||||
"Its learned numbers and your settings for it (weapon, offhand, pet, HP) are deleted. It comes back if you meet it again.");
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ internal abstract class DashboardDrawer
|
|||
if (FaceKit.IconButton("##drawer_close", PhosphorIcons.X, new Vector2(x + w - closeSize.X, y + (th - closeSize.Y) * 0.5f),
|
||||
closeSize, DMute, DBtnFill, border: DBtnBord, font: UiFont.Dash10))
|
||||
Close();
|
||||
ImGuiNET.ImGui.SetItemTooltip(closeTip);
|
||||
SafeImGui.SetItemTooltip(closeTip);
|
||||
return y + th + 4 * k;
|
||||
}
|
||||
}
|
||||
|
|
@ -388,7 +388,7 @@ internal sealed class DashboardDrawers
|
|||
bool rightClicked = d.CanMove && ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right);
|
||||
// Like SetItemTooltip (same delay), but the closed tooltip is only built while it shows.
|
||||
if (ImGuiNET.ImGui.IsItemHovered(ImGuiHoveredFlags.ForTooltip))
|
||||
ImGuiNET.ImGui.SetTooltip(open ? d.HideTip : d.TabTooltip(right) + (d.CanMove ? MoveHint : ""));
|
||||
SafeImGui.SetTooltip(open ? d.HideTip : d.TabTooltip(right) + (d.CanMove ? MoveHint : ""));
|
||||
if (clicked) Toggle(d);
|
||||
if (rightClicked) ImGuiNET.ImGui.OpenPopup(d.SideMenuId);
|
||||
|
||||
|
|
|
|||
|
|
@ -879,7 +879,7 @@ internal sealed class DungeonMapFace : IImGuiPanel
|
|||
return;
|
||||
}
|
||||
int i = _menuPt;
|
||||
ImGuiNET.ImGui.TextDisabled($"Point {i} {TypeName(nav.Points[i].Type)}");
|
||||
SafeImGui.TextDisabled($"Point {i} {TypeName(nav.Points[i].Type)}");
|
||||
ImGuiNET.ImGui.Separator();
|
||||
if (ImGuiNET.ImGui.MenuItem("Delete"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ internal sealed class HotkeysSettingsUi
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(p);
|
||||
if (ImGuiNET.ImGui.InvisibleButton("##on", new Vector2(14, 16)))
|
||||
HotkeyService.Replace(i, b with { Enabled = !b.Enabled });
|
||||
ImGuiNET.ImGui.SetItemTooltip(b.Enabled ? "On. Click to switch this hotkey off." : "Off. Click to switch this hotkey on.");
|
||||
SafeImGui.SetItemTooltip(b.Enabled ? "On. Click to switch this hotkey off." : "Off. Click to switch this hotkey on.");
|
||||
dl.AddRectFilled(p + new Vector2(0, 2), p + new Vector2(12, 14), b.Enabled ? ToggleOn : ToggleOff, 2);
|
||||
|
||||
dl.AddText(bold, bold.FontSize, p + new Vector2(18, 1), b.Enabled ? Amber : Mute, b.Combo.ToString());
|
||||
|
|
@ -153,7 +153,7 @@ internal sealed class HotkeysSettingsUi
|
|||
// The full text on hover (a long chat command is clipped).
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(p + new Vector2(18, 0));
|
||||
ImGuiNET.ImGui.InvisibleButton("##what", new Vector2(Math.Max(1, textRight - p.X - 18), rowH));
|
||||
ImGuiNET.ImGui.SetItemTooltip(b.Combo + ": " + what + (b.Enabled ? "" : " (off)"));
|
||||
SafeImGui.SetItemTooltip(b.Combo + ": " + what + (b.Enabled ? "" : " (off)"));
|
||||
|
||||
float x = p.X + w - 4 * 20;
|
||||
if (IconButton("##up", new Vector2(x, p.Y), PhosphorIcons.CaretUp, i > 0))
|
||||
|
|
@ -237,7 +237,7 @@ internal sealed class HotkeysSettingsUi
|
|||
else { HotkeyService.BeginCapture(); _waitingForKey = true; }
|
||||
}
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.SetItemTooltip(_waitingForKey ? "Waiting for a key. Click again or press Esc to stop." : "Click, then press the key combination.");
|
||||
SafeImGui.SetItemTooltip(_waitingForKey ? "Waiting for a key. Click again or press Esc to stop." : "Click, then press the key combination.");
|
||||
if (_waitingForKey && HotkeyService.CaptureNote.Length > 0)
|
||||
Warning(HotkeyService.CaptureNote, w);
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ internal sealed class HotkeysSettingsUi
|
|||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.FrameBg, BtnFill);
|
||||
bool open = ImGuiNET.ImGui.BeginCombo("##action", current, ImGuiComboFlags.HeightLarge);
|
||||
ImGuiNET.ImGui.PopStyleColor(3);
|
||||
if (!open && picked is { Tip.Length: > 0 }) ImGuiNET.ImGui.SetItemTooltip(picked.Tip);
|
||||
if (!open && picked is { Tip.Length: > 0 }) SafeImGui.SetItemTooltip(picked.Tip);
|
||||
if (open)
|
||||
{
|
||||
if (ImGuiNET.ImGui.Selectable(ChatCommandItem, isCommand)) _editAction = HotkeyActions.Command;
|
||||
|
|
@ -281,7 +281,7 @@ internal sealed class HotkeysSettingsUi
|
|||
if (ImGuiNET.ImGui.Selectable((a.Group.Length > 0 ? " " : "") + a.Name + "##" + a.Id,
|
||||
string.Equals(a.Id, _editAction, StringComparison.OrdinalIgnoreCase)))
|
||||
_editAction = a.Id;
|
||||
if (a.Tip.Length > 0) ImGuiNET.ImGui.SetItemTooltip(a.Tip);
|
||||
if (a.Tip.Length > 0) SafeImGui.SetItemTooltip(a.Tip);
|
||||
}
|
||||
ImGuiNET.ImGui.EndCombo();
|
||||
}
|
||||
|
|
@ -332,7 +332,7 @@ internal sealed class HotkeysSettingsUi
|
|||
}
|
||||
ImGuiNET.ImGui.EndDisabled();
|
||||
if (ImGuiNET.ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||
ImGuiNET.ImGui.SetTooltip(!canSave
|
||||
SafeImGui.SetTooltip(!canSave
|
||||
? (_editCombo.IsEmpty || _waitingForKey ? "Pick a key first."
|
||||
: !paramOk ? $"Pick the {picked?.Param?.ToLowerInvariant() ?? "value"} first."
|
||||
: "Type the chat command (starting with /).")
|
||||
|
|
@ -367,7 +367,7 @@ internal sealed class HotkeysSettingsUi
|
|||
bool typing = ImGuiNET.ImGui.IsItemActive();
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
ImGuiNET.ImGui.PopStyleColor(3);
|
||||
ImGuiNET.ImGui.SetItemTooltip(meta ? "The state's name, as in the meta (the case doesn't matter)." : a.Tip);
|
||||
SafeImGui.SetItemTooltip(meta ? "The state's name, as in the meta (the case doesn't matter)." : a.Tip);
|
||||
|
||||
if (states.Count > 0)
|
||||
{
|
||||
|
|
@ -404,7 +404,7 @@ internal sealed class HotkeysSettingsUi
|
|||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, TextDim);
|
||||
ImGuiNET.ImGui.TextUnformatted(text);
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
}
|
||||
|
||||
private static void Section(string text, float w)
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ internal sealed partial class InventoryFace
|
|||
: "Filter by item attributes (armor level, ratings, spells, slot...)";
|
||||
if (on && _unidentified.Count > 0)
|
||||
tip += "\n" + _unidentified.Count.ToString(CultureInfo.InvariantCulture) + " hidden until identified.";
|
||||
ImGuiNET.ImGui.SetTooltip(tip);
|
||||
SafeImGui.SetTooltip(tip);
|
||||
}
|
||||
|
||||
// ── The editor popup ────────────────────────────────────────────────
|
||||
|
|
@ -257,11 +257,11 @@ internal sealed partial class InventoryFace
|
|||
InventoryAttributeFilter.SetAttr(rule, a.Id);
|
||||
AttrChanged();
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(a.Tip);
|
||||
SafeImGui.SetItemTooltip(a.Tip);
|
||||
}
|
||||
ImGuiNET.ImGui.EndCombo();
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(info.Tip);
|
||||
SafeImGui.SetItemTooltip(info.Tip);
|
||||
info = InventoryAttributeFilter.Info(rule.Attr);
|
||||
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
|
|
|
|||
|
|
@ -238,10 +238,10 @@ internal sealed partial class InventoryFace
|
|||
var bMinus = new Vector2(bPlus.X - btn - 2 * s, b2.Y);
|
||||
if (TitleToggle("##inv_smaller", PhosphorIcons.Minus, bMinus, btn, false))
|
||||
InventorySettingsStore.StepSize(-1);
|
||||
ImGuiNET.ImGui.SetItemTooltip($"Smaller ({InventorySettingsStore.SizePct}%)");
|
||||
SafeImGui.SetItemTooltip($"Smaller ({InventorySettingsStore.SizePct}%)");
|
||||
if (TitleToggle("##inv_bigger", PhosphorIcons.Plus, bPlus, btn, false))
|
||||
InventorySettingsStore.StepSize(+1);
|
||||
ImGuiNET.ImGui.SetItemTooltip($"Bigger ({InventorySettingsStore.SizePct}%)");
|
||||
SafeImGui.SetItemTooltip($"Bigger ({InventorySettingsStore.SizePct}%)");
|
||||
if (TitleToggle("##inv_tools", PhosphorIcons.Funnel, b1, btn, InventorySettingsStore.ShowTools))
|
||||
{
|
||||
// Closing the search / filter row shows every item again.
|
||||
|
|
@ -729,7 +729,7 @@ internal sealed partial class InventoryFace
|
|||
if (hovered && hoverCell >= 0 && hoverCell < items.Length)
|
||||
{
|
||||
VaultItem hot = items[hoverCell];
|
||||
ImGuiNET.ImGui.SetTooltip(hot.Stack > 1 ? $"{hot.Name} ({hot.Stack:N0})" : hot.Name);
|
||||
SafeImGui.SetTooltip(hot.Stack > 1 ? $"{hot.Name} ({hot.Stack:N0})" : hot.Name);
|
||||
if (ImGuiNET.ImGui.IsMouseClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
_vaultCtx = hot;
|
||||
|
|
@ -753,7 +753,7 @@ internal sealed partial class InventoryFace
|
|||
if (it == null) ImGuiNET.ImGui.CloseCurrentPopup();
|
||||
else
|
||||
{
|
||||
ImGuiNET.ImGui.TextDisabled(it.Name);
|
||||
SafeImGui.TextDisabled(it.Name);
|
||||
ImGuiNET.ImGui.Separator();
|
||||
if (ImGuiNET.ImGui.MenuItem("Withdraw", "", false, VaultFeed.Available))
|
||||
VaultFeed.Withdraw(it);
|
||||
|
|
|
|||
|
|
@ -228,8 +228,8 @@ internal sealed partial class InventoryFace
|
|||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, Amber);
|
||||
ImGuiNET.ImGui.TextUnformatted(_confirmTitle);
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
foreach (string line in _confirmNames) ImGuiNET.ImGui.BulletText(line);
|
||||
if (_confirmNote.Length > 0) ImGuiNET.ImGui.TextDisabled(_confirmNote);
|
||||
foreach (string line in _confirmNames) SafeImGui.BulletText(line);
|
||||
if (_confirmNote.Length > 0) SafeImGui.TextDisabled(_confirmNote);
|
||||
if (_confirmItems.Length > 0 && _confirmItems[0].Kind == InventoryActionKind.Give)
|
||||
ImGuiNET.ImGui.TextDisabled("Given items can't be taken back.");
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ internal sealed partial class InventoryFace
|
|||
bool idle = InventoryModel.Pending == null && !InventoryModel.BatchRunning;
|
||||
InventoryTarget? target = InventoryModel.Target;
|
||||
RefreshSelectionLabels(target);
|
||||
ImGuiNET.ImGui.TextDisabled(_menuCount);
|
||||
SafeImGui.TextDisabled(_menuCount);
|
||||
ImGuiNET.ImGui.Separator();
|
||||
if (ImGuiNET.ImGui.MenuItem(_menuDrop, "", false, idle && InventoryModel.DropAvailable))
|
||||
GroupAction(DropKind.Drop, 0, string.Empty);
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ internal sealed partial class InventoryFace : IImGuiPanel
|
|||
float bw = ImGuiNET.ImGui.CalcTextSize(view.BurdenText).X;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(p);
|
||||
ImGuiNET.ImGui.InvisibleButton("##burden", new Vector2(x + bw - p.X, RowH));
|
||||
ImGuiNET.ImGui.SetItemTooltip(view.BurdenTip);
|
||||
SafeImGui.SetItemTooltip(view.BurdenTip);
|
||||
|
||||
x += bw + 16;
|
||||
PhosphorIcons.DrawCentered(dl, icons, PhosphorIcons.Coins, new Vector2(x, p.Y), new Vector2(18, RowH), Amber);
|
||||
|
|
@ -656,7 +656,7 @@ internal sealed partial class InventoryFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(pos);
|
||||
bool clicked = ImGuiNET.ImGui.InvisibleButton(id, size);
|
||||
bool hot = ImGuiNET.ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenBlockedByActiveItem);
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
bool dropHot = enabled && _dragItem != null && hot;
|
||||
var dl = ImGuiNET.ImGui.GetWindowDrawList();
|
||||
uint fill = dropHot ? DropHot : _dragItem != null && enabled ? Selected : hot && enabled ? Lighten(BtnFill) : BtnFill;
|
||||
|
|
@ -1021,7 +1021,7 @@ internal sealed partial class InventoryFace : IImGuiPanel
|
|||
if (it == null) { ImGuiNET.ImGui.CloseCurrentPopup(); return; }
|
||||
if (IsGroup(it)) { GroupMenu(view, it); return; }
|
||||
bool idle = InventoryModel.Pending == null && !InventoryModel.BatchRunning;
|
||||
ImGuiNET.ImGui.TextDisabled(it.Name);
|
||||
SafeImGui.TextDisabled(it.Name);
|
||||
ImGuiNET.ImGui.Separator();
|
||||
if (ImGuiNET.ImGui.MenuItem("Use", "double-click", false, idle))
|
||||
Act(InventoryActionKind.Use, it, 0, "", 0);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ internal sealed class ItemCountFace : IImGuiPanel
|
|||
{
|
||||
if (ItemHudMath.TryFind(items, sel, out HudItem it)) Add(it.Name);
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(haveSel ? "Count the selected item" : "Select an item in your inventory to count it (or drag one onto this panel)");
|
||||
SafeImGui.SetItemTooltip(haveSel ? "Count the selected item" : "Select an item in your inventory to count it (or drag one onto this panel)");
|
||||
NextLine(start, h + 4);
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ internal sealed class ItemCountFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.PushID(i);
|
||||
ImGuiNET.ImGui.InvisibleButton("##row", new Vector2(bw - XW, RowH));
|
||||
bool hot = ImGuiNET.ImGui.IsItemHovered();
|
||||
if (hot) ImGuiNET.ImGui.SetItemTooltip($"{data.Counts[i]}: {_countText[i]} carried");
|
||||
if (hot) SafeImGui.SetItemTooltip($"{data.Counts[i]}: {_countText[i]} carried");
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X + bw - XW, p.Y));
|
||||
if (ImGuiNET.ImGui.InvisibleButton("##x", new Vector2(XW, RowH))) remove = i;
|
||||
bool hotX = ImGuiNET.ImGui.IsItemHovered();
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ internal sealed class ItemsFace : IImGuiPanel
|
|||
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos() + new Vector2(4, 4);
|
||||
float bw = ButtonWidth(label) + 4;
|
||||
if (Button(id, label, p, new Vector2(bw, 24), Teal, BtnFill)) onClick();
|
||||
if (tooltip != null) ImGuiNET.ImGui.SetItemTooltip(tooltip);
|
||||
if (tooltip != null) SafeImGui.SetItemTooltip(tooltip);
|
||||
ImFontPtr f9 = ImGuiFonts.Get(UiFont.Ui9);
|
||||
ImGuiNET.ImGui.GetWindowDrawList().AddText(f9, f9.FontSize, new Vector2(p.X + bw + 8, p.Y + (24 - f9.FontSize) * 0.5f), Mute, hint);
|
||||
NextLine(new Vector2(p.X - 4, p.Y - 4), 32);
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ internal sealed class LootAddDialog
|
|||
ImGuiNET.ImGui.TextDisabled("Profile:");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.TextUnformatted(d.TargetFile + (d.TargetInUse ? " (in use)" : " (not the one RynthAi loots with)"));
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(d.TargetPath);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) SafeImGui.SetTooltip(d.TargetPath);
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
|
|
@ -257,7 +257,7 @@ internal sealed class LootAddDialog
|
|||
_match = i;
|
||||
changed = true;
|
||||
}
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(MatchTips[i]);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) SafeImGui.SetTooltip(MatchTips[i]);
|
||||
}
|
||||
|
||||
// T11 attributes. Shown for every item: a non-T11 item answers with a note saying so.
|
||||
|
|
@ -268,7 +268,7 @@ internal sealed class LootAddDialog
|
|||
changed = true;
|
||||
}
|
||||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
ImGuiNET.ImGui.SetTooltip(
|
||||
SafeImGui.SetTooltip(
|
||||
"Also require this item's T11 tier (the server's stamped tier when it sends one), weapon grade,\n" +
|
||||
"damage %, gear grade, every modifier, slot special and Cast on Strike, each at least as good\n" +
|
||||
"as this one. Works with any match.\n" +
|
||||
|
|
@ -306,7 +306,7 @@ internal sealed class LootAddDialog
|
|||
changed = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.TextDisabled(d.Stackable ? "(counts stack sizes)" : "(items)");
|
||||
SafeImGui.TextDisabled(d.Stackable ? "(counts stack sizes)" : "(items)");
|
||||
}
|
||||
|
||||
// Name.
|
||||
|
|
@ -316,7 +316,7 @@ internal sealed class LootAddDialog
|
|||
ImGuiNET.ImGui.InputText("##la_name", _name, (uint)_name.Length);
|
||||
if (ImGuiNET.ImGui.IsItemDeactivatedAfterEdit()) changed = true;
|
||||
if (Utf8(_name).Trim().Length == 0 && d.DefaultRuleName.Length > 0)
|
||||
ImGuiNET.ImGui.TextDisabled("Left empty, the rule is named \"" + d.DefaultRuleName + "\".");
|
||||
SafeImGui.TextDisabled("Left empty, the rule is named \"" + d.DefaultRuleName + "\".");
|
||||
|
||||
// Preview.
|
||||
ImGuiNET.ImGui.Separator();
|
||||
|
|
@ -360,7 +360,7 @@ internal sealed class LootAddDialog
|
|||
Send("item_add");
|
||||
}
|
||||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
ImGuiNET.ImGui.SetTooltip(d.InsertAt >= 0
|
||||
SafeImGui.SetTooltip(d.InsertAt >= 0
|
||||
? $"Insert at {d.InsertAt + 1} of {d.RuleCount + 1}, save {d.TargetFile} (old file kept as .bak) and reload it"
|
||||
: "Add the rule");
|
||||
if (Button("##la_cancel", "Cancel", bp + new Vector2(116, 0), new Vector2(80, 24), Text, BtnFill))
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
if (i >= 0 && i < s.Files.Count) RequestOpen(s.Files[i].Path);
|
||||
}, Math.Max(260, pickW));
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(s.Path.Length == 0 ? "Pick a loot profile" : s.Path);
|
||||
SafeImGui.SetItemTooltip(s.Path.Length == 0 ? "Pick a loot profile" : s.Path);
|
||||
PhosphorIcons.DrawCentered(ImGuiNET.ImGui.GetWindowDrawList(), ImGuiFonts.Get(UiFont.Ui11), PhosphorIcons.CaretDown,
|
||||
new Vector2(p.X + pickW - 18, p.Y), new Vector2(16, h), Mute);
|
||||
|
||||
|
|
@ -410,12 +410,12 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
if (Button("##save", PhosphorIcons.FloppyDisk + " Save", new Vector2(x, p.Y), new Vector2(saveW, h),
|
||||
canSave ? Green : Mute, canSave ? StartBg : BtnFill, canSave))
|
||||
Save(force: false);
|
||||
ImGuiNET.ImGui.SetItemTooltip(_saveTip);
|
||||
SafeImGui.SetItemTooltip(_saveTip);
|
||||
x += saveW + 4;
|
||||
|
||||
if (IconButton("##external", PhosphorIcons.ArrowSquareOut, new Vector2(x, p.Y), new Vector2(icon, h), Text, BtnFill))
|
||||
LaunchExternal(s.Path.Length > 0 ? s.Path : s.InUsePath);
|
||||
ImGuiNET.ImGui.SetItemTooltip(s.Dirty
|
||||
SafeImGui.SetItemTooltip(s.Dirty
|
||||
? "Open external editor (it reads the file on disk: save first to take your edits)"
|
||||
: "Open external editor");
|
||||
NextLine(p, h + 4);
|
||||
|
|
@ -455,7 +455,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
var b = new Vector2(x + ts.X + 12, y + h - 1);
|
||||
dl.AddRect(a, b, color, 8);
|
||||
dl.AddText(new Vector2(x + 6, y + (h - ts.Y) * 0.5f), color, text);
|
||||
if (ImGuiNET.ImGui.IsMouseHoveringRect(a, b) && tooltip.Length > 0) ImGuiNET.ImGui.SetTooltip(tooltip);
|
||||
if (ImGuiNET.ImGui.IsMouseHoveringRect(a, b) && tooltip.Length > 0) SafeImGui.SetTooltip(tooltip);
|
||||
return b.X + 6;
|
||||
}
|
||||
|
||||
|
|
@ -650,7 +650,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
LootEditCommands.Simple("set_enabled", index, r.Enabled ? "false" : "true", expect: r.Name);
|
||||
changed = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Enabled ? "Enabled: click to disable" : "Disabled: click to enable");
|
||||
SafeImGui.SetItemTooltip(r.Enabled ? "Enabled: click to disable" : "Disabled: click to enable");
|
||||
x += 20;
|
||||
|
||||
// Action badge
|
||||
|
|
@ -675,7 +675,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
Expect(Await.ScrollFocus);
|
||||
changed = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(reorder ? "Move up" : Filtering ? "Clear the search and filter to reorder" : "Move up");
|
||||
SafeImGui.SetItemTooltip(reorder ? "Move up" : Filtering ? "Clear the search and filter to reorder" : "Move up");
|
||||
bx += 18;
|
||||
if (IconButton("##dn", PhosphorIcons.ArrowDown, new Vector2(bx, p.Y + 2), new Vector2(16, 16), Mute, BtnFill,
|
||||
reorder && index < s.Rules.Count - 1, font: UiFont.Ui11))
|
||||
|
|
@ -684,7 +684,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
Expect(Await.ScrollFocus);
|
||||
changed = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(reorder ? "Move down" : Filtering ? "Clear the search and filter to reorder" : "Move down");
|
||||
SafeImGui.SetItemTooltip(reorder ? "Move down" : Filtering ? "Clear the search and filter to reorder" : "Move down");
|
||||
bx += 18;
|
||||
if (IconButton("##dup", PhosphorIcons.Copy, new Vector2(bx, p.Y + 2), new Vector2(16, 16), Mute, BtnFill, !ro, font: UiFont.Ui11))
|
||||
{
|
||||
|
|
@ -710,7 +710,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
{
|
||||
ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
||||
dl.AddRect(new Vector2(x - 2, p.Y), new Vector2(x + textW, p.Y + RowH), BtnBord, 2);
|
||||
ImGuiNET.ImGui.SetTooltip((r.Name.Length == 0 ? "(no name)" : r.Name) + "\n" + r.Summary);
|
||||
SafeImGui.SetTooltip((r.Name.Length == 0 ? "(no name)" : r.Name) + "\n" + r.Summary);
|
||||
}
|
||||
ImGuiNET.ImGui.PopID();
|
||||
|
||||
|
|
@ -754,7 +754,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
bool canItem = s.Path.Length > 0 && !s.Dirty && (!s.ReadOnly || s.Format == "json");
|
||||
if (Button("##add_item", itemLabel, new Vector2(p.X + addW + 6, p.Y), new Vector2(itemW, h), canItem ? Teal : Mute, BtnFill, canItem))
|
||||
_lootAdd.Open(0, string.Empty, toOpenProfile: true);
|
||||
ImGuiNET.ImGui.SetItemTooltip(canItem
|
||||
SafeImGui.SetItemTooltip(canItem
|
||||
? "A rule for the item selected in the game (click it first): preview, then add it here"
|
||||
: s.Dirty ? "Save or discard your edits first" : "This profile is read-only here");
|
||||
addW += itemW + 6;
|
||||
|
|
@ -769,7 +769,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
dl.PushClipRect(at, new Vector2(Math.Max(at.X + 1, right), at.Y + h), true);
|
||||
dl.AddText(new Vector2(at.X, at.Y + (h - ImGuiNET.ImGui.GetFontSize()) * 0.5f), _msgOk ? Green : Red, _msg);
|
||||
dl.PopClipRect();
|
||||
if (ImGuiNET.ImGui.IsMouseHoveringRect(at, new Vector2(right, at.Y + h))) ImGuiNET.ImGui.SetTooltip(_msg);
|
||||
if (ImGuiNET.ImGui.IsMouseHoveringRect(at, new Vector2(right, at.Y + h))) SafeImGui.SetTooltip(_msg);
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
|
|
@ -1017,7 +1017,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
{
|
||||
if (!_rawShown.Remove(i)) _rawShown.Add(i);
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(rawToggle ? "Show the raw data lines (any key id, any value)" : "This condition is edited as raw lines");
|
||||
SafeImGui.SetItemTooltip(rawToggle ? "Show the raw data lines (any key id, any value)" : "This condition is edited as raw lines");
|
||||
tx += 18;
|
||||
int result = 0;
|
||||
int prev = PrevVisible(r, i), next = NextVisible(r, i);
|
||||
|
|
@ -1105,7 +1105,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
string hint = node.Labels.Count > 0 ? node.Labels[0].ToLowerInvariant() : "value";
|
||||
if (Field("##val", FieldFor(i, 0), c.Lines[0], new Vector2(p.X + kw + 2, p.Y), w - kw - 2, hint, ro, out string v, h))
|
||||
c.Lines[0] = v;
|
||||
ImGuiNET.ImGui.SetItemTooltip(node.Labels.Count > 0 ? node.Labels[0] : "Value");
|
||||
SafeImGui.SetItemTooltip(node.Labels.Count > 0 ? node.Labels[0] : "Value");
|
||||
break;
|
||||
}
|
||||
case "keypattern":
|
||||
|
|
@ -1153,7 +1153,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
ClearFields();
|
||||
}, Math.Max(220, w));
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(sel >= 0 ? table.Names[sel] : "Not in the list: use the raw lines button to type any id");
|
||||
SafeImGui.SetItemTooltip(sel >= 0 ? table.Names[sel] : "Not in the list: use the raw lines button to type any id");
|
||||
}
|
||||
|
||||
/// <summary>The value names for this condition's long key, or null (no table, or a RynthAi that sends none).</summary>
|
||||
|
|
@ -1185,7 +1185,7 @@ internal sealed class LootEditorFace : IImGuiPanel
|
|||
}
|
||||
string tip = sel >= 0 ? table.Items[sel] : "Not in the list: pick \"" + OtherNumber + "\" to type any number";
|
||||
if (table.Flags) tip += "\nFlags: other combinations are typed as a number";
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
}
|
||||
|
||||
/// <summary>A whole number: "45", "45.0" (a buffed-long value written as a double).</summary>
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
dl.AddText(new Vector2(x + runW + sepW, ty), ai ? Green : Amber, aiText);
|
||||
dl.PopClipRect();
|
||||
if (ImGuiNET.ImGui.IsMouseHoveringRect(new Vector2(x + runW + sepW, p.Y), new Vector2(right, p.Y + h)))
|
||||
ImGuiNET.ImGui.SetTooltip(ai
|
||||
SafeImGui.SetTooltip(ai
|
||||
? "RynthAi's script interface is there: scripts can use its macro, nav and meta features."
|
||||
: "RynthAi isn't loaded (or is too old): scripts' RynthAi calls won't work.");
|
||||
NextLine(p, h + 2);
|
||||
|
|
@ -245,7 +245,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
{
|
||||
if (!isSel) dl.AddRectFilled(p, p + new Vector2(nameW, RowH), BtnFill);
|
||||
ImGuiNET.ImGui.SetTooltip(RowTooltip(info, notSaved));
|
||||
SafeImGui.SetTooltip(RowTooltip(info, notSaved));
|
||||
}
|
||||
if (isSel) dl.AddRectFilled(p, p + new Vector2(2, RowH), Teal);
|
||||
|
||||
|
|
@ -267,7 +267,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
_picker.Open(new Vector2(x, by + bh + 2), items, Array.IndexOf(AutoCodes, info.Autostart),
|
||||
k => LuaCommands.Send("autostart", name, AutoCodes[k]), 190);
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(notSaved
|
||||
SafeImGui.SetItemTooltip(notSaved
|
||||
? "Save it to a file to autostart it."
|
||||
: "Start at login: off, on every character (global), or on this character only.");
|
||||
x += autoW + gap;
|
||||
|
|
@ -281,7 +281,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
x += runW + gap;
|
||||
if (Button("##restart", RestartLabel, new Vector2(x, by), new Vector2(restartW, bh), Text, BtnFill, enabled: info.Running && !notSaved))
|
||||
LuaCommands.Send("restart", info.Name);
|
||||
ImGuiNET.ImGui.SetItemTooltip(notSaved ? "Not saved: run it again from the Editor." : "Stop it and start it again from its file.");
|
||||
SafeImGui.SetItemTooltip(notSaved ? "Not saved: run it again from the Editor." : "Stop it and start it again from its file.");
|
||||
NextLine(p, RowH);
|
||||
}
|
||||
|
||||
|
|
@ -334,7 +334,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
LuaCommands.Send("load", sel);
|
||||
_editorTab = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(canOpen
|
||||
SafeImGui.SetItemTooltip(canOpen
|
||||
? (si!.IsFolder ? "Edit its index.lua in the Editor tab." : "Edit it in the Editor tab.")
|
||||
: "It has no file to open.");
|
||||
NextLine(p, h);
|
||||
|
|
@ -407,7 +407,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
dl.PopClipRect();
|
||||
if (Button("##run", RunLabel, new Vector2(p.X + statusW + 4, p.Y), new Vector2(bw, 24), Text, StartBg))
|
||||
LuaCommands.Send("run", edName, _editor?.GetText() ?? string.Empty);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Run the editor's text as " + runName + " (replaces a running copy).");
|
||||
SafeImGui.SetItemTooltip("Run the editor's text as " + runName + " (replaces a running copy).");
|
||||
if (Button("##stop", StopLabel, new Vector2(p.X + statusW + bw + 8, p.Y), new Vector2(bw, 24), Text, StopBg, enabled: running))
|
||||
LuaCommands.Send("stopScript", runName);
|
||||
NextLine(p, 24);
|
||||
|
|
@ -495,7 +495,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
_editor?.MarkClean();
|
||||
}
|
||||
}
|
||||
if (saveTip != null) ImGuiNET.ImGui.SetItemTooltip(saveTip);
|
||||
if (saveTip != null) SafeImGui.SetItemTooltip(saveTip);
|
||||
x += bw + 4;
|
||||
if (Button("##new", PhosphorIcons.FilePlus + " New", new Vector2(x, p.Y), new Vector2(bw, 22), Text, BtnFill))
|
||||
{
|
||||
|
|
@ -508,7 +508,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
string name = Utf8(_name).Trim();
|
||||
if (name.Length > 0) LuaCommands.Send("delete", name);
|
||||
}
|
||||
if (deleteTip != null) ImGuiNET.ImGui.SetItemTooltip(deleteTip);
|
||||
if (deleteTip != null) SafeImGui.SetItemTooltip(deleteTip);
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X, p.Y + 22));
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 2));
|
||||
}
|
||||
|
|
@ -555,7 +555,7 @@ internal sealed class LuaFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.PushTextWrapPos(0);
|
||||
string text = _data?.Console ?? string.Empty;
|
||||
if (text.Length > 0) ImGuiNET.ImGui.TextUnformatted(text);
|
||||
if (_note.Length > 0) ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Highlight), "[panel] " + _note);
|
||||
if (_note.Length > 0) SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Highlight), "[panel] " + _note);
|
||||
ImGuiNET.ImGui.PopTextWrapPos();
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ internal sealed partial class MetaFace
|
|||
if (actions) MetaRuleEdit.AddAction(r); else MetaRuleEdit.AddCondition(r);
|
||||
_editChanged = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(actions
|
||||
SafeImGui.SetItemTooltip(actions
|
||||
? (r.Action == MetaRuleEdit.DoAll ? "Add one more action" : "Add another action: this one and the new one run in order (All)")
|
||||
: !canAdd ? "A Not has one condition"
|
||||
: r.Condition is MetaRuleEdit.All or MetaRuleEdit.Any or MetaRuleEdit.Not ? "Add one more condition"
|
||||
|
|
@ -515,7 +515,7 @@ internal sealed partial class MetaFace
|
|||
c.ConditionData = here;
|
||||
_editChanged = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(here != null
|
||||
SafeImGui.SetItemTooltip(here != null
|
||||
? $"Set to where you are now: {here}"
|
||||
: "Your position isn't known right now (portal space, or not in the world).");
|
||||
}
|
||||
|
|
@ -524,7 +524,7 @@ internal sealed partial class MetaFace
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(p);
|
||||
DataBox(id, c, action: false, MetaVocabulary.ConditionHint(c.Condition), width, height);
|
||||
if (c.Condition == MetaRuleEdit.NoKillsWithinMinutes)
|
||||
ImGuiNET.ImGui.SetItemTooltip(MetaRuleEdit.NoKillsTooltip(c.ConditionData).Replace("%", "%%")); // a format string: typed text may hold %
|
||||
SafeImGui.SetItemTooltip(MetaRuleEdit.NoKillsTooltip(c.ConditionData));
|
||||
}
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X, p.Y + height));
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 0));
|
||||
|
|
@ -617,7 +617,7 @@ internal sealed partial class MetaFace
|
|||
}
|
||||
|
||||
bool removed = IconButton("##rm", PhosphorIcons.X, new Vector2(p.X + rw - xw, p.Y), new Vector2(xw, rh), TextDim, DelFill, BtnBord);
|
||||
ImGuiNET.ImGui.SetItemTooltip(action ? "Remove this action" : nests ? "Remove this group and what is in it" : "Remove this condition");
|
||||
SafeImGui.SetItemTooltip(action ? "Remove this action" : nests ? "Remove this group and what is in it" : "Remove this condition");
|
||||
int moveTo = -1;
|
||||
if (action)
|
||||
{
|
||||
|
|
@ -720,7 +720,7 @@ internal sealed partial class MetaFace
|
|||
if (draft) { _autosave.Clear(); LeaveEditor(); }
|
||||
else _editConfirmDelete = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(draft ? "Drop this new rule (it was never added)" : "Delete this rule (asks first)");
|
||||
SafeImGui.SetItemTooltip(draft ? "Drop this new rule (it was never added)" : "Delete this rule (asks first)");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -787,7 +787,7 @@ internal sealed partial class MetaFace
|
|||
ImGuiNET.ImGui.GetWindowDrawList().AddRect(pos, pos + new Vector2(boxW, height), Red, 3);
|
||||
bool ok = IconButton(id + "_ok", PhosphorIcons.Check, new Vector2(pos.X + boxW + 3, pos.Y), new Vector2(bw, height), Green, NewFill, Green,
|
||||
enabled: _nameProblem == null);
|
||||
ImGuiNET.ImGui.SetItemTooltip(_nameProblem ?? $"Make the state '{name}' (Enter)");
|
||||
SafeImGui.SetItemTooltip(_nameProblem ?? $"Make the state '{name}' (Enter)");
|
||||
bool cancel = IconButton(id + "_cancel", PhosphorIcons.X, new Vector2(pos.X + boxW + bw + 6, pos.Y), new Vector2(bw, height),
|
||||
TextDim, BtnFill, BtnBord);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Cancel (Esc)");
|
||||
|
|
@ -861,7 +861,7 @@ internal sealed partial class MetaFace
|
|||
private static void Note(string text)
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), text);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), text);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ internal sealed partial class MetaFace
|
|||
float toggleX = x;
|
||||
if (Toggle(compactLabel, ref x, p.Y, !anyRuleOpen)) SetAllFolded(anyRuleOpen);
|
||||
x = toggleX + compactW + 4; // the button keeps one width whichever label it shows
|
||||
ImGuiNET.ImGui.SetItemTooltip(anyRuleOpen
|
||||
SafeImGui.SetItemTooltip(anyRuleOpen
|
||||
? "Fold every rule to one line (hover one to see all of it; its caret opens it again)."
|
||||
: "Show every rule in full: each condition and action on its own line.");
|
||||
|
||||
|
|
@ -289,7 +289,7 @@ internal sealed partial class MetaFace
|
|||
if (anyOpen) foreach ((string s, List<int> _) in _groups) _collapsed.Add(s);
|
||||
else _collapsed.Clear();
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(anyOpen ? "Collapse every state" : "Expand every state");
|
||||
SafeImGui.SetItemTooltip(anyOpen ? "Collapse every state" : "Expand every state");
|
||||
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(p.X, p.Y + 22));
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
|
||||
|
|
@ -452,7 +452,7 @@ internal sealed partial class MetaFace
|
|||
rx -= pw;
|
||||
if (GlyphButton("##add", PhosphorIcons.Plus, new Vector2(rx, hp.Y + (hh - 18) * 0.5f), new Vector2(pw, 18), Green, Lighten(Green)))
|
||||
OpenEditor(-1, new MetaRuleDto { State = state, Action = 1 });
|
||||
ImGuiNET.ImGui.SetItemTooltip($"New rule in {state}");
|
||||
SafeImGui.SetItemTooltip($"New rule in {state}");
|
||||
rx -= 4;
|
||||
}
|
||||
if (current)
|
||||
|
|
@ -482,8 +482,8 @@ internal sealed partial class MetaFace
|
|||
dl.AddRect(wa, wb, Amber, 8);
|
||||
dl.AddText(small, small.FontSize, new Vector2(wa.X + 5, wa.Y + 2), Amber, wtag);
|
||||
if (ImGuiNET.ImGui.IsMouseHoveringRect(wa, wb))
|
||||
ImGuiNET.ImGui.SetTooltip("Watchdog: unless you move far enough, the meta goes to " +
|
||||
(wdState.Length > 0 ? wdState.Replace("%", "%%") : "its state") + " when this runs out.");
|
||||
SafeImGui.SetTooltip("Watchdog: unless you move far enough, the meta goes to " +
|
||||
(wdState.Length > 0 ? wdState : "its state") + " when this runs out.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -555,7 +555,7 @@ internal sealed partial class MetaFace
|
|||
new Vector2(p.X + 2, firstLineY + (_lineH - 16) * 0.5f), new Vector2(14, 16), Faded(TextDim), Teal))
|
||||
SetFolded(index, !folded);
|
||||
caretHot = ImGuiNET.ImGui.IsItemHovered();
|
||||
ImGuiNET.ImGui.SetItemTooltip(folded ? "Show all of this rule" : "Fold this rule to one line");
|
||||
SafeImGui.SetItemTooltip(folded ? "Show all of this rule" : "Fold this rule to one line");
|
||||
}
|
||||
if (GlyphButton("##en", rule.Enabled ? PhosphorIcons.CheckSquare : PhosphorIcons.Square,
|
||||
new Vector2(p.X + 16, firstLineY + (_lineH - 16) * 0.5f), new Vector2(16, 16), rule.Enabled ? Green : Mute, TextDim))
|
||||
|
|
@ -563,7 +563,7 @@ internal sealed partial class MetaFace
|
|||
rule.Enabled = !rule.Enabled;
|
||||
SendEdit(new MetaCmd { Op = "set_rule_enabled", Index = index, Value = rule.Enabled ? "true" : "false" });
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(rule.Enabled ? "Enabled: click to disable" : "Disabled: click to enable");
|
||||
SafeImGui.SetItemTooltip(rule.Enabled ? "Enabled: click to disable" : "Disabled: click to enable");
|
||||
if ((hot && !filtering) || dragged) // on hover the number becomes a grip: the row drags
|
||||
PhosphorIcons.DrawCentered(dl, ImGuiFonts.Get(UiFont.Ui11), PhosphorIcons.DotsSixVertical,
|
||||
new Vector2(p.X + 34, firstLineY), new Vector2(_numW + 4, _lineH), dragged ? Teal : Mute);
|
||||
|
|
@ -618,13 +618,13 @@ internal sealed partial class MetaFace
|
|||
if (IconButton("##up", PhosphorIcons.ArrowUp, new Vector2(bx, by), new Vector2(bs, bs), Mute, BtnFill, BtnBord, enabled: canMove && gi > 0))
|
||||
changed |= Move(index, -1);
|
||||
toolHot |= ImGuiNET.ImGui.IsItemHovered();
|
||||
ImGuiNET.ImGui.SetItemTooltip(canMove ? "Move up" : "Clear the filter to move rules");
|
||||
SafeImGui.SetItemTooltip(canMove ? "Move up" : "Clear the filter to move rules");
|
||||
bx += bs + gap;
|
||||
if (IconButton("##dn", PhosphorIcons.ArrowDown, new Vector2(bx, by), new Vector2(bs, bs), Mute, BtnFill, BtnBord,
|
||||
enabled: canMove && gi < groupCount - 1))
|
||||
changed |= Move(index, +1);
|
||||
toolHot |= ImGuiNET.ImGui.IsItemHovered();
|
||||
ImGuiNET.ImGui.SetItemTooltip(canMove ? "Move down" : "Clear the filter to move rules");
|
||||
SafeImGui.SetItemTooltip(canMove ? "Move down" : "Clear the filter to move rules");
|
||||
bx += bs + gap;
|
||||
if (IconButton("##dup", PhosphorIcons.Copy, new Vector2(bx, by), new Vector2(bs, bs), Mute, BtnFill, BtnBord))
|
||||
changed |= Duplicate(index, rule);
|
||||
|
|
@ -645,7 +645,7 @@ internal sealed partial class MetaFace
|
|||
}
|
||||
}
|
||||
toolHot |= ImGuiNET.ImGui.IsItemHovered();
|
||||
ImGuiNET.ImGui.SetItemTooltip(arming ? "Click again to delete this rule" : "Delete rule");
|
||||
SafeImGui.SetItemTooltip(arming ? "Click again to delete this rule" : "Delete rule");
|
||||
}
|
||||
|
||||
dl.AddLine(new Vector2(p.X, p.Y + h - 0.5f), new Vector2(p.X + w, p.Y + h - 0.5f), RowLine);
|
||||
|
|
@ -1024,7 +1024,7 @@ internal sealed partial class MetaFace
|
|||
_stateClock.StateSet(NowMs); // picking a state enters it afresh (RynthAi resets its clock)
|
||||
}
|
||||
if (inState != null && ImGuiNET.ImGui.IsMouseHoveringRect(new Vector2(pickX, p.Y + 1), new Vector2(pickX + pickW, p.Y + 23)))
|
||||
ImGuiNET.ImGui.SetTooltip($"The meta's current state; in it for {inState}.");
|
||||
SafeImGui.SetTooltip($"The meta's current state; in it for {inState}.");
|
||||
bool canGo = HasRulesIn(_data.CurrentState);
|
||||
if (IconButton("##goto_current", PhosphorIcons.Crosshair, new Vector2(pickX + pickW + 4, p.Y + 1), new Vector2(goW, 22),
|
||||
Teal, BtnFill, BtnBord, enabled: canGo, font: UiFont.Ui14))
|
||||
|
|
@ -1036,7 +1036,7 @@ internal sealed partial class MetaFace
|
|||
SetFilter(string.Empty);
|
||||
}
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(canGo ? "Show the current state in the list" : "The current state has no rules");
|
||||
SafeImGui.SetItemTooltip(canGo ? "Show the current state in the list" : "The current state has no rules");
|
||||
if (Button(ruleLabel + "##new", new Vector2(ruleX, p.Y), new Vector2(newW, 24), TextDim, NewFill, Green))
|
||||
OpenEditor(-1, new MetaRuleDto { State = _data.CurrentState, Action = 1 });
|
||||
ImGuiNET.ImGui.SetItemTooltip("A new rule in the current state (added once its condition and action are filled in)");
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ internal sealed partial class MetaFace
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, y));
|
||||
TextBox(id, buf, boxW, "", ImGuiInputTextFlags.CharsDecimal, out _);
|
||||
bool done = ImGuiNET.ImGui.IsItemDeactivatedAfterEdit();
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
if (done && int.TryParse(Utf8(buf).Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out int n))
|
||||
commit(n);
|
||||
x += boxW + 3;
|
||||
|
|
@ -183,9 +183,9 @@ internal sealed partial class MetaFace
|
|||
: sc.LastPollMs == 0 ? "Waiting for the first /myquests."
|
||||
: $"{sc.QuestCount} quest timer(s), /myquests {Span(now - sc.LastPollMs)} ago.";
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(sc.ServerDisabled ? RynthTheme.Highlight : RynthTheme.MuteAlt), Fit(poll, w));
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(sc.ServerDisabled ? RynthTheme.Highlight : RynthTheme.MuteAlt), Fit(poll, w));
|
||||
if (sc.LastSwitch.Length > 0)
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent),
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent),
|
||||
Fit($"Last: {sc.LastSwitch}{(sc.LastSwitchMs > 0 ? $", {Span(now - sc.LastSwitchMs)} ago" : "")}", w));
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
|
@ -220,7 +220,7 @@ internal sealed partial class MetaFace
|
|||
r.Enabled = !r.Enabled;
|
||||
MetaCommands.Simple("mm_rule_enabled", i, r.Enabled ? "true" : "false");
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Enabled ? "On - click to turn this rule off" : "Off - click to turn it on");
|
||||
SafeImGui.SetItemTooltip(r.Enabled ? "On - click to turn this rule off" : "Off - click to turn it on");
|
||||
x += 16;
|
||||
if (IconButton("##up", PhosphorIcons.ArrowUp, new Vector2(x + 1, p.Y + 2), new Vector2(16, 16), Mute, BtnFill, BtnBord, enabled: i > 0))
|
||||
{
|
||||
|
|
@ -245,7 +245,7 @@ internal sealed partial class MetaFace
|
|||
if (IconButton("##cd", running ? PhosphorIcons.Stop : PhosphorIcons.Play, new Vector2(x + 1, p.Y + 2), new Vector2(16, 16),
|
||||
running ? Amber : Green, BtnFill, BtnBord))
|
||||
MetaCommands.Simple(running ? "mm_countdown_stop" : "mm_countdown_start", i);
|
||||
ImGuiNET.ImGui.SetItemTooltip(running ? "Stop the countdown" : $"Start the countdown ({Num(r.Minutes)} min)");
|
||||
SafeImGui.SetItemTooltip(running ? "Stop the countdown" : $"Start the countdown ({Num(r.Minutes)} min)");
|
||||
}
|
||||
else if (r.Fired || (r.State ?? "").StartsWith("error", StringComparison.Ordinal) || (r.State ?? "").Contains("holding"))
|
||||
{
|
||||
|
|
@ -270,7 +270,7 @@ internal sealed partial class MetaFace
|
|||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
{
|
||||
ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
||||
ImGuiNET.ImGui.SetTooltip(RuleTooltip(r, i, first));
|
||||
SafeImGui.SetTooltip(RuleTooltip(r, i, first));
|
||||
}
|
||||
ImGuiNET.ImGui.PopID();
|
||||
if (changed) return; // the list changed: draw it again next frame
|
||||
|
|
@ -367,7 +367,7 @@ internal sealed partial class MetaFace
|
|||
ScheduleRuleDto r = _schedRule;
|
||||
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), _schedEdit == -1 ? "New rule" : $"Edit rule {_schedEdit + 1}");
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), _schedEdit == -1 ? "New rule" : $"Edit rule {_schedEdit + 1}");
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
|
||||
FieldLabel("When:");
|
||||
|
|
@ -428,7 +428,7 @@ internal sealed partial class MetaFace
|
|||
else MetaCommands.Send(new MetaCmd { Op = "mm_update", Index = _schedEdit, ScheduleRule = send });
|
||||
_schedEdit = -2;
|
||||
}
|
||||
if (!valid) ImGuiNET.ImGui.SetItemTooltip(r.Meta.Length == 0 ? "Pick a meta to load" : "Name the quest");
|
||||
if (!valid) SafeImGui.SetItemTooltip(r.Meta.Length == 0 ? "Pick a meta to load" : "Name the quest");
|
||||
if (Button("Cancel##sched_cancel", new Vector2(b.X + sw + 6, b.Y), new Vector2(60, 22), Mute, BtnFill, BtnBord))
|
||||
_schedEdit = -2;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(b.X, b.Y + 22));
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ internal sealed partial class MetaFace : IImGuiPanel
|
|||
bool noFile = string.IsNullOrEmpty(_data.CurrentMetaPath);
|
||||
if (Button("Save As##save_as", new Vector2(x, p.Y), new Vector2(saveAsW, 22), TextDim, noFile ? NewFill : BtnFill, noFile ? Green : BtnBord))
|
||||
BeginSaveAs();
|
||||
ImGuiNET.ImGui.SetItemTooltip(noFile ? "Name a file for this meta; after that every change saves on its own."
|
||||
SafeImGui.SetItemTooltip(noFile ? "Name a file for this meta; after that every change saves on its own."
|
||||
: "Save a copy under a new name (and keep editing that one).");
|
||||
x += saveAsW + 4;
|
||||
SaveIndicator(new Vector2(x, p.Y), p.X + w - x, 22);
|
||||
|
|
@ -353,7 +353,7 @@ internal sealed partial class MetaFace : IImGuiPanel
|
|||
float tw = ImGuiNET.ImGui.CalcTextSize(text).X;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(pos);
|
||||
ImGuiNET.ImGui.InvisibleButton("##save_ind", new Vector2(width, height));
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
ImGuiNET.ImGui.GetWindowDrawList().AddText(new Vector2(pos.X + Math.Max(0, width - tw), pos.Y + (height - ImGuiNET.ImGui.GetFontSize()) * 0.5f),
|
||||
color, text);
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@ internal sealed partial class MetaFace : IImGuiPanel
|
|||
if (showMsg)
|
||||
{
|
||||
ImGuiNET.ImGui.PushTextWrapPos(ImGuiNET.ImGui.GetCursorPosX() + w);
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.Vec(_msgOk ? 0xFF33CC66 : 0xFFE04848), _msg);
|
||||
SafeImGui.TextColored(RynthTheme.Vec(_msgOk ? 0xFF33CC66 : 0xFFE04848), _msg);
|
||||
ImGuiNET.ImGui.PopTextWrapPos();
|
||||
}
|
||||
if (_sourceStale)
|
||||
|
|
@ -994,7 +994,7 @@ internal sealed partial class MetaFace : IImGuiPanel
|
|||
private static void FieldLabel(string text)
|
||||
{
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 1));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), text);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.MuteAlt), text);
|
||||
}
|
||||
|
||||
private static void Separator(float w)
|
||||
|
|
|
|||
511
src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.Sections.cs
Normal file
511
src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.Sections.cs
Normal file
|
|
@ -0,0 +1,511 @@
|
|||
// ============================================================================
|
||||
// RynthCore.Engine - ImGui/Panels/MiniRemoteFace.Sections.cs
|
||||
// The Mini Remote's sections (UI/Sections): the rail down the left, and the
|
||||
// body of the section picked on it.
|
||||
//
|
||||
// rail Remote (the slots / RynthAi's remote), then the core sections and
|
||||
// the plugins' own, in SectionRegistry's order. Right-click: the
|
||||
// menu (sections, active servers' items, hide the rail). Hidden, the
|
||||
// sections stay reachable from the menu and /rc miniremote section.
|
||||
// body a row of tabs when there is more than one view: the section's views
|
||||
// (engine panels embedded whole, the Session Stats overview, plugin views),
|
||||
// then one tab per active server with options here ("Server: ILT")
|
||||
// and "Plugins" for options every world gets. A view fills the body;
|
||||
// an options tab lists the plugins' option surfaces (collapsible) and
|
||||
// command buttons.
|
||||
// fit picking a section sizes the window for its first view; a resize by
|
||||
// hand holds until the next pick. Back on Remote, the remote refits.
|
||||
// saved the core section last picked, and whether the rail shows
|
||||
// (panel_columns.txt, for the whole PC).
|
||||
// ============================================================================
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using ImGuiNET;
|
||||
using RynthCore.Engine.Compatibility;
|
||||
using RynthCore.Engine.Plugins;
|
||||
using RynthCore.Engine.UI;
|
||||
using RynthCore.Engine.UI.Sections;
|
||||
using static RynthCore.Engine.ImGuiBackend.Panels.FaceKit;
|
||||
|
||||
namespace RynthCore.Engine.ImGuiBackend.Panels;
|
||||
|
||||
internal sealed partial class MiniRemoteFace
|
||||
{
|
||||
private const string SectionKey = "MiniRemote.section", RailKey = "MiniRemote.rail";
|
||||
private const float RailMinW = 52f, RailMaxW = 96f, RailRowH = 18f, TabRowH = 20f;
|
||||
/// <summary>The host key that keeps this window's embedded panels apart from other hosts'.</summary>
|
||||
private const string EmbedHost = "MiniRemote";
|
||||
/// <summary>Preferred body size (logical) for a view that doesn't say.</summary>
|
||||
private static readonly Vector2 DefaultViewSize = new(420, 380);
|
||||
private static readonly Vector2 OverviewSize = new(360, 200);
|
||||
|
||||
// Shared by every instance (the face is recreated on each open): the section shown.
|
||||
private static string _section = LoadSection();
|
||||
private static string? _requestedSection, _requestedSurface; // from commands, taken on the next draw
|
||||
private static readonly Dictionary<string, int> TabBySection = new(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
// This instance: the window fit and the plugin surfaces.
|
||||
private bool _fitPending = true;
|
||||
private Vector2 _remoteWindowSize;
|
||||
private readonly Dictionary<string, byte[]> _surfaceBytes = new(StringComparer.Ordinal);
|
||||
private readonly Dictionary<string, float> _surfaceHeights = new(StringComparer.Ordinal);
|
||||
private readonly HashSet<string> _surfaceOff = new(StringComparer.Ordinal);
|
||||
private float _railW;
|
||||
private int _railRevision = -1;
|
||||
|
||||
private static bool IsRemote => _section.Equals(SectionCatalog.RemoteId, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>Whether the window is on section <paramref name="sectionId"/> (the dashboard's lit Char launcher).</summary>
|
||||
public static bool ShowsSection(string sectionId) => _section.Equals(sectionId, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
private static bool RailShown => PanelColumnStore.Get(RailKey, 1f) >= 0.5f;
|
||||
|
||||
// ── Requests (commands; render thread) ──────────────────────────────
|
||||
|
||||
/// <summary>Shows section <paramref name="sectionId"/> ("remote" = the remote) on the next draw.</summary>
|
||||
public static void RequestSection(string sectionId)
|
||||
{
|
||||
Volatile.Write(ref _requestedSurface, null);
|
||||
Volatile.Write(ref _requestedSection, sectionId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the section and tab holding plugin surface <paramref name="surface"/> (RynthAi's
|
||||
/// "section:banking"), when one does now. False when no section has it.
|
||||
/// </summary>
|
||||
public static bool TryRequestSurface(string surface)
|
||||
{
|
||||
foreach (SectionView v in SectionRegistry.Current.Sections)
|
||||
if (TabOfSurface(v, surface) >= 0)
|
||||
{
|
||||
Volatile.Write(ref _requestedSurface, surface);
|
||||
Volatile.Write(ref _requestedSection, v.Id);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void TakeRequestedSection(SectionRegistry.Snapshot snap)
|
||||
{
|
||||
string? id = Interlocked.Exchange(ref _requestedSection, null);
|
||||
if (id == null) return;
|
||||
string? surface = Interlocked.Exchange(ref _requestedSurface, null);
|
||||
SelectSection(id);
|
||||
SectionView? v = snap.Find(_section);
|
||||
if (v != null && surface != null)
|
||||
{
|
||||
int tab = TabOfSurface(v, surface);
|
||||
if (tab >= 0) TabBySection[v.Id] = tab;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The tab index (views, then option groups) holding <paramref name="surface"/>, else -1.</summary>
|
||||
private static int TabOfSurface(SectionView v, string surface)
|
||||
{
|
||||
for (int i = 0; i < v.Panes.Length; i++)
|
||||
if (v.Panes[i].Contribution?.Surface.Equals(surface, StringComparison.OrdinalIgnoreCase) == true) return i;
|
||||
for (int g = 0; g < v.Groups.Length; g++)
|
||||
foreach (SectionContribution c in v.Groups[g].Items)
|
||||
if (c.Surface.Equals(surface, StringComparison.OrdinalIgnoreCase)) return v.Panes.Length + g;
|
||||
return -1;
|
||||
}
|
||||
|
||||
private void SelectSection(string id)
|
||||
{
|
||||
string next = id.Length == 0 ? SectionCatalog.RemoteId : id;
|
||||
if (next.Equals(_section, StringComparison.OrdinalIgnoreCase)) return;
|
||||
bool leavingRemote = IsRemote;
|
||||
if (leavingRemote && !ImGuiPopOuts.InPopOutFrame)
|
||||
_remoteWindowSize = ImGuiNET.ImGui.GetWindowSize() / ImGuiPanelHost.PlacementScale();
|
||||
_section = next;
|
||||
_fitPending = true;
|
||||
if (IsRemote)
|
||||
{
|
||||
// Back on the remote: RynthAi's asks again; the engine grid gets the size it had.
|
||||
_lastWant = Vector2.Zero;
|
||||
_requested = Vector2.Zero;
|
||||
if (_remoteWindowSize.X > 0 && !_hosted && !ImGuiPopOuts.InPopOutFrame)
|
||||
ImGuiPanelHost.RequestSize(Title, _remoteWindowSize);
|
||||
}
|
||||
SaveSection(_section);
|
||||
}
|
||||
|
||||
private static string LoadSection()
|
||||
{
|
||||
int i = (int)PanelColumnStore.Get(SectionKey, -1f);
|
||||
return i >= 0 && i < SectionCatalog.Core.Length ? SectionCatalog.Core[i].Id : SectionCatalog.RemoteId;
|
||||
}
|
||||
|
||||
/// <summary>Saves a core section (a plugin's own isn't: it may not be there next time).</summary>
|
||||
private static void SaveSection(string id)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < SectionCatalog.Core.Length; i++)
|
||||
if (SectionCatalog.Core[i].Id.Equals(id, StringComparison.OrdinalIgnoreCase)) index = i;
|
||||
if (PanelColumnStore.Get(SectionKey, -1f) != index) PanelColumnStore.Set(SectionKey, index);
|
||||
}
|
||||
|
||||
// ── Rail ────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Draws the rail at the body's left; returns the width it takes (with its gap).</summary>
|
||||
private float DrawRail(SectionRegistry.Snapshot snap, Vector2 origin, Vector2 size)
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9));
|
||||
try
|
||||
{
|
||||
if (_railRevision != snap.Revision || _railW <= 0)
|
||||
{
|
||||
float widest = ImGuiNET.ImGui.CalcTextSize("Remote").X;
|
||||
foreach (SectionView v in snap.Sections) widest = MathF.Max(widest, ImGuiNET.ImGui.CalcTextSize(v.Label).X);
|
||||
_railW = Math.Clamp(widest + 14f, RailMinW, RailMaxW);
|
||||
_railRevision = snap.Revision;
|
||||
}
|
||||
float h = Math.Max(RailRowH, size.Y - 12 - GripOverlap());
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(origin + new Vector2(6, 6));
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);
|
||||
bool open = ImGuiNET.ImGui.BeginChild("##mr_rail", new Vector2(_railW, h), ImGuiChildFlags.None,
|
||||
ImGuiWindowFlags.NoBackground | ImGuiWindowFlags.NoScrollbar);
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
try
|
||||
{
|
||||
if (open)
|
||||
{
|
||||
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
RailButton(SectionCatalog.RemoteId, "Remote", "The remote: item slots, and RynthAi's when it is loaded.", true, ref p);
|
||||
var dl = ImGuiNET.ImGui.GetWindowDrawList();
|
||||
dl.AddLine(p + new Vector2(2, 1), p + new Vector2(_railW - 2, 1), BtnBord);
|
||||
p.Y += 4;
|
||||
foreach (SectionView v in snap.Sections)
|
||||
RailButton(v.Id, v.Label, RailTooltip(v), v.HasContent, ref p);
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(p);
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(_railW, 1));
|
||||
if (ImGuiNET.ImGui.IsWindowHovered() && ImGuiNET.ImGui.IsMouseClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
_menuSlot = -1;
|
||||
_openMenu = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.EndChild();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
return _railW + 4f;
|
||||
}
|
||||
|
||||
private void RailButton(string id, string label, string tooltip, bool hasContent, ref Vector2 p)
|
||||
{
|
||||
bool selected = id.Equals(_section, StringComparison.OrdinalIgnoreCase);
|
||||
var size = new Vector2(_railW, RailRowH);
|
||||
if (Button("##rail_" + id, label, p, size, hasContent ? Text : Faded(Text), selected ? Selected : BtnFill,
|
||||
leftAlign: true, border: selected ? Teal : 0))
|
||||
SelectSection(id);
|
||||
if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right)) { _menuSlot = -1; _openMenu = true; }
|
||||
if (tooltip.Length > 0) SafeImGui.SetItemTooltip(tooltip);
|
||||
p.Y += RailRowH + 2;
|
||||
}
|
||||
|
||||
private static string RailTooltip(SectionView v)
|
||||
{
|
||||
if (!v.HasContent) return v.Label + ": " + EmptyNote(v.Id);
|
||||
var parts = new List<string>();
|
||||
foreach (SectionPane pane in v.Panes) parts.Add(pane.Title);
|
||||
foreach (SectionGroup g in v.Groups) parts.Add(g.Title);
|
||||
return v.Label + ": " + string.Join(", ", parts);
|
||||
}
|
||||
|
||||
/// <summary>What an empty section says (nothing installed fills it on this world).</summary>
|
||||
private static string EmptyNote(string id) => id switch
|
||||
{
|
||||
"friends" => "no friends list yet. A server plugin can add one here.",
|
||||
"fellowship" => "the fellowship view comes from RynthAi; it isn't loaded.",
|
||||
"pets" or "crafting" or "spells" => "this view comes from RynthAi; it isn't loaded.",
|
||||
"map" or "combat" or "nav" or "chat" or "skills" or "inventory" => "its engine panels are off (Settings, or the plugins they need aren't installed).",
|
||||
_ => "nothing installed adds to it on this world.",
|
||||
};
|
||||
|
||||
// ── Section body ────────────────────────────────────────────────────
|
||||
|
||||
private void DrawSection(SectionRegistry.Snapshot snap, float w, Vector2 origin, Vector2 size)
|
||||
{
|
||||
SectionView? view = snap.Find(_section);
|
||||
if (view == null)
|
||||
{
|
||||
// A plugin's section that went away (its server isn't active any more): back to the remote.
|
||||
if (snap.Sections.Count > 0) SelectSection(SectionCatalog.RemoteId);
|
||||
Label("Loading sections...", Mute);
|
||||
return;
|
||||
}
|
||||
|
||||
int tabs = view.Panes.Length + view.Groups.Length;
|
||||
if (tabs == 0)
|
||||
{
|
||||
Label(view.Label, Teal);
|
||||
ImGuiNET.ImGui.PushTextWrapPos(ImGuiNET.ImGui.GetCursorPosX() + w);
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, Mute);
|
||||
SafeImGui.TextWrapped(char.ToUpperInvariant(EmptyNote(view.Id)[0]) + EmptyNote(view.Id)[1..]);
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.PopTextWrapPos();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TabBySection.TryGetValue(view.Id, out int tab) || tab < 0 || tab >= tabs) tab = 0;
|
||||
float haveH = Remaining(origin, size);
|
||||
if (tabs > 1) tab = DrawTabRow(view, tab, w);
|
||||
TabBySection[view.Id] = tab;
|
||||
|
||||
if (_fitPending)
|
||||
{
|
||||
_fitPending = false;
|
||||
Vector2 pref = PreferredSize(view, tab);
|
||||
float place = ImGuiPanelHost.PlacementScale();
|
||||
float extra = (tabs > 1 ? TabRowH + 4 : 0) + GripOverlap();
|
||||
FitWindow(new Vector2(pref.X * place, pref.Y * place + extra), w, haveH);
|
||||
}
|
||||
|
||||
var box = new Vector2(w, Math.Max(40f, Remaining(origin, size) - GripOverlap()));
|
||||
if (tab < view.Panes.Length) DrawPane(snap, view.Panes[tab], box);
|
||||
else DrawGroup(view.Groups[tab - view.Panes.Length], box);
|
||||
}
|
||||
|
||||
/// <summary>The section's tabs as a wrapped row of buttons; returns the one selected.</summary>
|
||||
private int DrawTabRow(SectionView view, int tab, float w)
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9));
|
||||
try
|
||||
{
|
||||
Vector2 start = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
Vector2 p = start;
|
||||
int count = view.Panes.Length + view.Groups.Length;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
string label = i < view.Panes.Length ? view.Panes[i].Title : view.Groups[i - view.Panes.Length].Title;
|
||||
float bw = Math.Min(w, ButtonWidth(label));
|
||||
if (p.X > start.X && p.X + bw > start.X + w) p = new Vector2(start.X, p.Y + TabRowH + 2);
|
||||
bool selected = i == tab;
|
||||
bool enabled = i >= view.Panes.Length || view.Panes[i].Contribution?.Enabled != false;
|
||||
if (Button("##sectab_" + view.Id + "_" + i, label, p, new Vector2(bw, TabRowH), enabled ? Text : Faded(Text),
|
||||
selected ? Selected : BtnFill, border: selected ? Teal : 0) && i != tab)
|
||||
{
|
||||
tab = i;
|
||||
_fitPending = true;
|
||||
}
|
||||
p.X += bw + 3;
|
||||
}
|
||||
NextLine(start, p.Y - start.Y + TabRowH + 4);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
return tab;
|
||||
}
|
||||
|
||||
/// <summary>The body size (logical) a tab would like: its panel's default, or what its plugin said.</summary>
|
||||
private Vector2 PreferredSize(SectionView view, int tab)
|
||||
{
|
||||
if (tab >= view.Panes.Length) return DefaultViewSize;
|
||||
SectionPane pane = view.Panes[tab];
|
||||
switch (pane.Kind)
|
||||
{
|
||||
case SectionPaneKind.Overview:
|
||||
return OverviewSize;
|
||||
case SectionPaneKind.CorePanel:
|
||||
return ImGuiPanelHost.TryGetDefaultSize(pane.Panel, out Vector2 s) && s.X > 0 && s.Y > 0 ? s : DefaultViewSize;
|
||||
default:
|
||||
SectionContribution c = pane.Contribution!;
|
||||
return new Vector2(c.Width > 0 ? c.Width : DefaultViewSize.X, c.Height > 0 ? c.Height : DefaultViewSize.Y);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawPane(SectionRegistry.Snapshot snap, SectionPane pane, Vector2 box)
|
||||
{
|
||||
switch (pane.Kind)
|
||||
{
|
||||
case SectionPaneKind.Overview:
|
||||
DrawOverview(snap, box);
|
||||
break;
|
||||
case SectionPaneKind.CorePanel:
|
||||
ImGuiPanelHost.DrawEmbedded(EmbedHost, pane.Panel, box);
|
||||
break;
|
||||
default:
|
||||
SectionContribution c = pane.Contribution!;
|
||||
if (!c.Enabled) { DrawDisabledNote(c); break; }
|
||||
DrawSurface(c, box);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>An options tab: a server's (or every world's) option surfaces and command buttons.</summary>
|
||||
private void DrawGroup(SectionGroup group, Vector2 box)
|
||||
{
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(2, 2));
|
||||
bool open = ImGuiNET.ImGui.BeginChild("##mr_group_" + group.Title, box, ImGuiChildFlags.AlwaysUseWindowPadding,
|
||||
ImGuiWindowFlags.NoBackground);
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
try
|
||||
{
|
||||
if (!open) return;
|
||||
if (group.Server is ServerState s)
|
||||
Label(s.Force == ServerForce.Auto ? $"{s.Name}: detected ({s.Reason})." : $"{s.Name}: forced on for this character.",
|
||||
Faded(Mute));
|
||||
float w = ImGuiNET.ImGui.GetContentRegionAvail().X;
|
||||
foreach (SectionContribution c in group.Items)
|
||||
{
|
||||
ImGuiNET.ImGui.PushID(c.Plugin + "|" + c.Label + "|" + c.Surface + c.Command);
|
||||
try
|
||||
{
|
||||
if (c.IsSurface) DrawOptionSurface(c, w);
|
||||
else DrawCommandButton(c, w);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.PopID();
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.EndChild();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawOptionSurface(SectionContribution c, float w)
|
||||
{
|
||||
if (!ImGuiNET.ImGui.CollapsingHeader(c.Label, ImGuiTreeNodeFlags.DefaultOpen))
|
||||
{
|
||||
if (c.Tooltip.Length > 0) SafeImGui.SetItemTooltip(c.Tooltip);
|
||||
return;
|
||||
}
|
||||
if (c.Tooltip.Length > 0) SafeImGui.SetItemTooltip(c.Tooltip);
|
||||
if (!c.Enabled) { DrawDisabledNote(c); return; }
|
||||
string key = c.Plugin + "|" + c.Surface;
|
||||
if (!_surfaceHeights.TryGetValue(key, out float h)) h = c.Height > 0 ? c.Height : 220f;
|
||||
Vector2 want = DrawSurface(c, new Vector2(w, h));
|
||||
if (want.Y > 0 && Math.Abs(want.Y - h) > 1f) _surfaceHeights[key] = Math.Min(want.Y, SectionManifestParser.MaxSurfaceSize);
|
||||
}
|
||||
|
||||
private static void DrawCommandButton(SectionContribution c, float w)
|
||||
{
|
||||
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
float bw = Math.Min(w, Math.Max(120f, ButtonWidth(c.Label)));
|
||||
if (Button("##cmd", c.Label, p, new Vector2(bw, 22), c.Enabled ? Text : Faded(Text), BtnFill, c.Enabled))
|
||||
ServerMenus.Run(c.Command);
|
||||
string tip = c.Enabled || c.Note.Length == 0 ? c.Tooltip : c.Note;
|
||||
SafeImGui.SetItemTooltip(tip.Length > 0 ? tip + "\n" + c.Command : c.Command);
|
||||
NextLine(p, 26);
|
||||
if (!c.Enabled && c.Note.Length > 0) DrawDisabledNote(c);
|
||||
}
|
||||
|
||||
private static void DrawDisabledNote(SectionContribution c)
|
||||
{
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, Faded(Mute));
|
||||
ImGuiNET.ImGui.PushTextWrapPos(0f);
|
||||
SafeImGui.TextWrapped(c.Note.Length > 0 ? c.Note : c.Label + " isn't available right now.");
|
||||
ImGuiNET.ImGui.PopTextWrapPos();
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A plugin surface in a child of <paramref name="box"/>; returns the size the plugin asked
|
||||
/// for (zero when it didn't say). A surface whose export threw stays off for the session.
|
||||
/// </summary>
|
||||
private Vector2 DrawSurface(SectionContribution c, Vector2 box)
|
||||
{
|
||||
string key = c.Plugin + "|" + c.Surface;
|
||||
if (_surfaceOff.Contains(key))
|
||||
{
|
||||
Label($"{c.Label}: {c.Plugin} stopped drawing it (see the log).", Amber);
|
||||
return Vector2.Zero;
|
||||
}
|
||||
if (!_surfaceBytes.TryGetValue(c.Surface, out byte[]? bytes))
|
||||
_surfaceBytes[c.Surface] = bytes = Encoding.UTF8.GetBytes(c.Surface + "\0");
|
||||
|
||||
int result = PluginManager.EmbedNotReady;
|
||||
Vector2 want = Vector2.Zero;
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);
|
||||
bool open = ImGuiNET.ImGui.BeginChild("##surf_" + key, box, ImGuiChildFlags.None, ImGuiWindowFlags.NoBackground);
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
try
|
||||
{
|
||||
if (open)
|
||||
{
|
||||
// Plugin widgets use the default UI font, as in their own windows.
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui11));
|
||||
try { result = PluginManager.RenderEmbed(c.Plugin, bytes, box, out want); }
|
||||
finally { ImGuiNET.ImGui.PopFont(); }
|
||||
if (result == PluginManager.EmbedNotReady) ImGuiNET.ImGui.TextDisabled("Loading...");
|
||||
else if (result == PluginManager.EmbedNoPlugin)
|
||||
SafeImGui.TextDisabled($"{c.Plugin} isn't loaded, or is too old for this view.");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.EndChild();
|
||||
}
|
||||
if (result == PluginManager.EmbedFailed) _surfaceOff.Add(key);
|
||||
return result == PluginManager.EmbedDrawn ? want : Vector2.Zero;
|
||||
}
|
||||
|
||||
// ── Session Stats overview ──────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// The Session Stats section's stand-in, shown only while no plugin fills the section (RynthAi
|
||||
/// does, with its session XP, luminance, kills and rates). The engine keeps no session totals
|
||||
/// of its own here: it names the character and says where the numbers come from.
|
||||
/// Character details are RynthOracle's Character tab; server picks are Options > Diagnostics.
|
||||
/// </summary>
|
||||
private void DrawOverview(SectionRegistry.Snapshot snap, Vector2 box)
|
||||
{
|
||||
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(2, 2));
|
||||
bool open = ImGuiNET.ImGui.BeginChild("##mr_overview", box, ImGuiChildFlags.AlwaysUseWindowPadding, ImGuiWindowFlags.NoBackground);
|
||||
ImGuiNET.ImGui.PopStyleVar();
|
||||
try
|
||||
{
|
||||
if (!open) return;
|
||||
string who = SessionStateRegistry.LastCharacterName;
|
||||
Label(who.Length > 0 ? who : "No character logged in", Teal);
|
||||
float w = ImGuiNET.ImGui.GetContentRegionAvail().X;
|
||||
Separator(w);
|
||||
ImGuiNET.ImGui.PushTextWrapPos(0f);
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, Faded(Mute));
|
||||
SafeImGui.TextWrapped("This session's XP, luminance, kills and their per-hour rates come with RynthAi's "
|
||||
+ "Session Stats; RynthAi isn't loaded (or is too old to show them here). "
|
||||
+ "Character details: RynthOracle's Character tab (/ro character). Server picks: Options > Diagnostics.");
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.PopTextWrapPos();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.EndChild();
|
||||
}
|
||||
}
|
||||
|
||||
// ── Menu ────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>The menu's section half: every section, the active servers' items, the rail switch.</summary>
|
||||
private void DrawSectionsMenuItems()
|
||||
{
|
||||
SectionRegistry.Snapshot snap = SectionRegistry.Current;
|
||||
if (ImGuiNET.ImGui.MenuItem("Remote##sec_remote", "", IsRemote)) SelectSection(SectionCatalog.RemoteId);
|
||||
foreach (SectionView v in snap.Sections)
|
||||
if (ImGuiNET.ImGui.MenuItem(v.Label + "##sec_" + v.Id, "", v.Id.Equals(_section, StringComparison.OrdinalIgnoreCase)))
|
||||
SelectSection(v.Id);
|
||||
ServerMenus.DrawImGuiMenu(separatorFirst: true);
|
||||
ImGuiNET.ImGui.Separator();
|
||||
bool rail = RailShown;
|
||||
if (ImGuiNET.ImGui.MenuItem("Show the sections rail", "", rail))
|
||||
PanelColumnStore.Set(RailKey, rail ? 0f : 1f);
|
||||
SafeImGui.SetItemTooltip("The column of sections down the left. Hidden, RynthAi's remote shows its own tab bar again "
|
||||
+ "(Gear, Games and the other ILT tabs), and a section is picked here or with /rc miniremote section <name>.");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,16 @@
|
|||
// ============================================================================
|
||||
// RynthCore.Engine - ImGui/Panels/MiniRemoteFace.cs
|
||||
// The Mini Remote: one window for the quick-use item slots, whoever draws them.
|
||||
// The Mini Remote: one window for the quick-use item slots, whoever draws them,
|
||||
// and the sections (MiniRemoteFace.Sections.cs): a rail down the left with
|
||||
// Remote (this file) and the core sections Char, Map, Skills, Combat, Nav,
|
||||
// Inventory, Crafting, Spells, Chat, Friends, Fellowship and Pets, plus any a
|
||||
// plugin adds, each showing its engine panels or plugin views and the active
|
||||
// servers' options (UI/Sections).
|
||||
//
|
||||
// With RynthAi loaded it hosts RynthAi's Mini Remote (session rates, target,
|
||||
// summon, item slots, toggles, bank, rebuff, Translate, Guardian and its
|
||||
// Options menu, its Quests and Pets tabs, plus on ILT worlds the RynthILT
|
||||
// plugin's tabs Character, Banking, Gear, Charms and Games, which RynthAi asks
|
||||
// plugin's tabs Charms, Banking, Gear and Games (Character moved to RynthOracle, 2026.10.5.54), which RynthAi asks
|
||||
// RynthILT to draw), drawn by the plugin through
|
||||
// RynthPluginRenderEmbed ("miniremote-window"). The window fits itself to what
|
||||
// the plugin asks for whenever that changes (another tab, a section shown or
|
||||
|
|
@ -47,7 +52,7 @@ using static RynthCore.Engine.ImGuiBackend.Panels.FaceKit;
|
|||
|
||||
namespace RynthCore.Engine.ImGuiBackend.Panels;
|
||||
|
||||
internal sealed class MiniRemoteFace : IImGuiPanel
|
||||
internal sealed partial class MiniRemoteFace : IImGuiPanel
|
||||
{
|
||||
public const string Title = "Mini Remote";
|
||||
|
||||
|
|
@ -59,8 +64,21 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
ItemHudStore.EnsureLoadQueued();
|
||||
}
|
||||
|
||||
/// <summary>The RynthAi surface for this window (NUL-terminated for the export).</summary>
|
||||
private static ReadOnlySpan<byte> Surface => "miniremote-window\0"u8;
|
||||
/// <summary>
|
||||
/// The RynthAi surface for this window (NUL-terminated for the export): "miniremote-remote"
|
||||
/// (the remote alone: its tabs are sections here) from a RynthAi that publishes sections
|
||||
/// while the sections rail shows, else "miniremote-window" (the remote with its own tab bar).
|
||||
/// With the rail hidden the tab bar is the only way to RynthILT's tabs (Gear, Games).
|
||||
/// </summary>
|
||||
private static ReadOnlySpan<byte> Surface =>
|
||||
RailShown && RynthAiPublishesSections() ? "miniremote-remote\0"u8 : "miniremote-window\0"u8;
|
||||
|
||||
private static bool RynthAiPublishesSections()
|
||||
{
|
||||
foreach (UI.Sections.SectionManifest m in UI.Sections.SectionRegistry.Current.Manifests)
|
||||
if (m.Plugin.Contains("RynthAi", StringComparison.OrdinalIgnoreCase)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private const float Gap = 4f, StatusH = 18f;
|
||||
/// <summary>Pixels a Ctrl+wheel notch or a Bigger / Smaller menu click changes the box edge by.</summary>
|
||||
|
|
@ -116,12 +134,39 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
public void Draw()
|
||||
{
|
||||
float w = Begin(out Vector2 origin, out Vector2 size);
|
||||
if (DrawRynthAi(w, origin, size))
|
||||
{
|
||||
End(origin, size);
|
||||
return;
|
||||
}
|
||||
UI.Sections.SectionRegistry.Snapshot snap = UI.Sections.SectionRegistry.Current;
|
||||
TakeRequestedSection(snap);
|
||||
|
||||
// The rail, then everything else to its right (the indent keeps each line there).
|
||||
float railW = RailShown ? DrawRail(snap, origin, size) : 0f;
|
||||
if (railW > 0)
|
||||
{
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(origin + new Vector2(6 + railW, 6));
|
||||
ImGuiNET.ImGui.Indent(railW);
|
||||
}
|
||||
float cw = Math.Max(40f, w - railW);
|
||||
try
|
||||
{
|
||||
if (!IsRemote)
|
||||
{
|
||||
// This window is still the Mini Remote while it shows another section: RynthAi
|
||||
// keeps its floating copy hidden while it hears from it each frame.
|
||||
if (!_embedOff) PingRynthAiHost();
|
||||
DrawSection(snap, cw, origin, size);
|
||||
}
|
||||
else if (!DrawRynthAi(cw, origin, size)) DrawEngineGrid(cw, origin, size);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (railW > 0) ImGuiNET.ImGui.Unindent(railW);
|
||||
}
|
||||
End(origin, size);
|
||||
DrawMenu();
|
||||
}
|
||||
|
||||
/// <summary>The engine's own slot grid (no RynthAi to draw the remote).</summary>
|
||||
private void DrawEngineGrid(float w, Vector2 origin, Vector2 size)
|
||||
{
|
||||
InventoryView view = InventoryModel.Current;
|
||||
HudItem[] items = _items.Get(view);
|
||||
ItemHudCharacter data = ItemHudStore.Current;
|
||||
|
|
@ -133,8 +178,6 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
DrawGrid(data, items, w, gridH, ready);
|
||||
DrawStatus(ready);
|
||||
FitGrid(data, w, haveH);
|
||||
End(origin, size);
|
||||
DrawMenu(data, items);
|
||||
}
|
||||
|
||||
// ── RynthAi's Mini Remote ───────────────────────────────────────────
|
||||
|
|
@ -184,6 +227,15 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
return true;
|
||||
}
|
||||
|
||||
/// <summary>"miniremote-host": tells RynthAi this window is open on a section; it draws nothing.</summary>
|
||||
private void PingRynthAiHost()
|
||||
{
|
||||
int result;
|
||||
try { result = PluginManager.RenderEmbed("RynthAi", "miniremote-host\0"u8, Vector2.Zero, out _); }
|
||||
catch { result = PluginManager.EmbedFailed; }
|
||||
if (result == PluginManager.EmbedFailed) _embedOff = true;
|
||||
}
|
||||
|
||||
// ── Window fit ──────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -301,7 +353,7 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
dl.AddText(cp, id == 0 ? Amber : Text, count);
|
||||
}
|
||||
if (hot)
|
||||
ImGuiNET.ImGui.SetItemTooltip(id == 0
|
||||
SafeImGui.SetItemTooltip(id == 0
|
||||
? $"{s.Name}: none carried.\nRight-click for options."
|
||||
: $"{s.Name} ({count switch { "" => "1", _ => count }} carried)\nClick to use. Right-click for options.");
|
||||
}
|
||||
|
|
@ -391,7 +443,11 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
|
||||
// ── Right-click menu ────────────────────────────────────────────────
|
||||
|
||||
private void DrawMenu(ItemHudCharacter data, HudItem[] items)
|
||||
/// <summary>
|
||||
/// The right-click menu: a slot's options (the engine grid), then the sections, the active
|
||||
/// servers' items and the rail switch. Opened from a slot or from the rail.
|
||||
/// </summary>
|
||||
private void DrawMenu()
|
||||
{
|
||||
if (_openMenu)
|
||||
{
|
||||
|
|
@ -407,6 +463,23 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.PopStyleColor(3);
|
||||
if (!open) return;
|
||||
|
||||
try
|
||||
{
|
||||
if (_menuSlot >= 0 && IsRemote)
|
||||
{
|
||||
DrawSlotMenu(ItemHudStore.Current, _items.Get(InventoryModel.Current));
|
||||
ImGuiNET.ImGui.Separator();
|
||||
}
|
||||
DrawSectionsMenuItems();
|
||||
}
|
||||
finally
|
||||
{
|
||||
ImGuiNET.ImGui.EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSlotMenu(ItemHudCharacter data, HudItem[] items)
|
||||
{
|
||||
int i = _menuSlot;
|
||||
RemoteSlot? s = i >= 0 && i < data.Slots.Length ? data.Slots[i] : null;
|
||||
Label(i >= 0 ? $"Slot {i + 1}{(s != null ? ": " + s.Name : " (empty)")}" : "Mini Remote", Mute);
|
||||
|
|
@ -430,6 +503,5 @@ internal sealed class MiniRemoteFace : IImGuiPanel
|
|||
ResizeSlots(-SlotSizeStep);
|
||||
if (ImGuiNET.ImGui.MenuItem("Default box size", "", false, px != ItemHudCharacter.DefaultSlotSize))
|
||||
ResizeSlots(ItemHudCharacter.DefaultSlotSize - px);
|
||||
ImGuiNET.ImGui.EndPopup();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ internal sealed class NavFace : IImGuiPanel
|
|||
{
|
||||
string text = (on ? PhosphorIcons.CheckSquare : PhosphorIcons.Square) + " " + label;
|
||||
bool clicked = Button(id, text, pos, new Vector2(width, 22), on ? Teal : Mute, BtnFill, leftAlign: true);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(tooltip);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) SafeImGui.SetTooltip(tooltip);
|
||||
return clicked;
|
||||
}
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ internal sealed class NavFace : IImGuiPanel
|
|||
dl.AddText(new Vector2(p.X, p.Y + (22 - ImGuiNET.ImGui.GetFontSize()) * 0.5f), Mute, label);
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(p);
|
||||
ImGuiNET.ImGui.InvisibleButton("##reach_label", new Vector2(Math.Max(1, labelW), 22));
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(SettingsSchema.NavPointReachTip);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) SafeImGui.SetTooltip(SettingsSchema.NavPointReachTip);
|
||||
|
||||
const float stepW = 22, boxW = 52;
|
||||
float right = p.X + w;
|
||||
|
|
@ -456,7 +456,7 @@ internal sealed class NavFace : IImGuiPanel
|
|||
_picker.Open(new Vector2(tp.X, tp.Y + 22), NavCommands.TrailChoices, -1, i =>
|
||||
NavCommands.Send(new NavCmd { Cmd = "trailToRoute", Reverse = i == 1 }), width: 300);
|
||||
if (ImGuiNET.ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||
ImGuiNET.ImGui.SetTooltip(_data.TrailPoints >= 2
|
||||
SafeImGui.SetTooltip(_data.TrailPoints >= 2
|
||||
? $"Breadcrumb trail: {_data.TrailPoints} crumbs, {_data.TrailYards:0} yd.\nThe new route is unsaved; the loaded nav file is not changed."
|
||||
: "Turn on Breadcrumbs and walk a while to build a trail.");
|
||||
NextLine(p, 26);
|
||||
|
|
|
|||
|
|
@ -130,14 +130,14 @@ internal sealed class StatusFace : IImGuiPanel
|
|||
private static void Header(string text)
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
|
||||
ImGuiNET.ImGui.TextColored(HeaderColor, text);
|
||||
SafeImGui.TextColored(HeaderColor, text);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
||||
private static void Row(string text, bool error)
|
||||
{
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, error ? ErrorColor : RowColor);
|
||||
ImGuiNET.ImGui.TextWrapped(text);
|
||||
SafeImGui.TextWrapped(text);
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
}
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ internal sealed class TrackerFace : IImGuiPanel
|
|||
{
|
||||
float rowRight = ImGuiNET.ImGui.GetCursorPosX() + ImGuiNET.ImGui.GetContentRegionAvail().X;
|
||||
if (ImGuiNET.ImGui.GetCursorScreenPos().Y + rowH > gripTop) rowRight -= grip;
|
||||
ImGuiNET.ImGui.TextColored(LabelColor, labels[i]);
|
||||
SafeImGui.TextColored(LabelColor, labels[i]);
|
||||
if (labels[i].StartsWith("Pass", StringComparison.Ordinal))
|
||||
ImGuiNET.ImGui.SetItemTooltip("Luminance that reached your bank without a \"You've banked\" line: your vassals' pass-up.\nFellowship and Zone Share splits arrive the same silent way and are included.");
|
||||
else if (labels[i] == "Lum/5m")
|
||||
|
|
|
|||
|
|
@ -173,14 +173,14 @@ internal sealed class QuickSettingsDrawer : RynthAiDrawer
|
|||
{
|
||||
header = true;
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 3));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Highlight), tab.Name);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Highlight), tab.Name);
|
||||
}
|
||||
bool pinned = QuickSettings.IsPinned(key);
|
||||
ImGuiNET.ImGui.PushID(key);
|
||||
// Stays open, so several can be pinned in one go; the section shows dimmed at the right.
|
||||
if (ImGuiNET.ImGui.Selectable((pinned ? PhosphorIcons.Check : " ") + " " + label, pinned, ImGuiSelectableFlags.NoAutoClosePopups))
|
||||
QuickSettings.SetPinned(key, !pinned);
|
||||
if (row.Tooltip != null) ImGuiNET.ImGui.SetItemTooltip(row.Tooltip);
|
||||
if (row.Tooltip != null) SafeImGui.SetItemTooltip(row.Tooltip);
|
||||
if (section.Length > 0)
|
||||
{
|
||||
Vector2 max = ImGuiNET.ImGui.GetItemRectMax(), min = ImGuiNET.ImGui.GetItemRectMin();
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ internal sealed class RadarFace : IImGuiPanel
|
|||
{
|
||||
if (IconButton("##radar_pop", popPos, ImGuiPanelHost.PopOutGlyph))
|
||||
ImGuiPanelHost.TogglePopOut(Title);
|
||||
ImGuiNET.ImGui.SetItemTooltip(ImGuiPanelHost.PopOutTooltip);
|
||||
SafeImGui.SetItemTooltip(ImGuiPanelHost.PopOutTooltip);
|
||||
}
|
||||
bool gear = IconButton("##radar_gear", gearPos, PhosphorIcons.Gear);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Radar settings");
|
||||
|
|
@ -630,7 +630,7 @@ internal sealed class RadarFace : IImGuiPanel
|
|||
bool sub = kind == RadarKind.OwnCorpse;
|
||||
if (sub) { ImGuiNET.ImGui.Indent(14 * scale); ImGuiNET.ImGui.BeginDisabled(!RadarSettingsStore.ShowCorpses); }
|
||||
changed |= ImGuiNET.ImGui.Checkbox("##show", ref RadarSettingsStore.ShowFlag(kind));
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(KindTips[kind]);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) SafeImGui.SetTooltip(KindTips[kind]);
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
// The marker exactly as the radar draws it; faded while the kind is hidden, so the
|
||||
// legend doesn't look like the box did nothing.
|
||||
|
|
@ -644,7 +644,7 @@ internal sealed class RadarFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.AlignTextToFramePadding();
|
||||
ImGuiNET.ImGui.TextUnformatted(label);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(KindTips[kind]);
|
||||
if (ImGuiNET.ImGui.IsItemHovered()) SafeImGui.SetTooltip(KindTips[kind]);
|
||||
ImGuiNET.ImGui.SameLine(190 * scale);
|
||||
Vector4 v = RynthTheme.Vec(RadarSettingsStore.KindColors[kind]);
|
||||
if (ImGuiNET.ImGui.ColorEdit4("##col", ref v, pickFlags))
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ internal sealed class RangesSlideOut : RynthAiDrawer
|
|||
dl.AddText(new Vector2(x, y + (h - fs) * 0.5f), White, r.Label);
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, y));
|
||||
ImGuiNET.ImGui.InvisibleButton("##label", new Vector2(Math.Max(1, labelW - 2 * k), h));
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Tip);
|
||||
SafeImGui.SetItemTooltip(r.Tip);
|
||||
|
||||
// Box at the right.
|
||||
float boxW = 46 * k;
|
||||
|
|
@ -226,7 +226,7 @@ internal sealed class RangesSlideOut : RynthAiDrawer
|
|||
}
|
||||
else WriteValue(r, value); // bad input reverts
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Tip);
|
||||
SafeImGui.SetItemTooltip(r.Tip);
|
||||
|
||||
// Slider between them: drag (or click) to pick, saved when let go.
|
||||
float sx = x + labelW, sw = boxX - 6 * k - sx;
|
||||
|
|
@ -250,7 +250,7 @@ internal sealed class RangesSlideOut : RynthAiDrawer
|
|||
r.Dragging = false;
|
||||
if (r.DragValue != value) Changed(r, r.DragValue);
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Tip);
|
||||
SafeImGui.SetItemTooltip(r.Tip);
|
||||
|
||||
float cy = y + h * 0.5f;
|
||||
float frac = s.Max > s.Min ? (float)((shownValue - s.Min) / (s.Max - s.Min)) : 0f;
|
||||
|
|
@ -321,13 +321,13 @@ internal sealed class RangesSlideOut : RynthAiDrawer
|
|||
if (FaceKit.IconButton("##mon_edit", PhosphorIcons.PencilSimple, new Vector2(bx, y), bsize, monster ? Teal : Mute, BtnFill,
|
||||
enabled: monster, border: BtnBord, font: UiFont.Dash10))
|
||||
DamageDetailFace.Show(_selWcid, _selName);
|
||||
ImGuiNET.ImGui.SetItemTooltip(monster ? _editTip : NoEditTip);
|
||||
SafeImGui.SetItemTooltip(monster ? _editTip : NoEditTip);
|
||||
if (FaceKit.IconButton("##mon_damage", PhosphorIcons.Skull, new Vector2(bx + bsize.X + 2 * k, y), bsize, monster ? Teal : Mute, BtnFill,
|
||||
enabled: monster, border: BtnBord, font: UiFont.Dash10))
|
||||
{
|
||||
if (!ImGuiPanelHost.IsOpen(DamageFace.Title)) PanelRouter.ToggleMonsters();
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(monster ? _damageTip : NoDamageTip);
|
||||
SafeImGui.SetItemTooltip(monster ? _damageTip : NoDamageTip);
|
||||
|
||||
// Name line.
|
||||
string name; uint nameColor;
|
||||
|
|
@ -362,7 +362,7 @@ internal sealed class RangesSlideOut : RynthAiDrawer
|
|||
{
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, fy));
|
||||
ImGuiNET.ImGui.InvisibleButton("##mon_facts", new Vector2(w, 2 * lh));
|
||||
ImGuiNET.ImGui.SetItemTooltip(_factsTip);
|
||||
SafeImGui.SetItemTooltip(_factsTip);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ internal sealed class ReportFace : IImGuiPanel
|
|||
if (Button("##report_send", label, row, new Vector2(bw, 24), Text, StartBg, enabled: enabled))
|
||||
StartSend();
|
||||
if (ImGuiNET.ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled | ImGuiHoveredFlags.ForTooltip))
|
||||
ImGuiNET.ImGui.SetTooltip(!hasText ? "Write what went wrong first."
|
||||
SafeImGui.SetTooltip(!hasText ? "Write what went wrong first."
|
||||
: cooldown > 0 ? "One report a minute: " + CooldownText(cooldown)
|
||||
: "Send this report to the staff.");
|
||||
NextLine(row, 28);
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
// item slots, toggles, bank, rebuff, Translate, Guardian)
|
||||
// with its Options menu. The plugin draws it here through
|
||||
// RynthPluginRenderEmbed("miniremote") and says how big it
|
||||
// wants the panel; the Hub launcher's right-click opens it
|
||||
// (popped out: the floating Mini Remote instead).
|
||||
// wants the panel; its drawer tab opens it (popped out
|
||||
// there are no drawers: the Mini Remote window instead).
|
||||
// AC thread only (inside the dashboard's Draw).
|
||||
// ============================================================================
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ internal sealed partial class RynthAiFace
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>RynthAi's Mini Remote, drawn by the plugin into this drawer (the Hub launcher's right-click).</summary>
|
||||
/// <summary>RynthAi's Mini Remote, drawn by the plugin into this drawer (its drawer tab).</summary>
|
||||
private sealed class RemoteDrawer : RynthAiDrawer
|
||||
{
|
||||
/// <summary>The plugin surface name, NUL-terminated for the export.</summary>
|
||||
|
|
@ -207,7 +207,7 @@ internal sealed partial class RynthAiFace
|
|||
|
||||
public override string TabTooltip(bool right) =>
|
||||
"Mini Remote: session rates, attack target, summon, item slots, toggles, bank, rebuff, Translate.\n" +
|
||||
"Its Options button picks the sections (also: right-click Hub). RynthILT's ILT tabs are in the Mini Remote window.\n" +
|
||||
"Its Options button picks the sections. RynthILT's ILT tabs are in the Mini Remote window (Char, or the bar button).\n" +
|
||||
"Click to slide it out.";
|
||||
|
||||
public override float Width(float k) =>
|
||||
|
|
@ -247,12 +247,12 @@ internal sealed partial class RynthAiFace
|
|||
{
|
||||
_want = Vector2.Zero;
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, DMute);
|
||||
ImGuiNET.ImGui.TextWrapped(result switch
|
||||
SafeImGui.TextWrapped(result switch
|
||||
{
|
||||
PluginManager.EmbedNoPlugin =>
|
||||
"This RynthAi can't draw its Mini Remote here (it needs RynthAi 0.5.27 or later). Left-click Hub for the floating Mini Remote.",
|
||||
"This RynthAi can't draw its Mini Remote here (it needs RynthAi 0.5.27 or later). Use the bar's Mini Remote button (/rc miniremote).",
|
||||
PluginManager.EmbedFailed =>
|
||||
"The Mini Remote failed to draw here (see the log). Left-click Hub for the floating Mini Remote.",
|
||||
"The Mini Remote failed to draw here (see the log). Use the bar's Mini Remote button (/rc miniremote).",
|
||||
_ => "The Mini Remote shows here once RynthAi is ready: in the world, with plugin windows on (engine.json EnablePluginOverlayWindows).",
|
||||
});
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x0, y));
|
||||
ImGuiNET.ImGui.InvisibleButton("##dash_drag", new Vector2(Math.Max(1, width - chipsW), rowH));
|
||||
ImGuiPanelHost.DragWindowWithLastItem();
|
||||
ImGuiNET.ImGui.SetItemTooltip(DragTip);
|
||||
SafeImGui.SetItemTooltip(DragTip);
|
||||
|
||||
ImFontPtr title = ImGuiFonts.Get(UiFont.Dash14);
|
||||
float ty = y + (rowH - title.FontSize) * 0.5f;
|
||||
|
|
@ -314,7 +314,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
RynthAiDashboardState.SetShowTargetBar(!target);
|
||||
_fit = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(target
|
||||
SafeImGui.SetItemTooltip(target
|
||||
? "Target bar on: the target's name and health at the bottom. Click to hide it."
|
||||
: "Target bar off. Click to show the target's name and health at the bottom.");
|
||||
cx += chipW + chipGap;
|
||||
|
|
@ -324,14 +324,14 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
RynthAiDashboardState.SetShowVitals(!vitals);
|
||||
_fit = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(vitals
|
||||
SafeImGui.SetItemTooltip(vitals
|
||||
? "Player vitals on: your health, stamina and mana at the bottom. Click to hide them."
|
||||
: "Player vitals off. Click to show your health, stamina and mana at the bottom.");
|
||||
cx += chipW + chipGap;
|
||||
if (IconButton("##chip_lock", new Vector2(cx, cy), chip, raw.IsLocked ? PhosphorIcons.Lock : PhosphorIcons.LockOpen,
|
||||
chipFont, BtnFill, raw.IsLocked ? Amber : Mute, BtnBord, chipRound))
|
||||
RynthAiCommands.TogglePanelLock();
|
||||
ImGuiNET.ImGui.SetItemTooltip(raw.IsLocked ? "Locked. Click to unlock the dashboard." : "Click to lock the dashboard in place.");
|
||||
SafeImGui.SetItemTooltip(raw.IsLocked ? "Locked. Click to unlock the dashboard." : "Click to lock the dashboard in place.");
|
||||
cx += chipW + chipGap;
|
||||
if (IconButton("##chip_minus", new Vector2(cx, cy), chip, PhosphorIcons.Minus, chipFont, BtnFill, Mute, BtnBord, chipRound))
|
||||
RynthAiCommands.AdjustOpacity(-0.1f);
|
||||
|
|
@ -347,13 +347,13 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
RynthAiDashboardState.SetMinimized(!minimized);
|
||||
_fit = true; // the window fits the other mode's content next frame
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(minimized ? "Expand" : "Minimize");
|
||||
SafeImGui.SetItemTooltip(minimized ? "Expand" : "Minimize");
|
||||
cx += chipW + chipGap;
|
||||
if (PanelRouter.CanPopOut)
|
||||
{
|
||||
if (IconButton("##chip_dock", new Vector2(cx, cy), chip, ImGuiPanelHost.PopOutGlyph, chipFont, BtnFill, Mute, BtnBord, chipRound))
|
||||
ImGuiPanelHost.TogglePopOut(Title);
|
||||
ImGuiNET.ImGui.SetItemTooltip(ImGuiPanelHost.PopOutTooltip);
|
||||
SafeImGui.SetItemTooltip(ImGuiPanelHost.PopOutTooltip);
|
||||
}
|
||||
|
||||
// The size, from the title row (no host title bar here): Ctrl+wheel steps it, right-click
|
||||
|
|
@ -574,7 +574,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
if (IconButton("##macro", new Vector2(x, y), square, on ? PhosphorIcons.Stop : PhosphorIcons.Play,
|
||||
UiFont.Dash14, on ? MacroRun : BarBg, on ? White : Mute, on ? Green : BtnBord, round))
|
||||
RynthAiCommands.ToggleMacro();
|
||||
ImGuiNET.ImGui.SetItemTooltip(on ? "Macro running. Click to stop it." : "Macro stopped. Click to start it.");
|
||||
SafeImGui.SetItemTooltip(on ? "Macro running. Click to stop it." : "Macro stopped. Click to start it.");
|
||||
x += sqStep + Px(6);
|
||||
}
|
||||
Toggle("##t_combat", PhosphorIcons.Sword, raw.CombatEnabled, 0, new Vector2(x, y), "Combat",
|
||||
|
|
@ -601,7 +601,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
if (IconButton("##t_sort", new Vector2(x, y), square, PhosphorIcons.SortAscending, UiFont.Dash14,
|
||||
on ? TealSoft : BarBg, on ? Teal : Mute, on ? Teal : BtnBord, round))
|
||||
RynthSortCommands.SetAuto(!on);
|
||||
ImGuiNET.ImGui.SetItemTooltip(on ? "Auto-sort (RynthSort) on. Click to turn it off." : "Auto-sort (RynthSort) off. Click to turn it on.");
|
||||
SafeImGui.SetItemTooltip(on ? "Auto-sort (RynthSort) on. Click to turn it off." : "Auto-sort (RynthSort) off. Click to turn it on.");
|
||||
x += sqStep;
|
||||
}
|
||||
|
||||
|
|
@ -615,7 +615,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
if (IconButton("##files_open", new Vector2(frX - Px(4) - caretW, y), new Vector2(caretW, sq), PhosphorIcons.CaretDown,
|
||||
UiFont.Dash11, BtnFill, Teal, BtnBord, Px(2)))
|
||||
RynthAiDashboardState.SetFilesOpen(true);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Profile: " + (view?.ProfileText ?? "Default") + "\nNav: " + (view?.NavText ?? "None") +
|
||||
SafeImGui.SetItemTooltip("Profile: " + (view?.ProfileText ?? "Default") + "\nNav: " + (view?.NavText ?? "None") +
|
||||
"\nLoot: " + (view?.LootText ?? "None") + "\nMeta: " + (view?.MetaText ?? "None") +
|
||||
"\nBuffs: " + (view?.BuffText ?? "Built-in") +
|
||||
"\n\nClick to show the Profile, Nav, Loot, Meta and Buffs pickers.");
|
||||
|
|
@ -644,7 +644,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
dl.PopClipRect();
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(ax, y));
|
||||
ImGuiNET.ImGui.InvisibleButton("##activity", new Vector2(aRight - ax, sq));
|
||||
ImGuiNET.ImGui.SetItemTooltip("Bot activity: " + activity + "\nMeta state: " + (view?.MetaStateText ?? "Default"));
|
||||
SafeImGui.SetItemTooltip("Bot activity: " + activity + "\nMeta state: " + (view?.MetaStateText ?? "Default"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -671,7 +671,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
if (IconButton(id, pos, new Vector2(sq, sq), icon, UiFont.Dash14, on ? TealSoft : BarBg, on ? Teal : Off, on ? Teal : BtnBord, Px(3)))
|
||||
RynthAiCommands.SetSubsystemEnabled(subsystem, !on);
|
||||
bool right = ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right);
|
||||
ImGuiNET.ImGui.SetItemTooltip((on ? name + " on. Click to turn it off." : name + " off. Click to turn it on.") +
|
||||
SafeImGui.SetItemTooltip((on ? name + " on. Click to turn it off." : name + " off. Click to turn it on.") +
|
||||
"\nRight-click: " + rightWhat + ".");
|
||||
if (on)
|
||||
ImGuiNET.ImGui.GetWindowDrawList().AddRectFilled(new Vector2(pos.X + Px(5), pos.Y + sq - Px(3.5f)),
|
||||
|
|
@ -711,7 +711,8 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
{
|
||||
float y = ImGuiNET.ImGui.GetCursorScreenPos().Y;
|
||||
// Nav and Meta left the row (2026-10-14): right-click the Navigation and Meta toggles.
|
||||
const int buttons = 8;
|
||||
// Hub left it 2026-10-15 (the Mini Remote: the bar button, Char's menu, its drawer tab).
|
||||
const int buttons = 7;
|
||||
float gap = Px(LauncherGap);
|
||||
float bw = MathF.Floor((width - buttons * gap) / buttons);
|
||||
// Short labels only when every button has room for its icon and label.
|
||||
|
|
@ -752,31 +753,20 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
}
|
||||
x += bw + gap;
|
||||
|
||||
// Char and Hub open the Mini Remote window (MiniRemoteFace, hosting RynthAi's remote): Char
|
||||
// on its Character tab (RynthILT's ILT tab; elsewhere the remote shows), Hub as it was left.
|
||||
// Char opens RynthOracle's Character tab (character, level XP, session rates) since
|
||||
// 2026.10.5.54 (Infinite Leaftide's charms stay RynthILT's, in the Mini Remote's ILT tabs,
|
||||
// Char's right-click > Server); without RynthOracle, the Mini Remote's
|
||||
// Session Stats section. The Mini Remote as it was left is the bar button (/rc miniremote)
|
||||
// and "Mini Remote" in Char's right-click menu; its drawer is the drawer tab on the dashboard's
|
||||
// edge. (The Hub launcher, which opened the same window, left the row 2026-10-15.)
|
||||
Launcher("##l_char", PhosphorIcons.User, "Char",
|
||||
"Char. Left-click: the Mini Remote on its Character tab (ILT worlds). Right-click: Character windows (Spells, Quests, Pets, Skills, Inventory...), then Server: this server's plugin windows.",
|
||||
x, y, bw, labels, () => ShowMiniRemoteTab("character"), false);
|
||||
"Char. Left-click: RynthOracle's Character tab (Infinite Leaftide's charms and banking: the Mini Remote's ILT tabs). Right-click: Character windows (Mini Remote, Spells, Quests, Pets, Crafting, Fellowship, Skills, Inventory...), then Server: this server's plugin windows.",
|
||||
x, y, bw, labels, ShowCharacter, CharacterOpen());
|
||||
if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
ImGuiNET.ImGui.SetNextWindowPos(ImGuiNET.ImGui.GetItemRectMin(), ImGuiCond.Always, new Vector2(0, 1));
|
||||
ImGuiNET.ImGui.OpenPopup("##charmenu");
|
||||
}
|
||||
x += bw + gap;
|
||||
// Left-click is the Mini Remote window (MiniRemoteFace, which hosts RynthAi's remote, the
|
||||
// same window as the bar button). Right-click is the Mini Remote drawer, as Patrol's is
|
||||
// its drawer; popped out there are no drawers, so it opens the window. Inventory HUDs
|
||||
// setup is in the Mini Remote's Options menu.
|
||||
Launcher("##l_hub", PhosphorIcons.SquaresFour, "Hub",
|
||||
popped ? "Hub. Left-click: the Mini Remote window (/rc miniremote). Right-click: open the Mini Remote window."
|
||||
: "Hub. Left-click: the Mini Remote window (/rc miniremote). Right-click: the Mini Remote drawer (left), with its Options.",
|
||||
x, y, bw, labels, () => PanelRouter.Toggle(MiniRemoteFace.Title),
|
||||
ImGuiPanelHost.IsOpen(MiniRemoteFace.Title) || (!popped && _drawers.IsOpen(_remote)));
|
||||
if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
if (popped) ImGuiPanelHost.Open(MiniRemoteFace.Title);
|
||||
else _drawers.Toggle(_remote);
|
||||
}
|
||||
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x0, y + Px(LauncherH)));
|
||||
}
|
||||
|
|
@ -791,7 +781,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(pos);
|
||||
bool clicked = ImGuiNET.ImGui.InvisibleButton(id, size, ImGuiButtonFlags.MouseButtonLeft | ImGuiButtonFlags.MouseButtonRight)
|
||||
&& ImGuiNET.ImGui.IsMouseReleased(ImGuiMouseButton.Left);
|
||||
ImGuiNET.ImGui.SetItemTooltip(tooltip);
|
||||
SafeImGui.SetItemTooltip(tooltip);
|
||||
bool hot = ImGuiNET.ImGui.IsItemHovered();
|
||||
uint fill = ImGuiNET.ImGui.IsItemActive() ? Darken(BtnFill) : hot ? Lighten(BtnFill) : BtnFill;
|
||||
uint fg = lit ? Teal : hot ? White : Mute;
|
||||
|
|
@ -986,9 +976,10 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
// (UI.ServerMenus): the installed server plugins' windows for the world you're on.
|
||||
|
||||
/// <summary>
|
||||
/// Opens the Mini Remote window on one of its tabs ("" = the remote). Quests and Pets show on
|
||||
/// every server; RynthILT's ILT tabs show once the server reports that feature on (and only with
|
||||
/// RynthILT), and until then the window shows the remote.
|
||||
/// Opens the Mini Remote window on one of its tabs ("" = the remote). Pets and Crafting show on
|
||||
/// every server (Quests and Fellowship are RynthOracle's windows since 2026-10-13); RynthILT's ILT
|
||||
/// tabs show once the server reports that feature on (and only with RynthILT), and until then
|
||||
/// the window shows the remote.
|
||||
/// </summary>
|
||||
private static void ShowMiniRemoteTab(string section)
|
||||
{
|
||||
|
|
@ -996,6 +987,23 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
RynthAiCommands.ApplyRemoteCommand("hub", section.Length > 0 ? "tab " + section : "tab");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RynthOracle's Character tab ("/ro character"), or the Mini Remote's Session Stats section
|
||||
/// when RynthOracle isn't loaded. Every generic "Character" link goes here (Leaftide's Charms
|
||||
/// and Banking are RynthILT's Mini Remote tabs, in the menu's server half).
|
||||
/// </summary>
|
||||
private static void ShowCharacter()
|
||||
{
|
||||
if (UI.ScriptWindows.ScriptWindowRegistry.Has(OracleMainKey)) UI.ServerMenus.Run("/ro character");
|
||||
else UI.ServerMenus.Run("/rc miniremote section char");
|
||||
}
|
||||
|
||||
/// <summary>The Char launcher is lit: RynthOracle's window is open (else the Mini Remote on Session Stats).</summary>
|
||||
private static bool CharacterOpen() =>
|
||||
UI.ScriptWindows.ScriptWindowRegistry.Has(OracleMainKey)
|
||||
? UI.ScriptWindows.ScriptWindowRegistry.IsOpen(OracleMainKey)
|
||||
: ImGuiPanelHost.IsOpen(MiniRemoteFace.Title) && MiniRemoteFace.ShowsSection("char");
|
||||
|
||||
/// <summary>A Char menu item that toggles a registered ImGui panel (checked while open).</summary>
|
||||
private static void PanelMenuItem(string title, string command)
|
||||
{
|
||||
|
|
@ -1004,6 +1012,23 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
PanelRouter.Toggle(title);
|
||||
}
|
||||
|
||||
// RynthOracle's script window keys (RynthOraclePlugin: UiWindow keys).
|
||||
private const string OracleMainKey = "RynthOracle/Oracle";
|
||||
private const string OracleTimersKey = "RynthOracle/QuestTimers";
|
||||
|
||||
/// <summary>
|
||||
/// A Character menu line for one of RynthOracle's script windows: toggles it as the bar does,
|
||||
/// checked while open, greyed out when RynthOracle isn't loaded (or hasn't drawn it yet).
|
||||
/// </summary>
|
||||
private static void OracleMenuItem(string label, string command, string key, string tooltip)
|
||||
{
|
||||
bool has = UI.ScriptWindows.ScriptWindowRegistry.Has(key);
|
||||
bool open = has && UI.ScriptWindows.ScriptWindowRegistry.IsOpen(key);
|
||||
if (ImGuiNET.ImGui.MenuItem(label, command, open, has))
|
||||
UI.ScriptWindows.ScriptWindowRegistry.PlayerSetVisible(key, !open);
|
||||
SafeImGui.SetItemTooltip(has ? tooltip : tooltip + " (RynthOracle isn't loaded.)");
|
||||
}
|
||||
|
||||
private static void CharMenu()
|
||||
{
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.PopupBg, ShellBg);
|
||||
|
|
@ -1016,16 +1041,31 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
try
|
||||
{
|
||||
ImGuiNET.ImGui.TextDisabled("Character");
|
||||
bool hasOracle = UI.ScriptWindows.ScriptWindowRegistry.Has(OracleMainKey);
|
||||
if (ImGuiNET.ImGui.MenuItem("Character", "/ro character", false, hasOracle)) ShowCharacter();
|
||||
SafeImGui.SetItemTooltip(hasOracle
|
||||
? "RynthOracle's Character tab: level, XP and session rates. Infinite Leaftide's charms and banking are the Mini Remote's ILT tabs (Server, below)."
|
||||
: "RynthOracle's Character tab (RynthOracle isn't loaded).");
|
||||
if (ImGuiNET.ImGui.MenuItem("Mini Remote", "/rc miniremote", ImGuiPanelHost.IsOpen(MiniRemoteFace.Title)))
|
||||
ShowMiniRemoteTab("");
|
||||
if (ImGuiNET.ImGui.MenuItem("Spells", "/rc spells"))
|
||||
RynthAiCommands.ApplyRemoteCommand("spells", "toggle");
|
||||
ImGuiNET.ImGui.SetItemTooltip("RynthAi Spells: the spell catalog and buff profiles.");
|
||||
// Quests live in RynthOracle (its script windows), since 2026-10-13.
|
||||
OracleMenuItem("Quests", "/ro", OracleMainKey,
|
||||
"RynthOracle: every quest flag, timers, tracking, rewards and (Infinite Leaftide) the /qb list.");
|
||||
OracleMenuItem("Quest Timers", "/ro timers", OracleTimersKey,
|
||||
"RynthOracle's Quest Timers: the quests you track and the time left on each.");
|
||||
// The Mini Remote's universal tabs (every server); RynthILT's ILT tabs are in the server half.
|
||||
if (ImGuiNET.ImGui.MenuItem("Quests", "/rc miniremote tab quests")) ShowMiniRemoteTab("quests");
|
||||
ImGuiNET.ImGui.SetItemTooltip("The Mini Remote's Quests tab: /myquests timers and favorites (RynthAi).");
|
||||
if (ImGuiNET.ImGui.MenuItem("Pets", "/rc miniremote tab pets")) ShowMiniRemoteTab("pets");
|
||||
ImGuiNET.ImGui.SetItemTooltip("The Mini Remote's Pets tab: summoning essences, priorities and the healing pet (RynthAi).");
|
||||
if (ImGuiNET.ImGui.MenuItem("Crafting", "/rc miniremote tab crafting")) ShowMiniRemoteTab("crafting");
|
||||
ImGuiNET.ImGui.SetItemTooltip("The Mini Remote's Crafting tab: armor, weapon, jewelry and item tinkering, chunking and arrows (RynthAi).");
|
||||
// Fellowship is RynthOracle's Fellowship tab ("/ro fellowship" opens the window on it).
|
||||
if (ImGuiNET.ImGui.MenuItem("Fellowship", "/ro fellowship", false, hasOracle)) UI.ServerMenus.Run("/ro fellowship");
|
||||
SafeImGui.SetItemTooltip(hasOracle
|
||||
? "RynthOracle's Fellowship tab: members, leader, open / locked, XP sharing and (Infinite Leaftide) the /fship commands."
|
||||
: "RynthOracle's Fellowship tab (RynthOracle isn't loaded).");
|
||||
PanelMenuItem(SkillsFace.Title, "/rc skills");
|
||||
PanelMenuItem(InventoryFace.Title, "/rc inventory");
|
||||
PanelMenuItem(ItemCountFace.Title, "/rc itemcount");
|
||||
|
|
@ -1072,14 +1112,14 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
if (withTitle)
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Dash11));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), PatrolTitle);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), PatrolTitle);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
||||
Section("THIS DUNGEON");
|
||||
if (info.InDungeon)
|
||||
{
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), $"0x{info.CurrentLandblock} · {info.CurrentHazards} hazard cell(s)");
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), $"0x{info.CurrentLandblock} · {info.CurrentHazards} hazard cell(s)");
|
||||
if (info.CurrentHazards > 0)
|
||||
{
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
|
|
@ -1109,7 +1149,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
{
|
||||
DungeonHazards d = info.Dungeons[i];
|
||||
ImGuiNET.ImGui.PushID(i);
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), $"0x{d.Landblock} · {d.Cells} cell(s)");
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), $"0x{d.Landblock} · {d.Cells} cell(s)");
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
if (Mini("Clear"))
|
||||
RynthAiCommands.SendNavCommand($"{{\"Cmd\":\"clearHazards\",\"NavName\":\"{d.Landblock}\"}}", refreshPatrol: true);
|
||||
|
|
@ -1122,7 +1162,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
if (info.Routes.Length == 0)
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.TextMuted), "No .nav routes saved.");
|
||||
foreach (string name in info.Routes)
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), "• " + name);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Text), "• " + name);
|
||||
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
|
@ -1134,7 +1174,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
{
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, Px(4)));
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Dash9));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.TextMuted), text);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.TextMuted), text);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ internal sealed class RynthNavArrowFace : IImGuiPanel
|
|||
{
|
||||
if (IconButton("##rna_pop", ImGuiPanelHost.PopOutGlyph, popPos, new Vector2(sb, sb), Done, Glass, font: UiFont.Ui9))
|
||||
ImGuiPanelHost.TogglePopOut(Title);
|
||||
ImGuiNET.ImGui.SetItemTooltip(ImGuiPanelHost.PopOutTooltip);
|
||||
SafeImGui.SetItemTooltip(ImGuiPanelHost.PopOutTooltip);
|
||||
}
|
||||
if (IconButton("##rna_close", PhosphorIcons.X, closePos, new Vector2(sb, sb), Done, Glass, font: UiFont.Ui9))
|
||||
ImGuiPanelHost.Close(Title);
|
||||
|
|
@ -151,11 +151,11 @@ internal sealed class RynthNavArrowFace : IImGuiPanel
|
|||
if (typed.Length > 0) RynthNavCommands.Command("route " + typed);
|
||||
else if (st?.Arrow is RynthNavArrow pa) RynthNavCommands.Route(pa.Final, pa.FinalNs, pa.FinalEw);
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(typed.Length > 0
|
||||
SafeImGui.SetItemTooltip(typed.Length > 0
|
||||
? "Plan a route to " + typed + " without walking it (the steps open below)"
|
||||
: "Plan a route to the arrow's target without walking it (the steps open below)");
|
||||
bool go = IconButton("##rna_go", PhosphorIcons.Play, goPos, new Vector2(b, b), Green, BtnFill, enabled: canGo, font: UiFont.Ui11);
|
||||
ImGuiNET.ImGui.SetItemTooltip(typed.Length > 0
|
||||
SafeImGui.SetItemTooltip(typed.Length > 0
|
||||
? "Go to " + typed + " (with portals and recalls when RynthNav's routing is on)"
|
||||
: "Go: RynthNav walks to the arrow's target (with portals and recalls when its routing is on)");
|
||||
if ((go || enter) && canGo)
|
||||
|
|
@ -172,7 +172,7 @@ internal sealed class RynthNavArrowFace : IImGuiPanel
|
|||
_showRoute = !_showRoute;
|
||||
_scrolledTo = -1;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(hasRoute ? (_showRoute ? "Hide the route's steps" : "Show the route's steps") : "No route yet: Plan or Go makes one");
|
||||
SafeImGui.SetItemTooltip(hasRoute ? (_showRoute ? "Hide the route's steps" : "Show the route's steps") : "No route yet: Plan or Go makes one");
|
||||
|
||||
if (_showRoute && hasRoute)
|
||||
RouteList(st!, new Vector2(origin.X + pad, rowY + b + 4), new Vector2(size.X - 2 * pad, listH), bold, lineH);
|
||||
|
|
@ -183,7 +183,7 @@ internal sealed class RynthNavArrowFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.InvisibleButton("##rna_surface", new Vector2(size.X, rowY - origin.Y - 2));
|
||||
ImGuiPanelHost.DragWindowWithLastItem();
|
||||
if (ImGuiNET.ImGui.IsItemHovered() && _read.Tooltip.Length > 0)
|
||||
ImGuiNET.ImGui.SetItemTooltip(_read.Tooltip + (_read.Line3.Length > 0 && _read.Kind == "portal" ? "\n" + _read.Line3 : ""));
|
||||
SafeImGui.SetItemTooltip(_read.Tooltip + (_read.Line3.Length > 0 && _read.Kind == "portal" ? "\n" + _read.Line3 : ""));
|
||||
}
|
||||
|
||||
/// <summary>The coordinates or place typed in the box, trimmed.</summary>
|
||||
|
|
@ -242,7 +242,7 @@ internal sealed class RynthNavArrowFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.TextUnformatted(st.RouteLines[i]);
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
ImGuiNET.ImGui.SetTooltip(current && st.StepLeft.Length > 0 ? st.RouteLines[i] + "\n" + st.StepLeft : st.RouteLines[i]);
|
||||
SafeImGui.SetTooltip(current && st.StepLeft.Length > 0 ? st.RouteLines[i] + "\n" + st.StepLeft : st.RouteLines[i]);
|
||||
if (current && _scrolledTo != i) { ImGuiNET.ImGui.SetScrollHereY(0.3f); _scrolledTo = i; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
// The whole line on hover (it's clipped to one line).
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(p);
|
||||
ImGuiNET.ImGui.InvisibleButton("##rnav_status", new Vector2(Math.Max(1, textRight - p.X), h));
|
||||
if (text.Length > 40) ImGuiNET.ImGui.SetItemTooltip(text);
|
||||
if (text.Length > 40) SafeImGui.SetItemTooltip(text);
|
||||
if (stop)
|
||||
{
|
||||
if (IconButton("##rnav_status_stop", PhosphorIcons.Stop, new Vector2(p.X + w - 22, p.Y + 1), new Vector2(20, 20), Text, StopBg, font: UiFont.Ui11))
|
||||
|
|
@ -283,7 +283,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
{
|
||||
if (IconButton("##go_star", PhosphorIcons.Star, p, new Vector2(18, 18), fav ? Gold : Faded(Mute), fav ? Selected : PanelBg, font: UiFont.Ui11))
|
||||
RynthNavCommands.ToggleFavorite(_pick!.Name, _pick.Ns, _pick.Ew);
|
||||
ImGuiNET.ImGui.SetItemTooltip(fav ? "Remove from favorites" : "Add to favorites");
|
||||
SafeImGui.SetItemTooltip(fav ? "Remove from favorites" : "Add to favorites");
|
||||
lx += 22;
|
||||
}
|
||||
dl.PushClipRect(new Vector2(lx, p.Y), new Vector2(p.X + w, p.Y + 18), true);
|
||||
|
|
@ -301,19 +301,19 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
bool walking = st?.Goto == true;
|
||||
float bw = (w - 3 * 4) / 4f;
|
||||
if (Button("##go_go", GoLabel, p, new Vector2(bw, 26), Green, BtnFill, enabled: canGo)) Go(text);
|
||||
ImGuiNET.ImGui.SetItemTooltip(travel
|
||||
SafeImGui.SetItemTooltip(travel
|
||||
? (st!.PortalsOn ? "Walk there, through portals and with recalls when that is quicker" : "Walk there (portals and recalls are switched off)")
|
||||
: "Walk the navmesh to these coordinates (update RynthNav for places and routes)");
|
||||
if (Button("##go_route", PhosphorIcons.Path + " Route", new Vector2(p.X + bw + 4, p.Y), new Vector2(bw, 26), Text, BtnFill, enabled: travel && has))
|
||||
RynthNavCommands.Command("route " + Arg(text));
|
||||
ImGuiNET.ImGui.SetItemTooltip(travel ? "Plan only: show the steps below, don't walk" : "Update RynthNav (0.6.0+) for routes");
|
||||
SafeImGui.SetItemTooltip(travel ? "Plan only: show the steps below, don't walk" : "Update RynthNav (0.6.0+) for routes");
|
||||
if (Button("##go_arrow", PhosphorIcons.NavigationArrow + " Arrow", new Vector2(p.X + 2 * (bw + 4), p.Y), new Vector2(bw, 26), Teal, BtnFill, enabled: travel && has))
|
||||
RynthNavCommands.Command("arrow " + Arg(text));
|
||||
ImGuiNET.ImGui.SetItemTooltip(travel ? "Show the arrow overlay pointing there" : "Update RynthNav (0.6.0+) for the arrow");
|
||||
SafeImGui.SetItemTooltip(travel ? "Show the arrow overlay pointing there" : "Update RynthNav (0.6.0+) for the arrow");
|
||||
if (Button("##go_stop", PhosphorIcons.Stop + " Stop", new Vector2(p.X + 3 * (bw + 4), p.Y), new Vector2(bw, 26),
|
||||
walking ? Text : Red, walking ? StopBg : BtnFill, border: walking ? Red : 0))
|
||||
RynthNavCommands.Move(5);
|
||||
ImGuiNET.ImGui.SetItemTooltip(walking ? "Stop walking" : "Stop any movement");
|
||||
SafeImGui.SetItemTooltip(walking ? "Stop walking" : "Stop any movement");
|
||||
NextLine(p, 32);
|
||||
|
||||
// Switches
|
||||
|
|
@ -438,7 +438,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
if (IconButton("##fav", PhosphorIcons.Star, rp + new Vector2(2, 1), new Vector2(btn, btn), r.Favorite ? Gold : Faded(Mute),
|
||||
r.Favorite ? Selected : PanelBg, enabled: travel && r.OnMap, font: UiFont.Ui11))
|
||||
RynthNavCommands.ToggleFavorite(r.Name, r.Ns, r.Ew);
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Favorite ? "Remove from favorites" : "Add to favorites");
|
||||
SafeImGui.SetItemTooltip(r.Favorite ? "Remove from favorites" : "Add to favorites");
|
||||
|
||||
float bodyX = rp.X + btn + 4, bodyW = w - btn - 4;
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(bodyX, rp.Y));
|
||||
|
|
@ -605,7 +605,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SetItemTooltip("Is there navmesh under you?");
|
||||
if (Button("##preview", "Preview", new Vector2(p.X + 2 * (bw + 4), p.Y), new Vector2(bw, 24), Text, BtnFill, enabled: coord.Length > 0))
|
||||
RynthNavCommands.Preview(coord);
|
||||
ImGuiNET.ImGui.SetItemTooltip(coord.Length > 0 ? "Plan the navmesh path to the destination (close places only), no walking"
|
||||
SafeImGui.SetItemTooltip(coord.Length > 0 ? "Plan the navmesh path to the destination (close places only), no walking"
|
||||
: "Pick a destination on the map first");
|
||||
NextLine(p, 30);
|
||||
|
||||
|
|
@ -649,7 +649,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
{
|
||||
if (IconButton("##mv" + cmd, glyph, pos, new Vector2(58, 42), Text, active ? RunGreen : BtnFill))
|
||||
RynthNavCommands.Move(cmd);
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
}
|
||||
|
||||
// Avoidance, one row per kind of thing kept away from: on/off, then − value +. Each click
|
||||
|
|
@ -675,7 +675,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
}
|
||||
else
|
||||
Button("##av_" + key, label, p, new Vector2(lw, 22), Text, BtnFill, enabled: false, leftAlign: true);
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
bool active = on ?? true;
|
||||
float x = p.X + lw + 4;
|
||||
string Fmt(double v) => v.ToString("0.#", System.Globalization.CultureInfo.InvariantCulture);
|
||||
|
|
@ -695,7 +695,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
float w1 = (w - 8) * 0.40f, w2 = (w - 8) * 0.28f, w3 = w - 8 - w1 - w2;
|
||||
if (Toggle("##mk_on", "Path markers", st.MarkersOn, p, w1))
|
||||
RynthNavCommands.Command(st.MarkersOn ? "markers off" : "markers on");
|
||||
ImGuiNET.ImGui.SetItemTooltip("Show the planned trip on the ground, the way RynthAi shows its nav routes: rings at the\n"
|
||||
SafeImGui.SetItemTooltip("Show the planned trip on the ground, the way RynthAi shows its nav routes: rings at the\n"
|
||||
+ "waypoints, lines between them, the portals, recalls and the goal in their own colours.\n"
|
||||
+ "They go when the trip ends, you stop, or you land somewhere that isn't on it."
|
||||
+ (st.MarkerStatus.Length > 0 ? "\n\nNow: " + st.MarkerStatus : ""));
|
||||
|
|
@ -732,7 +732,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
if (Button("##save_go", st.SaveBusy ? "Saving…" : PhosphorIcons.FloppyDisk + " Save", new Vector2(p.X + boxW + 4, p.Y), new Vector2(bw, 22),
|
||||
Teal, BtnFill, enabled: can) || (enter && can))
|
||||
RynthNavCommands.Command("saveroute " + name);
|
||||
ImGuiNET.ImGui.SetItemTooltip("Write this trip as a RynthAi nav route (NavProfiles\\" + (name.Length > 0 ? name : "name") + ".nav):\n"
|
||||
SafeImGui.SetItemTooltip("Write this trip as a RynthAi nav route (NavProfiles\\" + (name.Length > 0 ? name : "name") + ".nav):\n"
|
||||
+ "the walks as waypoints, portals as portal steps, recalls as recall steps.\n"
|
||||
+ "RynthAi lists it in its Nav picker; /ra nav load " + (name.Length > 0 ? name : "<name>") + " loads it.");
|
||||
NextLine(p, 26);
|
||||
|
|
@ -746,7 +746,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
dl.PopClipRect();
|
||||
if (Button("##save_replace", "Replace", new Vector2(p.X + tw + 4, p.Y), new Vector2(rw, 22), Text, BtnFill, enabled: !st.SaveBusy, border: Amber))
|
||||
RynthNavCommands.Command("saveroute " + name + " overwrite");
|
||||
ImGuiNET.ImGui.SetItemTooltip("Replace NavProfiles\\" + name + ".nav with this trip");
|
||||
SafeImGui.SetItemTooltip("Replace NavProfiles\\" + name + ".nav with this trip");
|
||||
NextLine(p, 26);
|
||||
}
|
||||
if (st.SaveLast.Length > 0)
|
||||
|
|
@ -792,7 +792,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
_mode = Modes[i].Mode;
|
||||
PushQuery();
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(Modes[i].Tip);
|
||||
SafeImGui.SetItemTooltip(Modes[i].Tip);
|
||||
}
|
||||
NextLine(p, 26);
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
if (IconButton("##fav", PhosphorIcons.Star, starPos, new Vector2(btn, btn), r.Favorite ? Gold : Faded(Mute),
|
||||
r.Favorite ? Selected : PanelBg, enabled: r.OnMap, font: UiFont.Ui11))
|
||||
RynthNavCommands.ToggleFavorite(r.Name, r.Ns, r.Ew);
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.Favorite ? "Remove from favorites" : "Add to favorites");
|
||||
SafeImGui.SetItemTooltip(r.Favorite ? "Remove from favorites" : "Add to favorites");
|
||||
|
||||
// Arrow / Go (right)
|
||||
var goPos = new Vector2(rp.X + w - btn - 2, rp.Y + 1);
|
||||
|
|
@ -865,13 +865,13 @@ internal sealed class RynthNavFace : IImGuiPanel
|
|||
RynthNavCommands.Arrow(r.Name, r.Ns, r.Ew);
|
||||
_sel = r;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.OnMap ? "Point the arrow here" : "In a dungeon: no arrow");
|
||||
SafeImGui.SetItemTooltip(r.OnMap ? "Point the arrow here" : "In a dungeon: no arrow");
|
||||
if (IconButton("##go", PhosphorIcons.Play, goPos, new Vector2(btn, btn), Green, BtnFill, enabled: r.OnMap, font: UiFont.Ui11))
|
||||
{
|
||||
RynthNavCommands.Go(r.Name, r.Ns, r.Ew);
|
||||
_sel = r;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(r.OnMap ? "Go: RynthNav walks here" : "In a dungeon: RynthNav can't walk there");
|
||||
SafeImGui.SetItemTooltip(r.OnMap ? "Go: RynthNav walks here" : "In a dungeon: RynthNav can't walk there");
|
||||
|
||||
// Row body: click selects
|
||||
float bodyX = rp.X + btn + 4, bodyW = arPos.X - 4 - bodyX;
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ internal sealed class SenseFace : IImGuiPanel
|
|||
if (ImGuiNET.ImGui.InvisibleButton("##t", new Vector2(chipW - xW, ChipH))) toggle = i;
|
||||
bool hotT = ImGuiNET.ImGui.IsItemHovered();
|
||||
if (hotT)
|
||||
ImGuiNET.ImGui.SetItemTooltip(t.Enabled
|
||||
SafeImGui.SetItemTooltip(t.Enabled
|
||||
? (t.IsGlob ? "On: the whole name must match (wildcards). Click to switch off." : "On: names containing this match. Click to switch off.")
|
||||
: "Off. Click to switch on.");
|
||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x + chipW - xW, y));
|
||||
|
|
|
|||
126
src/RynthCore.Engine/ImGui/Panels/ServerPickSettingsUi.cs
Normal file
126
src/RynthCore.Engine/ImGui/Panels/ServerPickSettingsUi.cs
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
// ============================================================================
|
||||
// RynthCore.Engine - ImGui/Panels/ServerPickSettingsUi.cs
|
||||
// Settings > Diagnostics > 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
|
||||
// full list: verdict, detection, this character's override, and the plugin
|
||||
// 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.
|
||||
// ============================================================================
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using ImGuiNET;
|
||||
using RynthCore.Engine.UI.Sections;
|
||||
|
||||
namespace RynthCore.Engine.ImGuiBackend.Panels;
|
||||
|
||||
internal static class ServerPickSettingsUi
|
||||
{
|
||||
private static readonly Vector4 Teal = RynthTheme.Vec(0xFF26D9E6), Amber = RynthTheme.Vec(0xFFE8B333),
|
||||
Mute = RynthTheme.Vec(0xFFB8C8D8), Good = RynthTheme.Vec(0xFF33FF33);
|
||||
|
||||
// The last pick's outcome, shown under the picker until the next one.
|
||||
private static string _message = string.Empty;
|
||||
|
||||
/// <summary>The row: picker, active server, server table. Render thread.</summary>
|
||||
public static void Draw(float width, string? tooltip)
|
||||
{
|
||||
SectionRegistry.Snapshot snap = SectionRegistry.Current;
|
||||
IReadOnlyList<ServerState> servers = snap.Servers;
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 2));
|
||||
if (servers.Count == 0)
|
||||
{
|
||||
SafeImGui.TextDisabled("No servers known yet (the list fills in once a character is in game).");
|
||||
return;
|
||||
}
|
||||
|
||||
string? pick = ServerSelection.CurrentPick(servers);
|
||||
DrawPicker(servers, pick, width, tooltip);
|
||||
|
||||
ServerState? active = ServerSelection.ActiveServer(servers);
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 2));
|
||||
if (active == null)
|
||||
SafeImGui.TextColored(Mute, "Active: none (no custom server matched; retail rules).");
|
||||
else
|
||||
SafeImGui.TextColored(Teal, $"Active: {active.Name} ({active.Id}) - {active.Reason}");
|
||||
if (_message.Length > 0) SafeImGui.TextColored(Amber, _message);
|
||||
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
|
||||
DrawTable(servers, snap.Manifests);
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
|
||||
}
|
||||
|
||||
private static void DrawPicker(IReadOnlyList<ServerState> servers, string? pick, float width, string? tooltip)
|
||||
{
|
||||
string preview = pick == null ? "Mixed (set per server with /rc server <id> on|off)"
|
||||
: pick == ServerSelection.Auto ? "Auto (detect)"
|
||||
: Label(servers, pick);
|
||||
|
||||
ImGuiNET.ImGui.AlignTextToFramePadding();
|
||||
SafeImGui.TextColored(Mute, "Server");
|
||||
if (tooltip != null) SafeImGui.SetItemTooltip(tooltip);
|
||||
ImGuiNET.ImGui.SameLine(90);
|
||||
ImGuiNET.ImGui.SetNextItemWidth(Math.Max(160, width - 96));
|
||||
if (ImGuiNET.ImGui.BeginCombo("##serverpick", preview))
|
||||
{
|
||||
if (ImGuiNET.ImGui.Selectable("Auto (detect)##pick_auto", pick == ServerSelection.Auto))
|
||||
Pick(ServerSelection.Auto);
|
||||
foreach (ServerState s in servers)
|
||||
{
|
||||
string marks = (s.Active ? " [active]" : string.Empty) + (s.Detected ? " [detected]" : string.Empty);
|
||||
if (ImGuiNET.ImGui.Selectable(s.Name + " (" + s.Id + ")" + marks + "##pick_" + s.Id,
|
||||
pick != null && pick.Equals(s.Id, StringComparison.OrdinalIgnoreCase)))
|
||||
Pick(s.Id);
|
||||
}
|
||||
ImGuiNET.ImGui.EndCombo();
|
||||
}
|
||||
if (tooltip != null) SafeImGui.SetItemTooltip(tooltip);
|
||||
}
|
||||
|
||||
private static void Pick(string id)
|
||||
{
|
||||
ServerSelectionStore.Apply(id, out string message);
|
||||
_message = message;
|
||||
}
|
||||
|
||||
private static void DrawTable(IReadOnlyList<ServerState> servers, IReadOnlyList<SectionManifest> manifests)
|
||||
{
|
||||
const ImGuiTableFlags flags = ImGuiTableFlags.Borders | ImGuiTableFlags.RowBg | ImGuiTableFlags.SizingStretchProp;
|
||||
if (!ImGuiNET.ImGui.BeginTable("##servers", 5, flags)) return;
|
||||
ImGuiNET.ImGui.TableSetupColumn("Server", ImGuiTableColumnFlags.WidthStretch, 2.2f);
|
||||
ImGuiNET.ImGui.TableSetupColumn("Active", ImGuiTableColumnFlags.WidthStretch, 0.9f);
|
||||
ImGuiNET.ImGui.TableSetupColumn("Detected", ImGuiTableColumnFlags.WidthStretch, 1f);
|
||||
ImGuiNET.ImGui.TableSetupColumn("Override", ImGuiTableColumnFlags.WidthStretch, 1f);
|
||||
ImGuiNET.ImGui.TableSetupColumn("Settings from", ImGuiTableColumnFlags.WidthStretch, 1.6f);
|
||||
ImGuiNET.ImGui.TableHeadersRow();
|
||||
foreach (ServerState s in servers)
|
||||
{
|
||||
ImGuiNET.ImGui.TableNextRow();
|
||||
ImGuiNET.ImGui.TableNextColumn();
|
||||
SafeImGui.TextColored(s.Active ? Teal : Mute, s.Name + " (" + s.Id + ")");
|
||||
if (!string.IsNullOrEmpty(s.Reason)) SafeImGui.SetItemTooltip(s.Reason);
|
||||
ImGuiNET.ImGui.TableNextColumn();
|
||||
SafeImGui.TextColored(s.Active ? Good : Mute, s.Active ? "yes" : "no");
|
||||
ImGuiNET.ImGui.TableNextColumn();
|
||||
SafeImGui.TextColored(Mute, s.Detected ? "yes" : "no");
|
||||
ImGuiNET.ImGui.TableNextColumn();
|
||||
SafeImGui.TextColored(s.Force == ServerForce.Auto ? Mute : Amber, ServerForceText.Name(s.Force));
|
||||
ImGuiNET.ImGui.TableNextColumn();
|
||||
string owner = ServerSelection.OwnerPlugin(manifests, s.Id, SectionRegistry.EnginePlugin);
|
||||
SafeImGui.TextColored(owner.Length > 0 ? Teal : Mute, owner.Length > 0 ? owner : "(no plugin loaded)");
|
||||
}
|
||||
ImGuiNET.ImGui.EndTable();
|
||||
}
|
||||
|
||||
private static string Label(IReadOnlyList<ServerState> servers, string id)
|
||||
{
|
||||
foreach (ServerState s in servers)
|
||||
if (s.Id.Equals(id, StringComparison.OrdinalIgnoreCase)) return s.Name + " (" + s.Id + ")";
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
|
@ -159,7 +159,7 @@ internal sealed class SettingsFace : IImGuiPanel
|
|||
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
|
||||
if (_tab >= SettingsSchema.Tabs.Length) _tab = 0;
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), Headers[_tab]);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.Accent), Headers[_tab]);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
|
||||
Vector2 lp = ImGuiNET.ImGui.GetCursorScreenPos();
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ internal sealed class SettingsRows
|
|||
bool pinned = QuickSettings.IsPinned(key);
|
||||
if (ImGuiNET.ImGui.MenuItem(pinned ? PhosphorIcons.X + " Remove from My settings" : PhosphorIcons.PushPin + " Pin to My settings"))
|
||||
QuickSettings.SetPinned(key, !pinned);
|
||||
ImGuiNET.ImGui.SetItemTooltip(pinned
|
||||
SafeImGui.SetItemTooltip(pinned
|
||||
? "Take it out of the My settings drawer on the dashboard (the setting itself doesn't change)."
|
||||
: "Add it to the My settings drawer on the dashboard, for quick changes.");
|
||||
extraMenu?.Invoke(key);
|
||||
|
|
@ -134,6 +134,7 @@ internal sealed class SettingsRows
|
|||
case SettingKind.Text: TextRow(row, w); break;
|
||||
case SettingKind.Status: StatusRow(row, w); break;
|
||||
case SettingKind.Hotkeys: _editing |= _hotkeys.Draw(w); break;
|
||||
case SettingKind.ServerPick: ServerPickSettingsUi.Draw(w, row.Tooltip); break;
|
||||
case SettingKind.Color: ColorRow(row, w); break;
|
||||
}
|
||||
}
|
||||
|
|
@ -496,16 +497,16 @@ internal sealed class SettingsRows
|
|||
private void CraftingStatus(SettingRow row)
|
||||
{
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 2));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(RynthTheme.TextMuted), row.Label);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(RynthTheme.TextMuted), row.Label);
|
||||
ImGuiNET.ImGui.SameLine(0, 6);
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
|
||||
ImGuiNET.ImGui.TextColored(RynthTheme.VecOf(_data.MissileCraftingActive ? RynthTheme.Highlight : RynthTheme.TextMuted), _data.MissileCraftingState);
|
||||
SafeImGui.TextColored(RynthTheme.VecOf(_data.MissileCraftingActive ? RynthTheme.Highlight : RynthTheme.TextMuted), _data.MissileCraftingState);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
if (!string.IsNullOrEmpty(_data.MissileCraftingStatus))
|
||||
{
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui10));
|
||||
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, TextDim);
|
||||
ImGuiNET.ImGui.TextWrapped(_data.MissileCraftingStatus);
|
||||
SafeImGui.TextWrapped(_data.MissileCraftingStatus);
|
||||
ImGuiNET.ImGui.PopStyleColor();
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
|
@ -525,7 +526,7 @@ internal sealed class SettingsRows
|
|||
|
||||
private static void Tooltip(SettingRow row)
|
||||
{
|
||||
if (row.Tooltip != null) ImGuiNET.ImGui.SetItemTooltip(row.Tooltip);
|
||||
if (row.Tooltip != null) SafeImGui.SetItemTooltip(row.Tooltip);
|
||||
}
|
||||
|
||||
private static uint Lighten(uint abgr) => Scale(abgr, 1.25f, 12);
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ internal sealed partial class SkillsFace
|
|||
Label("Last updated: " + a.Updated, Dim);
|
||||
}
|
||||
NextLine(p, 28);
|
||||
if (a.Status.Length > 0) ImGuiNET.ImGui.TextWrapped(a.Status);
|
||||
if (a.Status.Length > 0) SafeImGui.TextWrapped(a.Status);
|
||||
if (a.LastRun.Length > 0) Label("Last run: " + a.LastRun, Dim);
|
||||
|
||||
ImGuiNET.ImGui.Separator();
|
||||
|
|
@ -338,7 +338,7 @@ internal sealed partial class SkillsFace
|
|||
: $"{what}: {exact} XP.";
|
||||
if (known && !afford) tip += " Not enough unassigned XP.";
|
||||
if (a.Running) tip += " Wait for the raise run to finish.";
|
||||
ImGuiNET.ImGui.SetItemTooltip(tip);
|
||||
SafeImGui.SetItemTooltip(tip);
|
||||
}
|
||||
|
||||
/// <summary>The client's own base value for a raiser row (0 when the snapshot has none).</summary>
|
||||
|
|
@ -574,7 +574,7 @@ internal sealed partial class SkillsFace
|
|||
}
|
||||
else if (active) _augTargetEdit[row.Key] = tgt;
|
||||
else _augTargetEdit.Remove(row.Key);
|
||||
ImGuiNET.ImGui.SetItemTooltip($"Target {row.Label} level (up to {row.Cap.ToString("N0", CultureInfo.InvariantCulture)}).");
|
||||
SafeImGui.SetItemTooltip($"Target {row.Label} level (up to {row.Cap.ToString("N0", CultureInfo.InvariantCulture)}).");
|
||||
}
|
||||
|
||||
private void DrawEnlPlanner(EnlPlanner e, float w)
|
||||
|
|
@ -593,7 +593,7 @@ internal sealed partial class SkillsFace
|
|||
ImGuiNET.ImGui.SetNextItemWidth(100);
|
||||
if (ImGuiNET.ImGui.InputInt("Plan to level##prog_enlt", ref target))
|
||||
SendProg("enltarget " + Math.Max(e.Level + 1, target).ToString(CultureInfo.InvariantCulture));
|
||||
foreach (string line in e.Plan) ImGuiNET.ImGui.BulletText(line);
|
||||
foreach (string line in e.Plan) SafeImGui.BulletText(line);
|
||||
|
||||
int coinsPerToken = e.CoinsPerToken;
|
||||
ImGuiNET.ImGui.SetNextItemWidth(100);
|
||||
|
|
@ -640,7 +640,7 @@ internal sealed partial class SkillsFace
|
|||
if (ImGuiNET.ImGui.InputInt("Check every (s)##prog_every", ref every))
|
||||
SendProg("checkevery " + Math.Max(10, every).ToString(CultureInfo.InvariantCulture));
|
||||
Label(e.Armed ? "Armed." : "Disarmed.", e.Armed ? Amber : Dim);
|
||||
if (e.Status.Length > 0) ImGuiNET.ImGui.TextWrapped(e.Status);
|
||||
if (e.Status.Length > 0) SafeImGui.TextWrapped(e.Status);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
dl.AddText(new Vector2(x, y), _summaryColors[i], _summary[i]);
|
||||
if (i == _radiancePart && _masteryTip.Length > 0
|
||||
&& ImGuiNET.ImGui.IsMouseHoveringRect(new Vector2(x, y), new Vector2(x + tw, y + lineH)))
|
||||
ImGuiNET.ImGui.SetTooltip(_masteryTip);
|
||||
SafeImGui.SetTooltip(_masteryTip);
|
||||
x += tw + 14;
|
||||
}
|
||||
long now = Environment.TickCount64;
|
||||
|
|
@ -735,7 +735,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
_descending = !_descending;
|
||||
_orderDirty = true;
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(_descending ? "Highest first" : "Lowest first");
|
||||
SafeImGui.SetItemTooltip(_descending ? "Highest first" : "Lowest first");
|
||||
NextLine(p, 26);
|
||||
}
|
||||
|
||||
|
|
@ -910,7 +910,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
if (ImGuiNET.ImGui.IsItemHovered() && !expanded)
|
||||
dl.AddRect(p, p + new Vector2(w, RowH), BtnBord);
|
||||
if (r.MasteryText.Length > 0 && _masteryTip.Length > 0 && ImGuiNET.ImGui.IsMouseHoveringRect(badgeMin, badgeMax))
|
||||
ImGuiNET.ImGui.SetTooltip(r.MasteryHover);
|
||||
SafeImGui.SetTooltip(r.MasteryHover);
|
||||
|
||||
// The row's action buttons: "+1" (raise one rank now, no confirm) and a caret that
|
||||
// opens +10 / +100 / Max on trained rows, attributes and vitals; Train (skill
|
||||
|
|
@ -923,13 +923,13 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
if (Button("##raise1", r.Max ? "max" : "+1", btnMin, oneSize, Teal, BtnFill, canRaise, border: canRaise ? Teal : 0)
|
||||
&& _snap != null)
|
||||
SendRaise(r, _snap, 1);
|
||||
ImGuiNET.ImGui.SetItemTooltip(why);
|
||||
SafeImGui.SetItemTooltip(why);
|
||||
bool canMore = !r.Max && PlayerTraining.Available && !_pending;
|
||||
var caretMin = new Vector2(btnMin.X + oneSize.X + 2, btnMin.Y);
|
||||
if (IconButton("##raiseN", PhosphorIcons.CaretDown, caretMin, new Vector2(CaretW, RowH - 2), Teal, BtnFill,
|
||||
canMore, font: UiFont.Ui11))
|
||||
OpenMulti(r, caretMin + new Vector2(CaretW - MultiW, RowH));
|
||||
ImGuiNET.ImGui.SetItemTooltip(canMore ? "Raise more: +10, +100 or Max"
|
||||
SafeImGui.SetItemTooltip(canMore ? "Raise more: +10, +100 or Max"
|
||||
: r.Max ? "At the top rank" : _pending ? "Waiting for the last raise to land"
|
||||
: "Raising isn't available on this client build");
|
||||
}
|
||||
|
|
@ -938,7 +938,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
bool canTrain = CanTrain(r, out string why);
|
||||
if (Button("##train", "Train", btnMin, btnSize, Amber, BtnFill, canTrain, border: canTrain ? Amber : 0))
|
||||
OpenConfirm(r, train: true);
|
||||
ImGuiNET.ImGui.SetItemTooltip(why);
|
||||
SafeImGui.SetItemTooltip(why);
|
||||
}
|
||||
ImGuiNET.ImGui.PopID();
|
||||
NextLine(p, RowH);
|
||||
|
|
@ -1063,7 +1063,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
{
|
||||
float tw = ImGuiNET.ImGui.CalcTextSize(r.MasteryLine).X;
|
||||
if (ImGuiNET.ImGui.IsMouseHoveringRect(new Vector2(x, y), new Vector2(x + 18 + tw, y + lineH)))
|
||||
ImGuiNET.ImGui.SetTooltip(_masteryTip);
|
||||
SafeImGui.SetTooltip(_masteryTip);
|
||||
}
|
||||
y += lineH;
|
||||
if (r.MasteryLine2.Length > 0)
|
||||
|
|
@ -1083,7 +1083,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
if (Button("##mastery_raise", PhosphorIcons.Crown + " Raise mastery", new Vector2(x + 18, y), new Vector2(130, 22),
|
||||
MasteryColor, BtnFill, can, border: can ? MasteryColor : 0))
|
||||
OpenMasteryConfirm(r);
|
||||
ImGuiNET.ImGui.SetItemTooltip(can ? why + "\nAsks before it spends anything." : why);
|
||||
SafeImGui.SetItemTooltip(can ? why + "\nAsks before it spends anything." : why);
|
||||
ImGuiNET.ImGui.PopID();
|
||||
y += 26;
|
||||
}
|
||||
|
|
@ -1263,7 +1263,7 @@ internal sealed partial class SkillsFace : IImGuiPanel
|
|||
SendRaise(r, s, n);
|
||||
ImGuiNET.ImGui.CloseCurrentPopup();
|
||||
}
|
||||
ImGuiNET.ImGui.SetItemTooltip(why);
|
||||
SafeImGui.SetItemTooltip(why);
|
||||
var dl = ImGuiNET.ImGui.GetWindowDrawList();
|
||||
float tw = ImGuiNET.ImGui.CalcTextSize(right).X;
|
||||
dl.AddText(new Vector2(x + size.X - 6 - tw, y + (h - ImGuiNET.ImGui.GetFontSize()) * 0.5f), ok ? Teal : Dim, right);
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ internal sealed class VisionFace : IImGuiPanel
|
|||
{
|
||||
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
|
||||
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
|
||||
ImGuiNET.ImGui.TextColored(HeaderColor, text);
|
||||
SafeImGui.TextColored(HeaderColor, text);
|
||||
ImGuiNET.ImGui.PopFont();
|
||||
}
|
||||
|
||||
|
|
@ -251,7 +251,7 @@ internal sealed class VisionFace : IImGuiPanel
|
|||
WriteUtf8(hex, argb.ToString("X8"));
|
||||
}
|
||||
if (ImGuiNET.ImGui.IsItemDeactivatedAfterEdit()) Save(f.Key);
|
||||
ImGuiNET.ImGui.SetItemTooltip("0% = invisible, 100% = solid. Ctrl+click to type a value");
|
||||
SafeImGui.SetItemTooltip("0% = invisible, 100% = solid. Ctrl+click to type a value");
|
||||
return ImGuiNET.ImGui.IsItemActive();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ internal sealed class WorldMapFace : IImGuiPanel
|
|||
var installed = WorldMapMaps.Installed;
|
||||
if (installed.Length > 0)
|
||||
{
|
||||
ImGuiNET.ImGui.TextDisabled("Map detail" + (WorldMapMaps.CurrentLabel.Length > 0 ? ": " + WorldMapMaps.CurrentLabel : ""));
|
||||
SafeImGui.TextDisabled("Map detail" + (WorldMapMaps.CurrentLabel.Length > 0 ? ": " + WorldMapMaps.CurrentLabel : ""));
|
||||
if (ImGuiNET.ImGui.RadioButton("Best installed", WorldMapSettings.Detail.Length == 0)) { WorldMapSettings.Detail = ""; WorldMapSettings.MarkDirty(); WorldMapMaps.Apply(); }
|
||||
foreach (var t in installed)
|
||||
if (ImGuiNET.ImGui.RadioButton(t.Label, WorldMapSettings.Detail == t.Key)) { WorldMapSettings.Detail = t.Key; WorldMapSettings.MarkDirty(); WorldMapMaps.Apply(); }
|
||||
|
|
|
|||
|
|
@ -811,8 +811,8 @@ internal sealed class WorldMapView
|
|||
if (_openCtx) { ImGuiNET.ImGui.OpenPopup(_ctxId); _openCtx = false; }
|
||||
if (!ImGuiNET.ImGui.BeginPopup(_ctxId)) return;
|
||||
string where = _ctxName.Length > 0 ? _ctxName : "Map point";
|
||||
ImGuiNET.ImGui.TextColored(new Vector4(1f, 0.82f, 0.3f, 1f), where);
|
||||
ImGuiNET.ImGui.TextDisabled(RynthNavStatus.Coord(_ctxNs, _ctxEw));
|
||||
SafeImGui.TextColored(new Vector4(1f, 0.82f, 0.3f, 1f), where);
|
||||
SafeImGui.TextDisabled(RynthNavStatus.Coord(_ctxNs, _ctxEw));
|
||||
ImGuiNET.ImGui.Separator();
|
||||
if (ImGuiNET.ImGui.Selectable("Go here")) RynthNavCommands.Go(where, _ctxNs, _ctxEw);
|
||||
if (ImGuiNET.ImGui.Selectable("Route here")) RynthNavCommands.Route(where, _ctxNs, _ctxEw);
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ internal static class RynthCoreShell
|
|||
UpdateBarPositionFromWindow();
|
||||
bool auxReady = frameCount >= 120;
|
||||
|
||||
ImGui.TextColored(Win32Backend.IsUiCaptureEnabled() ? Good : TextMute, Win32Backend.IsUiCaptureEnabled() ? "UI" : "GAME");
|
||||
SafeImGui.TextColored(Win32Backend.IsUiCaptureEnabled() ? Good : TextMute, Win32Backend.IsUiCaptureEnabled() ? "UI" : "GAME");
|
||||
ShowTooltip("Press Insert to toggle UI capture.");
|
||||
|
||||
ImGui.SameLine();
|
||||
|
|
@ -708,7 +708,7 @@ internal static class RynthCoreShell
|
|||
string pluginDir = PluginManager.PluginDirectory;
|
||||
if (!string.IsNullOrEmpty(pluginDir))
|
||||
{
|
||||
ImGui.TextColored(TextMute, pluginDir);
|
||||
SafeImGui.TextColored(TextMute, pluginDir);
|
||||
}
|
||||
|
||||
if (_showPluginTips)
|
||||
|
|
@ -741,16 +741,16 @@ internal static class RynthCoreShell
|
|||
string ver = string.IsNullOrEmpty(p.VersionString) ? "" : $" v{p.VersionString}";
|
||||
ImGui.BulletText("");
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(Accent, p.DisplayName);
|
||||
SafeImGui.TextColored(Accent, p.DisplayName);
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextMute, ver);
|
||||
SafeImGui.TextColored(TextMute, ver);
|
||||
ImGui.SameLine(300f);
|
||||
ImGui.TextColored(statusColor, statusText);
|
||||
SafeImGui.TextColored(statusColor, statusText);
|
||||
|
||||
if (!string.IsNullOrEmpty(p.SourceFilePath))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextMute, $"<{p.FileName}>");
|
||||
SafeImGui.TextColored(TextMute, $"<{p.FileName}>");
|
||||
}
|
||||
|
||||
string caps = "";
|
||||
|
|
@ -761,7 +761,7 @@ internal static class RynthCoreShell
|
|||
if (caps.Length > 0)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextMute, $"[{caps.Trim()}]");
|
||||
SafeImGui.TextColored(TextMute, $"[{caps.Trim()}]");
|
||||
}
|
||||
|
||||
ImGui.PopID();
|
||||
|
|
@ -796,7 +796,7 @@ internal static class RynthCoreShell
|
|||
_selectedPlugin = i;
|
||||
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextMute, PluginStatuses[i]);
|
||||
SafeImGui.TextColored(TextMute, PluginStatuses[i]);
|
||||
ImGui.PopID();
|
||||
}
|
||||
|
||||
|
|
@ -805,8 +805,8 @@ internal static class RynthCoreShell
|
|||
|
||||
if (_selectedPlugin >= 0 && _selectedPlugin < PluginNames.Length)
|
||||
{
|
||||
ImGui.TextColored(Gold, PluginNames[_selectedPlugin]);
|
||||
ImGui.TextColored(TextMute, PluginStatuses[_selectedPlugin]);
|
||||
SafeImGui.TextColored(Gold, PluginNames[_selectedPlugin]);
|
||||
SafeImGui.TextColored(TextMute, PluginStatuses[_selectedPlugin]);
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
|
|
@ -819,7 +819,7 @@ internal static class RynthCoreShell
|
|||
|
||||
// ── Loaded plugins ──────────────────────────────────────────────────
|
||||
var loadedPlugins = PluginManager.Plugins;
|
||||
ImGui.TextColored(Accent, $"Loaded Plugins ({loadedPlugins.Count})");
|
||||
SafeImGui.TextColored(Accent, $"Loaded Plugins ({loadedPlugins.Count})");
|
||||
ImGui.Separator();
|
||||
|
||||
if (loadedPlugins.Count == 0)
|
||||
|
|
@ -838,12 +838,12 @@ internal static class RynthCoreShell
|
|||
string ver = string.IsNullOrEmpty(p.VersionString) ? "" : $" v{p.VersionString}";
|
||||
ImGui.BulletText("");
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(Accent, p.DisplayName);
|
||||
SafeImGui.TextColored(Accent, p.DisplayName);
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextMute, ver);
|
||||
SafeImGui.TextColored(TextMute, ver);
|
||||
ImGui.SameLine(280f);
|
||||
ImGui.TextColored(statusColor, statusText);
|
||||
ImGui.TextColored(TextMute, $" {p.SourceFilePath}");
|
||||
SafeImGui.TextColored(statusColor, statusText);
|
||||
SafeImGui.TextColored(TextMute, $" {p.SourceFilePath}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -859,7 +859,7 @@ internal static class RynthCoreShell
|
|||
{
|
||||
ImGui.TextColored(TextMute, "Built-in directory:");
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextDim, builtInDir);
|
||||
SafeImGui.TextColored(TextDim, builtInDir);
|
||||
}
|
||||
|
||||
ImGui.Spacing();
|
||||
|
|
@ -877,9 +877,9 @@ internal static class RynthCoreShell
|
|||
{
|
||||
ImGui.PushID($"pluginpath_{i}");
|
||||
bool exists = File.Exists(extraPaths[i]);
|
||||
ImGui.TextColored(exists ? Good : Warn, exists ? " OK" : " ??");
|
||||
SafeImGui.TextColored(exists ? Good : Warn, exists ? " OK" : " ??");
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextDim, extraPaths[i]);
|
||||
SafeImGui.TextColored(TextDim, extraPaths[i]);
|
||||
ImGui.SameLine();
|
||||
if (ImGui.SmallButton("Remove"))
|
||||
removeIdx = i;
|
||||
|
|
@ -946,34 +946,34 @@ internal static class RynthCoreShell
|
|||
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, "Combat");
|
||||
ImGui.TextWrapped($"Melee {OnOff(status.MeleeAvailable)} Missile {OnOff(status.MissileAvailable)} Mode {OnOff(status.ChangeCombatModeAvailable)} Cancel {OnOff(status.CancelAttackAvailable)} Health {OnOff(status.QueryHealthAvailable)}");
|
||||
ImGui.TextColored(TextMute, status.CombatStatus);
|
||||
SafeImGui.TextWrapped($"Melee {OnOff(status.MeleeAvailable)} Missile {OnOff(status.MissileAvailable)} Mode {OnOff(status.ChangeCombatModeAvailable)} Cancel {OnOff(status.CancelAttackAvailable)} Health {OnOff(status.QueryHealthAvailable)}");
|
||||
SafeImGui.TextColored(TextMute, status.CombatStatus);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, "Movement");
|
||||
ImGui.TextWrapped($"Move {OnOff(status.DoMovementAvailable)} Stop {OnOff(status.StopMovementAvailable)} Jump {OnOff(status.JumpNonAutonomousAvailable)} Autonomy {OnOff(status.AutonomyLevelAvailable)}");
|
||||
ImGui.TextColored(TextMute, status.MovementStatus);
|
||||
SafeImGui.TextWrapped($"Move {OnOff(status.DoMovementAvailable)} Stop {OnOff(status.StopMovementAvailable)} Jump {OnOff(status.JumpNonAutonomousAvailable)} Autonomy {OnOff(status.AutonomyLevelAvailable)}");
|
||||
SafeImGui.TextColored(TextMute, status.MovementStatus);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, "Local");
|
||||
ImGui.TextWrapped($"Autorun {OnOff(status.SetAutoRunAvailable)} TapJump {OnOff(status.TapJumpAvailable)}");
|
||||
ImGui.TextColored(TextMute, status.CommandInterpreterStatus);
|
||||
SafeImGui.TextWrapped($"Autorun {OnOff(status.SetAutoRunAvailable)} TapJump {OnOff(status.TapJumpAvailable)}");
|
||||
SafeImGui.TextColored(TextMute, status.CommandInterpreterStatus);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, "UI");
|
||||
ImGui.TextColored(TextMute, UiLifecycleHooks.StatusMessage);
|
||||
SafeImGui.TextColored(TextMute, UiLifecycleHooks.StatusMessage);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, "Chat");
|
||||
ImGui.TextColored(TextMute, ChatCallbackHooks.StatusMessage);
|
||||
SafeImGui.TextColored(TextMute, ChatCallbackHooks.StatusMessage);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, "Multi-client");
|
||||
ImGui.TextColored(TextMute, MultiClientHooks.StatusMessage);
|
||||
SafeImGui.TextColored(TextMute, MultiClientHooks.StatusMessage);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, "Lifecycle");
|
||||
ImGui.TextColored(TextMute, LoginLifecycleHooks.StatusMessage);
|
||||
SafeImGui.TextColored(TextMute, LoginLifecycleHooks.StatusMessage);
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
|
|
@ -1032,8 +1032,8 @@ internal static class RynthCoreShell
|
|||
private static void DrawMetric(in ShellMetric metric)
|
||||
{
|
||||
ImGui.BeginChild($"{metric.Label}Card", new Vector2(0f, 76f), ImGuiChildFlags.Borders);
|
||||
ImGui.TextColored(TextMute, metric.Label);
|
||||
ImGui.TextColored(metric.Color, metric.Value);
|
||||
SafeImGui.TextColored(TextMute, metric.Label);
|
||||
SafeImGui.TextColored(metric.Color, metric.Value);
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
|
|
@ -1047,14 +1047,14 @@ internal static class RynthCoreShell
|
|||
drawList.AddRectFilled(pos, pos + new Vector2(size.X + 16f, size.Y + 8f), fill, 6f);
|
||||
drawList.AddRect(pos, pos + new Vector2(size.X + 16f, size.Y + 8f), stroke, 6f);
|
||||
ImGui.SetCursorScreenPos(pos + new Vector2(8f, 4f));
|
||||
ImGui.TextColored(color, text);
|
||||
SafeImGui.TextColored(color, text);
|
||||
}
|
||||
|
||||
private static void DrawFeatureLine(string name, string state, Vector4 color)
|
||||
{
|
||||
ImGui.TextColored(TextDim, name);
|
||||
SafeImGui.TextColored(TextDim, name);
|
||||
ImGui.SameLine(190f);
|
||||
ImGui.TextColored(color, state);
|
||||
SafeImGui.TextColored(color, state);
|
||||
}
|
||||
|
||||
private static string OnOff(bool value)
|
||||
|
|
@ -1073,16 +1073,16 @@ internal static class RynthCoreShell
|
|||
|
||||
private static void DrawBulletRow(string label, string value)
|
||||
{
|
||||
ImGui.BulletText($"{label}: {value}");
|
||||
SafeImGui.BulletText($"{label}: {value}");
|
||||
}
|
||||
|
||||
private static void DrawRoadmapStep(string index, string title, string body, Vector4 color)
|
||||
{
|
||||
ImGui.BeginChild($"Roadmap{index}", new Vector2(0f, 68f), ImGuiChildFlags.Borders);
|
||||
ImGui.TextColored(color, $"Step {index}");
|
||||
SafeImGui.TextColored(color, $"Step {index}");
|
||||
ImGui.SameLine();
|
||||
ImGui.TextColored(TextDim, title);
|
||||
ImGui.TextWrapped(body);
|
||||
SafeImGui.TextColored(TextDim, title);
|
||||
SafeImGui.TextWrapped(body);
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
|
|
@ -1158,13 +1158,13 @@ internal static class RynthCoreShell
|
|||
ImGui.TableNextRow();
|
||||
|
||||
ImGui.TableSetColumnIndex(0);
|
||||
ImGui.TextColored(isKnown ? TextMute : Accent, $"0x{opcode:X4}");
|
||||
SafeImGui.TextColored(isKnown ? TextMute : Accent, $"0x{opcode:X4}");
|
||||
|
||||
ImGui.TableSetColumnIndex(1);
|
||||
ImGui.TextColored(TextDim, entry.Count.ToString());
|
||||
SafeImGui.TextColored(TextDim, entry.Count.ToString());
|
||||
|
||||
ImGui.TableSetColumnIndex(2);
|
||||
ImGui.TextColored(TextDim, entry.LastPayloadLen.ToString());
|
||||
SafeImGui.TextColored(TextDim, entry.LastPayloadLen.ToString());
|
||||
|
||||
ImGui.TableSetColumnIndex(3);
|
||||
if (entry.LastSample is { Length: > 0 })
|
||||
|
|
@ -1176,7 +1176,7 @@ internal static class RynthCoreShell
|
|||
sb.Append(b.ToString("X2"));
|
||||
sb.Append(' ');
|
||||
}
|
||||
ImGui.TextColored(TextMute, sb.ToString().TrimEnd());
|
||||
SafeImGui.TextColored(TextMute, sb.ToString().TrimEnd());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1186,7 +1186,7 @@ internal static class RynthCoreShell
|
|||
if (visibleCount == 0)
|
||||
{
|
||||
ImGui.Spacing();
|
||||
ImGui.TextColored(TextMute, snapshot.Length == 0
|
||||
SafeImGui.TextColored(TextMute, snapshot.Length == 0
|
||||
? "No packets captured yet — join a server and traffic will appear here."
|
||||
: "All captured opcodes filtered. Toggle 'Show Known' / 'Show Unknown' to see them.");
|
||||
}
|
||||
|
|
|
|||
44
src/RynthCore.Engine/ImGui/SafeImGui.cs
Normal file
44
src/RynthCore.Engine/ImGui/SafeImGui.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// ============================================================================
|
||||
// RynthCore.Engine - ImGui/SafeImGui.cs
|
||||
// ImGui text calls for text that isn't a literal: chat lines, item, monster and
|
||||
// player names, plugin and script text, server replies, interpolated strings.
|
||||
//
|
||||
// ImGui.NET passes the string of Text / TextColored / TextWrapped /
|
||||
// TextDisabled / BulletText / SetTooltip / SetItemTooltip / LabelText to
|
||||
// native ImGui as a printf format with no arguments, so a '%' in it reads
|
||||
// arguments that were never passed (garbage, or a crash on %s / %n). These
|
||||
// wrappers double every '%' so the text draws exactly as given. Same
|
||||
// signatures as ImGui's, so a call site only changes "ImGui." to "SafeImGui.".
|
||||
// In the root namespace so every engine namespace sees it. Render thread only.
|
||||
// ============================================================================
|
||||
|
||||
using System.Numerics;
|
||||
|
||||
namespace RynthCore.Engine;
|
||||
|
||||
internal static class SafeImGui
|
||||
{
|
||||
/// <summary>The text as a printf format that prints it unchanged ('%' doubled); null is empty.</summary>
|
||||
internal static string Escape(string? text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text)) return string.Empty;
|
||||
return text.IndexOf('%') < 0 ? text : text.Replace("%", "%%");
|
||||
}
|
||||
|
||||
public static void Text(string? text) => ImGuiNET.ImGui.Text(Escape(text));
|
||||
|
||||
public static void TextColored(Vector4 color, string? text) => ImGuiNET.ImGui.TextColored(color, Escape(text));
|
||||
|
||||
public static void TextWrapped(string? text) => ImGuiNET.ImGui.TextWrapped(Escape(text));
|
||||
|
||||
public static void TextDisabled(string? text) => ImGuiNET.ImGui.TextDisabled(Escape(text));
|
||||
|
||||
public static void BulletText(string? text) => ImGuiNET.ImGui.BulletText(Escape(text));
|
||||
|
||||
public static void SetTooltip(string? text) => ImGuiNET.ImGui.SetTooltip(Escape(text));
|
||||
|
||||
public static void SetItemTooltip(string? text) => ImGuiNET.ImGui.SetItemTooltip(Escape(text));
|
||||
|
||||
/// <summary>The label is drawn as text, not used as a format; only the value is escaped.</summary>
|
||||
public static void LabelText(string label, string? text) => ImGuiNET.ImGui.LabelText(label, Escape(text));
|
||||
}
|
||||
Loading…
Reference in a new issue