Remove a bunch of deprecation warnings

This commit is contained in:
EliteMasterEric
2025-05-28 16:33:10 -07:00
committed by Kade
parent 25e04cf061
commit fc83685b0f
16 changed files with 59 additions and 58 deletions
+3 -4
View File
@@ -650,11 +650,10 @@ class Project extends HXProject {
// Should be false unless explicitly requested.
GITHUB_BUILD.apply(this, false);
FEATURE_NEWGROUNDS.apply(this, false);
EXCLUDE_ARMV7.apply(this, false);
UNLOCK_EVERYTHING.apply(this, false);
FEATURE_COMPRESSED_TEXTURES.apply(this, false);
FEATURE_GHOST_TAPPING.apply(this, false);
UNLOCK_EVERYTHING.apply(this, false);
// Should be true unless explicitly requested.
HARDCODED_CREDITS.apply(this, true);
@@ -663,7 +662,6 @@ class Project extends HXProject {
FEATURE_FUNKVIS.apply(this, true);
FEATURE_PARTIAL_SOUNDS.apply(this, true);
FEATURE_VIDEO_PLAYBACK.apply(this, true);
FEATURE_STAGE_EDITOR.apply(this, true);
// Should be true on debug builds or if GITHUB_BUILD is enabled.
FEATURE_DEBUG_FUNCTIONS.apply(this, isDebug() || GITHUB_BUILD.isEnabled(this));
@@ -673,7 +671,7 @@ class Project extends HXProject {
// TODO: Look into ways to optimize logging (maybe by using a thread pool?)
FEATURE_LOG_TRACE.apply(this, isDebug());
FEATURE_NEWGROUNDS.apply(this, !isMobile());
FEATURE_NEWGROUNDS.apply(this, true);
FEATURE_NEWGROUNDS_DEBUG.apply(this, false);
FEATURE_NEWGROUNDS_TESTING_MEDALS.apply(this, FEATURE_NEWGROUNDS.isEnabled(this) && FEATURE_DEBUG_FUNCTIONS.isEnabled(this));
FEATURE_NEWGROUNDS_AUTOLOGIN.apply(this, FEATURE_NEWGROUNDS.isEnabled(this) && isWeb());
@@ -702,6 +700,7 @@ class Project extends HXProject {
// Should be true except on web and mobile builds.
// Chart editor doesn't work there.
FEATURE_CHART_EDITOR.apply(this, !(isWeb() || isMobile()));
FEATURE_STAGE_EDITOR.apply(this, !(isWeb() || isMobile()));
// Should be true except on web and mobile builds.
// Screenshots doesn't work there.
+3 -3
View File
@@ -42,9 +42,9 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
if (_onVolumeChanged == null)
{
_onVolumeChanged = new FlxTypedSignal<Float->Void>();
FlxG.sound.volumeHandler = function(volume:Float) {
FlxG.sound.onVolumeChange.add(function(volume:Float) {
_onVolumeChanged.dispatch(volume);
}
});
}
return _onVolumeChanged;
}
@@ -475,7 +475,7 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
if (autoPlay) sound.play();
sound.volume = volume;
sound.group = FlxG.sound.defaultSoundGroup;
FlxG.sound.defaultSoundGroup.add(sound);
sound.persist = persist;
sound.important = important;
+8 -8
View File
@@ -276,12 +276,12 @@ class ResultState extends MusicBeatSubState
if (animData.loopFrame != null)
{
animation.animation.finishCallback = (_name:String) -> {
animation.animation.onFinish.add((_name:String) -> {
if (animation != null)
{
animation.animation.play('idle', true, false, animData.loopFrame ?? 0);
}
}
});
}
// Hide until ready to play.
@@ -349,7 +349,7 @@ class ResultState extends MusicBeatSubState
new FlxTimer().start(36 / 24, _ -> {
scorePopin.visible = true;
scorePopin.animation.play("score");
scorePopin.animation.finishCallback = anim -> {};
scorePopin.animation.onFinish.add(anim -> {});
});
new FlxTimer().start(37 / 24, _ -> {
@@ -379,7 +379,7 @@ class ResultState extends MusicBeatSubState
{
highscoreNew.visible = true;
highscoreNew.animation.play("new");
highscoreNew.animation.finishCallback = _ -> highscoreNew.animation.play("new", true, false, 16);
highscoreNew.animation.onFinish.add(_ -> highscoreNew.animation.play("new", true, false, 16));
}
else
{
@@ -587,7 +587,7 @@ class ResultState extends MusicBeatSubState
// ratingsPopin.animation.play("idle");
// ratingsPopin.visible = true;
ratingsPopin.animation.finishCallback = anim -> {
ratingsPopin.animation.onFinish.add(anim -> {
// scorePopin.animation.play("score");
// scorePopin.visible = true;
@@ -601,7 +601,7 @@ class ResultState extends MusicBeatSubState
{
highscoreNew.visible = false;
}
};
});
}
refresh();
@@ -1017,7 +1017,7 @@ class ResultState extends MusicBeatSubState
}
else
{
FlxG.switchState(targetState);
FlxG.switchState(() -> targetState);
}
}
});
@@ -1039,7 +1039,7 @@ class ResultState extends MusicBeatSubState
}
else
{
FlxG.switchState(targetState);
FlxG.switchState(() -> targetState);
}
}
}
+2 -2
View File
@@ -86,10 +86,10 @@ class PixelatedIcon extends FlxFilteredSprite
this.animation.addByPrefix('confirm', 'confirm0', 10, false);
this.animation.addByPrefix('confirm-hold', 'confirm-hold0', 10, true);
this.animation.finishCallback = function(name:String):Void {
this.animation.onFinish.add(function(name:String):Void {
trace('Finish pixel animation: ${name}');
if (name == 'confirm') this.animation.play('confirm-hold');
};
});
this.animation.play('idle');
}
@@ -720,7 +720,7 @@ class CharSelectSubState extends MusicBeatSubState
ease: FlxEase.backIn,
onComplete: function(_) {
funkin.ui.FullScreenScaleMode.enabled = true;
FlxG.switchState(FreeplayState.build(
FlxG.switchState(() -> FreeplayState.build(
{
{
character: curChar,
@@ -954,10 +954,10 @@ class CharSelectSubState extends MusicBeatSubState
HapticUtil.vibrate(0, 0.2);
cursorDenied.animation.play("idle", true);
cursorDenied.animation.finishCallback = (_) -> {
cursorDenied.animation.play('idle', true);
cursorDenied.animation.onFinish.add((_) -> {
cursorDenied.visible = false;
};
});
}
}
@@ -1115,14 +1115,16 @@ class CharSelectSubState extends MusicBeatSubState
memb.filters = selectedBizz;
memb.scale.set(2.6, 2.6);
}
if (pressedSelect && memb.animation.curAnim.name == "idle") memb.animation.play("confirm");
if (autoFollow && !pressedSelect && memb.animation.curAnim.name != "idle")
if (pressedSelect && memb.animation.curAnim.name == 'idle') memb.animation.play('confirm');
if (autoFollow && !pressedSelect && memb.animation.curAnim.name != 'idle')
{
memb.animation.play("confirm", false, true);
member.animation.finishCallback = (_) -> {
member.animation.play("idle");
member.animation.finishCallback = null;
var onFinish:String->Void = null;
onFinish = (_) -> {
member.animation.play('idle');
member.animation.onFinish.remove(onFinish);
};
member.animation.onFinish.add(onFinish);
}
}
else
@@ -125,7 +125,7 @@ class CharacterUnlockState extends MusicBeatState
// Fade to black, then switch state.
FlxG.camera.fade(FlxColor.BLACK, 0.75, false, () -> {
funkin.FunkinMemory.purgeCache();
FlxG.switchState(nextState);
FlxG.switchState(() -> nextState);
});
}
}
+7 -7
View File
@@ -97,37 +97,37 @@ class DebugMenuSubState extends MusicBeatSubState
return item;
}
function openChartEditor()
function openChartEditor():Void
{
FlxTransitionableState.skipNextTransIn = true;
FlxG.switchState(() -> new ChartEditorState());
}
function openInputOffsetTesting()
function openInputOffsetTesting():Void
{
openSubState(new funkin.ui.debug.latency.LatencyState());
trace('Input Offset Testing');
}
function openCharSelect()
function openCharSelect():Void
{
FlxG.switchState(new funkin.ui.charSelect.CharSelectSubState());
FlxG.switchState(() -> new funkin.ui.charSelect.CharSelectSubState());
}
function openAnimationEditor()
function openAnimationEditor():Void
{
FlxG.switchState(() -> new funkin.ui.debug.anim.DebugBoundingState());
trace('Animation Editor');
}
function testStickers()
function testStickers():Void
{
openSubState(new funkin.ui.transition.stickers.StickerSubState({}));
trace('opened stickers');
}
function openStageEditor()
function openStageEditor():Void
{
trace('Stage Editor');
}
@@ -68,11 +68,11 @@ class DebugBoundingState extends FlxState
function get_haxeUIFocused():Bool
{
// get the screen position, according to the HUD camera, temp default to FlxG.camera juuust in case?
var hudMousePos:FlxPoint = FlxG.mouse.getScreenPosition(hudCam ?? FlxG.camera);
var hudMousePos:FlxPoint = FlxG.mouse.getViewPosition(hudCam ?? FlxG.camera);
return Screen.instance.hasSolidComponentUnderPoint(hudMousePos.x, hudMousePos.y);
}
override function create()
override function create():Void
{
Paths.setCurrentLevel('week1');
@@ -1354,7 +1354,7 @@ class ChartEditorDialogHandler
new FlxTimer().start(EPSILON, function(_) {
for (handler in dropHandlers)
{
if (handler.component.hitTest(FlxG.mouse.screenX, FlxG.mouse.screenY))
if (handler.component.hitTest(FlxG.mouse.viewX, FlxG.mouse.viewY))
{
handler.handler(path);
return;
@@ -729,8 +729,8 @@ class StageEditorState extends UIState
bottomBarSelectText.text = infoSelection;
// ui stuff
nameTxt.x = FlxG.mouse.getScreenPosition(camHUD).x;
nameTxt.y = FlxG.mouse.getScreenPosition(camHUD).y - nameTxt.height;
nameTxt.x = FlxG.mouse.getViewPosition(camHUD).x;
nameTxt.y = FlxG.mouse.getViewPosition(camHUD).y - nameTxt.height;
// spriteMarker.visible = (moveMode == "assets" && selectedSprite != null);
camMarker.visible = moveMode == "chars";
@@ -946,7 +946,7 @@ class StageEditorState extends UIState
{
if (FlxG.mouse.overlaps(spr) /*spr.overlapsPoint(FlxG.mouse.getWorldPosition(spr.camera), true, spr.camera) */
&& Screen.instance != null
&& !Screen.instance.hasSolidComponentUnderPoint(FlxG.mouse.screenX, FlxG.mouse.screenY)
&& !Screen.instance.hasSolidComponentUnderPoint(FlxG.mouse.viewX, FlxG.mouse.viewY)
&& WindowManager.instance.windows.length == 0) // ik its stupid but maybe I have other cases soon (i did)
return true;
@@ -58,9 +58,9 @@ class CapsuleOptionsMenu extends FlxSpriteGroup
add(label);
add(currentInstrumental);
capsuleMenuBG.animation.finishCallback = function(_) {
capsuleMenuBG.animation.onFinish.add(function(_) {
capsuleMenuBG.animation.play('idle', true);
};
});
capsuleMenuBG.animation.play('open', true);
}
@@ -73,7 +73,7 @@ class CapsuleOptionsMenu extends FlxSpriteGroup
destroy();
return;
}
var changedInst = false;
var changedInst:Bool = false;
if (!busy)
{
@@ -128,10 +128,10 @@ class CapsuleOptionsMenu extends FlxSpriteGroup
capsuleMenuBG.animation.play('open', true, true);
if (leftArrow.moveShitDownTimer != null) leftArrow.moveShitDownTimer.cancel();
if (rightArrow.moveShitDownTimer != null) rightArrow.moveShitDownTimer.cancel();
capsuleMenuBG.animation.finishCallback = function(_) {
capsuleMenuBG.animation.onFinish.add(function(_) {
parent.cleanupCapsuleOptionsMenu();
queueDestroy = true;
};
});
}
/**
+2 -2
View File
@@ -29,9 +29,9 @@ class FreeplayFlames extends FlxSpriteGroup
flameCount = 0;
// sets the loop... maybe better way to do this lol!
flame.animation.finishCallback = function(_) {
flame.animation.onFinish.add(function(_) {
flame.animation.play("flame", true, false, 2);
};
});
add(flame);
}
}
+3 -3
View File
@@ -1060,10 +1060,10 @@ class FreeplayState extends MusicBeatSubState
sparks.animation.play('sparks', true);
sparksADD.animation.play('sparks add', true);
sparks.animation.finishCallback = anim -> {
sparks.animation.onFinish.add(anim -> {
sparks.visible = false;
sparksADD.visible = false;
};
});
}
switch (fromResultsParams?.newRank)
@@ -1297,7 +1297,7 @@ class FreeplayState extends MusicBeatSubState
FlxG.sound.music?.fadeOut(0.9, 0);
new FlxTimer().start(0.9, _ -> {
FullScreenScaleMode.enabled = false;
FlxG.switchState(new funkin.ui.charSelect.CharSelectSubState());
FlxG.switchState(() -> new funkin.ui.charSelect.CharSelectSubState());
});
for (grpSpr in exitMoversCharSel.keys())
{
+4 -4
View File
@@ -316,10 +316,10 @@ class TitleState extends MusicBeatState
function cheatCodeShit():Void
{
if (controls.NOTE_DOWN_P || controls.UI_DOWN_P #if mobile || SwipeUtil.justSwipedUp #end) codePress(FlxDirectionFlags.DOWN);
if (controls.NOTE_UP_P || controls.UI_UP_P #if mobile || SwipeUtil.justSwipedDown #end) codePress(FlxDirectionFlags.UP);
if (controls.NOTE_LEFT_P || controls.UI_LEFT_P #if mobile || SwipeUtil.justSwipedLeft #end) codePress(FlxDirectionFlags.LEFT);
if (controls.NOTE_RIGHT_P || controls.UI_RIGHT_P #if mobile || SwipeUtil.justSwipedRight #end) codePress(FlxDirectionFlags.RIGHT);
if (controls.NOTE_DOWN_P || controls.UI_DOWN_P #if mobile || SwipeUtil.justSwipedUp #end) codePress(FlxDirectionFlags.DOWN.toInt());
if (controls.NOTE_UP_P || controls.UI_UP_P #if mobile || SwipeUtil.justSwipedDown #end) codePress(FlxDirectionFlags.UP.toInt());
if (controls.NOTE_LEFT_P || controls.UI_LEFT_P #if mobile || SwipeUtil.justSwipedLeft #end) codePress(FlxDirectionFlags.LEFT.toInt());
if (controls.NOTE_RIGHT_P || controls.UI_RIGHT_P #if mobile || SwipeUtil.justSwipedRight #end) codePress(FlxDirectionFlags.RIGHT.toInt());
}
function codePress(input:Int)
+3 -3
View File
@@ -28,13 +28,13 @@ class MouseUtil
if (jusPres)
{
oldCamPos.set(target.x, target.y);
oldMousePos.set(FlxG.mouse.screenX, FlxG.mouse.screenY);
oldMousePos.set(FlxG.mouse.viewX, FlxG.mouse.viewY);
}
if (pressed)
{
target.x = oldCamPos.x - (FlxG.mouse.screenX - oldMousePos.x);
target.y = oldCamPos.y - (FlxG.mouse.screenY - oldMousePos.y);
target.x = oldCamPos.x - (FlxG.mouse.viewX - oldMousePos.x);
target.y = oldCamPos.y - (FlxG.mouse.viewY - oldMousePos.y);
}
}
@@ -113,7 +113,7 @@ class NewgroundsMedalPlugin extends FlxTypedContainer<FlxBasic>
{
FlxG.plugins.drawOnTop = true;
instance = new NewgroundsMedalPlugin();
FlxG.plugins.add(instance);
FlxG.plugins.addPlugin(instance);
instance.medal.anim.onComplete.add(function() {
if (instance.funcs.length > 0)