Exemple #1
0
        public UIInventorySubpanel(TS1GameScreen game) : base(game)
        {
            var ui = Content.Get().CustomUI;

            ScrollView           = new UITouchScroll(() => { return(Items?.Count ?? 0); }, DisplayProvider);
            ScrollView.X         = 148;
            ScrollView.ItemWidth = 90;
            ScrollView.Size      = new Vector2(582, 128);
            Add(ScrollView);

            MagicButton                = new UITwoStateButton(ui.Get("inv_mag_btn.png").Get(GameFacade.GraphicsDevice));
            MagicButton.Position       = new Vector2(21, 9);
            MagicButton.OnButtonClick += (b) => { ChangeCat(7); };
            Add(MagicButton);
            IngButton                = new UITwoStateButton(ui.Get("inv_ing_btn.png").Get(GameFacade.GraphicsDevice));
            IngButton.Position       = new Vector2(81, 9);
            IngButton.OnButtonClick += (b) => { ChangeCat(8); };
            Add(IngButton);
            OtherButton                = new UITwoStateButton(ui.Get("inv_other_btn.png").Get(GameFacade.GraphicsDevice));
            OtherButton.Position       = new Vector2(21, 69);
            OtherButton.OnButtonClick += (b) => { ChangeCat(-1); };
            Add(OtherButton);

            ChangeCat(-1);
        }
Exemple #2
0
        public UIRelationshipSubpanel(TS1GameScreen game) : base(game)
        {
            var ui = Content.Get().CustomUI;

            ScrollView           = new UITouchScroll(() => { return(Items?.Count ?? 0); }, DisplayProvider);
            ScrollView.X         = 148;
            ScrollView.ItemWidth = 90;
            ScrollView.Size      = new Vector2(582, 128);
            Add(ScrollView);

            FriendButton                = new UITwoStateButton(ui.Get("rel_friend.png").Get(GameFacade.GraphicsDevice));
            FriendButton.Position       = new Vector2(21, 9);
            FriendButton.OnButtonClick += (b) => { ChangeCat(0); };
            Add(FriendButton);
            FamButton                = new UITwoStateButton(ui.Get("rel_fam.png").Get(GameFacade.GraphicsDevice));
            FamButton.Position       = new Vector2(81, 9);
            FamButton.OnButtonClick += (b) => { ChangeCat(1); };
            Add(FamButton);
            AllButton                = new UITwoStateButton(ui.Get("rel_all.png").Get(GameFacade.GraphicsDevice));
            AllButton.Position       = new Vector2(21, 69);
            AllButton.OnButtonClick += (b) => { ChangeCat(-1); };
            Add(AllButton);
            FameButton                = new UITwoStateButton(ui.Get("rel_fame.png").Get(GameFacade.GraphicsDevice));
            FameButton.Position       = new Vector2(81, 69);
            FameButton.OnButtonClick += (b) => { ChangeCat(2); };
            Add(FameButton);

            ChangeCat(-1);
        }
        public UIBuyBrowsePanel(TS1GameScreen screen, sbyte category, UICatalogMode mode) : base(screen)
        {
            CatContainer            = new UITouchScroll(() => FilterCategory?.Count() ?? 0, CatalogElemProvider);
            CatContainer.ItemWidth  = 90;
            CatContainer.DrawBounds = false;
            CatContainer.Margin     = 15;
            CatContainer.SetScroll(-15);
            CatContainer.Size = new Vector2(775, 128);
            Category          = category;

            Add(CatContainer);
            Mode = mode;
            GameResized();

            InitCategory(category, false);

            screen.LotControl.ObjectHolder.OnPickup  += ObjectHolder_OnPickup;
            screen.LotControl.ObjectHolder.OnPutDown += ObjectHolder_OnPutDown;
            screen.LotControl.ObjectHolder.OnDelete  += ObjectHolder_OnDelete;
            HoldingEvents = true;
        }
Exemple #4
0
        public UIFamiliesCASPanel()
        {
            var gd = GameFacade.GraphicsDevice;
            var ui = Content.Get().CustomUI;
            var sh = UIScreen.Current.ScreenHeight;
            var sw = UIScreen.Current.ScreenWidth;

            FamilyList = new UITouchScroll(FamilyLength, FamilyProvider);
            FamilyList.VerticalMode = true;
            FamilyList.Size         = new Vector2(810, sh);
            FamilyList.X            = (sw - 810) / 2;
            FamilyList.ItemWidth    = 180;
            FamilyList.Margin       = 90;
            FamilyList.DrawBounds   = false;
            Add(FamilyList);
            WhitePx = TextureGenerator.GetPxWhite(GameFacade.GraphicsDevice);

            Title = new UILabel();
            Title.NewStyle(UIStyle.Current.Text, 37);
            Title.Caption   = "Select a Family";
            Title.Size      = new Vector2(sw, 60);
            Title.Alignment = TextAlignment.Middle | TextAlignment.Center;
            Title.Y         = -85;
            Add(Title);

            DeleteButton          = new UITwoStateButton(ui.Get("btn_deletefam.png").Get(gd));
            DeleteButton.Position = new Vector2(sw - 140, sh - 260);
            Add(DeleteButton);

            NewButton          = new UITwoStateButton(ui.Get("btn_createfam.png").Get(gd));
            NewButton.Position = new Vector2(sw - 140, sh - 380);
            Add(NewButton);
            NewButton.OnButtonClick += (btn) => OnNewFamily?.Invoke();

            TitleI = TitleI;
            SetSelection(-1);
        }