Skip to content

[ENHANCEMENT] [MODDING] Scoped Modules #5138

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

AbnormalPoof
Copy link
Member

Linked Issues

N/A

Description

This PR adds a brand new params parameter to the Module constructor with a state parameter to go along with it.
This allows modules that can only run in a specific state, making it easier to make modules that only run in PlayState for example!

import funkin.modding.module.Module;
import funkin.play.PlayState;

class SomePlayStateThing extends Module {
    public function new() {
        super("AAAAAAAAAAAAAAAAA", 1, {
          state: PlayState
        });
    }

    override function onUpdate(event:UpdateScriptEvent):Void {
        super.onUpdate();

        trace('IN PLAYSTATE!!!');
        PlayState.instance.currentStage.getBoyfriend().angle += 360 * event.elapsed;
    }
}

Screenshots/Videos

image

@AbnormalPoof AbnormalPoof added type: enhancement Involves an enhancement or new feature. topic: mods Related to the creation or use of mods. labels May 22, 2025
@github-actions github-actions bot added pr: haxe PR modifies game code. status: pending triage Awaiting review. size: medium A medium pull request with 100 or fewer changes. labels May 22, 2025
@AbnormalPoof AbnormalPoof changed the base branch from main to develop May 22, 2025 08:59
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: medium A medium pull request with 100 or fewer changes. status: pending triage Awaiting review. topic: mods Related to the creation or use of mods. type: enhancement Involves an enhancement or new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants