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;
        }
Beispiel #2
0
        public void Switcher_OnCategorySelect(int obj)
        {
            UISubpanel panel = null;

            switch (Mode)
            {
            case UIMainPanelMode.LIVE:
                switch (obj)
                {
                case 0:
                    panel = new UIMotiveSubpanel(Game); break;

                case 1:
                    panel = new UIJobSubpanel(Game); break;

                case 2:
                    panel = new UIPersonalitySubpanel(Game); break;

                case 3:
                    panel = new UIRelationshipSubpanel(Game); break;

                case 4:
                    panel = new UIInventorySubpanel(Game); break;
                }
                break;

            case UIMainPanelMode.BUY:
                panel = new UIBuyBrowsePanel(Game, (sbyte)obj, GetLotType(false));
                break;

            case UIMainPanelMode.BUILD:
                panel = new UIBuyBrowsePanel(Game, (sbyte)obj, UICatalogMode.Build);
                break;

            case UIMainPanelMode.OPTIONS:
                panel = new UIButtonSubpanel(Game, new UICatFunc[] {
                    new UICatFunc(GameFacade.Strings.GetString("145", "3"), "opt_save.png", () => { Game.Save(); }),
                    new UICatFunc(GameFacade.Strings.GetString("145", "1"), "opt_neigh.png", () => { Game.ReturnToNeighbourhood(); }),
                    new UICatFunc(GameFacade.Strings.GetString("145", "5"), "opt_quit.png", () => { Game.CloseAttempt(); }),
                });
                break;
            }
            SetSubpanel(panel);
        }