Example #1
0
File: MainForm.cs Project: JueZ/ITP
        public MainForm()
        {
            InitializeComponent();
            mainConnector = new FormConnector(this);
            M_Form = this;
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
            this.UpdateStyles();

            Game game = Game.Instance;
            game.adjustGameFormSize(this);
            DrawTimer.Start();
        }
Example #2
0
        private void buttonLogIn_Click(object sender, EventArgs e)
        {
            //NetOutgoingMessage sendMsg;

            //sendMsg = Program.netclient.CreateMessage();

            //sendMsg.Write(Program.guid.ToString() + ";" + textBoxName.Text);
            //Program.netclient.SendMessage(sendMsg, NetDeliveryMethod.ReliableSequenced);
            Program.ConnectToServer();
            Program.ConnectPlayerToLobby(textBoxName.Text, Color.FromName(colorBox.Text));
            //Program.ConnectPlayerToGame(textBoxName.Text, Color.FromName(colorBox.Text), "justWatching");
            //sollte zuerst lobby und dann mainform sein-> spieler wird beim anmelden aber sofort auf spielfeld gesetzt...
            MainForm Main = new MainForm();
            LobbyForm Lobby = new LobbyForm(textBoxName.Text,Color.FromName(colorBox.Items[colorBox.SelectedIndex].ToString()));

            this.Hide();
            Main.Show();
            Lobby.Show();

               //Lobby.SetDesktopLocation(Main.Location.X + Main.Size.Width, Main.Location.Y);
            Lobby.Location = new Point(Main.Left + Main.Width + 20, Main.Top);
            //this.Show();
            //this.Dispose();
        }