Skip to content

Commit 6e7cadd

Browse files
Small changes
this commit makes changes that re-adds compatibility with charts using Lua Extra Keys for HScript (well, a modified version which i made to support the new chart loading system.) This script will release with 1.45.0.
1 parent 0cc42d2 commit 6e7cadd

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

source/Note.hx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class Note extends FlxSprite
236236
}
237237
}
238238

239-
public static function initializeGlobalRGBShader(noteData:Int, ?note:Note = null)
239+
public static function initializeGlobalRGBShader(noteData:Int = 0, ?note:Note = null)
240240
{
241241
if (note == null)
242242
{
@@ -246,7 +246,7 @@ class Note extends FlxSprite
246246
globalRgbShaders[noteData] = newRGB;
247247

248248
var arr:Array<FlxColor> = ClientPrefs.noteColorStyle != 'Quant-Based' ? (!PlayState.isPixelStage) ? ClientPrefs.arrowRGB[noteData] : ClientPrefs.arrowRGBPixel[noteData] : ClientPrefs.quantRGB[noteData];
249-
if (noteData > -1 && noteData <= arr.length)
249+
if (arr != null && noteData > -1 && noteData <= arr.length)
250250
{
251251
newRGB.r = arr[0];
252252
newRGB.g = arr[1];
@@ -469,9 +469,10 @@ class Note extends FlxSprite
469469
}
470470
}
471471

472-
if(copyScaleX && !isSustainNote) //if i did this on sustain notes it would break, sorry!
472+
if(copyScaleX)
473473
{
474474
scale.x = strum.scale.x;
475+
if (isSustainNote) updateHitbox();
475476
}
476477
if(copyScaleY && !isSustainNote)
477478
{
@@ -526,14 +527,16 @@ class Note extends FlxSprite
526527
var noteColor:RGBPalette;
527528
var superCoolColor = null;
528529
var arr:Array<Int> = [255, 255, 255];
530+
var rainbowTime = 0.0;
529531
public function updateRGBColors()
530532
{
531533
if (rgbShader == null && useRGBShader) rgbShader = new RGBShaderReference(this, initializeGlobalRGBShader(noteData, this));
532534
else switch(ClientPrefs.noteColorStyle)
533535
{
534536
case 'Rainbow':
537+
rainbowTime = (ClientPrefs.rainbowTime != 0 ? ClientPrefs.rainbowTime * 1000 : Conductor.crochet);
535538
superCoolColor = new FlxColor(0xFFFF0000);
536-
superCoolColor.hue = (strumTime / (ClientPrefs.rainbowTime * 1000) * 360) % 360;
539+
superCoolColor.hue = (strumTime / rainbowTime * 360) % 360;
537540
rgbShader.r = superCoolColor;
538541
rgbShader.g = FlxColor.WHITE;
539542
rgbShader.b = superCoolColor.getDarkened(0.7);
@@ -604,7 +607,7 @@ class Note extends FlxSprite
604607
}
605608

606609
strumTime = chartNoteData.strumTime;
607-
noteData = chartNoteData.noteData % 4;
610+
noteData = chartNoteData.noteData;
608611
noteType = chartNoteData.noteType;
609612
animSuffix = chartNoteData.animSuffix;
610613
noAnimation = noMissAnimation = chartNoteData.noAnimation;
@@ -661,7 +664,7 @@ class Note extends FlxSprite
661664
if (isSustainNote) {
662665
offsetX += width / 2;
663666
copyAngle = false;
664-
animation.play(colArray[noteData % 4] + (chartNoteData.isSustainEnd ? 'holdend' : 'hold'));
667+
animation.play(colArray[noteData] + (chartNoteData.isSustainEnd ? 'holdend' : 'hold'));
665668
updateHitbox();
666669
offsetX -= width / 2;
667670

@@ -671,7 +674,7 @@ class Note extends FlxSprite
671674
updateHitbox();
672675
}
673676
else {
674-
animation.play(colArray[noteData % 4] + 'Scroll');
677+
animation.play(colArray[noteData] + 'Scroll');
675678
if (!copyAngle) copyAngle = true;
676679
offsetX = 0; //Just in case we recycle a sustain note to a regular note
677680
if (useRGBShader && shouldCenterOffsets)

source/Paths.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class Paths
9797
// Use a for loop for adding all of the animations in the note spritesheet, otherwise it won't find the animations for the next recycle
9898
for (d in 0...keys)
9999
{
100-
spr.animation.addByPrefix('purpleholdend', 'pruple end hold'); // ?????
100+
if (d == 0) spr.animation.addByPrefix('purpleholdend', 'pruple end hold'); // ?????
101101
spr.animation.addByPrefix(Note.colArray[d] + 'holdend', Note.colArray[d] + ' hold end');
102102
spr.animation.addByPrefix(Note.colArray[d] + 'hold', Note.colArray[d] + ' hold piece');
103103
spr.animation.addByPrefix(Note.colArray[d] + 'Scroll', Note.colArray[d] + '0');

source/PlayState.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,9 +690,6 @@ class PlayState extends MusicBeatState
690690
dadGroup = new FlxSpriteGroup(DAD_X, DAD_Y);
691691
gfGroup = new FlxSpriteGroup(GF_X, GF_Y);
692692

693-
startCallback = startCountdown;
694-
endCallback = endSong;
695-
696693
switch (curStage)
697694
{
698695
case 'stage': new stages.StageWeek1(); //Week 1
@@ -1580,6 +1577,9 @@ class PlayState extends MusicBeatState
15801577
}
15811578
}
15821579
#end
1580+
1581+
startCallback = startCountdown;
1582+
endCallback = endSong;
15831583

15841584
startCallback();
15851585
RecalculateRating();

source/StrumNote.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class StrumNote extends FlxSprite
4343

4444
var arr:Array<FlxColor> = ClientPrefs.arrowRGB[leData];
4545
if(PlayState.isPixelStage) arr = ClientPrefs.arrowRGBPixel[leData];
46-
if(leData <= arr.length && useRGBShader)
46+
if(arr != null && leData <= arr.length && useRGBShader)
4747
{
4848
@:bypassAccessor
4949
{

0 commit comments

Comments
 (0)