Ejemplo n.º 1
0
        public JoinGameDialog()
            : base("Dołącz się do gry", new RectangleF(GM.AppWindow.GraphicsParameters.WindowSize.Width / 2 - 190,
            GM.AppWindow.GraphicsParameters.WindowSize.Height / 2 - 200, 380, 400))
        {
            ok = new GuiButton("Start", new RectangleF(240, 300, 100, 34));
            cancel = new GuiButton("Anuluj", new RectangleF(155, 300, 80, 34));

            ok.OnClick += new ButtonEventHandler(OnOK);
            ok.Disable();
            cancel.OnClick += new ButtonEventHandler(Close);
            AddControl(ok);
            AddControl(cancel);

            AddControl(new GuiTextLabel("Nick:", new RectangleF(20, 10, 150, 22), 22));
            AddControl(new GuiTextLabel("Lista Gier:", new RectangleF(20, 35, 150, 22), 22));
            gameList = new GuiListBox(new RectangleF(20, 60, 320, 230), 8);
            gameList.OnSelectionChange += this.UpdateSelection;

            playerName = new GuiEditBox(Properties.Settings.Default.PlayerName, new RectangleF(190, 10, 150, 22), 18);

            AddControl(playerName);
            AddControl(gameList);

            //LoadShipData();
            //LoadMapData();

            clientSide = new UDPClientServerCommons.Client.ClientSide(4444);
            bool ret=clientSide.StartLookingForLANGames();
        }
Ejemplo n.º 2
0
        public NewGameDialog()
            : base("Stwórz grê",new RectangleF(GM.AppWindow.GraphicsParameters.WindowSize.Width/2-190,
            GM.AppWindow.GraphicsParameters.WindowSize.Height/2-200, 380,190))
        {
            ok = new GuiButton("Start", new RectangleF(240, 100, 100, 34));
            cancel = new GuiButton("Anuluj", new RectangleF(155, 100, 80, 34));

            ok.OnClick+=new ButtonEventHandler(OnOK);
            //ok.Disable();
            cancel.OnClick+=new ButtonEventHandler(Close);
            AddControl(ok);
            AddControl(cancel);

            AddControl(new GuiTextLabel("Nick", new RectangleF(20, 10, 150, 22), 22));
            AddControl(new GuiTextLabel("Nazwa gry:",new RectangleF(20, 35, 150, 22),22));
            AddControl(new GuiTextLabel("Max. graczy", new RectangleF(20, 60, 150, 22),22));

            playerName = new GuiEditBox(Properties.Settings.Default.PlayerName, new RectangleF(190, 10, 150, 22), 18);
            serverName = new GuiEditBox("Nowa gra", new RectangleF(190, 35, 150, 22), 18);
            maxPlayers = new GuiNumberBox(4, new RectangleF(190, 60, 150, 22), 18);
            AddControl(playerName);
            AddControl(serverName);
            AddControl(maxPlayers);

            //LoadShipData();
            //LoadMapData();
        }