Files
FNF-i486-Engine/source/FlashingState.hx
JordanSantiagoYT b32c4a7518 YES
added another window name suffix that updates based on if your JSE version is outdated, i'll fix the outdated state tomorrow (when JSE 1.13.0 releases!)
made the windownamesuffix update based on which state you're in
FINALLY fixed the Machine Gun Options bug on Android builds (turns out Stefan/MaysLastPlay forgot to make it remove the current virtualpad when you opened one of the menus)
Gave different exit choices
fixed a null object reference with Showcase Mode & scoreTxt Size
temporarily disabled the results screen in story mode, as it appears to popup after the first song
2023-10-26 15:23:01 -04:00

93 lines
2.4 KiB
Haxe

package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxSubState;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.effects.FlxFlicker;
import lime.app.Application;
import flixel.addons.transition.FlxTransitionableState;
import flixel.tweens.FlxTween;
import flixel.util.FlxTimer;
class FlashingState extends MusicBeatState
{
public static var leftState:Bool = false;
var warnText:FlxText;
override function create()
{
Paths.clearStoredMemory();
Paths.clearUnusedMemory();
MusicBeatState.windowNameSuffix = " - Flashing Lights Warning Screen";
super.create();
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
add(bg);
#if android
warnText = new FlxText(0, 0, FlxG.width,
"Hey, watch out!\n
This Mod contains some flashing lights!\n
Press A button to disable them now or go to Options Menu.\n
Press B button to ignore this message.\n
You've been warned!",
32);
#else
warnText = new FlxText(0, 0, FlxG.width,
"Hey, watch out!\n
This Mod contains some flashing lights!\n
Press ENTER to disable them now or go to Options Menu.\n
Press ESCAPE to ignore this message.\n
You've been warned!",
32);
#end
warnText.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, CENTER);
warnText.screenCenter(Y);
add(warnText);
#if android
addVirtualPad(NONE, A_B);
#end
}
override function update(elapsed:Float)
{
if(!leftState) {
var back:Bool = controls.BACK;
if (controls.ACCEPT || back) {
leftState = true;
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
if(!back) {
ClientPrefs.flashing = false;
ClientPrefs.saveSettings();
FlxG.sound.play(Paths.sound('confirmMenu'));
FlxFlicker.flicker(warnText, 1, 0.1, false, true, function(flk:FlxFlicker) {
#if android
virtualPad.alpha = 0.1;
#end
new FlxTimer().start(0.5, function (tmr:FlxTimer) {
MusicBeatState.switchState(new TitleState());
});
});
} else {
FlxG.sound.play(Paths.sound('cancelMenu'));
#if android
FlxTween.tween(virtualPad, {alpha: 0}, 1);
#end
FlxTween.tween(warnText, {alpha: 0}, 1, {
onComplete: function (twn:FlxTween) {
MusicBeatState.switchState(new TitleState());
}
});
}
}
}
super.update(elapsed);
}
}