Ejemplo n.º 1
0
        private void BeginDrag(UICatalogElement item, uint uid)
        {
            DragUID  = uid;
            DragItem = new UICatalogItem(true);
            DragItem.SetDisabled(false);
            DragItem.Info           = item;
            DragItem.Info.CalcPrice = item.CalcPrice;

            DragItem.Icon    = (item.Special?.Res != null) ? item.Special.Res.GetIcon(item.Special.ResID) : Catalog.GetObjIcon(item.Item.GUID);
            DragItem.Tooltip = (item.CalcPrice > 0) ? ("$" + item.CalcPrice.ToString()) : null;
            LastMouse        = true;

            Add(DragItem);

            BuildInventory();
            BuildOffer(MyOffer.ObjectOffer, OfferCatalog);
        }
Ejemplo n.º 2
0
        public UICatalogItem(UICatalogElement elem, UIBuyBrowsePanel budgetProvider)
        {
            BG      = Content.Get().CustomUI.Get("pswitch_icon_bg.png").Get(GameFacade.GraphicsDevice);
            Icon    = (elem.Special?.Res != null) ? elem.Special.Res.GetIcon(elem.Special.ResID) : GetObjIcon(elem.Item.GUID);
            Outline = Content.Get().CustomUI.Get("pswitch_icon_sel.png").Get(GameFacade.GraphicsDevice);

            PriceLabel                    = new UILabel();
            PriceLabel.Alignment          = TextAlignment.Center | TextAlignment.Middle;
            PriceLabel.Position           = new Vector2(0, 110);
            PriceLabel.Size               = new Vector2(90, 1);
            PriceLabel.CaptionStyle       = PriceLabel.CaptionStyle.Clone();
            PriceLabel.CaptionStyle.Color = UIStyle.Current.Text;
            PriceLabel.CaptionStyle.Size  = 14;
            PriceLabel.Caption            = "§" + elem.Item.Price.ToString();
            Add(PriceLabel);

            BudgetProvider = budgetProvider;
        }