@@ -4,12 +4,6 @@ import backend.animation.PsychAnimationController;
44import shaders .RGBPalette ;
55import flixel .system .FlxAssets .FlxShader ;
66import objects .charting .ChartingStrumNote ;
7- import flixel .FlxSprite ;
8- import flixel .animation .FlxBaseAnimation ;
9- import flixel .graphics .frames .FlxAtlasFrames ;
10- import flixel .util .FlxColor ;
11- import shaders .ColorSwap .ColorSwap ;
12- import objects .NoteObject ;
137
148typedef RGB = {
159 r : Null <Int >,
@@ -34,13 +28,14 @@ typedef NoteSplashConfig = {
3428 rgb : Array <Null <RGB >>
3529}
3630
37- class NoteSplash extends NoteObject
31+ class NoteSplash extends FlxSprite
3832{
3933 public var rgbShader : PixelSplashShaderRef ;
4034 public var texture : String ;
4135 public var config (default , set ): NoteSplashConfig ;
4236 public var babyArrow : StrumNote ;
4337 public var babyArrowCharting : ChartingStrumNote ;
38+ public var noteData : Int = 0 ;
4439
4540 public var copyX : Bool = true ;
4641 public var copyY : Bool = true ;
@@ -165,37 +160,10 @@ class NoteSplash extends NoteObject
165160 }
166161 }
167162
168- // Get current key count from PlayState or default to 4
169- var keyCount : Int = 4 ; // Default fallback
170- if (PlayState .instance != null && PlayState .instance .playfields != null && PlayState .instance .playfields .members .length > 0 ) {
171- keyCount = PlayState .instance .playfields .members [0 ].keyCount ;
172- } else if (PlayState .mania >= 0 && PlayState .mania < Note .ammo .length ) {
173- keyCount = Note .ammo [PlayState .mania ];
174- }
175-
176- // Get the appropriate color array for the current key count
177- var colArray : Array <String > = [];
178- if (PlayState .mania >= 0 && PlayState .mania < Note .ammo .length && Note .keysShit .exists (PlayState .mania )) {
179- var keyData = Note .keysShit .get (PlayState .mania );
180- if (keyData .exists (" letters" ) && keyData .get (" letters" ) is Array ) {
181- var letters : Array <String > = cast keyData .get (" letters" );
182- colArray = letters .map (letter -> letter .toLowerCase ()); // Convert to lowercase for consistency
183- }
184- }
185-
186- // Fallback to default if no proper key data found
187- if (colArray .length == 0 ) {
188- colArray = Note .colArray .copy ();
189- // Extend if we need more keys
190- while (colArray .length < keyCount ) {
191- colArray .push (' key ${colArray .length }' );
192- }
193- }
194-
195163 var failedToFind : Bool = false ;
196164 while (true )
197165 {
198- for (v in colArray )
166+ for (v in Note . colArray )
199167 {
200168 if (! checkForAnim (' $anim $v ${maxAnims + 1 }' ))
201169 {
@@ -209,9 +177,9 @@ class NoteSplash extends NoteObject
209177
210178 for (animNum in 0 ... maxAnims )
211179 {
212- for (i => col in colArray )
180+ for (i => col in Note . colArray )
213181 {
214- var data : Int = i % colArray .length + (animNum * colArray .length );
182+ var data : Int = i % Note . colArray .length + (animNum * Note . colArray .length );
215183 var name : String = animNum > 0 ? ' $col ' + (animNum + 1 ) : col ;
216184 var offset : Array <Float > = offsets [FlxMath .wrap (data , 0 , Std .int (offsets .length - 1 ))];
217185 addAnimationToConfig (tempConfig , 1 , name , ' $anim $col ${animNum + 1 }' , fps , offset , [], data );
@@ -249,40 +217,16 @@ class NoteSplash extends NoteObject
249217 if (note != null )
250218 noteData = note .noteData ;
251219
252- // Get current key count for proper noteData calculation
253- var keyCount : Int = 4 ; // Default fallback
254- var colArray : Array <String > = Note .colArray .copy ();
255-
256- if (PlayState .instance != null && PlayState .instance .playfields != null && PlayState .instance .playfields .members .length > 0 ) {
257- keyCount = PlayState .instance .playfields .members [0 ].keyCount ;
258- } else if (PlayState .mania >= 0 && PlayState .mania < Note .ammo .length ) {
259- keyCount = Note .ammo [PlayState .mania ];
260- }
261-
262- // Get the appropriate color array for the current key count
263- if (PlayState .mania >= 0 && PlayState .mania < Note .ammo .length && Note .keysShit .exists (PlayState .mania )) {
264- var keyData = Note .keysShit .get (PlayState .mania );
265- if (keyData .exists (" letters" ) && keyData .get (" letters" ) is Array ) {
266- var letters : Array <String > = cast keyData .get (" letters" );
267- colArray = letters .map (letter -> letter .toLowerCase ());
268- }
269- }
270-
271- // Extend color array if needed
272- while (colArray .length < keyCount ) {
273- colArray .push (' key ${colArray .length }' );
274- }
275-
276220 if (randomize && maxAnims > 1 )
277- noteData = noteData % colArray .length + (FlxG .random .int (0 , maxAnims - 1 ) * colArray .length );
221+ noteData = noteData % Note . colArray .length + (FlxG .random .int (0 , maxAnims - 1 ) * Note . colArray .length );
278222
279223 this .noteData = noteData ;
280224 var anim : String = playDefaultAnim ();
281225
282226 var tempShader : RGBPalette = null ;
283227 if (config .allowRGB )
284228 {
285- Note .initializeGlobalRGBShader (noteData % colArray .length );
229+ Note .initializeGlobalRGBShader (noteData % Note . colArray .length );
286230 if (inEditor || (note == null || note .noteSplashData .useRGBShader ) && (PlayState .SONG == null || ! PlayState .SONG .disableNoteRGB ))
287231 {
288232 tempShader = new RGBPalette ();
@@ -296,17 +240,8 @@ class NoteSplash extends NoteObject
296240 {
297241 if (i > 2 ) break ;
298242
299- var rgbIndex = noteData % colArray .length ;
300- var arr : Array <FlxColor > = null ;
301- // Ensure we don't go out of bounds for RGB arrays
302- if (rgbIndex < ClientPrefs .data .arrowRGB .length ) {
303- arr = ClientPrefs .data .arrowRGB [rgbIndex ];
304- if (PlayState .isPixelStage && rgbIndex < ClientPrefs .data .arrowRGBPixel .length )
305- arr = ClientPrefs .data .arrowRGBPixel [rgbIndex ];
306- } else {
307- // Fallback to default RGB values for extended keys
308- arr = [FlxColor .WHITE , FlxColor .WHITE , FlxColor .WHITE ];
309- }
243+ var arr : Array <FlxColor > = ClientPrefs .data .arrowRGB [noteData % Note .colArray .length ];
244+ if (PlayState .isPixelStage ) arr = ClientPrefs .data .arrowRGBPixel [noteData % Note .colArray .length ];
310245
311246 var rgb = colors [i ];
312247 if (rgb == null )
0 commit comments