Esempio n. 1
0
        public MainRibbon()
        {
            // Sourcemap
            sourcemap = new RibbonMenuItem("SourceMap", this);

            RibbonGroup group = new RibbonGroup("Loading", this);
            Button button = new Button("Load Sourcemap", this);
            button.Selected += new Button.ButtonSelectedEvent(LoadMapEvent);

            Button button2 = new Button("Unload Sourcemap", this);
            button2.Selected += new Button.ButtonSelectedEvent(UnLoadMapEvent);
            group.AddControl(button);
            group.AddControl(button2);
            sourcemap.AddItem(group);

            group = new RibbonGroup("Hags?",this);
            group.AddControl(new Button("Magic Button", this));
            sourcemap.AddItem(group);

            AddItem(sourcemap);

            // Renderer
            renderer = new RibbonMenuItem("Renderer", this);
            group = new RibbonGroup("Screenshot",this);
            button = new Button("Screenshot", this);
            group.AddControl(button);
            renderer.AddItem(group);
            AddItem(renderer);

            // Other
            AddItem(new RibbonMenuItem("Test2", this));
            AddItem(new RibbonMenuItem("Test3", this));
        }
Esempio n. 2
0
 public ServerListItemUI(Window window, serverInfo_t info)
     : base(window)
 {
     this.Layout = new FlowLayout(true);
     this.info = info;
     this.joinButton = new Button("Join", window);
     joinButton.Selected += new Button.ButtonSelectedEvent(JoinServer);
     serverIP = new Label("Address: " + info.adr.ToString(), window);
     this.AddControl(serverIP);
     this.AddControl(joinButton);
 }
Esempio n. 3
0
        public ServerListUI()
        {
            // Setup window
            Title = "LAN Server List";
            panel.Layout = new FlowLayout(false);
            WindowSpawnPosition = Corner.MIDDLE;
            Size = new System.Drawing.Size(400, 300);
            Bound.Size = Size;

            closeButton = new Button("Close", this);
            closeButton.Selected += new Button.ButtonSelectedEvent(HideWindow);
        }
Esempio n. 4
0
        public RibbonMenu()
        {
            // Set up size and position
            this.Size = this.PreferredSize = new System.Drawing.Size(Renderer.Instance.RenderSize.Width, 100);
            UpdateSize();
            this.WindowSpawnPosition = Corner.TOPLEFT;
            FlowLayout layout = new FlowLayout(true);
            //layout.centered = false;
            layout.Margin = 6;
            panel.Layout = layout;

            this.ForcePanelSize = true;
            this.PanelSize = new Size(Renderer.Instance.RenderSize.Width, 23);

            // Make window borderless
            this.Borderless = true;
            this.Resizeable = false;

            // Load textures..
            //backgroundTex = TextureManager.Instance.LoadTexture("gui/ribbon/ribbonbg.png");
            backgroundRect = new Rectangle(0, 0, 19, 99);
            //buttonTex = TextureManager.Instance.LoadTexture("gui/ribbon/ribbonbutton.png");
            buttonRect = new Rectangle[3];
            buttonRect[0] = new Rectangle(0,0,5,24); // left
            buttonRect[1] = new Rectangle(5,0,24,24); // middle (strect-able)
            buttonRect[2] = new Rectangle(28,0,5,24); // right
            //groupTex = TextureManager.Instance.LoadTexture("gui/ribbon/ribbongroup.png");
            groupRect = new Rectangle[9];
            groupRect[0] = new Rectangle(0,0,6,8);
            groupRect[1] = new Rectangle(6,0,44,8);
            groupRect[2] = new Rectangle(50,0,6,8);
            groupRect[3] = new Rectangle(0, 20, 6, 8);
            groupRect[4] = new Rectangle(6, 20, 44, 8);
            groupRect[5] = new Rectangle(50, 20, 6, 8);
            groupRect[6] = new Rectangle(0, 63, 6, 8);
            groupRect[7] = new Rectangle(6, 63, 44, 8);
            groupRect[8] = new Rectangle(50, 63, 6, 8);
            //gradientTex = TextureManager.Instance.LoadTexture("gui/ribbon/blacktransgrad.png");
            gradientRect = new Rectangle(0, 5, 16, 27);

            sprite = new Sprite(Renderer.Instance.device);

            // Set up button
            ToggleRibbonButton = new Button("+", this);
            ToggleRibbonButton.Selected += new Button.ButtonSelectedEvent(ToggleShowRibbon);
            panel.AddControl(ToggleRibbonButton);
        }
Esempio n. 5
0
        public ConnectGUI()
        {
            this.panel.Layout = new FlowLayout(false);
            this.Title = "Connecting...";
            this.WindowSpawnPosition = Corner.MIDDLE;

            ConnectStatus = new Label("Connecting... ", this);
            this.panel.AddControl(ConnectStatus);

            infoLabel = new Label(".", this);
            panel.AddControl(infoLabel);

            cancelButton = new Button("Cancel", this);
            cancelButton.Selected += new Button.ButtonSelectedEvent(Cancel);
            this.panel.AddControl(cancelButton);
            Visible = false;
        }
Esempio n. 6
0
        void Init()
        {
            BackButton = new Button("Back...", this);
            BackButton.label.LabelFont = "biglabel";
            BackButton.Selected += new Button.ButtonSelectedEvent(BackHandler);

            // Vsync
            Panel vsyncContainer = new Panel(this);
            vsyncContainer.AddControl(new Label("Toggle VSync:", this) { LabelFont = "biglabel" });
            VSyncButton = new Button(CVars.Instance.Get("r_vsync", "1", CVarFlags.ARCHIVE).Integer == 1? "On" : "Off", this);
            VSyncButton.label.LabelFont = "biglabel";
            VSyncButton.Selected += new Button.ButtonSelectedEvent(VSyncHandler);
            vsyncContainer.AddControl(VSyncButton);
            this.panel.AddControl(vsyncContainer);

            // Fullscreen
            Panel fsPanel = new Panel(this);
            fsPanel.AddControl(new Label("Fullscreen:", this) { LabelFont = "biglabel" });
            FullscreenButton = new Button(CVars.Instance.Get("r_fs", "1", CVarFlags.ARCHIVE).Integer == 1 ? "Yes" : "No", this);
            FullscreenButton.label.LabelFont = "biglabel";
            FullscreenButton.Selected += new Button.ButtonSelectedEvent(FSHandler);
            fsPanel.AddControl(FullscreenButton);
            this.panel.AddControl(fsPanel);

            // Resolution
            Panel resPanel = new Panel(this);
            resPanel.AddControl(new Label("Resolution", this) { LabelFont = "biglabel" });
            ResolutionButton = new Button(CVars.Instance.Get("r_res", "1", CVarFlags.ARCHIVE).String, this);
            ResolutionButton.label.LabelFont = "biglabel";
            ResolutionButton.Selected += new Button.ButtonSelectedEvent(ResolutionHandler);
            resPanel.AddControl(ResolutionButton);
            this.panel.AddControl(resPanel);

            // Show FPS
            Panel fpsPanel = new Panel(this);
            fpsPanel.AddControl(new Label("Show FPS", this) { LabelFont = "biglabel" });
            ShowFPSButton = new Button(CVars.Instance.Get("r_showfps", "1", CVarFlags.ARCHIVE).Integer == 1 ? "Yes" : "No", this);
            ShowFPSButton.label.LabelFont = "biglabel";
            ShowFPSButton.Selected += new Button.ButtonSelectedEvent(ShowFPSHandler);
            fpsPanel.AddControl(ShowFPSButton);
            this.panel.AddControl(fpsPanel);

            this.panel.AddControl(BackButton);
        }
Esempio n. 7
0
        void Init()
        {
            GameName = new Label("Cube!", this);
            GameName.LabelFont = "biggerlabel";
            StartGameButton = new Button("Create Game", this);
            StartGameButton.label.LabelFont = "biglabel";
            StartGameButton.Selected += new Button.ButtonSelectedEvent(StartGameHandler);
            JoinGameButton = new Button("Join Game", this);
            JoinGameButton.label.LabelFont = "biglabel";
            JoinGameButton.Selected += new Button.ButtonSelectedEvent(JoinGameHandler);
            SettingsButton = new Button("Settings", this);
            SettingsButton.label.LabelFont = "biglabel";
            SettingsButton.Selected += new Button.ButtonSelectedEvent(SettingsHandler);
            ExitButton = new Button("Exit", this);
            ExitButton.label.LabelFont = "biglabel";
            ExitButton.Selected += new Button.ButtonSelectedEvent(ExitHandler);

            panel.AddControl(GameName);
            panel.AddControl(StartGameButton);
            panel.AddControl(JoinGameButton);
            panel.AddControl(SettingsButton);
            panel.AddControl(ExitButton);
        }