Exemple #1
0
        public UIFamilyCASPanel(List <VMAvatar> avatar)
        {
            Avatars = avatar;

            AvatarOptions = new UICategorySwitcher();
            AvatarOptions.InitCategories(AvatarCategories);
            AvatarOptions.MainButton.Visible = false;
            AvatarOptions.OnCategorySelect  += AvatarOptions_OnCategorySelect;
            Add(AvatarOptions);

            NameStripe          = new UIDiagonalStripe(new Point(0, 75), UIDiagonalStripeSide.LEFT, UIStyle.Current.Bg);
            NameStripe.Position = new Vector2(UIScreen.Current.ScreenWidth, 30);
            Add(NameStripe);

            SecondName            = new UITextBox();
            SecondName.TextMargin = new Rectangle();
            SecondName.SetSize(UIScreen.Current.ScreenWidth, 60);
            SecondName.Alignment       = TextAlignment.Center;
            SecondName.TextStyle       = SecondName.TextStyle.Clone();
            SecondName.TextStyle.Size  = 37;
            SecondName.TextStyle.Color = UIStyle.Current.SecondaryText;
            SecondName.Position        = new Vector2(0, 40);
            Add(SecondName);

            ListStripe          = new UIDiagonalStripe(new Point(0, 125), UIDiagonalStripeSide.RIGHT, UIStyle.Current.Bg);
            ListStripe.Position = new Vector2(0, UIScreen.Current.ScreenHeight - 145);
            Add(ListStripe);

            AvatarList              = new UIAvatarListPanel(avatar);
            AvatarList.Y            = UIScreen.Current.ScreenHeight - 145;
            AvatarList.OnSelection += AvatarList_OnSelection;
            Add(AvatarList);

            Reset();
            ShowI = ShowI;
        }
Exemple #2
0
        public UIMainPanel(TS1GameScreen game) : base()
        {
            Game = game;
            Diag = new UIDiagonalStripe(new Point(0, 128), UIDiagonalStripeSide.RIGHT, UIStyle.Current.Bg);
            Add(Diag);
            WhitePx = TextureGenerator.GetPxWhite(GameFacade.GraphicsDevice);
            var ui = Content.Get().CustomUI;

            Div = ui.Get("panel_div.png").Get(GameFacade.GraphicsDevice);

            FloorUpBtn                = new UIStencilButton(ui.Get("level_up.png").Get(GameFacade.GraphicsDevice));
            FloorUpBtn.Position       = new Vector2(80, 10);
            FloorUpBtn.OnButtonClick += (b) => { if (Game.Level < 5)
                                                 {
                                                     Game.Level++;
                                                 }
            };
            Add(FloorUpBtn);

            FloorDownBtn                = new UIStencilButton(ui.Get("level_down.png").Get(GameFacade.GraphicsDevice));
            FloorDownBtn.Position       = new Vector2(80, 68);
            FloorDownBtn.OnButtonClick += (b) => { if (Game.Level > 1)
                                                   {
                                                       Game.Level--;
                                                   }
            };
            Add(FloorDownBtn);

            FloorLabel = new UILabel();
            FloorLabel.CaptionStyle       = FloorLabel.CaptionStyle.Clone();
            FloorLabel.CaptionStyle.Size  = 15;
            FloorLabel.CaptionStyle.Color = UIStyle.Current.Text;
            FloorLabel.Alignment          = TextAlignment.Middle | TextAlignment.Center;
            FloorLabel.Position           = new Vector2(80, 64);
            FloorLabel.Size = new Vector2(51, 18);

            FloorLabelShadow = new UILabel();
            FloorLabelShadow.CaptionStyle       = FloorLabel.CaptionStyle.Clone();
            FloorLabelShadow.Alignment          = TextAlignment.Middle | TextAlignment.Center;
            FloorLabelShadow.Position           = new Vector2(83, 67);
            FloorLabelShadow.Size               = new Vector2(51, 18);
            FloorLabelShadow.CaptionStyle.Color = Color.Black * 0.5f;
            Add(FloorLabelShadow);
            Add(FloorLabel);

            HideButton                = new UIStencilButton(ui.Get("panel_hide.png").Get(GameFacade.GraphicsDevice));
            HideButton.X              = Game.ScreenWidth - (50 + 64 + 15);
            HideButton.Y              = 26;
            HideButton.OnButtonClick += (b) => { Close(); };
            Add(HideButton);

            Divider          = new UIImage(ui.Get("divider.png").Get(GameFacade.GraphicsDevice));
            Divider.Position = new Vector2(146, 29);
            Add(Divider);

            Switcher          = new UICategorySwitcher();
            Switcher.Position = new Vector2(164, 0);
            Switcher.InitCategories(LiveCategories);
            Switcher.OnCategorySelect += Switcher_OnCategorySelect;
            Switcher.OnOpen           += Switcher_OnOpen;
            Add(Switcher);

            foreach (var fade in GetFadeables())
            {
                fade.Opacity = 0;
            }

            Game.LotControl.QueryPanel.Position = new Vector2(53, -5);
            Add(Game.LotControl.QueryPanel);
            Game.LotControl.PickupPanel.Opacity = 0;
            Add(Game.LotControl.PickupPanel);

            CurWidth = 0;
        }