Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 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;
             }
         }
     }
 }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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;
             }
         }
     }
 }