public Form1() { connectControl = new ConnectControl(); loadContentControl = new LoadContentControl(); logonControl = new LogonControl(); overWorldControl = new OverWorldControl(this); chatControl = new ChatControl(); ClientState = clientState.CONNECT; InitializeComponent(); connectControl.connectButton.Click += new System.EventHandler(this.ConnectClick); logonControl.LogonButton.Click += new System.EventHandler(this.LogonClick); this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form1_KeyPress); this.Controls.Add(connectControl); this.Controls.Add(loadContentControl); this.Controls.Add(logonControl); this.Controls.Add(overWorldControl); this.Controls.Add(chatControl); overWorldControl.LoadContent(); logonControl.Visible = chatControl.Visible = overWorldControl.Visible = loadContentControl.Visible = false; playerBuilt = worldBuilt = collectionBuilt = decksBuilt = false; client = new NetClient(this); client.Setup(); player = new Player(this.overWorldControl); }
public void CalcStatus() { if (this.client_away == "1") { this.state = clientState.away; return; } if (this.client_output_muted == "1") { this.state = clientState.speaker_muted; return; } if (this.client_input_muted == "1") { this.state = clientState.mic_muted; return; } this.state = clientState.normal; }
public void ChangeState(clientState newState) { if (!InvokeRequired) { switch (ClientState) { case clientState.CONNECT: if (newState == clientState.LOGIN) { this.connectControl.Visible = false; this.logonControl.Visible = true; ClientState = newState; } break; case clientState.LOGIN: if (newState == clientState.ADVENTURE) { ClientState = newState; Loading(); } break; case clientState.ADVENTURE: break; case clientState.STORE: break; case clientState.GAME: break; default: break; } } else { //if(message is string && sender is User && roomID is int && userID is int) Invoke(new ChangeStateDel(ChangeState), new object[] { newState }); } }