fivem icon indicating copy to clipboard operation
fivem copied to clipboard

feat(extra-natives/five): add IS_FULLSCREEN

Open Nyakudev opened this issue 1 year ago • 7 comments

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

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

Fixes issues

none

Nyakudev avatar Oct 03 '24 19:10 Nyakudev

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

Nyakudev avatar Oct 03 '24 19:10 Nyakudev

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

AvarianKnight avatar Oct 03 '24 19:10 AvarianKnight

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.

Nyakudev avatar Oct 03 '24 20:10 Nyakudev

You can already do this with

print(GetConvar("profile_vidScreenType", 1))

matehun00 avatar Oct 03 '24 20:10 matehun00

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”.

Nyakudev avatar Oct 03 '24 20:10 Nyakudev

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"

AvarianKnight avatar Oct 06 '24 19:10 AvarianKnight

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.

tens0rfl0w avatar Oct 06 '24 21:10 tens0rfl0w

Thank you for your contribution but our current common goal is to not increase codebase without proper reason for that. I can't find any real use case for that. If you have such use case feel free to provide it, but for now I will close this PR.

prikolium-cfx avatar Nov 06 '24 10:11 prikolium-cfx