How to track difficulties in the pause menu? #3603
-
I have a sprite that disappears or appears depending on the difficulty and it works in freeplay and story mode // Skipping Import x, y, z code
class devInfoDetector extends Module {
var game:PlayState;
var testSprite:FunkinSprite;
var jsonPath;
public function new() {
super("devInfoDetector", 1);
}
public override function onSongLoaded(e) {
super.onSongLoaded(e);
game = PlayState.instance;
jsonPath = Paths.json("songs/" + game.currentSong.id + "/" + game.currentChart.difficulty + "-devCom");
testSprite = new FunkinSprite(50, FlxG.height - 100);
testSprite.loadTexture("devInfoIcon");
testSprite.alpha = Assets.exists(jsonPath) ? 0.7 : 0; // This bugs out if you change the difficulty in the pause menu
testSprite.zIndex = game.camHUD.zIndex + 1000;
testSprite.scrollFactor.set(0, 0);
testSprite.cameras = [game.camHUD];
game.add(testSprite);
if (Assets.exists(jsonPath)) ModuleHandler.activateModule('devInfoActivator');
else ModuleHandler.deactivateModule('devInfoActivator');
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
NotHyper-474
Oct 7, 2024
Replies: 1 comment 4 replies
-
I believe onSongRetry should work with the pause menu |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just a wild guess but maybe you're repeatedly replacing the sprite with a new one while the older sprite stays?
Edit: Turns out that was the case.
2024-10-07.15-33-14.online-video-cutter.com.mp4