continuinggg (very cool improvements)
asynced video loadings, classes rewrites, bugfixes and a lot more
This commit is contained in:
@@ -43,6 +43,8 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
|
||||
public var debugMode:Bool = false;
|
||||
public var animDatas:Map<String, AnimData> = [];
|
||||
|
||||
public var globalCurFrame(get, set):Int;
|
||||
|
||||
/**
|
||||
* ODD interval -> asynced; EVEN interval -> synced
|
||||
*/
|
||||
@@ -374,4 +376,11 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
|
||||
|
||||
return beatInterval = v;
|
||||
}
|
||||
|
||||
@:noCompletion private inline function get_globalCurFrame() {
|
||||
return animateAtlas != null ? (animateAtlas.anim.curFrame) : (animation.curAnim != null ? animation.curAnim.curFrame : 0);
|
||||
}
|
||||
@:noCompletion private inline function set_globalCurFrame(val:Int) {
|
||||
return animateAtlas != null ? (animateAtlas.anim.curFrame = val) : (animation.curAnim != null ? animation.curAnim.curFrame = val : val);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ class MusicBeatState extends FlxState implements IBeatReceiver
|
||||
public override function openSubState(subState:FlxSubState) {
|
||||
var e = event("onOpenSubState", EventManager.get(StateEvent).recycle(subState));
|
||||
if (!e.cancelled)
|
||||
super.openSubState(subState);
|
||||
super.openSubState(e.substate is FlxSubState ? cast e.substate : subState);
|
||||
}
|
||||
|
||||
public override function onResize(w:Int, h:Int) {
|
||||
@@ -256,11 +256,9 @@ class MusicBeatState extends FlxState implements IBeatReceiver
|
||||
if (e.cancelled)
|
||||
return false;
|
||||
|
||||
if (skipTransOut)
|
||||
if (skipTransOut || (subState is MusicBeatTransition && cast(subState, MusicBeatTransition).newState != null))
|
||||
return true;
|
||||
if (subState is MusicBeatTransition && cast(subState, MusicBeatTransition).newState != null)
|
||||
return true;
|
||||
openSubState(new MusicBeatTransition(nextState));
|
||||
openSubState(new MusicBeatTransition(e.substate));
|
||||
persistentUpdate = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
|
||||
public override function openSubState(subState:FlxSubState) {
|
||||
var e = event("onOpenSubState", EventManager.get(StateEvent).recycle(subState));
|
||||
if (!e.cancelled)
|
||||
super.openSubState(subState);
|
||||
super.openSubState(e.substate is FlxSubState ? cast e.substate : subState);
|
||||
}
|
||||
|
||||
public override function onResize(w:Int, h:Int) {
|
||||
@@ -235,7 +235,7 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver
|
||||
var e = event("onStateSwitch", EventManager.get(StateEvent).recycle(nextState));
|
||||
if (e.cancelled)
|
||||
return false;
|
||||
return super.switchTo(nextState);
|
||||
return super.switchTo(e.substate);
|
||||
}
|
||||
|
||||
public override function onFocus() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import flixel.FlxState;
|
||||
|
||||
final class StateEvent extends CancellableEvent {
|
||||
/**
|
||||
* Substate that is about to be opened/closed
|
||||
* Substate or State that is about to be opened/closed
|
||||
*/
|
||||
public var substate:FlxState;
|
||||
public var substate:FlxState; // WHY is it named substate :sob: - Nex
|
||||
}
|
||||
@@ -18,8 +18,8 @@ class MainState extends FlxState {
|
||||
public override function create() {
|
||||
super.create();
|
||||
if (!initiated) {
|
||||
Main.loadGameSettings();
|
||||
Constants.init();
|
||||
Main.loadGameSettings();
|
||||
}
|
||||
|
||||
initiated = true;
|
||||
|
||||
Reference in New Issue
Block a user