Ejemplo n.º 1
0
        public UIFrame()
        {
            ElementType = UIElementType.Frame;
            Name = "";
            ContentView = new UIStackView();
            ContentView.Padding = new Margin(5);

            AddDefaultButtons();
        }
Ejemplo n.º 2
0
        public GameSidebar(GameDesktop Desktop)
            : base(null, UIElementType.Window)
        {
            this.Desktop = Desktop;
            this.Viewport = Desktop.ActiveViewport;
            Desktop.ActiveViewportChanged += ViewportChanged;

            ContentView = new UIStackView(UIStackDirection.Vertical);
            ContentView.ZOrder = -1;

            CreateMenu();

            AddSubview(ContentView);
        }
Ejemplo n.º 3
0
        private void CreateMenu()
        {
            Rectangle ButtonSize = new Rectangle(0, 0, 58, 15);
            MenuView = new UIStackView(UIStackDirection.Horizontal, true);

            UIToggleButton InventoryToggle = new UIToggleButton("Player");
            InventoryToggle.Bounds = ButtonSize;
            InventoryToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse)
            {
                if (Button.On && InventoryView == null)
                {
                    InventoryView = new InventoryPanel(Desktop);
                    AddWindow(InventoryView);
                }
                else if (!Button.On && InventoryView != null)
                {
                    InventoryView.RemoveFromSuperview();
                    InventoryView = null;
                }
            };
            MenuView.AddSubview(InventoryToggle);

            UIToggleButton SkillToggle = new UIToggleButton("Skills");
            SkillToggle.Bounds = ButtonSize;
            SkillToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse)
            {
                if (Button.On && SkillsView == null)
                {
                    SkillsView = new SkillPanel(Desktop);
                    SkillsView.Bounds.Width = 176;
                    SkillsView.Bounds.Height = 180;
                    AddWindow(SkillsView);
                }
                else if (!Button.On && SkillsView != null)
                {
                    SkillsView.RemoveFromSuperview();
                    SkillsView = null;
                }
            };
            MenuView.AddSubview(SkillToggle);

            UIToggleButton BattleToggle = new UIToggleButton("Battle");
            BattleToggle.Bounds = ButtonSize;
            MenuView.AddSubview(BattleToggle);

            UIToggleButton VIPToggle = new UIToggleButton("VIP");
            VIPToggle.Bounds = ButtonSize;
            VIPToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse)
            {
                if (Button.On && VIPView == null)
                {
                    VIPView = new VIPPanel(Desktop);
                    AddWindow(VIPView);
                }
                else if (!Button.On && VIPView != null)
                {
                    VIPView.RemoveFromSuperview();
                    VIPView = null;
                }
            };
            MenuView.AddSubview(VIPToggle);

            UIButton MapToggle = new UIButton("Map");
            MapToggle.Bounds = ButtonSize;
            MenuView.AddSubview(MapToggle);

            UIButton MenuToggle = new UIButton("Menu");
            MenuToggle.Bounds = ButtonSize;
            MenuView.AddSubview(MenuToggle);

            AddSubview(MenuView);
        }
Ejemplo n.º 4
0
        private void CreateMenu()
        {
            Rectangle ButtonSize = new Rectangle(0, 0, 58, 15);

            MenuView = new UIStackView(UIStackDirection.Horizontal, true);

            UIToggleButton InventoryToggle = new UIToggleButton("Player");

            InventoryToggle.Bounds         = ButtonSize;
            InventoryToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse)
            {
                if (Button.On && InventoryView == null)
                {
                    InventoryView = new InventoryPanel(Desktop);
                    AddWindow(InventoryView);
                }
                else if (!Button.On && InventoryView != null)
                {
                    InventoryView.RemoveFromSuperview();
                    InventoryView = null;
                }
            };
            MenuView.AddSubview(InventoryToggle);

            UIToggleButton SkillToggle = new UIToggleButton("Skills");

            SkillToggle.Bounds         = ButtonSize;
            SkillToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse)
            {
                if (Button.On && SkillsView == null)
                {
                    SkillsView = new SkillPanel(Desktop);
                    SkillsView.Bounds.Width  = 176;
                    SkillsView.Bounds.Height = 180;
                    AddWindow(SkillsView);
                }
                else if (!Button.On && SkillsView != null)
                {
                    SkillsView.RemoveFromSuperview();
                    SkillsView = null;
                }
            };
            MenuView.AddSubview(SkillToggle);

            UIToggleButton BattleToggle = new UIToggleButton("Battle");

            BattleToggle.Bounds = ButtonSize;
            MenuView.AddSubview(BattleToggle);

            UIToggleButton VIPToggle = new UIToggleButton("VIP");

            VIPToggle.Bounds         = ButtonSize;
            VIPToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse)
            {
                if (Button.On && VIPView == null)
                {
                    VIPView = new VIPPanel(Desktop);
                    AddWindow(VIPView);
                }
                else if (!Button.On && VIPView != null)
                {
                    VIPView.RemoveFromSuperview();
                    VIPView = null;
                }
            };
            MenuView.AddSubview(VIPToggle);

            UIButton MapToggle = new UIButton("Map");

            MapToggle.Bounds = ButtonSize;
            MenuView.AddSubview(MapToggle);

            UIButton MenuToggle = new UIButton("Menu");

            MenuToggle.Bounds = ButtonSize;
            MenuView.AddSubview(MenuToggle);

            AddSubview(MenuView);
        }