コード例 #1
0
ファイル: MainForm.cs プロジェクト: 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();
        }
コード例 #2
0
ファイル: StartMenu.cs プロジェクト: JueZ/ITP
        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();
        }