Skip to content

Fix cursor display on higher resolutions - #70

Open
JusticarProgramming wants to merge 3 commits into
OpenTS-Developers:mainfrom
JusticarProgramming:fix/cursor-display
Open

Fix cursor display on higher resolutions#70
JusticarProgramming wants to merge 3 commits into
OpenTS-Developers:mainfrom
JusticarProgramming:fix/cursor-display

Conversation

@JusticarProgramming

Copy link
Copy Markdown
Contributor

Summary

The in-game interface is laid out in fixed pixels, so at the higher render
resolutions OpenTS supports the sidebar, tab bar, dialogs, and readouts stay
the same on-screen size while only the tactical view grows. This adds a
configurable interface scale so the UI can be enlarged to match the resolution
without giving up the wider tactical view.

Add [Video] UIScale (an integer multiplier, default 1) and scale the sidebar,
tab bar, radar, dialogs, and their text by that factor. The tactical view keeps
the full render resolution and is shrunk only by the extra width the scaled
sidebar occupies.

Behavior and compatibility

Presentation-only. The UI layout is not part of the deterministic simulation,
the save format, or network packets. Confirm that the sidebar's serialized
state (SidebarClass::Serialize and StripClass::Serialize) persists only
slot indices and scroll positions in slot units, never scaled pixel values.

Validation

  • Configured with CMake 4.4.3, generator Visual Studio 17 2022, -A Win32 (MSVC 19.44.35207).
  • Win32 Debug build: succeeded (GameD.exe).
  • Win32 Release build: succeeded (Game.exe).
  • CTest, Debug: 1/1 passed (logstress).

Documentation

  • manual/changes/cursor-size-cap.md
  • manual/changes/cursor-dialog-visibility.md
  • manual/content/keys/cursorscale.md — notes the system-cursor size cap.

Checklist

  • The change is focused; unrelated mechanical cleanup is separate
  • Compatibility effects and any migration are explicit
  • A player- or modder-visible engine change carries its change record
  • Validation distinguishes what passed, failed, and was not run
  • No prohibited assets, binaries, SDKs, credentials, or generated output are included

@github-actions

Copy link
Copy Markdown

Development builds of bb4b98b:

The links work without a GitHub account. Artifacts expire after 90 days, and this comment follows the latest successful build.

Comment thread code/wwmouse.cpp
@@ -293,6 +293,9 @@ void WWMouseClass::Release_Mouse(void)
ClipCursor(NULL);
if (GetCapture() == Window) ReleaseCapture();
while (ShowCursor(TRUE) < 0) {}

SetCursor(LoadCursor(NULL, IDC_ARROW));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This restores the arrow for EVERY mouse release, like score and mission briefing paths too, that call Hide_Mouse(). Release_Mouse() increments the win display counter here and through Show_Mouse(), seems like one subsequent hide would leave the cursor visible. Scope arrow restoration to dialog handoff, or rebalance the counter, check the non-dialog callers too possibly.

@ZivDero

ZivDero commented Sep 5, 2026

Copy link
Copy Markdown
Member

I think this PR might also just outright break cursor scaling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants