Esempio n. 1
0
 // Token: 0x06000042 RID: 66 RVA: 0x000053B0 File Offset: 0x000035B0
 public void AddPlayer()
 {
     DebugTools.Print("Open dialog box: Add " + this.listName + " entry (DialogBoxPlayer)");
     using (DialogBoxPlayer dialogBoxPlayer = new DialogBoxPlayer())
     {
         dialogBoxPlayer.Text               = "Add Player";
         dialogBoxPlayer.LabelTitle.Text    = "Add this player to the " + this.listName + ":";
         dialogBoxPlayer.ButtonConfirm.Text = "Add";
         dialogBoxPlayer.TextBoxPlayerName.Select();
         bool flag = false;
         while (!flag)
         {
             try
             {
                 if (dialogBoxPlayer.ShowDialog() == DialogResult.OK)
                 {
                     this.AddPlayer(dialogBoxPlayer.TextBoxPlayerName.Text, Convert.ToUInt64(dialogBoxPlayer.TextBoxPlayerSteamID.Text), dialogBoxPlayer.CheckBoxPlayerEnabled.Checked);
                     this.UpdateStatic();
                     GameMemory.OptionsUpdate();
                 }
                 flag = true;
             }
             catch
             {
                 DebugTools.Print("Error: Failed to add player to the " + this.listName + ", invalid Steam ID.");
                 MessageBox.Show("The Steam ID is invalid.", "Could not add player.", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             }
         }
     }
 }
Esempio n. 2
0
 // Token: 0x06000044 RID: 68 RVA: 0x00005688 File Offset: 0x00003888
 public void EditPlayer()
 {
     foreach (object obj in this.ListView.SelectedIndices)
     {
         int index = (int)obj;
         DebugTools.Print("Open dialog box: Edit " + this.listName + " entry (DialogBoxPlayer)");
         using (DialogBoxPlayer dialogBoxPlayer = new DialogBoxPlayer())
         {
             dialogBoxPlayer.Text            = "Edit Player";
             dialogBoxPlayer.LabelTitle.Text = string.Concat(new string[]
             {
                 "Edit ",
                 this.Config.Players[index].Name,
                 "'s ",
                 this.listName,
                 " entry:"
             });
             dialogBoxPlayer.ButtonConfirm.Text = "Confirm";
             dialogBoxPlayer.TextBoxPlayerName.Select();
             dialogBoxPlayer.TextBoxPlayerName.Text        = this.Config.Players[index].Name;
             dialogBoxPlayer.TextBoxPlayerSteamID.Text     = this.Config.Players[index].SteamId.ToString();
             dialogBoxPlayer.CheckBoxPlayerEnabled.Checked = this.Config.Players[index].Enabled;
             dialogBoxPlayer.TextBoxPlayerSteamID.Enabled  = !this.restricted;
             for (;;)
             {
                 try
                 {
                     if (dialogBoxPlayer.ShowDialog() == DialogResult.OK)
                     {
                         this.EditPlayer(dialogBoxPlayer.TextBoxPlayerName.Text, Convert.ToUInt64(dialogBoxPlayer.TextBoxPlayerSteamID.Text), dialogBoxPlayer.CheckBoxPlayerEnabled.Checked, index);
                         this.UpdateStatic();
                         GameMemory.OptionsUpdate();
                     }
                     break;
                 }
                 catch
                 {
                     DebugTools.Print("Error: Failed to edit " + this.listName + " entry, invalid Steam ID.");
                     MessageBox.Show("The Steam ID is invalid.", "Could not edit player.", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 }
             }
         }
     }
 }