Exemplo n.º 1
0
        private void UpdateEditor()
        {
            if (mEditorItem != null)
            {
                pnlContainer.Show();

                txtName.Text                       = mEditorItem.Name;
                cmbFolder.Text                     = mEditorItem.Folder;
                nudSpeed.Value                     = mEditorItem.Speed;
                nudSpawn.Value                     = mEditorItem.Delay;
                nudAmount.Value                    = mEditorItem.Quantity;
                nudRange.Value                     = mEditorItem.Range;
                cmbSpell.SelectedIndex             = SpellBase.ListIndex(mEditorItem.SpellId) + 1;
                nudKnockback.Value                 = mEditorItem.Knockback;
                chkIgnoreMapBlocks.Checked         = mEditorItem.IgnoreMapBlocks;
                chkIgnoreActiveResources.Checked   = mEditorItem.IgnoreActiveResources;
                chkIgnoreInactiveResources.Checked = mEditorItem.IgnoreExhaustedResources;
                chkIgnoreZDimensionBlocks.Checked  = mEditorItem.IgnoreZDimension;
                chkGrapple.Checked                 = mEditorItem.GrappleHook;
                chkPierce.Checked                  = mEditorItem.PierceTarget;
                cmbItem.SelectedIndex              = ItemBase.ListIndex(mEditorItem.AmmoItemId) + 1;
                nudConsume.Value                   = mEditorItem.AmmoRequired;

                if (lstAnimations.SelectedIndex < 0)
                {
                    lstAnimations.SelectedIndex = 0;
                }

                UpdateAnimationData(0);
                lstAnimations.SelectedIndex = 0;

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

            UpdateToolStripItems();
        }