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

[FEATURE] Registry Macro #3694

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

lemz1
Copy link
Contributor

@lemz1 lemz1 commented Oct 13, 2024

TODO

  • RegistryMacro
    • build instance field
    • build getScriptedClassNames field
    • build createScriptedEntry field
    • build parseEntryData field
    • build parseEntryDataRaw field
  • EntryMacro
    • build registryInstance field
    • build _fetchData field
    • build id field
    • build _data field
    • build toString field
    • build destroy field
  • General
    • fix macro crying about non-existing fields (ISSUE 1)
    • fix macro for Conversation(Registry) (help wanted) (ISSUE 2)
    • fix macro for AlbumRegistry, FreeplayStyleRegistry, LevelRegistry, StageRegistry (help wanted) (ISSUE 3)

ISSUE 1 (SOLVED?)

image

This also happens with other registries.

I know that the macro isn't directly the problem, because I've used a similar macro for a different branch, in which I created my own types of registries. The entries for my registries didn't access Registry.instance. This is why I believe that the issue arises from NoteStyle calling NoteStyleRegistry.instance.

Update: I've tested it out, and yes my assumption was correct. The use of instance in the entry causes the macro not to work.

Solution(?): Use EntryMacro to create a getter called registryInstance, and use that instead of Registry.instance.

ISSUE 2

image

Conversation and ConversationRegistry don't use the macro, however, Speaker and SpeakerRegistry do use it.

I don't know why this error happens.

If we find a solution to this, we might not need the registryInstance field anymore.

ISSUE 3

image

This also happens with FreeplayStyleRegistry, LevelRegistry, StageRegistry.

I believe the issue is the order in which the macros are called. The registries that work call the macros in this order:
EntryMacro
RegistryMacro

The ones that don’t work call it in this order:
RegistryMacro
EntryMacro

@lemz1 lemz1 marked this pull request as draft October 13, 2024 17:45
@github-actions github-actions bot added large A large pull request with more than 100 changes haxe Issue/PR modifies game code labels Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
haxe Issue/PR modifies game code large A large pull request with more than 100 changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant