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

fix(nui): Fixed to be able to change the resolution setting of Fixed-size NUI #2397

Closed

Conversation

wacha-329
Copy link

@wacha-329 wacha-329 commented Feb 21, 2024

Goal of this PR

The purpose is to be able to change the resolution setting of Fixed-sizeNUI, which is one of the items in the FiveM settings.
The current implementation is fixed at 1920x1080, and when playing in 4K, the game cannot be set to 4K and the size of the NUI to WQHD, which lacks scalability, so this modification will make it possible.

How is this PR achieving the goal

By defining FixedSizeWindowX and FixedSizeWindowY in CitizenFX.ini, the resolution can be changed to any desired resolution.
If not defined, the resolution will be 1920x1080.
FixedSizeWindowX ranges is 640-7680
FixedSizeWindowY range is 480-4320
If this range is exceeded, the default is 1920x1080.

This PR applies to the following area(s)

FiveM, RedM

Successfully tested on

Platforms: Windows

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

N/A

Supplement

I was thinking of loading ini within NUIWindow::UpdateFrame(), but I thought it was not a good idea because UpdateFrame is a function that is called frequently.
As a result, we implemented it in a way that the file is loaded in Initialized and the value is held in a variable.
If there are any problems with this implementation, please let us know.
I am new to programming and may have implemented it incorrectly. My apologies.

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Feb 21, 2024
@wacha-329 wacha-329 changed the title Fixed to be able to change the resolution setting of Fixed-size NUI fix(components/nui-core): Fixed to be able to change the resolution setting of Fixed-size NUI Feb 21, 2024
@AvarianKnight
Copy link
Contributor

AvarianKnight commented Feb 21, 2024

I'm confused why this is necessary? The only reason this option exists is because developers don't scale their UI properly for higher resolution monitors, see the original commit.

If you're playing at 4k then you should ideally not have to use nui_useFixedSize if the server owner/developers properly scale their UI.

@wacha-329
Copy link
Author

Thank you for presenting the original commit.
I understood that it was added as a setting to address the case where the UI display is broken.

If you're playing at 4k then you should ideally not have to use nui_useFixedSize if the server owner/developers properly scale their UI.

I agree with that opinion.
However, there are some Plugins that do not support scale, and some of them are not supported even if we ask the developer to do so.
Therefore, I believe that if the client can change the resolution to any desired resolution, such problems will no longer occur.
So I suggested this option.

Thank you.

@wacha-329 wacha-329 changed the title fix(components/nui-core): Fixed to be able to change the resolution setting of Fixed-size NUI fix(nui): Fixed to be able to change the resolution setting of Fixed-size NUI Feb 21, 2024
@Mycroft-Studios
Copy link

However, there are some Plugins that do not support scale

thats exactly why its locked at 1080p, changing the resoltuion it locks to, wouldnt make literally any "better" scaling experience,
and would just be the same as changing your games resolution

@wacha-329
Copy link
Author

Let me talk about what made me decide to make this correction.
I want to play the game in 4K, in which case the UI will also scale to 4K.
However, that made the UI too small and the text hard to read, so I enabled Fixed-size NUI and the next thing I knew the UI was too large.
Currently, the resolution is fixed at 1920x1080, and I proposed this PR because I would like to be able to set the resolution of the Fixed-size NUI to 2560x1440 (WQHD).
This modification was born from the idea that we would like to play the game in 4K and the UI in WQHD.
I think this is different from the intention of setting Fixed-size NUI, so please close this PR if you think it is unnecessary.
Thank you.

@Mycroft-Studios
Copy link

Mycroft-Studios commented Feb 26, 2024

I want to play the game in 4K, in which case the UI will also scale to 4K.

yeah, that, isnt what this is intended for, or what it does

@wacha-329
Copy link
Author

OK :)
Thank you for taking the time to help me with this PR.

I want to play the game in 4K, in which case the UI will also scale to 4K.

Hopefully one day this will happen as a different feature.
Thank you very much.

@wacha-329 wacha-329 closed this Feb 27, 2024
@AvarianKnight
Copy link
Contributor

AvarianKnight commented Feb 27, 2024

I want to play the game in 4K, in which case the UI will also scale to 4K.

yeah, that, isnt what this is intended for, or what it does

I don't think this is completely right, this mode is meant to fix bad scaling by developers which seems to be what wacha is asking for, but I don't think this is the right approach to do it as it would be hidden and not very intuitive for the end user.

Adding an option to switch between 1920x1080 & 2560x1440 might be worthwhile.

AvarianKnight added a commit to AvarianKnight/fivem that referenced this pull request Feb 27, 2024
- 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
AvarianKnight added a commit to AvarianKnight/fivem that referenced this pull request Feb 27, 2024
- 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
AvarianKnight added a commit to AvarianKnight/fivem that referenced this pull request Feb 27, 2024
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RedM Issues/PRs related to RedM 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.

3 participants