Пример #1
0
 private void DlgGameLobby_ReadyStateChanged(PnlLobbyParticipant sender)
 {
     this.RefreshParticipant();
     this.UpdateLaunchAbility();
 }
Пример #2
0
 private void InitializeComponent()
 {
     this.chatPanel = new ChatPanel();
     this.pnlLobbyParticipant1 = new PnlLobbyParticipant();
     this.pnlLobbyParticipant2 = new PnlLobbyParticipant();
     this.pnlLobbyParticipant3 = new PnlLobbyParticipant();
     this.pnlLobbyParticipant4 = new PnlLobbyParticipant();
     ((ISupportInitialize) base.pbBottom).BeginInit();
     base.SuspendLayout();
     base.pbBottom.Size = new Size(0x2f3, 0x39);
     base.ttDefault.SetSuperTip(base.pbBottom, null);
     base.ttDefault.DefaultController.AutoPopDelay = 0x3e8;
     base.ttDefault.DefaultController.ToolTipLocation = ToolTipLocation.RightTop;
     this.chatPanel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     this.chatPanel.Location = new Point(0x10, 0x109);
     this.chatPanel.Name = "chatPanel";
     this.chatPanel.ShowSlashCommands = false;
     this.chatPanel.Size = new Size(0x30d, 0xf1);
     base.ttDefault.SetSuperTip(this.chatPanel, null);
     this.chatPanel.TabIndex = 7;
     this.chatPanel.SendChatMessage += new StringEventHandler(this.chatPanel_SendChatMessage);
     this.chatPanel.StyleChatLine += new ChatLineStyleEventHandler(this.chatPanel_StyleChatLine);
     this.pnlLobbyParticipant1.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.pnlLobbyParticipant1.BackColor = Color.Transparent;
     this.pnlLobbyParticipant1.Game = null;
     this.pnlLobbyParticipant1.IsOpen = true;
     this.pnlLobbyParticipant1.Location = new Point(11, 0x4c);
     this.pnlLobbyParticipant1.Name = "pnlLobbyParticipant1";
     this.pnlLobbyParticipant1.Postition = -1;
     this.pnlLobbyParticipant1.Size = new Size(0x312, 0x26);
     base.ttDefault.SetSuperTip(this.pnlLobbyParticipant1, null);
     this.pnlLobbyParticipant1.TabIndex = 11;
     this.pnlLobbyParticipant2.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.pnlLobbyParticipant2.BackColor = Color.Transparent;
     this.pnlLobbyParticipant2.Game = null;
     this.pnlLobbyParticipant2.IsOpen = true;
     this.pnlLobbyParticipant2.Location = new Point(11, 120);
     this.pnlLobbyParticipant2.Name = "pnlLobbyParticipant2";
     this.pnlLobbyParticipant2.Postition = -1;
     this.pnlLobbyParticipant2.Size = new Size(0x312, 0x26);
     base.ttDefault.SetSuperTip(this.pnlLobbyParticipant2, null);
     this.pnlLobbyParticipant2.TabIndex = 12;
     this.pnlLobbyParticipant3.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.pnlLobbyParticipant3.BackColor = Color.Transparent;
     this.pnlLobbyParticipant3.Game = null;
     this.pnlLobbyParticipant3.IsOpen = true;
     this.pnlLobbyParticipant3.Location = new Point(11, 0xa4);
     this.pnlLobbyParticipant3.Name = "pnlLobbyParticipant3";
     this.pnlLobbyParticipant3.Postition = -1;
     this.pnlLobbyParticipant3.Size = new Size(0x312, 0x26);
     base.ttDefault.SetSuperTip(this.pnlLobbyParticipant3, null);
     this.pnlLobbyParticipant3.TabIndex = 13;
     this.pnlLobbyParticipant4.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.pnlLobbyParticipant4.BackColor = Color.Transparent;
     this.pnlLobbyParticipant4.Game = null;
     this.pnlLobbyParticipant4.IsOpen = true;
     this.pnlLobbyParticipant4.Location = new Point(11, 0xd0);
     this.pnlLobbyParticipant4.Name = "pnlLobbyParticipant4";
     this.pnlLobbyParticipant4.Postition = -1;
     this.pnlLobbyParticipant4.Size = new Size(0x312, 0x26);
     base.ttDefault.SetSuperTip(this.pnlLobbyParticipant4, null);
     this.pnlLobbyParticipant4.TabIndex = 14;
     base.AutoScaleDimensions = new SizeF(7f, 13f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.ClientSize = new Size(0x32e, 0x22f);
     base.Controls.Add(this.pnlLobbyParticipant4);
     base.Controls.Add(this.pnlLobbyParticipant3);
     base.Controls.Add(this.pnlLobbyParticipant2);
     base.Controls.Add(this.pnlLobbyParticipant1);
     base.Controls.Add(this.chatPanel);
     this.Font = new Font("Verdana", 8f);
     base.Location = new Point(0, 0);
     this.MinimumSize = new Size(0x32e, 0x22f);
     base.Name = "DlgGameLobby";
     base.ttDefault.SetSuperTip(this, null);
     this.Text = "<LOC>Space Siege Game Lobby";
     base.AfterShown += new BaseFormEvent(this.DlgGameLobby_AfterShown);
     base.Controls.SetChildIndex(this.chatPanel, 0);
     base.Controls.SetChildIndex(this.pnlLobbyParticipant1, 0);
     base.Controls.SetChildIndex(this.pnlLobbyParticipant2, 0);
     base.Controls.SetChildIndex(this.pnlLobbyParticipant3, 0);
     base.Controls.SetChildIndex(this.pnlLobbyParticipant4, 0);
     ((ISupportInitialize) base.pbBottom).EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
Пример #3
0
 private void DlgGameLobby_OccupyPosition(PnlLobbyParticipant sender)
 {
     this.SendMessage(SpaceSiegeLobbyMessages.ChangePosition, new object[] { sender.Postition });
     this.ChangePosition(this.Game.GetSelf() as SpaceSiegeGameParticipant, sender.Postition);
 }
Пример #4
0
 private void DlgGameLobby_OpenPosition(PnlLobbyParticipant sender)
 {
     this.OpenPosition(sender.Postition);
     this.SendMessage(SpaceSiegeLobbyMessages.OpenPosition, new object[] { sender.Postition });
 }
Пример #5
0
 private void DlgGameLobby_LaunchGame(PnlLobbyParticipant sender)
 {
     this.RemoveGameFromList();
     this.SendMessage(SpaceSiegeLobbyMessages.ChatMessage, new object[] { "I have launched the game." });
     this.Game.HasLaunched = true;
     sender.Participant.IsReady = false;
     sender.SetParticipant(sender.Participant);
     GameInformation.SelectedGame.UserForcedCommandLineArgs = string.Format("character={0} players={1}", (this.Game.GetSelf() as SpaceSiegeGameParticipant).Character.CharacterName, this.Game.Members.Count);
     GPGnetSelectedGame.ProfileName = (this.Game.GetSelf() as SpaceSiegeGameParticipant).Character.CharacterName;
     base.MainForm.GameHosted += new EventHandler(this.MainForm_GameHosted);
     base.MainForm.HostGame(this.Game.ID);
 }
Пример #6
0
 private void DlgGameLobby_LeaveLobby(PnlLobbyParticipant sender)
 {
     if (new DlgYesNo(base.MainForm, "<LOC>Confirm", "<LOC>Do you really want to leave this game lobby?").ShowDialog() == DialogResult.Yes)
     {
         this.LeaveLobby();
     }
 }
Пример #7
0
 private void DlgGameLobby_KickParticipant(PnlLobbyParticipant sender)
 {
     if (sender.Participant != null)
     {
         this.KickParticipant(sender.Participant);
     }
 }
Пример #8
0
 private void DlgGameLobby_InviteParticipant(PnlLobbyParticipant sender)
 {
     DialogResult result;
     string name = DlgAskQuestion.AskQuestion(base.MainForm, "<LOC>Please enter the name of the player to invite", "<LOC>Invite", false, out result);
     if (((result == DialogResult.OK) && (name != null)) && (name.Length > 0))
     {
         if ((name == null) || (name.Length < 3))
         {
             this.chatPanel.ErrorMessage("<LOC>Player name cannot be less than {0} characters.", new object[] { 3 });
         }
         else if (this.Game.FindMember(name) != null)
         {
             this.chatPanel.SystemMessage("<LOC>{0} is already in your game.", new object[] { name });
         }
         else if (this.Game.AvailablePositions < 1)
         {
             this.chatPanel.SystemMessage("<LOC>Unable to invite more members, your game is already full.", new object[0]);
         }
         else
         {
             User user;
             if (base.MainForm.TryFindUser(name, true, out user))
             {
                 if ((user != null) && user.Online)
                 {
                     this.SendMessage(name, SpaceSiegeLobbyMessages.Invite, new object[0]);
                     this.chatPanel.SystemMessage("<LOC>Invitation sent.", new object[0]);
                 }
                 else
                 {
                     this.chatPanel.SystemMessage("<LOC>{0} is offline and cannot join your game at this time.", new object[] { name });
                 }
             }
             else
             {
                 this.chatPanel.SystemMessage("<LOC>Unable to locate player {0}", new object[] { name });
             }
         }
     }
 }
Пример #9
0
 private void DlgGameLobby_DisbandLobby(PnlLobbyParticipant sender)
 {
     if (new DlgYesNo(base.MainForm, "<LOC>Confirm", "<LOC>Do you really want to disband this game lobby?").ShowDialog() == DialogResult.Yes)
     {
         this.DisbandLobby();
         this.Game.Members.Clear();
         base.Close();
     }
 }
Пример #10
0
 private void DlgGameLobby_ClosePosition(PnlLobbyParticipant sender)
 {
     if (sender.Participant != null)
     {
         this.KickParticipant(sender.Participant);
     }
     this.ClosePosition(sender.Postition);
     this.SendMessage(SpaceSiegeLobbyMessages.ClosePosition, new object[] { sender.Postition });
 }
Пример #11
0
 private void DlgGameLobby_CharacterChanged(PnlLobbyParticipant sender)
 {
     this.UpdateHostedGameRecord();
     this.RefreshParticipant();
 }