FunkinParentDisabler + ratings fix
This commit is contained in:
@@ -70,8 +70,6 @@ class Chart {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.difficulties.length <= 0)
|
||||
data.difficulties.push("CHART MISSING");
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package funkin.editors.ui;
|
||||
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
import flixel.math.FlxRect;
|
||||
import openfl.ui.MouseCursor;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import flixel.math.FlxRect;
|
||||
import flixel.system.FlxAssets.FlxShader;
|
||||
import flixel.util.FlxAxes;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
import flixel.util.FlxSpriteUtil;
|
||||
import openfl.display.BlendMode;
|
||||
import openfl.filters.BitmapFilter;
|
||||
|
||||
@@ -9,7 +9,6 @@ import funkin.menus.StoryMenuState.WeekData;
|
||||
import funkin.ui.FunkinText;
|
||||
import flixel.group.FlxSpriteGroup;
|
||||
import funkin.scripting.Script;
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
import funkin.scripting.ScriptPack;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
@@ -1463,7 +1462,7 @@ class PlayState extends MusicBeatState
|
||||
if (event.showRating || (event.showRating == null && event.player && !note.isSustainNote))
|
||||
{
|
||||
var rating:FlxSprite = comboGroup.recycle(FlxSprite);
|
||||
rating.resetSprite(-40, -60);
|
||||
rating.resetSprite(comboGroup.x + -40, comboGroup.y + -60);
|
||||
comboGroup.remove(rating, true);
|
||||
|
||||
songScore += score;
|
||||
@@ -1474,7 +1473,7 @@ class PlayState extends MusicBeatState
|
||||
rating.velocity.x -= FlxG.random.int(0, 10);
|
||||
|
||||
var comboSpr:FlxSprite = comboGroup.recycle(FlxSprite).loadAnimatedGraphic(Paths.image('${event.ratingPrefix}combo${event.ratingSuffix}'));
|
||||
comboSpr.resetSprite(0, 0);
|
||||
comboSpr.resetSprite(comboGroup.x, comboGroup.y);
|
||||
comboGroup.remove(comboSpr, true);
|
||||
comboSpr.acceleration.y = 600;
|
||||
comboSpr.velocity.y -= 150;
|
||||
@@ -1497,7 +1496,7 @@ class PlayState extends MusicBeatState
|
||||
for (i in 0...separatedScore.length)
|
||||
{
|
||||
var numScore:FlxSprite = comboGroup.recycle(FlxSprite).loadAnimatedGraphic(Paths.image('${event.ratingPrefix}num${separatedScore.charAt(i)}${event.ratingSuffix}'));
|
||||
numScore.resetSprite((43 * i) - 90, 80);
|
||||
numScore.resetSprite(comboGroup.x + (43 * i) - 90, comboGroup.y + 80);
|
||||
comboGroup.remove(numScore, true);
|
||||
numScore.antialiasing = event.numAntialiasing;
|
||||
numScore.scale.set(event.numScale, event.numScale);
|
||||
|
||||
@@ -19,6 +19,7 @@ import flixel.FlxCamera;
|
||||
import flixel.FlxObject;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
|
||||
import funkin.ui.Alphabet;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
|
||||
@@ -13,6 +13,7 @@ import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import funkin.options.keybinds.KeybindsOptions;
|
||||
import funkin.menus.StoryMenuState;
|
||||
import funkin.system.FunkinParentDisabler;
|
||||
|
||||
class PauseSubState extends MusicBeatSubstate
|
||||
{
|
||||
@@ -39,6 +40,8 @@ class PauseSubState extends MusicBeatSubstate
|
||||
{
|
||||
super.create();
|
||||
|
||||
add(new FunkinParentDisabler());
|
||||
|
||||
pauseScript = Script.create(Paths.script(script));
|
||||
pauseScript.setParent(this);
|
||||
pauseScript.load();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package funkin.options;
|
||||
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
class OptionsTree extends FlxTypedGroup<OptionsScreen> {
|
||||
public var lastMenu:OptionsScreen;
|
||||
public override function new() {
|
||||
|
||||
@@ -5,7 +5,6 @@ import sys.thread.Thread;
|
||||
#end
|
||||
|
||||
import hscript.IHScriptCustomBehaviour;
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
|
||||
class MultiThreadedScript implements IFlxDestroyable implements IHScriptCustomBehaviour {
|
||||
var thread:#if ALLOW_MULTITHREADING Thread #else Dynamic #end;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package funkin.system;
|
||||
|
||||
import flixel.util.FlxTimer;
|
||||
import flixel.tweens.FlxTween;
|
||||
|
||||
/**
|
||||
* Just add this in any substate to disable tweens, timers & camera movement from parent state.
|
||||
*/
|
||||
class FunkinParentDisabler extends FlxBasic {
|
||||
var __tweens:Array<FlxTween>;
|
||||
var __cameras:Array<FlxCamera>;
|
||||
var __timers:Array<FlxTimer>;
|
||||
var __replaceUponDestroy:Bool;
|
||||
public function new(replaceUponDestroy:Bool = true) {
|
||||
super();
|
||||
__replaceUponDestroy = replaceUponDestroy;
|
||||
@:privateAccess {
|
||||
// tweens
|
||||
__tweens = FlxTween.globalManager._tweens.copy();
|
||||
FlxTween.globalManager._tweens = [];
|
||||
|
||||
// timers
|
||||
__timers = FlxTimer.globalManager._timers.copy();
|
||||
FlxTimer.globalManager._timers = [];
|
||||
|
||||
// cameras
|
||||
__cameras = [for(c in FlxG.cameras.list) if (c.followActive) c];
|
||||
for(c in __cameras) c.followActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override function update(elapsed:Float) {}
|
||||
public override function draw() {}
|
||||
|
||||
public override function destroy() {
|
||||
super.destroy();
|
||||
@:privateAccess {
|
||||
if (__replaceUponDestroy) {
|
||||
FlxTween.globalManager._tweens = __tweens;
|
||||
FlxTimer.globalManager._timers = __timers;
|
||||
} else {
|
||||
for(t in __tweens) FlxTween.globalManager._tweens.push(t);
|
||||
for(t in __timers) FlxTimer.globalManager._timers.push(t);
|
||||
}
|
||||
for(c in __cameras) c.followActive = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import flixel.math.FlxMatrix;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.math.FlxPoint;
|
||||
import funkin.interfaces.IBeatReceiver;
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
|
||||
@:enum
|
||||
abstract XMLAnimType(Int)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package funkin.updating;
|
||||
|
||||
import funkin.shaders.CustomShader;
|
||||
import flixel.util.FlxDestroyUtil;
|
||||
import funkin.ui.FunkinText;
|
||||
import funkin.menus.TitleState;
|
||||
import flixel.math.FlxRect;
|
||||
|
||||
Reference in New Issue
Block a user