예제 #1
0
 public void Read(BinaryReader reader)
 {
     type      = (Type)reader.ReadInt32();
     id        = reader.ReadInt32();
     uniqueKey = reader.ReadString();
     animation = new DrawAnimationVertical(reader.ReadInt32(), reader.ReadInt32());
 }
예제 #2
0
        private void SetDefaults_Autosize()
        {
            if (Main.itemAnimationsRegistered.Contains(item.type))
            {
                DrawAnimationVertical animation = Main.itemAnimations[item.type] as DrawAnimationVertical;
                item.Size = new Vector2(texture.Width / animation.FrameCount, texture.Height);
                return;
            }

            item.Size = texture.Size();
        }
예제 #3
0
        public sealed override void SetDefaults()
        {
            SetItemDefaults();

            if (UseConsistentAxePower)
            {
                item.axe /= 5;
            }

            if (CompletionMod.CanAutosizeItems && AutosizeItem && Main.itemAnimationsRegistered.Contains(item.type))
            {
                DrawAnimationVertical itemAnimation = (DrawAnimationVertical)Main.itemAnimations[item.type];
                item.Size = new Vector2(ItemTexture.Width / itemAnimation.FrameCount, ItemTexture.Height);
            }
        }
예제 #4
0
        public void Load(TagCompound tag)
        {
            type      = (Type)tag.Get <int>("Type");
            uniqueKey = tag.GetString("UniqueKey");

            switch (type)
            {
            case Type.Item:
                id = ItemID.TypeFromUniqueKey(uniqueKey);
                break;

            case Type.NPC:
                id = NPCID.TypeFromUniqueKey(uniqueKey);
                break;

            case Type.Projectile:
                id = ProjectileID.TypeFromUniqueKey(uniqueKey);
                break;
            }

            animation = new DrawAnimationVertical(tag.Get <int>("TicksPerFrame"), tag.Get <int>("FrameCount"));
        }
예제 #5
0
        public IconData(Type type, int id)
        {
            this.type = type;
            this.id   = id;

            switch (type)
            {
            case Type.Item:
                uniqueKey = ItemID.GetUniqueKey(id);
                animation = Main.itemAnimations[id] as DrawAnimationVertical ?? new DrawAnimationVertical(0, 1);
                break;

            case Type.NPC:
                uniqueKey = NPCID.GetUniqueKey(id);
                animation = new DrawAnimationVertical(5, Main.npcFrameCount[id]);
                break;

            case Type.Projectile:
                uniqueKey = ProjectileID.GetUniqueKey(id);
                animation = new DrawAnimationVertical(5, Main.projFrames[id]);
                break;
            }
        }
 public override void SetStaticDefaults()
 {
     DisplayName.SetDefault("Blade of Kusanagi");
     Tooltip.SetDefault("From 'Ökami'.");
     Main.RegisterItemAnimation(item.type, animation = new DrawAnimationVertical(10, 4));
 }