Пример #1
0
        public static MTexture GetHairTexture(On.Celeste.PlayerHair.orig_GetHairTexture orig, PlayerHair self, int index)
        {
            if (!(self.Entity is Player) || !Settings.Enabled)
            {
                return(orig(self, index));
            }
            Player player = self.Entity as Player;

            if (player.Dashes >= MAX_DASH_COUNT || player.Dashes < 0)
            {
                return(orig(self, index));
            }

            if (index == 0)  //bangs
            {
                if (Settings.hairBangs[player.Dashes] == null || Settings.hairBangs[player.Dashes].Count == 0)
                {
                    return(orig(self, index));
                }
                return(Settings.hairBangs[player.Dashes][self.GetSprite().HairFrame % Settings.hairBangs[player.Dashes].Count]);
            }
            if (Settings.hairTextures[player.Dashes] == null || Settings.hairTextures[player.Dashes].Count == 0)
            {
                return(orig(self, index));
            }
            return(Settings.hairTextures[player.Dashes][index % Settings.hairTextures[player.Dashes].Count]);
        }
 private MTexture PlayerHairGetHairTextureHook(On.Celeste.PlayerHair.orig_GetHairTexture orig, PlayerHair self, int index)
 {
     if (UniqueSkinSelected())
     {
         if (index == 0)
         {
             string newBangsPath = skinConfigs[Settings.SelectedSkinMod].GetUniquePath() + "characters/player/bangs";
             if (GFX.Game.Has(newBangsPath + "00"))
             {
                 List <MTexture> bangsTextures = GFX.Game.GetAtlasSubtextures(newBangsPath);
                 if (bangsTextures.Count > self.Sprite.HairFrame)
                 {
                     return(bangsTextures[self.Sprite.HairFrame]);
                 }
                 else
                 {
                     return(bangsTextures[0]);
                 }
             }
         }
         string newHairPath = skinConfigs[Settings.SelectedSkinMod].GetUniquePath() + "characters/player/hair00";
         if (GFX.Game.Has(newHairPath))
         {
             return(GFX.Game[newHairPath]);
         }
     }
     return(orig(self, index));
 }
Пример #3
0
        public static MTexture GetHairTexture(On.Celeste.PlayerHair.orig_GetHairTexture orig, PlayerHair self, int index)
        {
            MTexture       texOrig = orig(self, index);
            Ghost          ghost   = self.Entity as Ghost;
            GhostNetClient client  = GhostNetModule.Instance.Client;
            uint           playerID;
            GhostNetFrame  frame;
            ChunkUUpdate   update;

            if (ghost == null ||
                client == null ||
                !client.GhostPlayerIDs.TryGetValue(ghost, out playerID) ||
                !client.UpdateMap.TryGetValue(playerID, out frame) ||
                (update = frame) == null)
            {
                return(texOrig);
            }

            if (index < 0 || update.HairColors.Length <= index)
            {
                return(texOrig);
            }
            string texName = update.HairTextures[index];

            if (!GFX.Game.Has(texName))
            {
                return(texOrig);
            }
            return(GFX.Game[texName]);
        }
Пример #4
0
        public static MTexture GetHairTexture(On.Celeste.PlayerHair.orig_GetHairTexture orig, PlayerHair self, int index)
        {
            if (!(self.Entity is Player) || self.GetSprite().Mode == PlayerSpriteMode.Badeline)
            {
                return(orig(self, index));
            }

            if (Settings.FoxEnabled)
            {
                if (index == 0)
                {
                    return(FoxBangs[self.GetSprite().HairFrame]);
                }
                return(FoxHair[index % FoxHair.Count]);
            }

            return(orig(self, index));
        }
Пример #5
0
 private MTexture PlayerHairGetHairTextureHook(On.Celeste.PlayerHair.orig_GetHairTexture orig, PlayerHair self, int index)
 {
     if (Settings.SelectedSkinMod != SkinModHelperConfig.DEFAULT_SKIN)
     {
         if (index == 0)
         {
             string newBangsPath = skinConfigs[Settings.SelectedSkinMod].GetUniquePath() + "characters/player/bangs";
             if (GFX.Game.Has(newBangsPath + "00"))
             {
                 return(GFX.Game.GetAtlasSubtextures(newBangsPath)[self.Sprite.HairFrame]);
             }
         }
         string newHairPath = skinConfigs[Settings.SelectedSkinMod].GetUniquePath() + "characters/player/hair00";
         if (GFX.Game.Has(newHairPath))
         {
             return(GFX.Game[newHairPath]);
         }
     }
     return(orig(self, index));
 }