Snapshot for release 2026.10.8.1 (internal e654aa5)
This commit is contained in:
parent
cfcab27d0d
commit
650915dadc
26 changed files with 1154 additions and 30 deletions
|
|
@ -690,7 +690,11 @@ internal static class EngineFrameController
|
|||
// too (ImGuiTextFocus): the keys typed right after the click stay out of AC.
|
||||
ImGuiTextFocus.EndMainFrame(io.WantTextInput);
|
||||
bool typing = io.WantTextInput || ImGuiTextFocus.MainBoxActive;
|
||||
Win32Backend.UpdateCaptureFlags(io.WantCaptureMouse || Hud.MonsterHud.WantsMouse, typing);
|
||||
// A plate that is only hovered lets the mouse moves through, so AC's own
|
||||
// mouse-over stays current (MonsterHud.MouseMovesToGame, Compatibility/AcMouseOver).
|
||||
Win32Backend.UpdateCaptureFlags(io.WantCaptureMouse || Hud.MonsterHud.WantsMouse, typing,
|
||||
mouseMovesToGame: !io.WantCaptureMouse && Hud.MonsterHud.MouseMovesToGame);
|
||||
Compatibility.AcMouseOver.Tick(); // /rc acmouse watch, when on
|
||||
// The UI is released (Insert): no text box keeps the keyboard. Keys are not
|
||||
// gated by the toggle any more (Win32Backend.UpdateCaptureFlags), so the edit
|
||||
// ends instead and the next keys go to the game.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
// on a plate and no ImGui panel is under it, WantsMouse asks the game window
|
||||
// to keep that click from AC (EngineFrameController ORs it into the capture
|
||||
// flags), and the press selects the plate's monster through the main-thread
|
||||
// overlay-select slot. Every other click still goes to the game.
|
||||
// overlay-select slot. Every other click still goes to the game - including
|
||||
// one on an AC window that covers a plate: a plate only counts where AC's own
|
||||
// mouse-over is the 3D world (Compatibility/AcMouseOver), and while a plate
|
||||
// is only hovered the mouse moves still reach AC (MouseMovesToGame) so that
|
||||
// answer follows the cursor.
|
||||
//
|
||||
// Two rates:
|
||||
// Update (AC's render thread, before the ImGui frame): at most 4x a second
|
||||
|
|
@ -222,6 +226,13 @@ internal static class MonsterHud
|
|||
/// </summary>
|
||||
public static bool WantsMouse => _wantsMouse || PlayerPlate.WantsMouse;
|
||||
|
||||
/// <summary>
|
||||
/// The plates want the mouse only because one is under the cursor (no press held, no
|
||||
/// self-plate drag): mouse moves still go to AC then, so AC's own mouse-over (what
|
||||
/// AcMouseOver reads) follows the cursor onto a window that covers the plate.
|
||||
/// </summary>
|
||||
public static bool MouseMovesToGame => _wantsMouse && _pressId == 0 && !PlayerPlate.WantsMouse;
|
||||
|
||||
/// <summary>Plates being tracked (diagnostics).</summary>
|
||||
public static int PlateCount => Plates.Count;
|
||||
|
||||
|
|
@ -712,6 +723,7 @@ internal static class MonsterHud
|
|||
public long Now;
|
||||
public float UiScale;
|
||||
public ImDrawListPtr Dl;
|
||||
public bool UnderUi; // Dl is UnderUiLayer's (under AC's windows), not the background list
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -773,7 +785,8 @@ internal static class MonsterHud
|
|||
// plates (UnderUiLayer). The background list (over AC's UI) only if the
|
||||
// layer isn't available.
|
||||
f.Dl = UnderUiLayer.BeginBuild(display);
|
||||
if (!UnderUiLayer.IsBuilding) f.Dl = ImGuiNET.ImGui.GetBackgroundDrawList();
|
||||
f.UnderUi = UnderUiLayer.IsBuilding;
|
||||
if (!f.UnderUi) f.Dl = ImGuiNET.ImGui.GetBackgroundDrawList();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -933,7 +946,7 @@ internal static class MonsterHud
|
|||
}
|
||||
|
||||
// ── Click-to-select: which plate is under the cursor, and a press on it ──
|
||||
PlateClick(f.UiScale);
|
||||
PlateClick(f.UiScale, f.UnderUi);
|
||||
|
||||
// ── Paint: farthest first, nearest (and the target) on top ──
|
||||
for (int i = DrawOrder.Count - 1; i >= 0; i--)
|
||||
|
|
@ -1103,8 +1116,12 @@ internal static class MonsterHud
|
|||
/// (Win32Backend.MouseCaptured) were up, so AC never saw it. The press selects at
|
||||
/// once (as a click in the 3D world does) and the capture stays until the button
|
||||
/// is released, so the release never reaches AC either. One select per press.
|
||||
/// Drawn under AC's windows (<paramref name="underUi"/>), a plate only counts where
|
||||
/// AC itself has the 3D world under the cursor (AcMouseOver): where one of AC's
|
||||
/// windows covers it (inventory, chat, radar, the selected-object bar...) the
|
||||
/// click is AC's. AC's UI state unreadable: the plate counts, as before.
|
||||
/// </summary>
|
||||
private static void PlateClick(float uiScale)
|
||||
private static void PlateClick(float uiScale, bool underUi)
|
||||
{
|
||||
uint prevHover = _hoverId; // the plate whose hover put the capture up for this frame's input
|
||||
_hoverId = 0;
|
||||
|
|
@ -1123,6 +1140,14 @@ internal static class MonsterHud
|
|||
}
|
||||
}
|
||||
|
||||
// A plate (or last frame's, for a press that slipped off it) under one of AC's windows:
|
||||
// no capture, no select. Only asked when a plate could take the mouse (one read per frame).
|
||||
if (usable && underUi && (_hoverId != 0 || (_pressId == 0 && prevHover != 0)) && AcWindowUnderCursor())
|
||||
{
|
||||
_hoverId = 0;
|
||||
prevHover = 0;
|
||||
}
|
||||
|
||||
if (_pressId == 0)
|
||||
{
|
||||
// The press went where last frame's hover sent it: if the cursor slipped off
|
||||
|
|
@ -1144,6 +1169,22 @@ internal static class MonsterHud
|
|||
_wantsMouse = _hoverId != 0 || _pressId != 0;
|
||||
}
|
||||
|
||||
private static int _leftToAcLogged;
|
||||
|
||||
/// <summary>AC's own UI has one of its windows under the cursor (not the 3D world). AC's main thread.</summary>
|
||||
private static bool AcWindowUnderCursor()
|
||||
{
|
||||
AcMouseOver.Sample s = AcMouseOver.Read();
|
||||
if (AcMouseOverRules.UnderUiOverlayMayTakeClick(s.Target))
|
||||
return false;
|
||||
if (_leftToAcLogged < 3)
|
||||
{
|
||||
_leftToAcLogged++;
|
||||
RynthLog.UI($"MonsterHud: a plate is under AC's UI element 0x{s.ElementId:X8} (type 0x{s.Type:X8}) - its click stays with AC.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>Text width at <paramref name="size"/> px. No font push: this runs outside any window.</summary>
|
||||
internal static float TextWidth(ImFontPtr font, float size, string text) =>
|
||||
font.CalcTextSizeA(size, float.MaxValue, 0f, text).X;
|
||||
|
|
@ -1581,6 +1622,7 @@ internal static class MonsterHud
|
|||
$"weakness data {(_weakByWcid.Count + _weakByName.Count > 0 ? "loaded" : "none")}.",
|
||||
PlateDebuffs.Describe(),
|
||||
PlayerPlate.Describe() + " " + CombatText.Describe(),
|
||||
AcMouseOver.Describe(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@
|
|||
//
|
||||
// The input line belongs to ChatModel (UI/Data/ChatData.cs): Win32Backend
|
||||
// turns the chat keys into ChatModel edits on AC's thread, which is also
|
||||
// this face's thread. Clicking the box starts typing, like Enter.
|
||||
// this face's thread. Clicking the box starts typing, like Enter. While
|
||||
// typing, Ctrl+V pastes and Ctrl+C / Ctrl+X copy / cut the whole line;
|
||||
// /r and /rt reply and retell (TellMemory).
|
||||
//
|
||||
// The panel has no strip under the body for the resize grip (PanelSpec.
|
||||
// GripInBody): the input row stops short of the bottom-right corner by
|
||||
|
|
@ -639,7 +641,7 @@ internal sealed class ChatFace : IImGuiPanel
|
|||
ImGuiNET.ImGui.SetCursorScreenPos(p);
|
||||
if (ImGuiNET.ImGui.InvisibleButton("##chat_input", new Vector2(boxW, h)))
|
||||
ChatModel.BeginTyping();
|
||||
if (!typing && ChatHooks.RynthChatOwnsChat) ImGuiNET.ImGui.SetItemTooltip("Click or press Enter to chat");
|
||||
if (!typing && ChatHooks.RynthChatOwnsChat) ImGuiNET.ImGui.SetItemTooltip("Click or press Enter to chat (Ctrl+V pastes; /r replies, /rt retells)");
|
||||
dl.AddRectFilled(p, p + new Vector2(boxW, h), InputBg, 3);
|
||||
dl.AddRect(p, p + new Vector2(boxW, h), typing ? InputActive : InputBorder, 3);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@
|
|||
//
|
||||
// item its name and the profile the rule goes to
|
||||
// match name + class (default), name only, items like this
|
||||
// T11 "Include T11 attributes": also require the item's T11 tier,
|
||||
// grade, damage %, modifiers, slot special and Cast on Strike,
|
||||
// each at least this item's (any match; 2026-10-07)
|
||||
// action Keep, Keep # (with the count), Salvage, Sell, Read
|
||||
// name the rule's name (empty: RynthAi's default, "Keep Copper Pea")
|
||||
// preview the rule in words, where it goes in the list and why, notes
|
||||
|
|
@ -48,6 +51,7 @@ internal sealed class LootAddDialog
|
|||
|
||||
// What the popup asks for (0 / -1 = RynthAi's default).
|
||||
private int _match, _action, _keep = -1;
|
||||
private bool _includeT11;
|
||||
private readonly byte[] _name = new byte[128];
|
||||
private int _keepEdit = 1;
|
||||
|
||||
|
|
@ -88,6 +92,7 @@ internal sealed class LootAddDialog
|
|||
_match = 0;
|
||||
_action = 0;
|
||||
_keep = -1;
|
||||
_includeT11 = false;
|
||||
Array.Clear(_name);
|
||||
_draft = null;
|
||||
_adding = false;
|
||||
|
|
@ -113,7 +118,7 @@ internal sealed class LootAddDialog
|
|||
Item = new LootEditItemRequestDto
|
||||
{
|
||||
ItemId = _itemId, Match = _match, Action = _action, KeepCount = _keep,
|
||||
RuleName = Utf8(_name).Trim(), ToOpenProfile = _toOpenProfile, Seq = _seq,
|
||||
RuleName = Utf8(_name).Trim(), ToOpenProfile = _toOpenProfile, IncludeT11 = _includeT11, Seq = _seq,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -255,6 +260,24 @@ internal sealed class LootAddDialog
|
|||
if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(MatchTips[i]);
|
||||
}
|
||||
|
||||
// T11 attributes. Shown for every item: a non-T11 item answers with a note saying so.
|
||||
bool t11 = _includeT11;
|
||||
if (ImGuiNET.ImGui.Checkbox("Include T11 attributes##la_t11", ref t11))
|
||||
{
|
||||
_includeT11 = t11;
|
||||
changed = true;
|
||||
}
|
||||
if (ImGuiNET.ImGui.IsItemHovered())
|
||||
ImGuiNET.ImGui.SetTooltip(
|
||||
"Also require this item's T11 tier, weapon grade, damage %, every modifier, slot special\n" +
|
||||
"and Cast on Strike, each at least as good as this one. Works with any match.\n" +
|
||||
"Not added: Can Wield (depends on your character) and Zone Locked (depends on where it was assessed).");
|
||||
if (!d.IsT11)
|
||||
{
|
||||
ImGuiNET.ImGui.SameLine();
|
||||
ImGuiNET.ImGui.TextDisabled("(not a T11 item)");
|
||||
}
|
||||
|
||||
// Action.
|
||||
ImGuiNET.ImGui.TextDisabled("Action:");
|
||||
for (int i = 0; i < ActionIds.Length; i++)
|
||||
|
|
|
|||
|
|
@ -554,19 +554,45 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
|||
|
||||
// ── Footer: FPS | version | uptime ─────────────────────────────────────
|
||||
|
||||
private static string Clock(TimeSpan t) =>
|
||||
t.TotalHours >= 1 ? $"{(int)t.TotalHours}:{t.Minutes:D2}:{t.Seconds:D2}" : $"{t.Minutes}:{t.Seconds:D2}";
|
||||
|
||||
private static DateTime _clientStartedUtc = DateTime.MinValue;
|
||||
private static bool _clientStartRead;
|
||||
|
||||
/// <summary>When acclient.exe started (read once; MinValue if Windows won't say).</summary>
|
||||
private static DateTime ClientStartedUtc()
|
||||
{
|
||||
if (_clientStartRead) return _clientStartedUtc;
|
||||
_clientStartRead = true;
|
||||
try
|
||||
{
|
||||
using var p = System.Diagnostics.Process.GetCurrentProcess();
|
||||
_clientStartedUtc = p.StartTime.ToUniversalTime();
|
||||
}
|
||||
catch { _clientStartedUtc = DateTime.MinValue; }
|
||||
return _clientStartedUtc;
|
||||
}
|
||||
|
||||
private void Footer(RynthAiView? view, float x0, float width)
|
||||
{
|
||||
int fps = (int)MathF.Round(D3D9.EndSceneHook.MeasuredFps);
|
||||
if (fps != _fpsShown) { _fpsShown = fps; _fpsText = fps > 0 ? $"FPS {fps}" : "FPS —"; }
|
||||
// Bot: since this engine loaded (a hot reload restarts it). Client: since the game client
|
||||
// started (2026-10-08), which a reload doesn't touch.
|
||||
DateTime started = EntryPoint.InitStartedUtc;
|
||||
if (started != DateTime.MinValue)
|
||||
{
|
||||
TimeSpan up = DateTime.UtcNow - started;
|
||||
DateTime now = DateTime.UtcNow;
|
||||
TimeSpan up = now - started;
|
||||
long secs = (long)up.TotalSeconds;
|
||||
if (secs != _upShown)
|
||||
{
|
||||
_upShown = secs;
|
||||
_upText = up.TotalHours >= 1 ? $"Up {(int)up.TotalHours}:{up.Minutes:D2}:{up.Seconds:D2}" : $"Up {up.Minutes}:{up.Seconds:D2}";
|
||||
DateTime client = ClientStartedUtc();
|
||||
_upText = client != DateTime.MinValue
|
||||
? $"Bot {Clock(up)} Client {Clock(now - client)}"
|
||||
: $"Up {Clock(up)}";
|
||||
}
|
||||
}
|
||||
var dl = ImGuiNET.ImGui.GetWindowDrawList();
|
||||
|
|
|
|||
|
|
@ -403,6 +403,10 @@ internal static unsafe class Win32Backend
|
|||
private static readonly Queue<QueuedInputMessage> _pendingInput = new();
|
||||
private static volatile bool _wantCaptureMouse;
|
||||
private static volatile bool _wantCaptureKeyboard;
|
||||
/// <summary>The mouse capture is only a nameplate under the cursor (MonsterHud.MouseMovesToGame):
|
||||
/// WM_MOUSEMOVE still reaches AC, so AC's own mouse-over follows the cursor (Compatibility/AcMouseOver).
|
||||
/// Means nothing while _wantCaptureMouse is false.</summary>
|
||||
private static volatile bool _mouseMovesToGame;
|
||||
|
||||
/// <summary>
|
||||
/// True while the game window eats mouse input for the ImGui layer: the capture
|
||||
|
|
@ -479,6 +483,12 @@ internal static unsafe class Win32Backend
|
|||
public static Action? OnChatUp;
|
||||
/// <summary>Fired on VK_DOWN while capture is active (history next).</summary>
|
||||
public static Action? OnChatDown;
|
||||
/// <summary>Fired on Ctrl+V / Shift+Insert while capture is active.</summary>
|
||||
public static Action? OnChatPaste;
|
||||
/// <summary>Fired on Ctrl+C / Ctrl+Insert while capture is active.</summary>
|
||||
public static Action? OnChatCopy;
|
||||
/// <summary>Fired on Ctrl+X while capture is active.</summary>
|
||||
public static Action? OnChatCut;
|
||||
private static int _lastPanelClientX; // last game-client pos over the panel (for wheel)
|
||||
private static int _lastPanelClientY;
|
||||
|
||||
|
|
@ -684,8 +694,9 @@ internal static unsafe class Win32Backend
|
|||
bool insertDown = (GetAsyncKeyState(VK_INSERT) & 0x8000) != 0;
|
||||
// GetAsyncKeyState reads the physical key whatever window has focus: without
|
||||
// the focus test, Insert (or Shift/Ctrl+Insert paste/copy) pressed in another
|
||||
// client or app flipped this client's capture off unseen.
|
||||
if (insertDown && !_insertWasDown && _hasFocus)
|
||||
// client or app flipped this client's capture off unseen. Not while typing in
|
||||
// RynthChat: there Shift/Ctrl+Insert are paste/copy.
|
||||
if (insertDown && !_insertWasDown && _hasFocus && !ChatCaptureActive)
|
||||
{
|
||||
_uiCaptureEnabled = !_uiCaptureEnabled;
|
||||
RynthLog.Render($"Win32Backend: ImGui capture {(_uiCaptureEnabled ? "ENABLED" : "DISABLED")} (Insert)");
|
||||
|
|
@ -868,7 +879,13 @@ internal static unsafe class Win32Backend
|
|||
else if (msg == WM_KEYDOWN)
|
||||
{
|
||||
int vk = (int)wParam;
|
||||
if (vk == VK_RETURN && !IsExtendedKey(lParam)) { ChatCaptureActive = false; _swallowEnterTail = true; PostMessage(_gameHwnd, WM_RYNTHCORE_CHAT, IntPtr.Zero, IntPtr.Zero); }
|
||||
// Clipboard keys. Their WM_CHARs (Ctrl+V is 0x16, Ctrl+C 0x03) are
|
||||
// control characters the branch above drops, so paste did nothing.
|
||||
bool ctrl = (GetKeyState(VK_CONTROL) & 0x8000) != 0, shift = (GetKeyState(VK_SHIFT) & 0x8000) != 0;
|
||||
if ((ctrl && vk == 'V') || (shift && !ctrl && vk == VK_INSERT)) { OnChatPaste?.Invoke(); }
|
||||
else if (ctrl && (vk == 'C' || vk == VK_INSERT)) { OnChatCopy?.Invoke(); }
|
||||
else if (ctrl && vk == 'X') { OnChatCut?.Invoke(); }
|
||||
else if (vk == VK_RETURN && !IsExtendedKey(lParam)) { ChatCaptureActive = false; _swallowEnterTail = true; PostMessage(_gameHwnd, WM_RYNTHCORE_CHAT, IntPtr.Zero, IntPtr.Zero); }
|
||||
else if (vk == VK_ESCAPE) { ChatCaptureActive = false; _swallowEnterTail = true; OnChatCancel?.Invoke(); }
|
||||
else if (vk == VK_BACK) { OnChatBackspace?.Invoke(); }
|
||||
else if (vk == VK_DELETE) { OnChatDelete?.Invoke(); }
|
||||
|
|
@ -1038,7 +1055,9 @@ internal static unsafe class Win32Backend
|
|||
|
||||
// ImGui wants the mouse (io.WantCaptureMouse): eat it, unless the held
|
||||
// buttons were pressed for the game (see _heldButtonsBelongToGame).
|
||||
if (_wantCaptureMouse && IsMouseMessage(msg) && !_heldButtonsBelongToGame)
|
||||
// A nameplate that is only hovered keeps the clicks but not the moves.
|
||||
if (_wantCaptureMouse && IsMouseMessage(msg) && !_heldButtonsBelongToGame
|
||||
&& !(msg == WM_MOUSEMOVE && _mouseMovesToGame))
|
||||
return IntPtr.Zero;
|
||||
|
||||
// An ImGui text box is being typed in (io.WantTextInput): keep keys from
|
||||
|
|
@ -1523,10 +1542,14 @@ internal static unsafe class Win32Backend
|
|||
/// box left open with the gate shut typed into the box AND the game. A key that
|
||||
/// reaches the game WndProc means AC has keyboard focus anyway; Insert-off ends
|
||||
/// the text edit instead (EngineFrameController), so keys go back to the game.
|
||||
///
|
||||
/// <paramref name="mouseMovesToGame"/>: the mouse is wanted only by a nameplate under
|
||||
/// the cursor (no ImGui window, no press held); its clicks are eaten, its moves are not.
|
||||
/// </summary>
|
||||
public static void UpdateCaptureFlags(bool wantMouse, bool wantTextInput)
|
||||
public static void UpdateCaptureFlags(bool wantMouse, bool wantTextInput, bool mouseMovesToGame = false)
|
||||
{
|
||||
bool live = _uiCaptureEnabled && _hasFocus;
|
||||
_mouseMovesToGame = mouseMovesToGame;
|
||||
_wantCaptureMouse = live && wantMouse;
|
||||
_wantCaptureKeyboard = wantTextInput;
|
||||
ImGuiTextInputActive = wantTextInput;
|
||||
|
|
|
|||
Loading…
Reference in a new issue