diff --git a/Changelog/2026-10-15-borderless-restore-chrome-2026.10.5.67.md b/Changelog/2026-10-15-borderless-restore-chrome-2026.10.5.67.md new file mode 100644 index 0000000..79d2694 --- /dev/null +++ b/Changelog/2026-10-15-borderless-restore-chrome-2026.10.5.67.md @@ -0,0 +1,29 @@ +# 2026.10.5.67 - Borderless Windowed: restore title bar when turning off + +Previous release: 2026.10.5.66. + +## Bug + +Turning **Borderless Windowed** off did not bring back the Asheron's Call title bar +and borders — especially when the client was maximized (or otherwise filled the +monitor). `IsLikelyExclusiveFullscreen` treated that maximized borderless frame as +exclusive fullscreen and skipped the restore path, so chrome stayed gone. Turning +the setting back on then did nothing useful. + +Seen on Silentkelpie (pid 34764 / earlier 55676): log showed `borderless windowed on` +and never `window borders restored`. + +## Fix + +- Do not block chrome restore for maximized borderless windows we stripped. +- Only skip applying borderless when the client already looks like true exclusive + fullscreen and we have not already taken chrome off. +- If the saved style was lost (hot reload) or already lacked a caption, rebuild + chrome with the full border mask so Off still heals a stuck window. +- Settings toggle uses the same HWND resolver as Tick. + +## Test plan + +- [ ] Windowed AC: Borderless on → chrome gone; off → title bar and borders return. +- [ ] Maximized windowed: same on/off cycle restores chrome. +- [ ] Exclusive fullscreen: Borderless toggle does not fight the client. diff --git a/Changelog/2026-10-15-display-borderless-remember-layout-2026.10.5.65.md b/Changelog/2026-10-15-display-borderless-remember-layout-2026.10.5.65.md new file mode 100644 index 0000000..c21aeac --- /dev/null +++ b/Changelog/2026-10-15-display-borderless-remember-layout-2026.10.5.65.md @@ -0,0 +1,41 @@ +# 2026.10.5.65 - Settings > Display: borderless windowed and remember layout + +Previous release: 2026.10.5.64. + +## Change + +Under **Settings > Display**: + +- **Borderless Windowed** — strips the Asheron's Call title bar and borders while + staying windowed (exclusive fullscreen is left alone). Stored in `engine.json` + as `BorderlessWindowed` (default off); applies to every client on this PC. +- **Remember Open Windows and Positions** — when on (default), reopen Rynth panels + where you left them, keep Vision HUD / `imgui.ini` layout, and restore the AC + window position across launches. When off, do not overwrite `panel_state.txt` or + reopen panels / AC placement from the last session (`RememberWindowLayout` in + `engine.json`). +- **Save Layout Now** — writes open panels, AC window placement, Vision self-plate, + and ImGui window positions to disk immediately. + +## Files + +| Area | Notes | +|---|---| +| `UI/AcWindowChrome.cs` | New: GWL_STYLE borderless + `ac_window.txt` placement | +| `Plugins/EngineSettings.cs` | `BorderlessWindowed`, `RememberWindowLayout` | +| `UI/Data/SettingsData.cs` | Display rows; `SettingKind.Color` (was missing on this branch) | +| `UI/PanelStateStore.cs` | Gate saves; `Flush()` for Save Now | +| `ImGui/ImGuiPanelHost.cs` / `UI/AvaloniaOverlay.cs` | Skip restore when remember is off | +| `ImGui/EngineFrameController.cs` | Throttled `AcWindowChrome.Tick` | + +Also restored a few files that were already broken on `build-comp-10-11` so the +engine could compile again (`SettingsFace`, `ImGuiBar` DrawControls/BarMenu, +`RynthAiFace`, `MiniRemoteFace` + `.Sections`) from aelrynth `main`. + +## Test plan + +- [ ] Windowed AC: toggle Borderless Windowed on/off; chrome hides and returns. +- [ ] Exclusive fullscreen: toggle does not break the client. +- [ ] Arrange panels, Save Layout Now, restart client with Remember on: panels reopen. +- [ ] Remember off: rearrange panels, restart: previous saved layout is not overwritten; + panels do not force-reopen from disk. diff --git a/Changelog/2026-10-15-loot-picker-filter-2026.10.5.66.md b/Changelog/2026-10-15-loot-picker-filter-2026.10.5.66.md new file mode 100644 index 0000000..cb6919a --- /dev/null +++ b/Changelog/2026-10-15-loot-picker-filter-2026.10.5.66.md @@ -0,0 +1,19 @@ +# 2026.10.5.66 - Loot editor pickers: type-to-filter + +Previous release: 2026.10.5.65. + +## Change + +The shared ImGui `FaceKit.Picker` (loot face key/value lists, and any other face +using it) shows a **Type to filter…** box when the list has 12 or more items. +Players can type part of a name (e.g. `olth` for Olthoi) instead of scrolling +long lists such as **Slayer Type** creature names, materials, or long keys. + +Filter is case-insensitive substring match; empty filter shows the full list. +Selecting still returns the original list index to the caller. + +## Pair with + +RynthSuite loot vocab rename: long key 166 displays as **Slayer Type** with an +A–Z creature-type value table (see Suite changelog +`2026-10-15-loot-slayer-type-picker.md`). diff --git a/Changelog/2026-10-15-vaulted-dungeons-options-nav-2026.10.5.68.md b/Changelog/2026-10-15-vaulted-dungeons-options-nav-2026.10.5.68.md new file mode 100644 index 0000000..8a35032 --- /dev/null +++ b/Changelog/2026-10-15-vaulted-dungeons-options-nav-2026.10.5.68.md @@ -0,0 +1,17 @@ +# Options > Navigation > Vaulted Dungeons (2026.10.5.68) + +Date: 2026-10-15 +Previous release: 2026.10.5.67 + +## What + +Adds an Options > Navigation checkbox **Vaulted Dungeons** (under Infinite Leaftide). When on, +RynthAi shows RynthILT's Mini Remote "Vaulted Dungeons" tab on ILT / ACECustom worlds. + +Also: ChatData.ChannelForType maps chat type 0x1C (28) to Channels so ILT Trade/General lines +match RynthChat's classifier. + +## Files + +- UI/Data/SettingsData.cs — EnableVaultedDungeons + Navigation schema row +- UI/Data/ChatData.cs — type 0x1C → Channels diff --git a/Changelog/2026-10-16-hotbuild-local-2026.10.5.69.md b/Changelog/2026-10-16-hotbuild-local-2026.10.5.69.md new file mode 100644 index 0000000..01e5a25 --- /dev/null +++ b/Changelog/2026-10-16-hotbuild-local-2026.10.5.69.md @@ -0,0 +1,12 @@ +# RynthCore 2026.10.5.69 — local hotbuild (tonight) + +Date: 2026-10-16 +Engine: 2026.10.5.69 (previous 2026.10.5.68) + +## Included from local (build-comp-10-11) + +- Options > Navigation > Vaulted Dungeons checkbox (`EnableVaultedDungeons`). +- Chat type 0x1C (28) → Channels (ILT/ACECustom `[Trade]`/`[General]`). +- Borderless / chrome restore and related display layout work from 2026-10-15 changelogs (.65–.67), carried forward in this compile. + +Hot-deployed to `C:\Games\RynthCore` with matching Suite plugins (see Suite changelog). diff --git a/Changelog/2026-10-16-runtime-borderless-display-2026.10.5.70.md b/Changelog/2026-10-16-runtime-borderless-display-2026.10.5.70.md new file mode 100644 index 0000000..ac94694 --- /dev/null +++ b/Changelog/2026-10-16-runtime-borderless-display-2026.10.5.70.md @@ -0,0 +1,26 @@ +# 2026.10.5.70 - CoreCLR Runtime deploy: Settings > Display borderless / layout + +Previous release: 2026.10.5.69. + +## Why you could not see them + +Live clients load the engine from `C:\Games\RynthCore\Runtime\` (CoreCLR host), +not the NativeAOT `C:\Games\RynthCore\RynthCore.Engine.dll`. Earlier hotbuilds +only updated the AOT copy. Runtime was still **2026.10.15.7**, which had no +**Borderless Windowed**, **Remember Open Windows and Positions**, or **Save Layout Now**. + +## Fix + +Published the local engine as CoreCLR (`-p:EngineHost=coreclr`) and copied it to +`Runtime\RynthCore.Engine.dll` as **2026.10.5.70**, including the Display rows from +2026.10.5.65–.67. + +## Where to look + +**Settings > Display** (Advanced Settings > Display): + +- Borderless Windowed +- Remember Open Windows and Positions +- Save Layout Now + +Hot reload should pick up the new Runtime DLL; otherwise reinject. diff --git a/Changelog/2026-10-16-sk-tonight-port-2026.10.5.71.md b/Changelog/2026-10-16-sk-tonight-port-2026.10.5.71.md new file mode 100644 index 0000000..e305dfa --- /dev/null +++ b/Changelog/2026-10-16-sk-tonight-port-2026.10.5.71.md @@ -0,0 +1,17 @@ +# 2026.10.5.71 - SK port: Display chrome + Vaulted Dungeons Options gate + +Previous release: 2026.10.5.70. + +## Summary + +Standing `sk` branch now carries tonight's local engine work for upstream release prep: + +- **Settings > Display**: Borderless Windowed, Remember Open Windows and Positions, Save Layout Now (`AcWindowChrome`, EngineSettings, PanelStateStore). +- **Settings > Navigation > Vaulted Dungeons**: Options checkbox (default off) that gates the Mini Remote ILT "Vaulted Dungeons" tab (paired with RynthSuite `sk` Ai/ILT). +- Chat type **0x1C** recognized for ILT channel lines (ChatData). +- Loot picker filter and related FaceKit / Mini Remote face polish from 2026.10.5.65–.70. + +## Deploy note + +Live clients load CoreCLR from `C:\Games\RynthCore\Runtime\`. Publish with +`scripts\Publish-EngineCoreClr.ps1 -MsBuildArgs @('-p:Version=2026.10.5.71')`. diff --git a/installer/previous-release/last-built-version.txt b/installer/previous-release/last-built-version.txt new file mode 100644 index 0000000..7405422 --- /dev/null +++ b/installer/previous-release/last-built-version.txt @@ -0,0 +1 @@ +2026.10.5.71 diff --git a/installer/previous-release/previous-version.txt b/installer/previous-release/previous-version.txt new file mode 100644 index 0000000..dbeffde --- /dev/null +++ b/installer/previous-release/previous-version.txt @@ -0,0 +1 @@ +2026.10.5.70 diff --git a/src/RynthCore.Engine/ImGui/EngineFrameController.cs b/src/RynthCore.Engine/ImGui/EngineFrameController.cs index 945e34c..592f2e0 100644 --- a/src/RynthCore.Engine/ImGui/EngineFrameController.cs +++ b/src/RynthCore.Engine/ImGui/EngineFrameController.cs @@ -278,6 +278,10 @@ internal static class EngineFrameController // in ImGui-off mode so Avalonia owner-window binding works. EnsureCore(pDevice); + // Settings > Display: borderless windowed + restore AC placement (throttled). + try { UI.AcWindowChrome.Tick(_gameHwnd); } + catch (Exception ex) { RynthLog.UI($"AcWindowChrome.Tick threw {ex.GetType().Name}: {ex.Message}"); } + // Cache the D3D9 device function pointers used by Nav3DRenderInjector, // RenderNav3D, and the always-on render path. This is a strict subset // of what InitImGui needs and is safe to run without ImGui state. diff --git a/src/RynthCore.Engine/ImGui/ImGuiPanelHost.cs b/src/RynthCore.Engine/ImGui/ImGuiPanelHost.cs index 676b110..7383507 100644 --- a/src/RynthCore.Engine/ImGui/ImGuiPanelHost.cs +++ b/src/RynthCore.Engine/ImGui/ImGuiPanelHost.cs @@ -512,6 +512,8 @@ internal static class ImGuiPanelHost { if (_restored) return; _restored = true; + // Settings > Display "Remember open windows and positions" (default on). + if (!Plugins.EngineSettings.RememberWindowLayout) return; List titles = new(); // Script windows (dynamic) open when their owner says so, not from the saved state. lock (Sync) diff --git a/src/RynthCore.Engine/ImGui/Panels/FaceKit.cs b/src/RynthCore.Engine/ImGui/Panels/FaceKit.cs index 4ca8656..7f4b55f 100644 --- a/src/RynthCore.Engine/ImGui/Panels/FaceKit.cs +++ b/src/RynthCore.Engine/ImGui/Panels/FaceKit.cs @@ -222,17 +222,26 @@ internal static class FaceKit /// /// One popup list per face, opened from any button: call Open from the /// button's click and Draw once per frame at the end of the face's Draw - /// (outside any child window, so the popup id always matches). + /// (outside any child window, so the popup id always matches). Long lists + /// (Slayer Type's creature names, materials, long keys…) get a type-to-filter + /// box so players can pick by name instead of scrolling. /// internal sealed class Picker { + /// Show the filter box when the list is at least this long. + private const int FilterAt = 12; + private const float FilterH = 22f; + private const float RowH = 20f; + private readonly string _popupId; + private readonly byte[] _filter = new byte[64]; private string[] _items = Array.Empty(); private int _selected = -1; private Action? _onPick; private Vector2 _pos; private float _width = 220; private bool _openRequested; + private bool _focusFilter; public Picker(string popupId) => _popupId = popupId; @@ -244,6 +253,8 @@ internal static class FaceKit _pos = below; _width = width; _openRequested = items.Length > 0; + _filter[0] = 0; // clear the previous open's filter + _focusFilter = items.Length >= FilterAt; } public void Draw() @@ -255,38 +266,74 @@ internal static class FaceKit ImGuiNET.ImGui.SetNextWindowPos(new Vector2(Math.Clamp(_pos.X, 0, Math.Max(0, display.X - _width)), _pos.Y)); ImGuiNET.ImGui.OpenPopup(_popupId); } + bool filterOn = _items.Length >= FilterAt; + string filterText = filterOn ? Utf8(_filter) : string.Empty; + // Count matches so the popup height tracks a short filtered list. + int shown = 0; + if (!filterOn) shown = _items.Length; + else + { + for (int i = 0; i < _items.Length; i++) + if (FilterMatch(_items[i], filterText)) shown++; + } + float listH = Math.Min(Math.Max(shown, 1) * RowH + 4, 340); + float totalH = listH + (filterOn ? FilterH + 4 : 0); + ImGuiNET.ImGui.PushStyleColor(ImGuiCol.PopupBg, ShellBg); ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Border, Teal); ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.PopupRounding, 4f); ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(2, 2)); ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0, 1)); - ImGuiNET.ImGui.SetNextWindowSize(new Vector2(_width, Math.Min(_items.Length * 21 + 4, 340))); + ImGuiNET.ImGui.SetNextWindowSize(new Vector2(_width, totalH)); bool open = ImGuiNET.ImGui.BeginPopup(_popupId); ImGuiNET.ImGui.PopStyleVar(3); ImGuiNET.ImGui.PopStyleColor(2); if (!open) return; + + if (filterOn) + { + Vector2 fp = ImGuiNET.ImGui.GetCursorScreenPos(); + if (_focusFilter) + { + _focusFilter = false; + ImGuiNET.ImGui.SetKeyboardFocusHere(0); // next widget = the filter box + } + TextBox("##pick_filter", _filter, fp, ImGuiNET.ImGui.GetContentRegionAvail().X, "Type to filter…", out _, + ImGuiInputTextFlags.None, FilterH); + ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(fp.X, fp.Y + FilterH + 2)); + filterText = Utf8(_filter); + } + var dl = ImGuiNET.ImGui.GetWindowDrawList(); float iw = ImGuiNET.ImGui.GetContentRegionAvail().X; for (int i = 0; i < _items.Length; i++) { + if (filterOn && !FilterMatch(_items[i], filterText)) continue; ImGuiNET.ImGui.PushID(i); Vector2 ip = ImGuiNET.ImGui.GetCursorScreenPos(); - bool click = ImGuiNET.ImGui.InvisibleButton("##it", new Vector2(iw, 20)); + bool click = ImGuiNET.ImGui.InvisibleButton("##it", new Vector2(iw, RowH)); bool hot = ImGuiNET.ImGui.IsItemHovered(); ImGuiNET.ImGui.PopID(); bool sel = i == _selected; - dl.AddRectFilled(ip, ip + new Vector2(iw, 20), sel ? Selected : hot ? Lighten(BtnFill) : BtnFill); - dl.AddRect(ip, ip + new Vector2(iw, 20), BtnBord); - dl.AddText(ip + new Vector2(6, (20 - ImGuiNET.ImGui.GetFontSize()) * 0.5f), sel ? Teal : Text, _items[i]); + dl.AddRectFilled(ip, ip + new Vector2(iw, RowH), sel ? Selected : hot ? Lighten(BtnFill) : BtnFill); + dl.AddRect(ip, ip + new Vector2(iw, RowH), BtnBord); + dl.AddText(ip + new Vector2(6, (RowH - ImGuiNET.ImGui.GetFontSize()) * 0.5f), sel ? Teal : Text, _items[i]); if (click) { Action? act = _onPick; ImGuiNET.ImGui.CloseCurrentPopup(); - act?.Invoke(i); + act?.Invoke(i); // still the original index for the caller } } ImGuiNET.ImGui.EndPopup(); } + + /// Case-insensitive substring match; empty filter shows everything. + private static bool FilterMatch(string item, string filter) + { + if (filter.Length == 0) return true; + return item.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0; + } } // ── Text buffers ───────────────────────────────────────────────────── diff --git a/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.Sections.cs b/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.Sections.cs index f9342f4..cc0e588 100644 --- a/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.Sections.cs +++ b/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.Sections.cs @@ -64,7 +64,7 @@ internal sealed partial class MiniRemoteFace private static bool RailShown => PanelColumnStore.Get(RailKey, 1f) >= 0.5f; - // ── Requests (commands; render thread) ────────────────────────────── + // ── Requests (commands; render thread) ────────────────────────────── /// Shows section ("remote" = the remote) on the next draw. public static void RequestSection(string sectionId) @@ -149,7 +149,7 @@ internal sealed partial class MiniRemoteFace if (PanelColumnStore.Get(SectionKey, -1f) != index) PanelColumnStore.Set(SectionKey, index); } - // ── Rail ──────────────────────────────────────────────────────────── + // ── Rail ──────────────────────────────────────────────────────────── /// Draws the rail at the body's left; returns the width it takes (with its gap). private float DrawRail(SectionRegistry.Snapshot snap, Vector2 origin, Vector2 size) @@ -233,7 +233,7 @@ internal sealed partial class MiniRemoteFace _ => "nothing installed adds to it on this world.", }; - // ── Section body ──────────────────────────────────────────────────── + // ── Section body ──────────────────────────────────────────────────── private void DrawSection(SectionRegistry.Snapshot snap, float w, Vector2 origin, Vector2 size) { @@ -456,7 +456,7 @@ internal sealed partial class MiniRemoteFace return result == PluginManager.EmbedDrawn ? want : Vector2.Zero; } - // ── Session Stats overview ────────────────────────────────────────── + // ── Session Stats overview ────────────────────────────────────────── /// /// The Session Stats section's stand-in, shown only while no plugin fills the section (RynthAi @@ -490,7 +490,7 @@ internal sealed partial class MiniRemoteFace } } - // ── Menu ──────────────────────────────────────────────────────────── + // ── Menu ──────────────────────────────────────────────────────────── /// The menu's section half: every section, the active servers' items, the rail switch. private void DrawSectionsMenuItems() diff --git a/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.cs b/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.cs index d3cba40..ffdbe91 100644 --- a/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.cs +++ b/src/RynthCore.Engine/ImGui/Panels/MiniRemoteFace.cs @@ -180,7 +180,7 @@ internal sealed partial class MiniRemoteFace : IImGuiPanel FitGrid(data, w, haveH); } - // ── RynthAi's Mini Remote ─────────────────────────────────────────── + // ── RynthAi's Mini Remote ─────────────────────────────────────────── /// /// Lets RynthAi draw its Mini Remote here. True when it did (or is mid-layout after @@ -236,10 +236,10 @@ internal sealed partial class MiniRemoteFace : IImGuiPanel if (result == PluginManager.EmbedFailed) _embedOff = true; } - // ── Window fit ────────────────────────────────────────────────────── + // ── Window fit ────────────────────────────────────────────────────── /// - /// Sizes the window so the body area ( × + /// Sizes the window so the body area ( × /// now) becomes ; never taller than the screen. Docked only: /// popped out the OS window keeps its size, as other faces do (RynthNavArrowFace). /// @@ -276,7 +276,7 @@ internal sealed partial class MiniRemoteFace : IImGuiPanel FitWindow(body, w, haveH); } - // ── Engine grid ───────────────────────────────────────────────────── + // ── Engine grid ───────────────────────────────────────────────────── private void Resolve(ItemHudCharacter data, HudItem[] items) { @@ -409,7 +409,7 @@ internal sealed partial class MiniRemoteFace : IImGuiPanel if (!ItemHudStore.Update(d => d.WithSlot(i, new RemoteSlot(itemId, name)), out string why)) ShowMessage(why, Amber); } - // ── Status ────────────────────────────────────────────────────────── + // ── Status ────────────────────────────────────────────────────────── private void ShowMessage(string text, uint color) { @@ -441,7 +441,7 @@ internal sealed partial class MiniRemoteFace : IImGuiPanel private static float BodyGripRoom() => ImGuiPanelHost.BodyGripReserve; - // ── Right-click menu ──────────────────────────────────────────────── + // ── Right-click menu ──────────────────────────────────────────────── /// /// The right-click menu: a slot's options (the engine grid), then the sections, the active diff --git a/src/RynthCore.Engine/Plugins/EngineSettings.cs b/src/RynthCore.Engine/Plugins/EngineSettings.cs index 1c72850..a20af88 100644 --- a/src/RynthCore.Engine/Plugins/EngineSettings.cs +++ b/src/RynthCore.Engine/Plugins/EngineSettings.cs @@ -41,6 +41,10 @@ internal static class EngineSettings private static bool _serverMessageStream = true; private static bool _flightRecorder = true; private static bool _insertReleasesUi; + // Settings > Display: strip AC window chrome while windowed (default off). + private static bool _borderlessWindowed; + // Settings > Display: persist open panels / AC placement / HUD layout (default on). + private static bool _rememberWindowLayout = true; // "LoadAllServerPlugins": hand-set only, written back only when true (PluginManifestGate). private static bool _loadAllServerPlugins; // Read-only, like EnableLargeAddressAlignmentFix: only a hand-set value is written back. @@ -414,6 +418,47 @@ internal static class EngineSettings } } + /// "BorderlessWindowed" in engine.json (default false, 2026-10-15): strip the AC + /// window caption and thick frame while staying windowed. Exclusive fullscreen is left alone. + /// Set in game in Settings > Display. + public static bool BorderlessWindowed + { + get + { + EnsureLoaded(); + return _borderlessWindowed; + } + set + { + EnsureLoaded(); + if (_borderlessWindowed == value) return; + _borderlessWindowed = value; + Save(); + // AcWindowChrome.Tick / Settings > Display apply the style; keep this + // file free of HWND / UI refs so EngineSettingsTests can compile it alone. + } + } + + /// "RememberWindowLayout" in engine.json (default true, 2026-10-15): reopen Rynth + /// panels where they were, keep Vision HUD / imgui.ini / AC window placement across launches. + /// Off: do not overwrite panel_state.txt or restore open panels / AC placement. + /// Set in game in Settings > Display. + public static bool RememberWindowLayout + { + get + { + EnsureLoaded(); + return _rememberWindowLayout; + } + set + { + EnsureLoaded(); + if (_rememberWindowLayout == value) return; + _rememberWindowLayout = value; + Save(); + } + } + /// "MaxHotReloads" in engine.json (default 3, 2026-10-11): how many engine hot reloads /// one client takes; the loader asks before each one (RynthCoreMaxHotReloads) and refuses the /// rest, so a newer engine then needs a client restart. Clients died with CoreCLR fatal error @@ -660,6 +705,14 @@ internal static class EngineSettings (iruEl.ValueKind == JsonValueKind.True || iruEl.ValueKind == JsonValueKind.False)) _insertReleasesUi = iruEl.GetBoolean(); + if (doc.RootElement.TryGetProperty("BorderlessWindowed", out var blwEl) && + (blwEl.ValueKind == JsonValueKind.True || blwEl.ValueKind == JsonValueKind.False)) + _borderlessWindowed = blwEl.GetBoolean(); + + if (doc.RootElement.TryGetProperty("RememberWindowLayout", out var rwlEl) && + (rwlEl.ValueKind == JsonValueKind.True || rwlEl.ValueKind == JsonValueKind.False)) + _rememberWindowLayout = rwlEl.GetBoolean(); + if (doc.RootElement.TryGetProperty("MaxHotReloads", out var mhrEl) && mhrEl.ValueKind == JsonValueKind.Number && mhrEl.TryGetInt32(out int mhr)) @@ -741,7 +794,8 @@ internal static class EngineSettings "EnableAvaloniaOverlay", "EnableD3D9Hook", "EnableEngine", "EngineHookCount", "EnableImGuiBackend", "EnableHangMinidump", "PreventIdleLogoff", "DecalBridge", "DecalInGameImGui", "DecalStandDown", "DisabledUiHooks", "ServerMessageStream", - "FlightRecorder", "InsertReleasesUi", "IltServerNames", "IltHosts", "EnableLargeAddressAlignmentFix", + "FlightRecorder", "InsertReleasesUi", "BorderlessWindowed", "RememberWindowLayout", + "IltServerNames", "IltHosts", "EnableLargeAddressAlignmentFix", "MaxHotReloads", "ReportEndpoint", "CloseOnServerDisconnect", "AutoIdMode", "EnablePluginOverlayWindows", "LoggingLevel", "LoadAllServerPlugins", }; @@ -795,6 +849,10 @@ internal static class EngineSettings w.WriteBoolean("EnableLargeAddressAlignmentFix", false); if (_insertReleasesUi) // default false: leave the file as it was w.WriteBoolean("InsertReleasesUi", true); + if (_borderlessWindowed) // default false: leave the file as it was + w.WriteBoolean("BorderlessWindowed", true); + if (!_rememberWindowLayout) // default true: leave the file as it was + w.WriteBoolean("RememberWindowLayout", false); if (!_closeOnServerDisconnect) // default true: leave the file as it was w.WriteBoolean("CloseOnServerDisconnect", false); if (_loadAllServerPlugins) // default false: only a hand-set true is written diff --git a/src/RynthCore.Engine/UI/AcWindowChrome.cs b/src/RynthCore.Engine/UI/AcWindowChrome.cs new file mode 100644 index 0000000..22dd96b --- /dev/null +++ b/src/RynthCore.Engine/UI/AcWindowChrome.cs @@ -0,0 +1,337 @@ +// ============================================================================ +// RynthCore.Engine - UI/AcWindowChrome.cs +// Settings > Display helpers for the Asheron's Call game HWND: +// - Borderless windowed: strip caption / thick frame while leaving the client +// windowed (not exclusive fullscreen). +// - Remember placement: persist and restore the outer window rect across +// launches when "Remember open windows and HUD positions" is on. +// Styles use SetWindowLong (x86); SWP_FRAMECHANGED so the non-client area +// rebuilds after GWL_STYLE changes. +// ============================================================================ + +using System; +using System.Globalization; +using System.IO; +using System.Runtime.InteropServices; +using RynthCore.Engine.Plugins; + +namespace RynthCore.Engine.UI; + +internal static class AcWindowChrome +{ + private const int GwlStyle = -16; + private const int WsCaption = 0x00C00000; + private const int WsThickFrame = 0x00040000; + private const int WsSysMenu = 0x00080000; + private const int WsMinimizeBox = 0x00020000; + private const int WsMaximizeBox = 0x00010000; + private const int WsBorder = 0x00800000; + // Caption + frame + sysmenu/minmax: the chrome "Borderless windowed" removes. + private const int BorderChromeMask = + WsCaption | WsThickFrame | WsSysMenu | WsMinimizeBox | WsMaximizeBox | WsBorder; + + private const uint SwpNosize = 0x0001; + private const uint SwpNomove = 0x0002; + private const uint SwpNozorder = 0x0004; + private const uint SwpNoactivate = 0x0010; + private const uint SwpFramechanged = 0x0020; + + private static readonly object Sync = new(); + private static int? _savedStyle; + private static IntPtr _styleHwnd; + private static bool _borderlessApplied; + private static long _nextApplyTick; + private static long _nextPlacementSaveTick; + private static bool _placementRestored; + + private static string PlacementPath + { + get + { + string root = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + return Path.Combine(root, "RynthCore", "ac_window.txt"); + } + } + + /// Re-apply borderless / restore placement when the HWND is known. + /// Cheap when nothing changed; call from the frame loop at a low rate. + public static void Tick(IntPtr hwnd) + { + if (hwnd == IntPtr.Zero) return; + long now = Environment.TickCount64; + if (now < _nextApplyTick) return; + _nextApplyTick = now + 2000; + + try + { + if (EngineSettings.RememberWindowLayout && !_placementRestored) + TryRestorePlacement(hwnd); + + ApplyBorderlessDesired(hwnd); + + // Keep AC placement fresh while the user drags/resizes (throttled). + if (EngineSettings.RememberWindowLayout && now >= _nextPlacementSaveTick) + { + _nextPlacementSaveTick = now + 10000; + SavePlacement(hwnd); + } + } + catch (Exception ex) + { + try { RynthLog.UI($"AcWindowChrome: tick failed - {ex.Message}"); } catch { } + } + } + + /// Immediate borderless apply (Settings toggle). + public static void ApplyBorderlessDesired(IntPtr hwnd) + { + if (hwnd == IntPtr.Zero) return; + bool want = EngineSettings.BorderlessWindowed; + lock (Sync) + { + if (hwnd != _styleHwnd) + { + _styleHwnd = hwnd; + _savedStyle = null; + _borderlessApplied = false; + } + + int style = GetWindowLong(hwnd, GwlStyle); + bool missingChrome = (style & WsCaption) == 0; + + if (want) + { + // Leave true exclusive fullscreen alone — but a maximized borderless + // window we made ourselves still needs to be able to restore later. + if (!_borderlessApplied && IsLikelyExclusiveFullscreen(hwnd, style)) + { + RynthLog.UI("AcWindowChrome: skip borderless — looks like exclusive fullscreen."); + return; + } + + if (_borderlessApplied && missingChrome) + return; + + // Remember a style that still has chrome. After a hot reload the window + // can already be borderless while our statics were cleared — OR the mask + // back on so turning the setting off can still restore a real frame. + if (_savedStyle is null) + _savedStyle = missingChrome ? (style | BorderChromeMask) : style; + + int next = style & ~BorderChromeMask; + if (next == style && _borderlessApplied) return; + SetWindowLong(hwnd, GwlStyle, next); + SetWindowPos(hwnd, IntPtr.Zero, 0, 0, 0, 0, + SwpNomove | SwpNosize | SwpNozorder | SwpNoactivate | SwpFramechanged); + _borderlessApplied = true; + RynthLog.UI("AcWindowChrome: borderless windowed on."); + } + else + { + // Restore even when the window fills the monitor (maximized borderless + // looks like exclusive fullscreen and used to early-return forever). + // Also heal a stuck chrome-less window after engine reload with the + // setting already off (_borderlessApplied false, _savedStyle null). + if (!_borderlessApplied && _savedStyle is null && !missingChrome) return; + + int restore; + if (_savedStyle is int saved && (saved & WsCaption) != 0) + restore = saved; + else + restore = style | BorderChromeMask; + + if (style != restore) + { + SetWindowLong(hwnd, GwlStyle, restore); + SetWindowPos(hwnd, IntPtr.Zero, 0, 0, 0, 0, + SwpNomove | SwpNosize | SwpNozorder | SwpNoactivate | SwpFramechanged); + } + _borderlessApplied = false; + _savedStyle = null; + RynthLog.UI("AcWindowChrome: window borders restored."); + } + } + } + + /// Write the AC outer window rect when layout remembering is on + /// (or always when for "Save layout now"). + public static void SavePlacement(IntPtr hwnd, bool force = false) + { + if (hwnd == IntPtr.Zero) return; + if (!force && !EngineSettings.RememberWindowLayout) return; + if (!GetWindowRect(hwnd, out RECT rc)) return; + int w = rc.Right - rc.Left; + int h = rc.Bottom - rc.Top; + if (w < 160 || h < 120) return; + if (IsLikelyExclusiveFullscreen(hwnd, GetWindowLong(hwnd, GwlStyle))) return; + + try + { + string path = PlacementPath; + string? dir = Path.GetDirectoryName(path); + if (!string.IsNullOrEmpty(dir)) Directory.CreateDirectory(dir); + File.WriteAllText(path, + FormattableString.Invariant( + $"# RynthCore AC window placement — auto-generated.\nleft={rc.Left}\ntop={rc.Top}\nwidth={w}\nheight={h}\n")); + } + catch (Exception ex) + { + try { RynthLog.UI($"AcWindowChrome: save placement failed - {ex.Message}"); } catch { } + } + } + + /// Force-save panels (already on disk via PanelStateStore), AC window, + /// Vision self-plate, and ImGui.ini. Used by Settings > Display "Save layout now". + public static void SaveLayoutNow() + { + IntPtr hwnd = ResolveGameHwnd(); + if (hwnd != IntPtr.Zero) + SavePlacement(hwnd, force: true); + + try { ImGuiBackend.Hud.MonsterHudSettings.Save(); } catch { /* best-effort */ } + + try + { + string iniPath = Path.Combine(RynthCore.Install.RynthInstallPaths.RynthAiDir, "imgui.ini"); + Directory.CreateDirectory(RynthCore.Install.RynthInstallPaths.RynthAiDir); + if (ImGuiNET.ImGui.GetCurrentContext() != IntPtr.Zero) + ImGuiNET.ImGui.SaveIniSettingsToDisk(iniPath); + } + catch (Exception ex) + { + try { RynthLog.UI($"AcWindowChrome: imgui.ini save failed - {ex.Message}"); } catch { } + } + + // PanelStateStore writes on every move already; Flush ensures the file exists + // even if nothing moved this session (re-write current in-memory state). + try { PanelStateStore.Flush(); } catch { /* best-effort */ } + + try + { + Compatibility.AcMainThreadQueue.EnqueueWriteToChat( + "[RynthCore] Saved open windows and HUD positions.", 1); + } + catch { /* chat may not be ready */ } + } + + private static void TryRestorePlacement(IntPtr hwnd) + { + _placementRestored = true; + if (!EngineSettings.RememberWindowLayout) return; + if (IsLikelyExclusiveFullscreen(hwnd, GetWindowLong(hwnd, GwlStyle))) return; + + string path = PlacementPath; + if (!File.Exists(path)) return; + + int left = 0, top = 0, width = 0, height = 0; + try + { + foreach (string raw in File.ReadAllLines(path)) + { + string line = raw.Trim(); + if (line.Length == 0 || line.StartsWith('#')) continue; + int eq = line.IndexOf('='); + if (eq <= 0) continue; + string key = line[..eq].Trim(); + string val = line[(eq + 1)..].Trim(); + if (!int.TryParse(val, NumberStyles.Integer, CultureInfo.InvariantCulture, out int n)) continue; + if (string.Equals(key, "left", StringComparison.OrdinalIgnoreCase)) left = n; + else if (string.Equals(key, "top", StringComparison.OrdinalIgnoreCase)) top = n; + else if (string.Equals(key, "width", StringComparison.OrdinalIgnoreCase)) width = n; + else if (string.Equals(key, "height", StringComparison.OrdinalIgnoreCase)) height = n; + } + } + catch (Exception ex) + { + try { RynthLog.UI($"AcWindowChrome: read placement failed - {ex.Message}"); } catch { } + return; + } + + if (width < 160 || height < 120) return; + // Keep the restored rect on a visible monitor so a missing display does not + // park the client off-screen. + if (!IsRectOnAnyMonitor(left, top, width, height)) + { + RynthLog.UI("AcWindowChrome: saved placement is off-screen; leaving AC where it is."); + return; + } + + SetWindowPos(hwnd, IntPtr.Zero, left, top, width, height, + SwpNozorder | SwpNoactivate | SwpFramechanged); + RynthLog.UI(FormattableString.Invariant( + $"AcWindowChrome: restored AC window to ({left},{top}) {width}x{height}.")); + } + + /// Game HWND for Settings toggles (EntryPoint, else Win32Backend). + internal static IntPtr ResolveGameHwndForSettings() => ResolveGameHwnd(); + + private static IntPtr ResolveGameHwnd() + { + IntPtr hwnd = EntryPoint.GameHwnd; + if (hwnd != IntPtr.Zero) return hwnd; + try { return ImGuiBackend.Win32Backend.GameHwnd; } catch { return IntPtr.Zero; } + } + + /// True when the outer rect fills a monitor and has no caption — exclusive + /// fullscreen or already-borderless fullscreen; do not fight it. + private static bool IsLikelyExclusiveFullscreen(IntPtr hwnd, int style) + { + if ((style & WsCaption) != 0) return false; + if (!GetWindowRect(hwnd, out RECT wr)) return false; + IntPtr mon = MonitorFromWindow(hwnd, 2 /* MONITOR_DEFAULTTONEAREST */); + if (mon == IntPtr.Zero) return false; + var mi = new MONITORINFO { cbSize = Marshal.SizeOf() }; + if (!GetMonitorInfo(mon, ref mi)) return false; + int mw = mi.rcMonitor.Right - mi.rcMonitor.Left; + int mh = mi.rcMonitor.Bottom - mi.rcMonitor.Top; + int ww = wr.Right - wr.Left; + int wh = wr.Bottom - wr.Top; + return Math.Abs(ww - mw) <= 4 && Math.Abs(wh - mh) <= 4 + && Math.Abs(wr.Left - mi.rcMonitor.Left) <= 4 + && Math.Abs(wr.Top - mi.rcMonitor.Top) <= 4; + } + + private static bool IsRectOnAnyMonitor(int left, int top, int width, int height) + { + // Probe the center of the saved rect; if no monitor claims it, skip restore. + var pt = new POINT { X = left + width / 2, Y = top + height / 2 }; + return MonitorFromPoint(pt, 0 /* MONITOR_DEFAULTTONULL */) != IntPtr.Zero; + } + + [StructLayout(LayoutKind.Sequential)] + private struct RECT { public int Left, Top, Right, Bottom; } + + [StructLayout(LayoutKind.Sequential)] + private struct POINT { public int X, Y; } + + [StructLayout(LayoutKind.Sequential)] + private struct MONITORINFO + { + public int cbSize; + public RECT rcMonitor; + public RECT rcWork; + public uint dwFlags; + } + + [DllImport("user32.dll")] + private static extern int GetWindowLong(IntPtr hWnd, int nIndex); + + [DllImport("user32.dll")] + private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); + + [DllImport("user32.dll")] + private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, + int X, int Y, int cx, int cy, uint uFlags); + + [DllImport("user32.dll")] + private static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); + + [DllImport("user32.dll")] + private static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); + + [DllImport("user32.dll")] + private static extern IntPtr MonitorFromPoint(POINT pt, uint dwFlags); + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + private static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi); +} diff --git a/src/RynthCore.Engine/UI/AvaloniaOverlay.cs b/src/RynthCore.Engine/UI/AvaloniaOverlay.cs index 87af52f..f0e0eb6 100644 --- a/src/RynthCore.Engine/UI/AvaloniaOverlay.cs +++ b/src/RynthCore.Engine/UI/AvaloniaOverlay.cs @@ -1513,6 +1513,11 @@ internal class RynthOverlayWindow : Window { try { + // Settings > Display "Remember open windows and positions" (default on). + // Off: leave panels closed so a hand-arranged layout is not forced back. + if (!Plugins.EngineSettings.RememberWindowLayout) + return; + // Bar floating mode restores once AC's HWND is available. If we // pop out before that, the FloatingPanelHost ctor takes its // legacy code path (no marshal to game thread) and the layered diff --git a/src/RynthCore.Engine/UI/Data/ChatData.cs b/src/RynthCore.Engine/UI/Data/ChatData.cs index dfe6464..334dc25 100644 --- a/src/RynthCore.Engine/UI/Data/ChatData.cs +++ b/src/RynthCore.Engine/UI/Data/ChatData.cs @@ -395,7 +395,8 @@ internal static class ChatModel public static string ChannelForType(int chatType) => (uint)chatType switch { 0x02 or 0x03 or 0x04 or 0x0A or 0x0B or 0x0C or 0x12 or 0x13 => "Chat", - 0x08 or 0x09 => "Channels", + // 0x08/0x09 = retail channel; 0x1C (28) = ILT/ACECustom tagged [Trade]/[General] lines. + 0x08 or 0x09 or 0x1C => "Channels", 0x00 or 0x05 or 0x0D or 0x14 or 0x17 or 0x18 or 0x19 or 0x1F => "System", 0x06 or 0x07 or 0x11 or 0x15 or 0x16 => "Combat", _ => "Other", diff --git a/src/RynthCore.Engine/UI/Data/SettingsData.cs b/src/RynthCore.Engine/UI/Data/SettingsData.cs index 9804617..fc89fa4 100644 --- a/src/RynthCore.Engine/UI/Data/SettingsData.cs +++ b/src/RynthCore.Engine/UI/Data/SettingsData.cs @@ -121,6 +121,17 @@ internal sealed class RynthAiSettings public bool UseNativeAttack { get; set; } = true; public bool SummonPets { get; set; } public int PetMinMonsters { get; set; } = 1; + // RynthAi 0.5.47 (2026-10-12): Variable attack power and the environment-impact throttle. + // Nullable in RynthAi's payload: an older RynthAi omits them and these defaults show. + public int VariablePowerMin { get; set; } = 50; + public int VariablePowerMax { get; set; } = 100; + public int MissileEnvironmentResponse { get; set; } + public int MagicEnvironmentResponse { get; set; } + public int EnvironmentImpactLimit { get; set; } = 2; + public int EnvironmentImpactWindowSec { get; set; } = 20; + public int EnvironmentApproachMeters { get; set; } = 6; + public int EnvironmentMinDistance { get; set; } = 3; + public int EnvironmentSkipSec { get; set; } = 30; // Spell Combat public int SpellCastIntervalMs { get; set; } = 400; public int AttackSpellIntervalMs { get; set; } = 1500; @@ -148,6 +159,11 @@ internal sealed class RynthAiSettings public double CorpseApproachRangeMin { get; set; } = 2.0; // Navigation public bool BoostNavPriority { get; set; } + /// + /// RynthAi / RynthILT: show the Mini Remote "Vaulted Dungeons" tab on ILT worlds (off by default). + /// Absent from an older plugin: the row still writes false. + /// + public bool EnableVaultedDungeons { get; set; } public float FollowNavMin { get; set; } = 1.5f; public float NavRingThickness { get; set; } = 6f; public float NavLineThickness { get; set; } = 6f; @@ -512,6 +528,8 @@ internal static class SettingsSchema } public static readonly string[] AttackHeights = { "Low", "Medium", "High" }; + // RynthAi's EnvironmentResponse, in its order (0 Off .. 3). + public static readonly string[] EnvironmentResponses = { "Off", "Move closer", "New target", "Move closer, then new target" }; public static readonly string[] LootOwnershipModes = { "My Kills Only", "Fellowship Kills", "All Corpses" }; public static readonly string[] NavLabelModes = { "Off", "Numbers", "Numbers and names" }; public static readonly string[] DunPatrolCoverages = { "Whole dungeon", "Loops only", "Everything", "Sweep (by sight)" }; @@ -660,6 +678,25 @@ internal static class SettingsSchema Bool("Insert Key Releases the UI", _ => Plugins.EngineSettings.InsertReleasesUi, (_, v) => { Plugins.EngineSettings.InsertReleasesUi = v; if (!v) ImGuiBackend.Win32Backend.ReclaimUi(); }, "On: Insert switches between UI and GAME (shown on the RynthCore bar). In GAME, clicks pass through\nRynth windows to the game and Rynth text boxes can't be typed in. Press Insert again to get the UI back.\nOff (default): Insert does nothing. Applies to all your clients; others pick it up when they start."), + Bool("Borderless Windowed", _ => Plugins.EngineSettings.BorderlessWindowed, + (_, v) => + { + Plugins.EngineSettings.BorderlessWindowed = v; + try + { + // ResolveGameHwnd covers EntryPoint + Win32Backend; Tick retries if zero. + AcWindowChrome.ApplyBorderlessDesired(AcWindowChrome.ResolveGameHwndForSettings()); + } + catch { /* HWND may not be ready; Tick applies later */ } + }, + "On: hide the Asheron's Call window title bar and borders while staying windowed (no exclusive fullscreen).\nOff (default): normal window chrome. Applies to all your clients; others pick it up when they start."), + Spacer(), + Section("Window and HUD Layout"), + Bool("Remember Open Windows and Positions", _ => Plugins.EngineSettings.RememberWindowLayout, + (_, v) => Plugins.EngineSettings.RememberWindowLayout = v, + "On (default): reopen Rynth panels where you left them, keep the Vision self-plate / ImGui layout, and restore the\nAC window position across launches.\nOff: do not overwrite the saved layout or reopen panels from the last session. Applies to all your clients."), + Button("Save Layout Now", "Save", () => AcWindowChrome.SaveLayoutNow(), + "Write the current open panels, AC window placement, Vision HUD, and ImGui window positions to disk now.\nNeeds Remember Open Windows and Positions on to keep updating panel_state afterward."), Spacer(), // The colour theme is stored by the engine (theme.txt, ImGuiBackend.RynthTheme), not in the RynthAi profile. Section("Colour Theme"), @@ -917,6 +954,30 @@ internal static class SettingsSchema Int("Missile Power %", s => s.MissileAttackPower, (s, v) => s.MissileAttackPower = v, 0, 100, 5, when: s => s.MissileAttackPower >= 0), Combo("Missile Attack Height", AttackHeights, s => s.MissileAttackHeight, (s, v) => s.MissileAttackHeight = v), Spacer(), + Section("Variable Power (monster rules)"), + Int("Variable Min %", s => s.VariablePowerMin, (s, v) => s.VariablePowerMin = v, 0, 100, 5, + "A monster rule's Power picks per monster (Damage panel, a monster's detail):\n" + + "Default (the settings above), High (100%), Reckless (80%, needs Recklessness trained),\n" + + "Variable (a new random power each attack, between these two), or Reckless + Variable\n" + + "(random, kept inside the Recklessness band 20-80%)."), + Int("Variable Max %", s => s.VariablePowerMax, (s, v) => s.VariablePowerMax = v, 0, 100, 5), + Spacer(), + Section("Hitting the Environment"), + Combo("Missile Response", EnvironmentResponses, s => s.MissileEnvironmentResponse, (s, v) => s.MissileEnvironmentResponse = v, + "When arrows or bolts keep hitting walls or objects instead of the target\n" + + "(\"Your missile attack hit the environment.\"), stop shooting and:\n" + + " Move closer - run toward the target for a clearer shot\n" + + " New target - skip this one for a while and fight another\n" + + " Move closer, then new target - one approach, then switch\n" + + "The only monster in reach is never skipped. Magic: Spell Combat tab."), + Int("Hits to trip", s => s.EnvironmentImpactLimit, (s, v) => s.EnvironmentImpactLimit = v, 1, 10, 1, + "Environment hits on one target, within the window, before combat reacts (missiles and magic)."), + Int("Window (s)", s => s.EnvironmentImpactWindowSec, (s, v) => s.EnvironmentImpactWindowSec = v, 5, 120, 5), + Int("Move closer by (m)", s => s.EnvironmentApproachMeters, (s, v) => s.EnvironmentApproachMeters = v, 1, 30, 1), + Int("Closest (m)", s => s.EnvironmentMinDistance, (s, v) => s.EnvironmentMinDistance = v, 1, 30, 1, + "Never moves nearer than this. Already this close, a new target is picked instead."), + Int("Skip target (s)", s => s.EnvironmentSkipSec, (s, v) => s.EnvironmentSkipSec = v, 5, 300, 5), + Spacer(), Bool("Use Native Attack", s => s.UseNativeAttack, (s, v) => s.UseNativeAttack = v, "Uses the client's combat pipeline for attacks.\nThe client handles turn-to-face naturally (no backwards arrows)."), Spacer(), @@ -948,6 +1009,16 @@ internal static class SettingsSchema Int("Min Wall Targets", s => s.MinWallTargets, (s, v) => s.MinWallTargets = v, 1, 20, 1, "How many monsters (the target included) must be in the wall's path, within Wall Range."), Spacer(), + Section("Hitting the Environment"), + Combo("Magic Response", EnvironmentResponses, s => s.MagicEnvironmentResponse, (s, v) => s.MagicEnvironmentResponse = v, + "When bolts, streaks, arcs or blasts keep stopping short of the target\n" + + "(a wall, a pillar, the ceiling) with no hit or resist, stop casting and:\n" + + " Move closer - run toward the target for a clearer line\n" + + " New target - skip this one for a while and fight another\n" + + " Move closer, then new target - one approach, then switch\n" + + "Rings and walls aren't judged. The only monster in reach is never skipped.\n" + + "Hits to trip, the window, distances and the skip time: Melee Combat tab."), + Spacer(), Section("Spell Difficulty (Min Buffed Skill)"), Tiers( new Func[] { s => s.MinSkillLevelTier1, s => s.MinSkillLevelTier2, s => s.MinSkillLevelTier3, s => s.MinSkillLevelTier4, @@ -984,6 +1055,13 @@ internal static class SettingsSchema Bool("Boost Nav Priority", s => s.BoostNavPriority, (s, v) => s.BoostNavPriority = v), Float(NavPointReachLabel, s => s.FollowNavMin, (s, v) => s.FollowNavMin = v, 0.5f, 20f, 0.1f, NavPointReachTip), Spacer(), + Section("Infinite Leaftide"), + Bool("Vaulted Dungeons", s => s.EnableVaultedDungeons, (s, v) => s.EnableVaultedDungeons = v, + "Show the Mini Remote \"Vaulted Dungeons\" tab on Infinite Leaftide / ACECustom worlds.\n" + + "Keeps the character in one Vaulted Dungeon via a tied Portal Recall Gem, with optional\n" + + "Kill Client (/rc quit) after N minutes without a \"You've banked N Luminance.\" kill.\n" + + "Settings are per character (RynthILT\\…\\VaultedDungeons\\settings.json). Off by default."), + Spacer(), Section("Nav Marker Display"), Bool("Breadcrumbs", s => s.TrackBreadcrumbs ?? true, (s, v) => s.TrackBreadcrumbs = v, BreadcrumbsTip + SameAsNavPanel, when: s => s.TrackBreadcrumbs.HasValue), diff --git a/src/RynthCore.Engine/UI/PanelStateStore.cs b/src/RynthCore.Engine/UI/PanelStateStore.cs index 924c652..b6b89e5 100644 --- a/src/RynthCore.Engine/UI/PanelStateStore.cs +++ b/src/RynthCore.Engine/UI/PanelStateStore.cs @@ -25,6 +25,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using RynthCore.Engine.Plugins; namespace RynthCore.Engine.UI; @@ -170,6 +171,17 @@ internal static class PanelStateStore } } + /// Rewrite panel_state.txt from the in-memory snapshot (Settings > + /// Display "Save layout now"). No-op when RememberWindowLayout is off. + public static void Flush() + { + lock (Sync) + { + Load(); + Save(force: true); + } + } + private static void Load() { if (_loaded) return; @@ -249,8 +261,13 @@ internal static class PanelStateStore } } - private static void Save() + private static void Save(bool force = false) { + // Settings > Display "Remember open windows and HUD positions" (default on). + // Off: keep the last file; do not overwrite it while the user is rearranging. + if (!force && !EngineSettings.RememberWindowLayout) + return; + try { string path = FilePath;