예제 #1
0
        private void BtnAddScript_Click(object sender, EventArgs e)
        {
            var rule         = new Rule();
            var scriptEditor = new ScriptEditor(rule);

            scriptEditor.Location = Location;
            scriptEditor.ShowDialog();
            if (scriptEditor.Save)
            {
                if (BeTabs.SelectedTab.Name.Equals("TabCombat"))
                {
                    AddCondition(rule, BeComRules);
                }
                if (BeTabs.SelectedTab.Name.Equals("TabBuffs"))
                {
                    AddCondition(rule, BeBuffRules);
                }
                if (BeTabs.SelectedTab.Name.Equals("TabPull"))
                {
                    AddCondition(rule, BePullRules);
                }
                if (BeTabs.SelectedTab.Name.Equals("TabRest"))
                {
                    AddCondition(rule, BeRestRules);
                }
                if (BeTabs.SelectedTab.Name.Equals("TabPrePull"))
                {
                    AddCondition(rule, BePrePullRules);
                }
            }
        }
예제 #2
0
 private void EditRule(Node node)
 {
     if (node.Tag is Rule)
     {
         var rule = (Rule)node.Tag;
         if (string.IsNullOrEmpty(rule.Script))
         {
             var ruleEditor = new RuleEditor(rule, true);
             ruleEditor.Location = Location;
             ruleEditor.ShowDialog();
             if (ruleEditor.Save)
             {
                 node.Tag  = rule;
                 node.Text = rule.Name;
             }
         }
         else
         {
             var scriptEditor = new ScriptEditor(rule);
             scriptEditor.Location = Location;
             scriptEditor.ShowDialog();
             if (scriptEditor.Save)
             {
                 node.Tag  = rule;
                 node.Text = rule.Name;
             }
         }
     }
 }
예제 #3
0
 private void BtnAddScript_Click(object sender, EventArgs e)
 {
     var rule = new Rule();
     var scriptEditor = new ScriptEditor(rule);
     scriptEditor.Location = Location;
     scriptEditor.ShowDialog();
     if (scriptEditor.Save)
     {
         if (BeTabs.SelectedTab.Name.Equals("TabCombat"))
         {
             AddCondition(rule, BeComRules);
         }
     }
 }
예제 #4
0
 private void EditRule(Node node)
 {
     if (node.Tag is Rule)
     {
         var rule = (Rule) node.Tag;
         if (string.IsNullOrEmpty(rule.Script))
         {
             var ruleEditor = new RuleEditor(rule, true);
             ruleEditor.Location = Location;
             ruleEditor.ShowDialog();
             if (ruleEditor.Save)
             {
                 node.Tag = rule;
                 node.Text = rule.Name;
             }
         }
         else
         {
             var scriptEditor = new ScriptEditor(rule);
             scriptEditor.Location = Location;
             scriptEditor.ShowDialog();
             if (scriptEditor.Save)
             {
                 node.Tag = rule;
                 node.Text = rule.Name;
             }
         }
     }
 }