Example #1
0
        public UINPCSpawnInfo(int npcid, float percent)
        {
            this.npcid    = npcid;
            this.percent  = 100 * percent;
            Width         = StyleDimension.Fill;
            Height.Pixels = 32;

            NPC npc = new NPC();

            npc.SetDefaults(npcid);

            npcSlot = new UINPCSlot(npc);
            Append(npcSlot);

            string name = Lang.GetNPCNameValue(npc.type) + (npc.ModNPC != null ? " [" + npc.ModNPC.Mod.Name + "]" : "");

            information             = new UIText(name, 0.8f);
            information.Top.Pixels  = 1;
            information.Left.Pixels = 40;
            Append(information);

            percentText             = new UIText(this.percent.ToString("0.00") + "%", 0.8f);
            percentText.Left.Pixels = 40;
            percentText.Top.Pixels  = 18;
            Append(percentText);
        }
Example #2
0
        public override int CompareTo(object obj)
        {
            UINPCSlot other = obj as UINPCSlot;

            return /*-1 * */ (npcType.CompareTo(other.npcType));
        }