11package funkin .data .freeplay .player ;
22
33import funkin .data .animation .AnimationData ;
4+ import funkin .graphics .FunkinSprite ;
45
56@:nullSafety
67class PlayerData
@@ -297,12 +298,83 @@ class PlayerCharSelectData
297298 */
298299 @:optional
299300 public var gf : PlayerCharSelectGFData ;
301+
302+ /**
303+ * The optional data for the character bopping in the character select menu.
304+ */
305+ @:optional
306+ public var characterData : PlayerCharSelectCharacterData ;
307+
308+ /**
309+ * Return the array of default animations for the player character. Used for backwards compatibility with older versions.
310+ */
311+ public function getDefaultAnimations (gf : Bool = false ): Array <AnimationData >
312+ {
313+ if (gf )
314+ {
315+ return [
316+ {
317+ name : " idle" ,
318+ prefix : " idle" ,
319+ looped : true
320+ },
321+ {
322+ name : " confirm" ,
323+ prefix : " confirm" ,
324+ looped : true
325+ },
326+ {
327+ name : " cancel" ,
328+ prefix : " deselect"
329+ }
330+ ];
331+ }
332+
333+ return [
334+ {
335+ name : " idle" ,
336+ prefix : " idle" ,
337+ looped : true
338+ },
339+ {
340+ name : " unlock" ,
341+ prefix : " unlock"
342+ },
343+ {
344+ name : " slideOut-unlock" ,
345+ prefix : " death"
346+ },
347+ {
348+ name : " confirm" ,
349+ prefix : " select"
350+ },
351+ {
352+ name : " cancel" ,
353+ prefix : " deselect"
354+ },
355+ {
356+ name : " cancel-hold" ,
357+ prefix : " deselect loop start"
358+ },
359+ {
360+ name : " locked" ,
361+ prefix : " cannot select"
362+ },
363+ {
364+ name : " slideOut" ,
365+ prefix : " slideout"
366+ },
367+ {
368+ name : " slideIn" ,
369+ prefix : " slidein"
370+ }
371+ ];
372+ }
300373}
301374
302375typedef PlayerCharSelectGFData =
303376{
304- @:optional
305- public var assetPath : String ;
377+ > PlayerCharSelectCharacterData ,
306378
307379 @:optional
308380 public var animInfoPath : String ;
@@ -312,6 +384,34 @@ typedef PlayerCharSelectGFData =
312384 public var visualizer : Bool ;
313385}
314386
387+ typedef PlayerCharSelectCharacterData =
388+ {
389+ /**
390+ * Optional asset path for the character.
391+ */
392+ @:optional
393+ var assetPath : String ;
394+
395+ /**
396+ * Optional render type for the character. Defaults to using texture atlases.
397+ */
398+ @:optional
399+ @:default (" animateatlas" )
400+ var renderType : String ;
401+
402+ /**
403+ * Optional script class to use for the character, allowing for custom behavior.
404+ */
405+ @:optional
406+ var scriptClass : String ;
407+
408+ /**
409+ * Optional list of animations for the character.
410+ */
411+ @:optional
412+ var animations : Array <AnimationData >;
413+ }
414+
315415typedef PlayerResultsData =
316416{
317417 var music : PlayerResultsMusicData ;
0 commit comments