Exemplo n.º 1
0
        private void addPackslotRulesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SelectMinPackSlotsForm f = new SelectMinPackSlotsForm();
            DialogResult           r = f.ShowDialog(this);

            if (r == DialogResult.OK || r == DialogResult.Yes)
            {
                lstRules.Visible = false;
                try
                {
                    SetCurrentReq(null, 0);
                    foreach (cLootItemRule rule in LootRules.Rules)
                    {
                        bool needsReq = true;
                        if (rule.Action() == f.act)
                        {
                            foreach (iLootRule req in rule.IntRules)
                            {
                                if (req.GetRuleType() == eLootRuleType.CharacterMainPackEmptySlotsGE)
                                {
                                    needsReq = false;
                                    if (r == DialogResult.Yes)
                                    {
                                        ((CharacterMainPackEmptySlotsGE)req).keyval = f.slots;
                                        FileChanged = true;
                                    }
                                    break;
                                }
                            }
                            if (needsReq)
                            {
                                rule.IntRules.Add(new CharacterMainPackEmptySlotsGE(f.slots));
                                FileChanged = true;
                            }
                        }
                    }
                }
                catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Exception: " + ex.ToString()); }

                SetCurrentRule(CurrentRule, CurrentRuleNum);
                lstRules.Visible = true;
            }
            f.Dispose();
        }
Exemplo n.º 2
0
        private void addPackslotRulesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SelectMinPackSlotsForm f = new SelectMinPackSlotsForm();
            DialogResult r = f.ShowDialog(this);
            if (r == DialogResult.OK || r == DialogResult.Yes)
            {
                lstRules.Visible = false;
                try
                {
                    SetCurrentReq(null, 0);
                    foreach (cLootItemRule rule in LootRules.Rules)
                    {
                        bool needsReq = true;
                        if (rule.Action() == f.act)
                        {
                            foreach (iLootRule req in rule.IntRules)
                            {
                                if (req.GetRuleType() == eLootRuleType.CharacterMainPackEmptySlotsGE)
                                {
                                    needsReq = false;
                                    if (r == DialogResult.Yes)
                                    {
                                        ((CharacterMainPackEmptySlotsGE)req).keyval = f.slots;
                                        FileChanged = true;
                                    }
                                    break;
                                }
                            }
                            if (needsReq)
                            {
                                rule.IntRules.Add(new CharacterMainPackEmptySlotsGE(f.slots));
                                FileChanged = true;
                            }
                        }
                    }
                }
                catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Exception: " + ex.ToString()); }

                SetCurrentRule(CurrentRule, CurrentRuleNum);
                lstRules.Visible = true;
            }
            f.Dispose();
        }