Skip to content

Code favorites

AAA1459 edited this page Dec 25, 2024 · 2 revisions

Documented some code, maybe

Don't look here if you just want to make skins and not helpers.

Fill Animation For Player it self

private static void on_PlayerSprite_CreateFramesMetadata(On.Celeste.PlayerSprite.orig_CreateFramesMetadata orig, string id) {
   orig(id);
   if (id == "player")
      PlayerSprite.CreateFramesMetadata("[yourAnimSet in Sprites.xml]");
   Dictionary<string, Sprite.Animation> existingPlayerAnim = GFX.SpriteBank.SpriteData[id].Sprite.Animations;
   foreach (KeyValuePair<string, Sprite.Animation> fillAnim in GFX.SpriteBank.SpriteData["[yourAnimSet in Sprites.xml]"].Sprite.Animations){
      string animId = fillAnim.Key;
      if (!existingPlayerAnim.ContainsKey(animId))
         existingPlayerAnim[animId] = fillAnim.Value;
   }
}
...
// in elsewhere uses
  player.Sprite.Play("[someAnim from yourAnimSet]");

This will gain color grading, silhouettes, hair, etc. support compared to use other entities to play animations that include players and make the player invisible

And almost a minimalist version of XaphanHelper or CH or SMH+ related parts

Clone this wiki locally