Beispiel #1
0
 private void newActClick(object sender, EventArgs e)
 {
     string[] names = GetActionNames();
     if (NewHitboxInteractionActionDialog.Show(ParentForm, names) == DialogResult.OK)
     {
         AddText?.Invoke(addstart.Replace("rep1", NewHitboxInteractionActionDialog.NewName));
         if (NewHitboxInteractionActionDialog.Autoselect)
         {
             foreach (var ob in actionSelectorHB.Items)
             {
                 if (ob.GetType() == typeof(string))
                 {
                     if ((string)ob == NewHitboxInteractionActionDialog.NewName)
                     {
                         actionSelectorHB.SelectedIndex = actionSelectorHB.Items.IndexOf(ob);
                         break;
                     }
                 }
                 else if (((HitBoxAction)ob).Name == NewHitboxInteractionActionDialog.NewName)
                 {
                     actionSelectorHB.SelectedIndex = actionSelectorHB.Items.IndexOf(ob);
                     break;
                 }
             }
         }
         if (NewHitboxInteractionActionDialog.GotoAct)
         {
             GotoText?.Invoke(NewHitboxInteractionActionDialog.NewName);
         }
     }
 }
Beispiel #2
0
        public static DialogResult Show(IWin32Window Owner,
                                        string[] hbact)
        {
            NewHitboxInteractionActionDialog dial = new NewHitboxInteractionActionDialog
            {
                names = hbact
            };

            dial.name.Text               = "HitboxAction" + hbact.Length;
            dial.autosel.Checked         = Autoselect;
            dial.gotoact.Checked         = GotoAct;
            dial.autosel.CheckedChanged += dial.autoselCheckedChanged;
            dial.gotoact.CheckedChanged += dial.gotoactCheckedChanged;
            bool found = true;
            int  j     = hbact.Length;

            while (found)
            {
                found = false;
                for (int i = 0; i < hbact.Length; i++)
                {
                    if (hbact[i] == dial.name.Text)
                    {
                        found = true;
                        break;
                    }
                }
                if (found)
                {
                    j++;
                    dial.name.Text = "HitboxAction" + j;
                }
            }
            NewName = dial.name.Text;

            return(dial.ShowDialog(Owner));
        }