From 7442f6ec91b74b3322845e89b4a41d9685937b9c Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Fri, 6 Sep 2024 03:45:00 +0200 Subject: [PATCH] Small Cleanup --- source/funkin/editors/charter/Charter.hx | 11 +++++------ source/funkin/editors/charter/CharterNote.hx | 5 +++-- source/funkin/game/SplashGroup.hx | 5 +++-- source/funkin/game/Strum.hx | 2 +- source/funkin/menus/FreeplayState.hx | 14 ++++++++------ 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 7c06ad0f..34db42c0 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -111,10 +111,10 @@ class Charter extends UIState { { label: "File", childs: [ - { + /*{ label: "New" }, - null, + null,*/ { label: "Save", keybind: [CONTROL, S], @@ -362,9 +362,9 @@ class Charter extends UIState { onSelect: _playback_metronome, icon: Options.charterMetronomeEnabled ? 1 : 0 }, - { + /*{ label: "Visual metronome" - }, + },*/ ] } ]; @@ -420,7 +420,7 @@ class Charter extends UIState { }; uiGroup.add(scrollBar); - songPosInfo = new UIText(FlxG.width - 30 - 400, scrollBar.y + 10, 400, "00:00\nBeat: 0\nStep: 0\nMeasure: 0\nBPM: 0\nTime Signature: 4/4"); + songPosInfo = new UIText(FlxG.width - 30 - 400, scrollBar.y + 10, 400, "00:00 / 00:00\nBeat: 0\nStep: 0\nMeasure: 0\nBPM: 0\nTime Signature: 4/4"); songPosInfo.alignment = RIGHT; uiGroup.add(songPosInfo); @@ -1164,7 +1164,6 @@ class Charter extends UIState { var snapButton:UITopMenuButton = cast topMenuSpr.members[snapIndex]; var lastButtonX = playBackButton.x-10; - var buttonI:Int = 0; for (button in quantButtons) { button.visible = ((button.quant == quant) || (button.quant == quants[FlxMath.wrap(quants.indexOf(quant)-1, 0, quants.length-1)]) || diff --git a/source/funkin/editors/charter/CharterNote.hx b/source/funkin/editors/charter/CharterNote.hx index da314820..de5747da 100644 --- a/source/funkin/editors/charter/CharterNote.hx +++ b/source/funkin/editors/charter/CharterNote.hx @@ -163,8 +163,9 @@ class CharterNote extends UISprite implements ICharterSelectable { } if (strumLine != null) { - sustainSpr.alpha = alpha = !strumLine.strumLine.visible ? (__passed ? 0.2 : 0.4) : (__passed ? 0.6 : 1); - typeAlpha = !strumLine.strumLine.visible ? (__passed ? 0.4 : 0.6) : (__passed ? 0.8 : 1); + var isVisible = strumLine.strumLine.visible; + sustainSpr.alpha = alpha = !isVisible ? (__passed ? 0.2 : 0.4) : (__passed ? 0.6 : 1); + typeAlpha = !isVisible ? (__passed ? 0.4 : 0.6) : (__passed ? 0.8 : 1); } colorTransform.redMultiplier = colorTransform.greenMultiplier = colorTransform.blueMultiplier = selected ? 0.75 : 1; diff --git a/source/funkin/game/SplashGroup.hx b/source/funkin/game/SplashGroup.hx index ffa9f135..2f1fe0b4 100644 --- a/source/funkin/game/SplashGroup.hx +++ b/source/funkin/game/SplashGroup.hx @@ -100,8 +100,9 @@ class SplashGroup extends FlxTypedGroup { public function getSplashAnim(id:Int):String { if (animationNames.length <= 0) return null; id %= animationNames.length; - if (animationNames[id] == null || animationNames[id].length <= 0) return null; - return animationNames[id][FlxG.random.int(0, animationNames[id].length - 1)]; + var animNames = animationNames[id]; + if (animNames == null || animNames.length <= 0) return null; + return animNames[FlxG.random.int(0, animNames.length - 1)]; } var __splash:FunkinSprite; diff --git a/source/funkin/game/Strum.hx b/source/funkin/game/Strum.hx index 5a0299d8..2fc6047b 100644 --- a/source/funkin/game/Strum.hx +++ b/source/funkin/game/Strum.hx @@ -80,7 +80,7 @@ class Strum extends FlxSprite { super.draw(); } - @:noCompletion public static final PIX180:Float = 565.4866776461628; // 180 * Math.PI + @:noCompletion public static inline final PIX180:Float = 565.4866776461628; // 180 * Math.PI @:noCompletion public static final N_WIDTHDIV2:Float = Note.swagWidth / 2; public function updateNotePosition(daNote:Note) { diff --git a/source/funkin/menus/FreeplayState.hx b/source/funkin/menus/FreeplayState.hx index 3c122494..c1670dfd 100644 --- a/source/funkin/menus/FreeplayState.hx +++ b/source/funkin/menus/FreeplayState.hx @@ -281,12 +281,13 @@ class FreeplayState extends MusicBeatState function updateCoopModes() { __opponentMode = false; __coopMode = false; - if (songs[curSelected].coopAllowed && songs[curSelected].opponentModeAllowed) { + var curSong = songs[curSelected]; + if (curSong.coopAllowed && curSong.opponentModeAllowed) { __opponentMode = curCoopMode % 2 == 1; __coopMode = curCoopMode >= 2; - } else if (songs[curSelected].coopAllowed) { + } else if (curSong.coopAllowed) { __coopMode = curCoopMode == 1; - } else if (songs[curSelected].opponentModeAllowed) { + } else if (curSong.opponentModeAllowed) { __opponentMode = curCoopMode == 1; } } @@ -315,9 +316,10 @@ class FreeplayState extends MusicBeatState } public function convertChart() { - trace('Converting ${songs[curSelected].name} (${songs[curSelected].difficulties[curDifficulty]}) to Codename format...'); - var chart = Chart.parse(songs[curSelected].name, songs[curSelected].difficulties[curDifficulty]); - Chart.save('${Main.pathBack}assets/songs/${songs[curSelected].name}', chart, songs[curSelected].difficulties[curDifficulty].toLowerCase()); + var curSong = songs[curSelected]; + trace('Converting ${curSong.name} (${curSong.difficulties[curDifficulty]}) to Codename format...'); + var chart = Chart.parse(curSong.name, curSong.difficulties[curDifficulty]); + Chart.save('${Main.pathBack}assets/songs/${curSong.name}', chart, curSong.difficulties[curDifficulty].toLowerCase()); } /**