mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-10 06:07:09 +00:00
Fix some issues causing the Input Offsets view to crash on web.
This commit is contained in:
parent
a41d3033d5
commit
0bf1bead03
|
@ -103,7 +103,11 @@ class NoteStyle implements IRegistryEntry<NoteStyleData>
|
||||||
function buildNoteFrames(force:Bool = false):Null<FlxAtlasFrames>
|
function buildNoteFrames(force:Bool = false):Null<FlxAtlasFrames>
|
||||||
{
|
{
|
||||||
var noteAssetPath = getNoteAssetPath();
|
var noteAssetPath = getNoteAssetPath();
|
||||||
if (noteAssetPath == null) return null;
|
if (noteAssetPath == null)
|
||||||
|
{
|
||||||
|
FlxG.log.warn('Note asset path not found: ${id}');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!FunkinSprite.isTextureCached(Paths.image(noteAssetPath)))
|
if (!FunkinSprite.isTextureCached(Paths.image(noteAssetPath)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,7 @@ import funkin.ui.debug.latency.CoolStatsGraph;
|
||||||
import openfl.events.KeyboardEvent;
|
import openfl.events.KeyboardEvent;
|
||||||
import funkin.input.PreciseInputManager;
|
import funkin.input.PreciseInputManager;
|
||||||
import funkin.play.notes.Strumline;
|
import funkin.play.notes.Strumline;
|
||||||
|
import funkin.ui.mainmenu.MainMenuState;
|
||||||
import funkin.play.notes.notestyle.NoteStyle;
|
import funkin.play.notes.notestyle.NoteStyle;
|
||||||
import funkin.data.notestyle.NoteStyleData;
|
import funkin.data.notestyle.NoteStyleData;
|
||||||
import funkin.data.notestyle.NoteStyleRegistry;
|
import funkin.data.notestyle.NoteStyleRegistry;
|
||||||
|
@ -188,6 +189,12 @@ class LatencyState extends MusicBeatSubState
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function close():Void
|
override public function close():Void
|
||||||
|
{
|
||||||
|
cleanup();
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanup():Void
|
||||||
{
|
{
|
||||||
PreciseInputManager.instance.onInputPressed.remove(preciseInputPressed);
|
PreciseInputManager.instance.onInputPressed.remove(preciseInputPressed);
|
||||||
PreciseInputManager.instance.onInputReleased.remove(preciseInputReleased);
|
PreciseInputManager.instance.onInputReleased.remove(preciseInputReleased);
|
||||||
|
@ -200,7 +207,6 @@ class LatencyState extends MusicBeatSubState
|
||||||
|
|
||||||
FlxG.state.persistentDraw = prevPersistentDraw;
|
FlxG.state.persistentDraw = prevPersistentDraw;
|
||||||
FlxG.state.persistentUpdate = prevPersistentUpdate;
|
FlxG.state.persistentUpdate = prevPersistentUpdate;
|
||||||
super.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function regenNoteData()
|
function regenNoteData()
|
||||||
|
@ -311,7 +317,9 @@ class LatencyState extends MusicBeatSubState
|
||||||
|
|
||||||
if (controls.BACK)
|
if (controls.BACK)
|
||||||
{
|
{
|
||||||
close();
|
// close();
|
||||||
|
cleanup();
|
||||||
|
FlxG.switchState(() -> new MainMenuState());
|
||||||
}
|
}
|
||||||
|
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package funkin.ui.options;
|
package funkin.ui.options;
|
||||||
|
|
||||||
|
import funkin.ui.transition.LoadingState;
|
||||||
import funkin.ui.debug.latency.LatencyState;
|
import funkin.ui.debug.latency.LatencyState;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.FlxSubState;
|
import flixel.FlxSubState;
|
||||||
|
@ -185,7 +186,11 @@ class OptionsMenu extends Page
|
||||||
createItem("PREFERENCES", function() switchPage(Preferences));
|
createItem("PREFERENCES", function() switchPage(Preferences));
|
||||||
createItem("CONTROLS", function() switchPage(Controls));
|
createItem("CONTROLS", function() switchPage(Controls));
|
||||||
createItem("INPUT OFFSETS", function() {
|
createItem("INPUT OFFSETS", function() {
|
||||||
|
#if web
|
||||||
|
LoadingState.transitionToState(() -> new LatencyState());
|
||||||
|
#else
|
||||||
FlxG.state.openSubState(new LatencyState());
|
FlxG.state.openSubState(new LatencyState());
|
||||||
|
#end
|
||||||
});
|
});
|
||||||
|
|
||||||
#if newgrounds
|
#if newgrounds
|
||||||
|
|
|
@ -451,6 +451,11 @@ class LoadingState extends MusicBeatSubState
|
||||||
|
|
||||||
return promise.future;
|
return promise.future;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function transitionToState(state:NextState, stopMusic:Bool = false):Void
|
||||||
|
{
|
||||||
|
FlxG.switchState(() -> new LoadingState(state, stopMusic));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MultiCallback
|
class MultiCallback
|
||||||
|
|
Loading…
Reference in a new issue