Skip to content

Conversation

@lemz1
Copy link

@lemz1 lemz1 commented Feb 22, 2025

DESCRIPTION

This pr adds the ability to import scripted classes like you would do in regular haxe, meaning:

package my.mod.game;

import game.ScriptedGame;
import my.mod.objects.ModdedPlayer;

class ModdedGame extends ScriptedGame {
  public function new() {
    var player = new ModdedPlayer();
  }
}

EXPLANATION

We create another imports variable to the PolymodClassDeclEx, because a script might import a class that hasn't been registered yet.
After all classes have been registered and parsed, we validate the imports. If the import still can't be found we give the user an error.

@lemz1 lemz1 force-pushed the feature/import-scripted-class branch 3 times, most recently from 3eacb74 to 8cee453 Compare February 22, 2025 11:25
Copy link
Member

@AbnormalPoof AbnormalPoof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please

@lunacynne
Copy link

will #201 replace this? or is it a separate thing
i see "ability to extend scripted classes" but idk if this implies the ability to import or not

@lemz1
Copy link
Author

lemz1 commented Mar 3, 2025

will #201 replace this? or is it a separate thing i see "ability to extend scripted classes" but idk if this implies the ability to import or not

#201 does implement importing scripted classes. So i guess #201 would also replace this pr.

@EliteMasterEric EliteMasterEric changed the base branch from experiment/static-fields to experimental July 2, 2025 19:24
@EliteMasterEric
Copy link
Member

When you want to
test a PR
but Github said
1 billion conflicts

@lemz1 lemz1 force-pushed the feature/import-scripted-class branch 2 times, most recently from b1ace5d to f73c56b Compare July 2, 2025 19:46
Copy link
Member

@EliteMasterEric EliteMasterEric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still has merge conflicts with the experimental branch.

@lemz1 lemz1 force-pushed the feature/import-scripted-class branch from f73c56b to cef484b Compare July 5, 2025 01:08
@lemz1 lemz1 requested a review from EliteMasterEric July 11, 2025 03:27
@EliteMasterEric EliteMasterEric merged commit 6365030 into FunkinCrew:experimental Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants