Skip to content

Commit

Permalink
small stuff
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JordanSantiagoYT committed Dec 23, 2024
1 parent 8ce214a commit d0a2a77
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
10 changes: 7 additions & 3 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion source/StrumNote.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
41 changes: 19 additions & 22 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}


Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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<Dynamic>, Obj2:Array<Dynamic>):Int
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -4538,4 +4535,4 @@ class SelectionNote extends FlxSprite
}
}
}
}
}

0 comments on commit d0a2a77

Please sign in to comment.