Ejemplo n.º 1
0
 private void cbxRestrict_CheckedChanged(object sender, EventArgs e)
 {
     if (!cbxRestrict.Checked)
     {
         nudQuantity.Enabled = true;
         nudQuantity.Maximum = Int32.MaxValue;
     }
     else if (lbxItems.SelectedIndex != -1)
     {
         DSRItem item = lbxItems.SelectedItem as DSRItem;
         nudQuantity.Maximum = item.StackLimit;
         if (item.StackLimit == 1)
         {
             nudQuantity.Enabled = false;
         }
     }
 }
Ejemplo n.º 2
0
        private void createItem()
        {
            DSRItemCategory category = cmbCategory.SelectedItem as DSRItemCategory;
            DSRItem         item     = lbxItems.SelectedItem as DSRItem;
            int             id       = item.ID;

            if (item.UpgradeType == DSRItem.Upgrade.PyroFlame || item.UpgradeType == DSRItem.Upgrade.PyroFlameAscended)
            {
                id += (int)nudUpgrade.Value * 100;
            }
            else
            {
                id += (int)nudUpgrade.Value;
            }
            if (item.UpgradeType == DSRItem.Upgrade.Infusable || item.UpgradeType == DSRItem.Upgrade.InfusableRestricted)
            {
                DSRInfusion infusion = cmbInfusion.SelectedItem as DSRInfusion;
                id += infusion.Value;
            }
            Hook.GetItem(category.ID, id, (int)nudQuantity.Value);
        }
Ejemplo n.º 3
0
        private void lbxItems_SelectedIndexChanged(object sender, EventArgs e)
        {
            DSRItem item = lbxItems.SelectedItem as DSRItem;

            if (cbxRestrict.Checked)
            {
                if (item.StackLimit == 1)
                {
                    nudQuantity.Enabled = false;
                }
                else
                {
                    nudQuantity.Enabled = true;
                }
                nudQuantity.Maximum = item.StackLimit;
            }
            switch (item.UpgradeType)
            {
            case DSRItem.Upgrade.None:
                cmbInfusion.Enabled = false;
                cmbInfusion.Items.Clear();
                nudUpgrade.Enabled = false;
                nudUpgrade.Maximum = 0;
                break;

            case DSRItem.Upgrade.Unique:
                cmbInfusion.Enabled = false;
                cmbInfusion.Items.Clear();
                nudUpgrade.Maximum = 5;
                nudUpgrade.Enabled = true;
                break;

            case DSRItem.Upgrade.Armor:
                cmbInfusion.Enabled = false;
                cmbInfusion.Items.Clear();
                nudUpgrade.Maximum = 10;
                nudUpgrade.Enabled = true;
                break;

            case DSRItem.Upgrade.Infusable:
                cmbInfusion.Items.Clear();
                foreach (DSRInfusion infusion in DSRInfusion.All)
                {
                    cmbInfusion.Items.Add(infusion);
                }
                cmbInfusion.SelectedIndex = 0;
                cmbInfusion.Enabled       = true;
                nudUpgrade.Enabled        = true;
                break;

            case DSRItem.Upgrade.InfusableRestricted:
                cmbInfusion.Items.Clear();
                foreach (DSRInfusion infusion in DSRInfusion.All)
                {
                    if (!infusion.Restricted)
                    {
                        cmbInfusion.Items.Add(infusion);
                    }
                }
                cmbInfusion.SelectedIndex = 0;
                cmbInfusion.Enabled       = true;
                nudUpgrade.Enabled        = true;
                break;

            case DSRItem.Upgrade.PyroFlame:
                cmbInfusion.Enabled = false;
                cmbInfusion.Items.Clear();
                nudUpgrade.Maximum = 15;
                nudUpgrade.Enabled = true;
                break;

            case DSRItem.Upgrade.PyroFlameAscended:
                cmbInfusion.Enabled = false;
                cmbInfusion.Items.Clear();
                nudUpgrade.Maximum = 5;
                nudUpgrade.Enabled = true;
                break;
            }
        }