Skip to content

[FEATURE] Add support for static fields importing - #526

Merged
AbnormalPoof merged 2 commits into
FunkinCrew:developfrom
ahmed7p:import-fields
Oct 4, 2026
Merged

AbnormalPoof merged 2 commits into
FunkinCrew:developfrom
ahmed7p:import-fields

Conversation

@ahmed7p

@ahmed7p ahmed7p commented Oct 4, 2026 •

Copy link
Copy Markdown

Linked Issues

#328

Description

This PR adds support for importing and resolving static fields locally within scripts, covering both standard and scripted classes and enums, alongside wildcard support.

// 1. Importing a direct static field from a class
import my.package.MyClass.myStaticField;

// 2. Importing a field from a normal enum
import my.package.MyEnum.SomeEnumValue;

// 3. Importing a static field from a scripted class
import custom.scripts.MyScriptedClass.someStaticField;

// 4. Importing a field/value from a scripted enum
import custom.scripts.MyScriptedEnum.MyScriptedEnumValue;

// 5. Importing a static field with an alias
import my.package.MyClass.someStaticField as myStaticField;

// 6. Wildcard importing all fields from a class
import my.package.MyClass.*;

 
    // Using the imported static field from a class
    if (myStaticField) {
        trace("Static field is active!");

      // Using the imported  enum field
      var enumVal = SomeEnumValue;
      trace("Enum field value: " + enumVal);

      // Using the imported static field from a scripted class
      someScriptedMethod();

      // Using the imported scripted enum value
      var scriptedEnumVal = MyScriptedEnumValue;
      trace("Scripted enum value: " + scriptedEnumVal);

  }

@AbnormalPoof
AbnormalPoof merged commit 35549bb into FunkinCrew:develop Oct 4, 2026
9 checks passed
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.

2 participants