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(extra-natives/five): add IS_FULLSCREEN #2835

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Nyakudev
Copy link

@Nyakudev Nyakudev commented Oct 3, 2024

Goal of this PR

This PR introduces a new native function that determines whether the client window is in fullscreen mode. This feature can benefit web developers and be useful for some functionalities.

How is this PR achieving the goal

By adding the native function IsFullscreen, developers can easily check if the client window is in fullscreen mode.

This PR applies to the following area(s)

  • FiveM
  • Natives

Successfully tested on

  • 3258
  • 3095
  • 2944

Game builds:
all

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

none

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Oct 3, 2024
@Nyakudev
Copy link
Author

Nyakudev commented Oct 3, 2024

Sorry for shitty commits name, it's because i have modified the native-decls in github web.

@AvarianKnight
Copy link
Contributor

Can you explain what this is needed for?

This feature can benefit web developers and be useful for some functionalities.

Isn't very specific.

A feature request like this got shut down before out of fear that people would abuse this for cheat detection

@Nyakudev
Copy link
Author

Nyakudev commented Oct 3, 2024

A feature request like this got shut down before out of fear that people would abuse this for cheat detection

What is the problem if it's used to detect cheaters? It's the server problem if it lead to a fake ban.

@matehun00
Copy link

You can already do this with

print(GetConvar("profile_vidScreenType", 1))

@Nyakudev
Copy link
Author

Nyakudev commented Oct 3, 2024

You can already do this with

print(GetConvar("profile_vidScreenType", 1))

oh ok good to know but very few people know it adding the native would make it “easier”.

@AvarianKnight
Copy link
Contributor

A feature request like this got shut down before out of fear that people would abuse this for cheat detection

What is the problem if it's used to detect cheaters? It's the server problem if it lead to a fake ban.

Because this will lead to servers trying to force players to play in "Fullscreen" or risk being banned because of the possibility of the player cheating.

There is also no need for the server to have access to this information, unless you have another reason other than "to detect cheats"

@tens0rfl0w
Copy link
Contributor

A set screen type of Windowed or Fullscreen (with a non-default resolution) would result in this returning false. So there's no way to differentiate between a non-focused game window and these screen settings. I can't think of any use case where a script could benefit from this information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants