RynthCore: let players enlarge the in-game toolbar #7

Closed
AwfulWaffle wants to merge 1 commit from AwfulWaffle/RynthCore:toolbar-size into main
First-time contributor

Closed by the author: this change is already in main (checked against 418d80b). Thanks for taking it in.

One commit against RynthCore 194ea47 (release 2026.10.9.3). It touches only RynthCore.Engine and adds one offline test tool. There are no RynthSuite or SDK changes, so it is independent of the RynthAi.Combat patch for RynthSuite and can land in either order.

Why

The bar's buttons are a fixed 20 logical px (ImGuiBar.cs, ButtonSize). The only multiplier is UiScale.ForWindow, which is DPI/96 and comes out as 1 for a DPI-unaware acclient. On a high-resolution window the icons are tiny, and because panel names only appear in the bar's tooltips, this also makes features hard to discover.

Design: reuse the panel text-size system

  • PanelTextScale gains a separate __chrome row (GetChrome / SetChrome, steps 0-10 like the panel sizes).
  • While the bar draws, ImGuiFonts.CurrentStep is set to that step, so it uses the already-baked enlarged fonts with merged icons (sharp, not stretched). The button size is scaled by the same step's factor. One helper, ImGuiBar.ChromeStep, is the only source of both, and CurrentStep is reset in finally.
  • Tooltips, the face popup and the scripts menu are drawn inside the bar window, so they inherit the size.
  • Two fixes needed for the new row:
    • StepsInUse now bakes the chrome step even when per-panel sizing is off.
    • SetForWindow's reset loop skips the chrome row.
  • Untouched:
    • FontScale / _uiScale;
    • PlacementScale and InputScale;
    • the plugin SDK structs;
    • pop-out styling;
    • panel title bars, which keep their size by design.

How players change it

  • Right-click the bar's grip: a "Bar size" row with - / + / Reset.
  • Ctrl+mouse wheel over the bar.
  • Settings > Display > Text Size > "Toolbar".
  • /rc ui barsize [0-10|+|-|+n|-n|status].

Position handling

When the bar grows past the screen edge it is pulled back on screen. The pulled-back position is saved only after a user drag or a size change. A clamp caused by a smaller AC window, or by the first frame after a load, leaves the saved bar= row alone, so restoring the window size puts the bar back where the player left it.

Tests

  • New tools/PanelTextScaleTests (console, dotnet run -c Release, same shape as EngineSettingsTests). It runs one child process per case, using RYNTHCORE_PANEL_TEXT_SIZE to point at a temp file. Coverage:

    • the chrome row survives SetForWindow;
    • StepsInUse includes the chrome step with per-panel sizing off;
    • UseForAll and SetAll leave the chrome row alone;
    • chrome 0 is not baked;
    • clamping;
    • a file round trip.

    Reverting the two PanelTextScale fixes makes 4 cases fail.

  • Gates:

    • dotnet build src/RynthCore.Engine/RynthCore.Engine.csproj -c Release, with and without -p:EngineHost=coreclr: 0 errors.
    • tools/check_imgui_calls.py: OK.
    • EngineSettingsTests: 123/123.
  • check_offthread_mutators.py reports DecalBridgeHost.cs:305 PostNotice(). This violation is identical on 194ea47, so it predates the patch.

Notes for the maintainer

  • Should panel title bars follow the toolbar size too? I left them alone because of the "title bar keeps its size" comment in ImGuiPanelHost.
  • Unrelated, noticed while reading: /rc resetbar rewrites Desktop\RynthCore.bar.cfg for the diagnostic shell (RynthCoreShell), so it never moves the real ImGui toolbar. A toolbar dragged off-screen has no recovery command. Not changed here.

🤖 Generated with Claude Code

Closed by the author: this change is already in main (checked against 418d80b). Thanks for taking it in. One commit against RynthCore `194ea47` (release 2026.10.9.3). It touches only `RynthCore.Engine` and adds one offline test tool. There are no RynthSuite or SDK changes, so it is independent of the RynthAi.Combat patch for RynthSuite and can land in either order. ## Why The bar's buttons are a fixed 20 logical px (`ImGuiBar.cs`, `ButtonSize`). The only multiplier is `UiScale.ForWindow`, which is DPI/96 and comes out as 1 for a DPI-unaware acclient. On a high-resolution window the icons are tiny, and because panel names only appear in the bar's tooltips, this also makes features hard to discover. ## Design: reuse the panel text-size system - `PanelTextScale` gains a separate `__chrome` row (`GetChrome` / `SetChrome`, steps 0-10 like the panel sizes). - While the bar draws, `ImGuiFonts.CurrentStep` is set to that step, so it uses the already-baked enlarged fonts with merged icons (sharp, not stretched). The button size is scaled by the same step's factor. One helper, `ImGuiBar.ChromeStep`, is the only source of both, and `CurrentStep` is reset in `finally`. - Tooltips, the face popup and the scripts menu are drawn inside the bar window, so they inherit the size. - Two fixes needed for the new row: - `StepsInUse` now bakes the chrome step even when per-panel sizing is off. - `SetForWindow`'s reset loop skips the chrome row. - **Untouched:** - `FontScale` / `_uiScale`; - `PlacementScale` and `InputScale`; - the plugin SDK structs; - pop-out styling; - panel title bars, which keep their size by design. ## How players change it - Right-click the bar's grip: a "Bar size" row with - / + / Reset. - Ctrl+mouse wheel over the bar. - Settings > Display > Text Size > "Toolbar". - `/rc ui barsize [0-10|+|-|+n|-n|status]`. ## Position handling When the bar grows past the screen edge it is pulled back on screen. The pulled-back position is saved only after a user drag or a size change. A clamp caused by a smaller AC window, or by the first frame after a load, leaves the saved `bar=` row alone, so restoring the window size puts the bar back where the player left it. ## Tests - New `tools/PanelTextScaleTests` (console, `dotnet run -c Release`, same shape as `EngineSettingsTests`). It runs one child process per case, using `RYNTHCORE_PANEL_TEXT_SIZE` to point at a temp file. Coverage: - the chrome row survives `SetForWindow`; - `StepsInUse` includes the chrome step with per-panel sizing off; - `UseForAll` and `SetAll` leave the chrome row alone; - chrome 0 is not baked; - clamping; - a file round trip. Reverting the two `PanelTextScale` fixes makes 4 cases fail. - Gates: - `dotnet build src/RynthCore.Engine/RynthCore.Engine.csproj -c Release`, with and without `-p:EngineHost=coreclr`: 0 errors. - `tools/check_imgui_calls.py`: OK. - `EngineSettingsTests`: 123/123. - `check_offthread_mutators.py` reports `DecalBridgeHost.cs:305 PostNotice()`. This violation is identical on `194ea47`, so it predates the patch. ## Notes for the maintainer - Should panel title bars follow the toolbar size too? I left them alone because of the "title bar keeps its size" comment in `ImGuiPanelHost`. - Unrelated, noticed while reading: `/rc resetbar` rewrites `Desktop\RynthCore.bar.cfg` for the diagnostic shell (`RynthCoreShell`), so it never moves the real ImGui toolbar. A toolbar dragged off-screen has no recovery command. Not changed here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The bar's buttons are a fixed 20 logical px and the only multiplier is the
DPI scale, which is 1 for a DPI-unaware acclient, so the icons cannot be
made bigger. This adds a separate "chrome" row to PanelTextScale that the
bar draws at: it uses the existing baked enlarged fonts (icons stay sharp)
and scales the button size by the same step's factor. Tooltips and menus
opened from the bar inherit it.

- PanelTextScale: __chrome row with GetChrome/SetChrome; StepsInUse bakes it
  even with per-panel sizing off; SetForWindow's reset loop skips it;
  RYNTHCORE_PANEL_TEXT_SIZE overrides the file path for tests.
- ImGuiBar: grip right-click size row (- / + / Reset), Ctrl+wheel over the
  bar, and an on-screen clamp when the bar grows. A clamp only persists the
  position when the user dragged or the size changed, so a smaller AC
  window never overwrites the saved position.
- Settings > Display > Text Size: "Toolbar" combo.
- /rc ui barsize [0-10|+|-|+n|-n|status].
- tools/PanelTextScaleTests: offline tests for the chrome row.

Untouched: FontScale/_uiScale, placement scale, the plugin SDK, pop-out
styling and panel title bars.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AwfulWaffle closed this pull request 2026-11-07 14:00:15 -05:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rynth/RynthCore!7
No description provided.