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
        private void gotoActClick(object sender, EventArgs e)
        {
            string str = "";

            if (actionSelectorHB.SelectedItem.GetType() == typeof(string))
            {
                str = (string)actionSelectorHB.SelectedItem;
            }
            else
            {
                str = ((HitBoxAction)actionSelectorHB.SelectedItem).Name;
            }

            GotoText?.Invoke(str);
        }