Beispiel #1
0
        public UIFishingCatchesInfo(int itemid, float percent)
        {
            this.itemid   = itemid;
            this.percent  = 100 * percent;
            Width         = StyleDimension.Fill;
            Height.Pixels = 32;

            Item item = new Item();

            item.SetDefaults(itemid);

            npcSlot = new UIFishingCatchesSlot(item);
            Append(npcSlot);

            string name;

            if (itemid <= 0)
            {
                name = "Nothing";
            }
            else
            {
                name = Lang.GetItemNameValue(item.type) + (item.modItem != null ? " [" + item.modItem.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);
        }
Beispiel #2
0
        public override int CompareTo(object obj)
        {
            UIFishingCatchesSlot other = obj as UIFishingCatchesSlot;

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