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

Steam.InputGlyphStyle warnings when combining flags #425

Open
Formedras opened this issue Feb 29, 2024 · 1 comment
Open

Steam.InputGlyphStyle warnings when combining flags #425

Formedras opened this issue Feb 29, 2024 · 1 comment
Assignees
Labels
gdextension Related to the GDExtension build mono Related to Mono / C#

Comments

@Formedras
Copy link

Describe the bug
Steam.InputGlyphStyle is supposed to be bitfield flags rather than a straight enum. This causes the problem that when a variable is defined as type Steam.InputGlyphStyle, it causes a warning when trying to use multiple styles together, such as Steam.INPUT_GLYPH_STYLE_LIGHT | Steam.INPUT_GLYPH_STYLE_SOLID_ABXY.

To Reproduce
Steps to reproduce the behavior:

  1. Define a variable set as type Steam.InputGlyphStyle. Example: var gstyle : Steam.InputGlyphStyle
  2. Use bitwise OR to use multiple styles together, and assign that value to the variable. gstyle = Steam.INPUT_GLYPH_STYLE_LIGHT | Steam.INPUT_GLYPH_STYLE_SOLID_ABXY
  3. Code editor (I use Visual Studio Code Insiders) will give INT_AS_ENUM_WITHOUT_MATCH and INT_AS_ENUM_WITHOUT_CAST warnings.

Expected behavior
These warnings should not appear.

Screenshots
2024-02-29

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: 22H2 Build 22621.3155

Version of Godot:
Godot 4.2.1 .NET

Version of GodotSteam:
GDExtension 4.6

Additional context
Unfortunately, I don't know if GDScript is structured such that this problem even can be fixed. From what I've seen, it uses a different syntax for bitflags than it does for enums, and I can't tell if said syntax is even compatible with being used in code in the first place; the docs seem to imply using bitflags only as hints for the Inspector.
Thankfully, this isn't a breaking error. It just gives warnings that can be suppressed with @ignore_warning and in-game functionality will be as expected (that is, the styles combine without issue when you request a glyph path from Steam) even if you don't do so. Also, not explicitly casting the variable will avoid these warnings as well.

@Formedras Formedras changed the title Steam.InputGlyphStyle issues as enum Steam.InputGlyphStyle warnings when combining flags Feb 29, 2024
@Gramps Gramps self-assigned this Feb 29, 2024
@Gramps Gramps added gdextension Related to the GDExtension build mono Related to Mono / C# labels Feb 29, 2024
@Gramps
Copy link
Member

Gramps commented Feb 29, 2024

Hey there! Interesting. I know in Godot 3.x we cannot set a bitfield cast:

VARIANT_ENUM_CAST(Steam::InputGlyphStyle);

But in 4.x we can:

VARIANT_BITFIELD_CAST(Steam::InputGlyphStyle);

Yeah, I'm not sure this is fixable on our end but I will investigate it more and see what I can figure out! Thank you for submitting this issue. If it is not something that can be fixed, we do need to mention this in our documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gdextension Related to the GDExtension build mono Related to Mono / C#
Projects
None yet
Development

No branches or pull requests

2 participants