Beispiel #1
0
        private void UpdateTargetTypePanel()
        {
            lblHitRadius.Hide();
            nudHitRadius.Hide();
            lblCastRange.Hide();
            nudCastRange.Hide();
            lblProjectile.Hide();
            cmbProjectile.Hide();
            lblDuration.Hide();
            nudDuration.Hide();

            if (cmbTargetType.SelectedIndex == (int)SpellTargetTypes.Single)
            {
                lblCastRange.Show();
                nudCastRange.Show();
                nudCastRange.Value = mEditorItem.Combat.CastRange;
                if (cmbType.SelectedIndex == (int)SpellTypes.CombatSpell)
                {
                    lblHitRadius.Show();
                    nudHitRadius.Show();
                    nudHitRadius.Value = mEditorItem.Combat.HitRadius;
                }
            }

            if (cmbTargetType.SelectedIndex == (int)SpellTargetTypes.AoE &&
                cmbType.SelectedIndex == (int)SpellTypes.CombatSpell)
            {
                lblHitRadius.Show();
                nudHitRadius.Show();
                nudHitRadius.Value = mEditorItem.Combat.HitRadius;
            }

            if (cmbTargetType.SelectedIndex < (int)SpellTargetTypes.Self)
            {
                lblCastRange.Show();
                nudCastRange.Show();
                nudCastRange.Value = mEditorItem.Combat.CastRange;
            }

            if (cmbTargetType.SelectedIndex == (int)SpellTargetTypes.Projectile)
            {
                lblProjectile.Show();
                cmbProjectile.Show();
                cmbProjectile.SelectedIndex = ProjectileBase.ListIndex(mEditorItem.Combat.ProjectileId);
            }

            if (cmbTargetType.SelectedIndex == (int)SpellTargetTypes.OnHit)
            {
                lblDuration.Show();
                nudDuration.Show();
                nudDuration.Value = mEditorItem.Combat.OnHitDuration;
            }

            if (cmbTargetType.SelectedIndex == (int)SpellTargetTypes.Trap)
            {
                lblDuration.Show();
                nudDuration.Show();
                nudDuration.Value = mEditorItem.Combat.TrapDuration;
            }
        }
Beispiel #2
0
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text          = mEditorItem.Name;
                cmbFolder.Text        = mEditorItem.Folder;
                txtDesc.Text          = mEditorItem.Description;
                cmbType.SelectedIndex = (int)mEditorItem.ItemType;
                cmbPic.SelectedIndex  = cmbPic.FindString(TextUtils.NullToNone(mEditorItem.Icon));
                cmbEquipmentAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.EquipmentAnimationId) + 1;
                nudPrice.Value          = mEditorItem.Price;
                cmbRarity.SelectedIndex = mEditorItem.Rarity;

                nudStr.Value = mEditorItem.StatsGiven[0];
                nudMag.Value = mEditorItem.StatsGiven[1];
                nudDef.Value = mEditorItem.StatsGiven[2];
                nudMR.Value  = mEditorItem.StatsGiven[3];
                nudSpd.Value = mEditorItem.StatsGiven[4];

                nudStrPercentage.Value = mEditorItem.PercentageStatsGiven[0];
                nudMagPercentage.Value = mEditorItem.PercentageStatsGiven[1];
                nudDefPercentage.Value = mEditorItem.PercentageStatsGiven[2];
                nudMRPercentage.Value  = mEditorItem.PercentageStatsGiven[3];
                nudSpdPercentage.Value = mEditorItem.PercentageStatsGiven[4];

                nudHealthBonus.Value  = mEditorItem.VitalsGiven[0];
                nudManaBonus.Value    = mEditorItem.VitalsGiven[1];
                nudHPPercentage.Value = mEditorItem.PercentageVitalsGiven[0];
                nudMPPercentage.Value = mEditorItem.PercentageVitalsGiven[1];
                nudHPRegen.Value      = mEditorItem.VitalsRegen[0];
                nudMpRegen.Value      = mEditorItem.VitalsRegen[1];

                nudDamage.Value         = mEditorItem.Damage;
                nudCritChance.Value     = mEditorItem.CritChance;
                nudCritMultiplier.Value = (decimal)mEditorItem.CritMultiplier;
                cmbAttackSpeedModifier.SelectedIndex = mEditorItem.AttackSpeedModifier;
                nudAttackSpeedValue.Value            = mEditorItem.AttackSpeedValue;
                nudScaling.Value                 = mEditorItem.Scaling;
                nudRange.Value                   = mEditorItem.StatGrowth;
                chkBound.Checked                 = Convert.ToBoolean(mEditorItem.Bound);
                chkStackable.Checked             = Convert.ToBoolean(mEditorItem.Stackable);
                cmbToolType.SelectedIndex        = mEditorItem.Tool + 1;
                cmbAttackAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.AttackAnimationId) + 1;
                RefreshExtendedData();
                if (mEditorItem.ItemType == ItemTypes.Equipment)
                {
                    cmbEquipmentBonus.SelectedIndex = (int)mEditorItem.Effect.Type;
                }

                nudEffectPercent.Value         = mEditorItem.Effect.Percentage;
                chk2Hand.Checked               = mEditorItem.TwoHanded;
                cmbMalePaperdoll.SelectedIndex =
                    cmbMalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.MalePaperdoll));

                cmbFemalePaperdoll.SelectedIndex =
                    cmbFemalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.FemalePaperdoll));

                if (mEditorItem.ItemType == ItemTypes.Consumable)
                {
                    cmbConsume.SelectedIndex    = (int)mEditorItem.Consumable.Type;
                    nudInterval.Value           = mEditorItem.Consumable.Value;
                    nudIntervalPercentage.Value = mEditorItem.Consumable.Percentage;
                }

                picItem.BackgroundImage?.Dispose();
                picItem.BackgroundImage = null;
                if (cmbPic.SelectedIndex > 0)
                {
                    picItem.BackgroundImage = System.Drawing.Image.FromFile("resources/items/" + cmbPic.Text);
                }

                picMalePaperdoll.BackgroundImage?.Dispose();
                picMalePaperdoll.BackgroundImage = null;
                if (cmbMalePaperdoll.SelectedIndex > 0)
                {
                    picMalePaperdoll.BackgroundImage =
                        System.Drawing.Image.FromFile("resources/paperdolls/" + cmbMalePaperdoll.Text);
                }

                picFemalePaperdoll.BackgroundImage?.Dispose();
                picFemalePaperdoll.BackgroundImage = null;
                if (cmbFemalePaperdoll.SelectedIndex > 0)
                {
                    picFemalePaperdoll.BackgroundImage =
                        System.Drawing.Image.FromFile("resources/paperdolls/" + cmbFemalePaperdoll.Text);
                }

                cmbDamageType.SelectedIndex  = mEditorItem.DamageType;
                cmbScalingStat.SelectedIndex = mEditorItem.ScalingStat;

                //External References
                cmbProjectile.SelectedIndex = ProjectileBase.ListIndex(mEditorItem.ProjectileId) + 1;
                cmbAnimation.SelectedIndex  = AnimationBase.ListIndex(mEditorItem.AnimationId) + 1;

                nudCooldown.Value = mEditorItem.Cooldown;

                if (mChanged.IndexOf(mEditorItem) == -1)
                {
                    mChanged.Add(mEditorItem);
                    mEditorItem.MakeBackup();
                }
            }
            else
            {
                pnlContainer.Hide();
            }

            UpdateToolStripItems();
        }
Beispiel #3
0
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text          = mEditorItem.Name;
                cmbFolder.Text        = mEditorItem.Folder;
                txtDesc.Text          = mEditorItem.Description;
                cmbType.SelectedIndex = (int)mEditorItem.ItemType;
                cmbPic.SelectedIndex  = cmbPic.FindString(TextUtils.NullToNone(mEditorItem.Icon));
                nudRgbaR.Value        = mEditorItem.Color.R;
                nudRgbaG.Value        = mEditorItem.Color.G;
                nudRgbaB.Value        = mEditorItem.Color.B;
                nudRgbaA.Value        = mEditorItem.Color.A;
                cmbEquipmentAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.EquipmentAnimationId) + 1;
                nudPrice.Value          = mEditorItem.Price;
                cmbRarity.SelectedIndex = mEditorItem.Rarity;

                nudStr.Value = mEditorItem.StatsGiven[0];
                nudMag.Value = mEditorItem.StatsGiven[1];
                nudDef.Value = mEditorItem.StatsGiven[2];
                nudMR.Value  = mEditorItem.StatsGiven[3];
                nudSpd.Value = mEditorItem.StatsGiven[4];

                nudStrPercentage.Value = mEditorItem.PercentageStatsGiven[0];
                nudMagPercentage.Value = mEditorItem.PercentageStatsGiven[1];
                nudDefPercentage.Value = mEditorItem.PercentageStatsGiven[2];
                nudMRPercentage.Value  = mEditorItem.PercentageStatsGiven[3];
                nudSpdPercentage.Value = mEditorItem.PercentageStatsGiven[4];

                nudHealthBonus.Value  = mEditorItem.VitalsGiven[0];
                nudManaBonus.Value    = mEditorItem.VitalsGiven[1];
                nudHPPercentage.Value = mEditorItem.PercentageVitalsGiven[0];
                nudMPPercentage.Value = mEditorItem.PercentageVitalsGiven[1];
                nudHPRegen.Value      = mEditorItem.VitalsRegen[0];
                nudMpRegen.Value      = mEditorItem.VitalsRegen[1];

                nudDamage.Value         = mEditorItem.Damage;
                nudCritChance.Value     = mEditorItem.CritChance;
                nudCritMultiplier.Value = (decimal)mEditorItem.CritMultiplier;
                cmbAttackSpeedModifier.SelectedIndex = mEditorItem.AttackSpeedModifier;
                nudAttackSpeedValue.Value            = mEditorItem.AttackSpeedValue;
                nudScaling.Value                 = mEditorItem.Scaling;
                nudRange.Value                   = mEditorItem.StatGrowth;
                chkCanDrop.Checked               = Convert.ToBoolean(mEditorItem.CanDrop);
                chkCanBank.Checked               = Convert.ToBoolean(mEditorItem.CanBank);
                chkCanGuildBank.Checked          = Convert.ToBoolean(mEditorItem.CanGuildBank);
                chkCanBag.Checked                = Convert.ToBoolean(mEditorItem.CanBag);
                chkCanSell.Checked               = Convert.ToBoolean(mEditorItem.CanSell);
                chkCanTrade.Checked              = Convert.ToBoolean(mEditorItem.CanTrade);
                chkStackable.Checked             = Convert.ToBoolean(mEditorItem.Stackable);
                nudInvStackLimit.Value           = mEditorItem.MaxInventoryStack;
                nudBankStackLimit.Value          = mEditorItem.MaxBankStack;
                nudDeathDropChance.Value         = mEditorItem.DropChanceOnDeath;
                cmbToolType.SelectedIndex        = mEditorItem.Tool + 1;
                cmbAttackAnimation.SelectedIndex = AnimationBase.ListIndex(mEditorItem.AttackAnimationId) + 1;
                RefreshExtendedData();
                if (mEditorItem.ItemType == ItemTypes.Equipment)
                {
                    cmbEquipmentBonus.SelectedIndex = (int)mEditorItem.Effect.Type;
                }

                nudEffectPercent.Value         = mEditorItem.Effect.Percentage;
                chk2Hand.Checked               = mEditorItem.TwoHanded;
                cmbMalePaperdoll.SelectedIndex =
                    cmbMalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.MalePaperdoll));

                cmbFemalePaperdoll.SelectedIndex =
                    cmbFemalePaperdoll.FindString(TextUtils.NullToNone(mEditorItem.FemalePaperdoll));

                if (mEditorItem.ItemType == ItemTypes.Consumable)
                {
                    cmbConsume.SelectedIndex    = (int)mEditorItem.Consumable.Type;
                    nudInterval.Value           = mEditorItem.Consumable.Value;
                    nudIntervalPercentage.Value = mEditorItem.Consumable.Percentage;
                }

                picItem.BackgroundImage?.Dispose();
                picItem.BackgroundImage = null;
                if (cmbPic.SelectedIndex > 0)
                {
                    DrawItemIcon();
                }

                picMalePaperdoll.BackgroundImage?.Dispose();
                picMalePaperdoll.BackgroundImage = null;
                if (cmbMalePaperdoll.SelectedIndex > 0)
                {
                    DrawItemPaperdoll(Gender.Male);
                }

                picFemalePaperdoll.BackgroundImage?.Dispose();
                picFemalePaperdoll.BackgroundImage = null;
                if (cmbFemalePaperdoll.SelectedIndex > 0)
                {
                    DrawItemPaperdoll(Gender.Female);
                }

                cmbDamageType.SelectedIndex  = mEditorItem.DamageType;
                cmbScalingStat.SelectedIndex = mEditorItem.ScalingStat;

                //External References
                cmbProjectile.SelectedIndex = ProjectileBase.ListIndex(mEditorItem.ProjectileId) + 1;
                cmbAnimation.SelectedIndex  = AnimationBase.ListIndex(mEditorItem.AnimationId) + 1;

                nudCooldown.Value               = mEditorItem.Cooldown;
                cmbCooldownGroup.Text           = mEditorItem.CooldownGroup;
                chkIgnoreGlobalCooldown.Checked = mEditorItem.IgnoreGlobalCooldown;
                chkIgnoreCdr.Checked            = mEditorItem.IgnoreCooldownReduction;

                txtCannotUse.Text = mEditorItem.CannotUseMessage;

                if (mChanged.IndexOf(mEditorItem) == -1)
                {
                    mChanged.Add(mEditorItem);
                    mEditorItem.MakeBackup();
                }
            }
            else
            {
                pnlContainer.Hide();
            }

            UpdateToolStripItems();
        }