Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nui-core): add options to switch between fixed size modes #2403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AvarianKnight
Copy link
Contributor

@AvarianKnight AvarianKnight commented Feb 27, 2024

Goal of this PR

Allow users to choose between 1920x1080 and 2560x1440 for the scaled UI, fixing bad UI scaling by server developers for users using 4k monitors.

See #2397 for more discussion

How is this PR achieving the goal

Adds nui_fixedSizeMode and UI elements to allows the user to choose between 0 (1920x1080) and 1 (2560x1440).

This PR applies to the following area(s)

FiveM, NUI

Successfully tested on

@wacha-329 tested the build and said it works as expected

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

#2397

- for players with larger screens (4160x2160) 1920x1080 might be too big this adds an option to scale to 1920x1080 or 2560x1440
- see citizenfx#2397 for more discussion
@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Feb 27, 2024
@wacha-329
Copy link

Thanks for the great suggestions!
This PR is going to solve the problem I had.
I will build and try it out.

Another reason for the fix I suggested in #2397 is that I have seen other users playing on FiveM with misaligned UI and thought it would be useful to be able to freely determine the resolution of the UI.
I don't know what the resolution of that player is, but it is probably a 16:10 display.
I think it would be useful to have some other resolution options as well.
So I implemented it in the form of a .ini file so that the user can freely change it.
GTAV also has a resolution option, and I think it would be even more usable if we could match it.

Reference: Resolution options when launching GTAV on a 4K display

3840x2160, 2560x1600, 2560x1440, 2048x1536, 2048x1280, 2048x1152, 1920x1440, 1920x1200, 1920x1080, 1680x1050,
1600x1200, 1600x1024, 1600x900, 1440x1080, 1440x900, 1400x1050, 1366x768, 1360x768, 1280x1024, 1280x960,
1280x800, 1280x768, 1280x720, 1176x664, 1152x864, 1024x768, 800x600

@wacha-329
Copy link

wacha-329 commented Feb 27, 2024

I have tried the build in both the environment with the latest source code reflecting the modifications and in the PR branch environment.

Both builds were successful and the UI resolution changes worked correctly.
I am attaching a screenshot for reference.

Fixed-size NUI disable
Fixed-size NUI-disable
Fixed-size NUI enable 1920x1080
Fixed-size NUI-enable-1920x1080
Fixed-size NUI enable 2560x1440
Fixed-size NUI-enable-2560x1440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants