コード例 #1
0
        public static Item GetDyeItem(this Player player, DyeSlotType type)
        {
            switch (type)
            {
            case DyeSlotType.Head:
            case DyeSlotType.Body:
            case DyeSlotType.Legs:
                return(player.dye[(int)type]);

            case DyeSlotType.Mount:
                if (player.carpet)
                {
                    return(player.GetDyeFromArmorSlot((EquipType)DyeSlotType.Carpet));
                }
                else
                {
                    return(player.miscDyes[(int)type - 15]);
                }

            case DyeSlotType.Pet:
            case DyeSlotType.Light:
            case DyeSlotType.Minecart:
            case DyeSlotType.Grapple:
                return(player.miscDyes[(int)type - 15]);

            default:
                return(player.GetDyeFromArmorSlot((EquipType)type));
            }
        }
コード例 #2
0
ファイル: CustomDyePlayer.cs プロジェクト: gamrguy/CustomDyes
 private PlayerLayer TrackerLayer(string name, DyeSlotType slotType) 
     => new PlayerLayer("CustomDyes", "tracker" + name, (info) => {
         var item = info.drawPlayer.GetDyeItem(slotType);
         if(item != null) {
             for(int i = count; i < Main.playerDrawData.Count; i++) {
                 if(Main.playerDrawData[i].shader == CustomDyes.DyeID) {
                     customDye.Add(item);
                 }
             }
         }
         count = Main.playerDrawData.Count;
     });