From d0a2a77ed5107bc2b097b8b29b7e2f39a09cd3ec Mon Sep 17 00:00:00 2001 From: JordanSantiagoYT Date: Mon, 23 Dec 2024 04:07:27 -0500 Subject: [PATCH] small stuff if a character has a noteskin that is null, it changes to '' instead of null!!!!! additionally, the noteskin and stuff no longer breaks because of that :) additionally, I FOUND AN ISSUE WITH STEP-LONG SUSTAIN LENGTHS ROUNDING DOWN AND FIXED IT. --- source/PlayState.hx | 10 +++++--- source/StrumNote.hx | 3 ++- source/editors/ChartingState.hx | 41 +++++++++++++++------------------ 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index e728c8a1bee..2b99a65ecb2 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2844,9 +2844,11 @@ class PlayState extends MusicBeatState case 0: var boyfriendToGrab:Boyfriend = boyfriendMap.get(charChangeNames[0]); if (boyfriendToGrab != null && boyfriendToGrab.noteskin.length > 0) bfNoteskin = boyfriendToGrab.noteskin; + else bfNoteskin = ''; case 1: var dadToGrab:Character = dadMap.get(charChangeNames[0]); if (dadToGrab != null && dadToGrab.noteskin.length > 0) dadNoteskin = dadToGrab.noteskin; + else dadNoteskin = ''; } charChangeTimes.shift(); charChangeNames.shift(); @@ -4462,6 +4464,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.bfIconStyle == "OS 'Engine'") iconP1.changeIcon('bfos'); } if (boyfriend.noteskin.length > 0) bfNoteskin = boyfriend.noteskin; + else bfNoteskin = ''; } setOnLuas('boyfriendName', boyfriend.curCharacter); @@ -4490,12 +4493,13 @@ class PlayState extends MusicBeatState if (scoreTxt != null && !ClientPrefs.hideHud) FlxTween.color(scoreTxt, 1, scoreTxt.color, FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2])); } - if (ClientPrefs.scoreStyle == 'JS Engine' && !ClientPrefs.hideHud) { + if (ClientPrefs.scoreStyle == 'JS Engine' && !ClientPrefs.hideHud) if (scoreTxt != null) FlxTween.color(scoreTxt, 1, scoreTxt.color, FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2])); - } + if (dadAnim != '') dad.playAnim(dadAnim, true); } if (dad.noteskin.length > 0) dadNoteskin = dad.noteskin; + else dadNoteskin = ''; setOnLuas('dadName', dad.curCharacter); case 2: @@ -4523,7 +4527,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.showNotes) { for (i in strumLineNotes.members) - if ((i.player == 0 ? dadNoteskin : bfNoteskin).length > 0) + if ((i.player == 0 ? dadNoteskin : bfNoteskin) != null) { i.updateNoteSkin(i.player == 0 ? dadNoteskin : bfNoteskin); i.useRGBShader = false; diff --git a/source/StrumNote.hx b/source/StrumNote.hx index c483acea2a5..be227ea8e34 100644 --- a/source/StrumNote.hx +++ b/source/StrumNote.hx @@ -183,7 +183,8 @@ class StrumNote extends FlxSprite } public function updateNoteSkin(noteskin:String) { if (texture == "noteskins/" + noteskin || noteskin == ogNoteskin || texture == noteskin) return; //if the noteskin to change to is the same as before then don't update it - if (noteskin != null && noteskin != '') texture = "noteskins/" + noteskin; + if (noteskin != null && noteskin.length > 0) texture = "noteskins/" + noteskin; + else texture = "noteskins/NOTE_assets" + Note.getNoteSkinPostfix(); } public function updateRGBColors(?r:FlxColor, ?g:FlxColor, ?b:FlxColor) { if (rgbShader != null) diff --git a/source/editors/ChartingState.hx b/source/editors/ChartingState.hx index 9f551b63853..aa8dc537754 100644 --- a/source/editors/ChartingState.hx +++ b/source/editors/ChartingState.hx @@ -2691,20 +2691,14 @@ class ChartingState extends MusicBeatState } if(curSelectedNote != null && curSelectedNote[1] > -1) { - if (FlxG.keys.justPressed.E) + if (FlxG.keys.justPressed.E || FlxG.keys.pressed.CONTROL && FlxG.mouse.wheel < 0) { changeNoteSustain(Conductor.stepCrochet); } - if (FlxG.keys.justPressed.Q) + if (FlxG.keys.justPressed.Q || FlxG.keys.pressed.CONTROL && FlxG.mouse.wheel > 0) { changeNoteSustain(-Conductor.stepCrochet); } - if (FlxG.keys.pressed.CONTROL && FlxG.mouse.wheel < 0) { - changeNoteSustain(Conductor.stepCrochet); - } - if (FlxG.keys.pressed.CONTROL && FlxG.mouse.wheel > 0) { - changeNoteSustain(-Conductor.stepCrochet); - } } @@ -3461,6 +3455,9 @@ class ChartingState extends MusicBeatState if (curSelectedNote[2] != null) { curSelectedNote[2] += value; + + //actually fixes an issue where step-long sustain lengths would round down instead of up + curSelectedNote[2] = Math.ceil(curSelectedNote[2] * 13) / 13; curSelectedNote[2] = Math.max(curSelectedNote[2], 0); } } @@ -4272,7 +4269,7 @@ class ChartingState extends MusicBeatState cpp.vm.Gc.enable(true); if (unsavedChanges) unsavedChanges = false; if (autoSaveTimer != null) - autoSaveTimer.reset(autoSaveLength); + autoSaveTimer.reset(autoSaveLength); } function sortByTime(Obj1:Array, Obj2:Array):Int @@ -4358,18 +4355,18 @@ class ChartingState extends MusicBeatState } override public function destroy():Void - { - Paths.noteSkinFramesMap.clear(); - Paths.noteSkinAnimsMap.clear(); - Paths.splashSkinFramesMap.clear(); - Paths.splashSkinAnimsMap.clear(); - Paths.splashConfigs.clear(); - Paths.splashAnimCountMap.clear(); - Note.globalRgbShaders = []; - - super.destroy(); - } - + { + Paths.noteSkinFramesMap.clear(); + Paths.noteSkinAnimsMap.clear(); + Paths.splashSkinFramesMap.clear(); + Paths.splashSkinAnimsMap.clear(); + Paths.splashConfigs.clear(); + Paths.splashAnimCountMap.clear(); + Note.globalRgbShaders = []; + + super.destroy(); + } + override function startOutro(onOutroComplete:()->Void):Void { FlxG.autoPause = ClientPrefs.autoPause; @@ -4538,4 +4535,4 @@ class SelectionNote extends FlxSprite } } } -} +} \ No newline at end of file