mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-12 05:07:06 +00:00
Merge pull request #187 from FunkinCrew/rewrite/bugfix/menu-spam
Fix spamming buttons on Pause/Freeplay breaking shit
This commit is contained in:
commit
eb95f105d7
|
@ -570,7 +570,7 @@ class FreeplayState extends MusicBeatSubState
|
|||
var randomCapsule:SongMenuItem = grpCapsules.recycle(SongMenuItem);
|
||||
randomCapsule.init(FlxG.width, 0, "Random");
|
||||
randomCapsule.onConfirm = function() {
|
||||
trace("RANDOM SELECTED");
|
||||
capsuleOnConfirmRandom(randomCapsule);
|
||||
};
|
||||
randomCapsule.y = randomCapsule.intendedY(0) + 10;
|
||||
randomCapsule.targetPos.x = randomCapsule.x;
|
||||
|
@ -643,6 +643,8 @@ class FreeplayState extends MusicBeatSubState
|
|||
var spamTimer:Float = 0;
|
||||
var spamming:Bool = false;
|
||||
|
||||
var busy:Bool = false; // Set to true once the user has pressed enter to select a song.
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
@ -690,11 +692,13 @@ class FreeplayState extends MusicBeatSubState
|
|||
fp.updateScore(Std.int(lerpScore));
|
||||
|
||||
txtCompletion.text = Math.floor(lerpCompletion * 100) + "%";
|
||||
// trace(Highscore.getCompletion(songs[curSelected].songName, curDifficulty));
|
||||
|
||||
// trace(intendedScore);
|
||||
// trace(lerpScore);
|
||||
// Highscore.getAllScores();
|
||||
handleInputs(elapsed);
|
||||
}
|
||||
|
||||
function handleInputs(elapsed:Float):Void
|
||||
{
|
||||
if (busy) return;
|
||||
|
||||
var upP = controls.UI_UP_P;
|
||||
var downP = controls.UI_DOWN_P;
|
||||
|
@ -949,6 +953,13 @@ class FreeplayState extends MusicBeatSubState
|
|||
}
|
||||
}
|
||||
|
||||
function capsuleOnConfirmRandom(cap:SongMenuItem):Void
|
||||
{
|
||||
trace("RANDOM SELECTED");
|
||||
|
||||
busy = true;
|
||||
}
|
||||
|
||||
function capsuleOnConfirmDefault(cap:SongMenuItem):Void
|
||||
{
|
||||
// var poop:String = songs[curSelected].songName.toLowerCase();
|
||||
|
@ -963,6 +974,8 @@ class FreeplayState extends MusicBeatSubState
|
|||
curDifficulty = 1;
|
||||
}*/
|
||||
|
||||
busy = true;
|
||||
|
||||
PlayStatePlaylist.isStoryMode = false;
|
||||
|
||||
var songId:String = cap.songTitle.toLowerCase();
|
||||
|
|
|
@ -150,6 +150,11 @@ class PauseSubState extends MusicBeatSubState
|
|||
|
||||
super.update(elapsed);
|
||||
|
||||
handleInputs();
|
||||
}
|
||||
|
||||
function handleInputs():Void
|
||||
{
|
||||
var upP = controls.UI_UP_P;
|
||||
var downP = controls.UI_DOWN_P;
|
||||
var accepted = controls.ACCEPT;
|
||||
|
@ -229,9 +234,14 @@ class PauseSubState extends MusicBeatSubState
|
|||
FlxTransitionableState.skipNextTransIn = true;
|
||||
FlxTransitionableState.skipNextTransOut = true;
|
||||
|
||||
if (PlayStatePlaylist.isStoryMode) openSubState(new funkin.ui.StickerSubState(null, STORY));
|
||||
if (PlayStatePlaylist.isStoryMode)
|
||||
{
|
||||
openSubState(new funkin.ui.StickerSubState(null, STORY));
|
||||
}
|
||||
else
|
||||
{
|
||||
openSubState(new funkin.ui.StickerSubState(null, FREEPLAY));
|
||||
}
|
||||
|
||||
case 'Exit to Chart Editor':
|
||||
this.close();
|
||||
|
|
|
@ -206,6 +206,8 @@ class StickerSubState extends MusicBeatSubState
|
|||
sticker.timing = FlxMath.remapToRange(ind, 0, grpStickers.members.length, 0, 0.9);
|
||||
|
||||
new FlxTimer().start(sticker.timing, _ -> {
|
||||
if (grpStickers == null) return;
|
||||
|
||||
sticker.visible = true;
|
||||
var daSound:String = FlxG.random.getObject(sounds);
|
||||
FlxG.sound.play(Paths.sound(daSound));
|
||||
|
@ -269,10 +271,10 @@ class StickerSubState extends MusicBeatSubState
|
|||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (FlxG.keys.justPressed.ANY)
|
||||
{
|
||||
regenStickers();
|
||||
}
|
||||
// if (FlxG.keys.justPressed.ANY)
|
||||
// {
|
||||
// regenStickers();
|
||||
// }
|
||||
}
|
||||
|
||||
var switchingState:Bool = false;
|
||||
|
|
Loading…
Reference in a new issue