Skip to content

Conversation

@KoloInDaCrib
Copy link
Contributor

@KoloInDaCrib KoloInDaCrib commented Nov 12, 2025

Linked Issues

No, sire, none at all.

Description

This PR adds more functionality to ClassMacro - using it to list all typedefs and store them and their underlying class into a map to then be added as an import alias for HScript.
This works for both typedefs that point to a class (such as FlxSpriteGroup) and typedefs that point to an abstract of a class (such as FlxSignal).

If you're wondering why I'm comparing string versions of parameters instead of their regular enum selves, refer to this screenshot:
image
As you can see, Type.enumEq returns false despite the two parameters being literally the exact same. Macros are infuriating.

Screenshots/Videos

image

@github-actions github-actions bot added size: large A large pull request with more than 100 changes. status: pending triage Awaiting review. pr: haxe PR modifies game code. labels Nov 12, 2025
@AbnormalPoof AbnormalPoof added type: enhancement Involves an enhancement or new feature. topic: mods Related to the creation or use of mods. labels Nov 12, 2025
@lemz1
Copy link
Contributor

lemz1 commented Nov 13, 2025

As you can see, Type.enumEq returns false despite the two parameters being literally the exact same. Macros are infuriating.

The reason Type.enumEq returns false is because we are comparing arrays.
even though the arguments in TFun of params and checkParams are both an empty array, they dont live at the same memory address.
in other words, Type.enumEq does not work when the enum has arguments of type array, because it compares the references of the arrays not the actual values inside the array.

you can see what i mean here: Try Haxe Code

Maybe we should create a helper function that also works with enums that have arguments of type array?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: haxe PR modifies game code. size: large A large pull request with more than 100 changes. status: pending triage Awaiting review. topic: mods Related to the creation or use of mods. type: enhancement Involves an enhancement or new feature.

Development

Successfully merging this pull request may close these issues.

3 participants