Skip to content

Allow configuring the minimum client resolution and refactor ScreenResolution class - #1092

Open
SadPencil with Copilot wants to merge 16 commits into
developfrom
copilot/allow-minimal-client-resolution
Open

Allow configuring the minimum client resolution and refactor ScreenResolution class#1092
SadPencil with Copilot wants to merge 16 commits into
developfrom
copilot/allow-minimal-client-resolution

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Feature Pull Request

Warning

A linked feature issue in the same repository is required. Pull requests that do not link an existing feature issue—or link an issue that has not been approved by the maintainers—may be closed.

Related Issue

What's Changed

This adds explicit ClientDefinitions.ini settings for the minimum client window size, replacing the hardcoded 800x600 floor used by fullscreen/windowed resolution selection. The new settings align client window sizing with the existing render-resolution configuration model.

  • Configuration surface

    • Add MinimalClientWidth and MinimalClientHeight to ClientConfiguration with 800x600 defaults.
    • Expose the new keys in DXMainClient/Resources/ClientDefinitions.ini.
  • Resolution selection

    • Use the configured minimum client size when computing SafeFullScreenResolution.
    • Use the configured minimum client size when populating the client resolution dropdown in display options.
  • Recommended resolution handling

    • Filter recommended/scaled client resolutions against the configured minimum so recommended entries cannot bypass the floor.
  • Documentation

    • Document the client window render bounds and minimum client size settings in Docs/INISystem.md.
[Settings]
MinimumRenderWidth=1024
MinimumRenderHeight=600
MaximumRenderWidth=1280
MaximumRenderHeight=720
MinimalClientWidth=1280
MinimalClientHeight=720

Breaking Changes

  • This pull request introduces a breaking change
  • This pull request does not introduce a breaking change

If checked, describe the breaking change:

Documentation

  • Documentation update is needed and has been included
  • Documentation update is not needed

Checklist

  • I linked the corresponding feature issue above
  • This pull request is scoped to one feature only
  • Verifier: I honestly verified the implementation by running the client with this PR. Verifier name: @SadPencil. The verifier must be a human, not an AI. The verifier can be the same person as the PR proposer.
图片 图片 图片

Copilot AI and others added 2 commits September 11, 2026 10:54
Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
Copilot AI changed the title [WIP] Allow specifying a minimal client resolution overriding 800x600 Allow configuring the minimum client resolution Sep 11, 2026
Copilot AI requested a review from SadPencil September 11, 2026 11:00
@SadPencil

Copy link
Copy Markdown
Member

@copilot your understanding about RenderWidth/Height is completely wrong. The client resolution is NOT the render resolution. Read the code.

Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot your understanding about RenderWidth/Height is completely wrong. The client resolution is NOT the render resolution. Read the code.

Updated in 8fa235e7. I corrected the INI comments and Docs/INISystem.md so MinimumRenderWidth / MinimumRenderHeight / MaximumRenderWidth / MaximumRenderHeight are described as internal render-resolution bounds, and MinimalClientWidth / MinimalClientHeight are described as the client-resolution selection floor.

Copilot AI and others added 2 commits September 11, 2026 11:07
Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
@SadPencil
SadPencil marked this pull request as ready for review September 11, 2026 11:30
@11EJDE11

Copy link
Copy Markdown
Member

The options window can crash if MinimalClient* is bigger than the desktop in either dimension - ddClientResolution would be empty and Load() would set a SelectedIndex=0. Fix like, Math.Min(MinimalClientWidth, SafeMaximumResolution.Width) (and height too).
I'd change Minimal to Minimum also.

Double check if wm.InitGraphicsMode(1024, 600, false) (GameClass.cs:417) is intended?

A player that has 1024x600 in their settings keeps running at 1024x600 even if a mod increases the setting.

@SadPencil

Copy link
Copy Markdown
Member

The options window can crash if MinimalClient* is bigger than the desktop in either dimension - ddClientResolution would be empty and Load() would set a SelectedIndex=0. Fix like, Math.Min(MinimalClientWidth, SafeMaximumResolution.Width) (and height too). I'd change Minimal to Minimum also.

Double check if wm.InitGraphicsMode(1024, 600, false) (GameClass.cs:417) is intended?

A player that has 1024x600 in their settings keeps running at 1024x600 even if a mod increases the setting.

Nice catch! Let me think

@SadPencil SadPencil changed the title Allow configuring the minimum client resolution Allow configuring the minimum client resolution and refactor ScreenResolution class Sep 12, 2026
@SadPencil
SadPencil requested a review from 11EJDE11 September 12, 2026 05:18
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.

Allow specifying a minimal client resolution overriding 800x600

3 participants