public void UpdateView(AllMonsterSkills skills, PatcherLib.Datatypes.Context context)
 {
     dataGridView.DataSource = null;
     foreach (DataGridViewComboBoxColumn col in new DataGridViewComboBoxColumn[] { Ability1, Ability2, Ability3, Beastmaster })
     {
         col.Items.Clear();
         col.Items.AddRange(AllAbilities.GetDummyAbilities(context));
         col.ValueType = typeof(Ability);
     }
     dataGridView.DataSource = skills.MonsterSkills;
 }
Пример #2
0
        public void UpdateView(Context context)
        {
            this.ignoreChanges = true;
            this.SuspendLayout();
            actionGroupBox.SuspendLayout();
            theRestGroupBox.SuspendLayout();

            if (ourContext != context)
            {
                ourContext = context;

                foreach (ComboBoxWithDefault actionComboBox in actionComboBoxes)
                {
                    actionComboBox.Items.Clear();
                    actionComboBox.Items.AddRange(AllAbilities.GetDummyAbilities(context));
                    actionComboBox.SelectedIndexChanged += actionComboBox_SelectedIndexChanged;
                }
                foreach (ComboBoxWithDefault theRestComboBox in theRestComboBoxes)
                {
                    theRestComboBox.Items.Clear();
                    theRestComboBox.Items.AddRange(AllAbilities.GetDummyAbilities(context));
                    theRestComboBox.SelectedIndexChanged += theRestComboBox_SelectedIndexChanged;
                }
            }
            for (int i = 0; i < 16; i++)
            {
                actionComboBoxes[i].SetValueAndDefault(skillSet.Actions[i], skillSet.Default.Actions[i], toolTip);
            }
            for (int i = 0; i < 6; i++)
            {
                theRestComboBoxes[i].SetValueAndDefault(skillSet.TheRest[i], skillSet.Default.TheRest[i], toolTip);
            }

            theRestGroupBox.ResumeLayout();
            actionGroupBox.ResumeLayout();
            this.ResumeLayout();
            this.ignoreChanges = false;
        }
Пример #3
0
        public void UpdateView(Context context)
        {
            ignoreChanges = true;
            this.SuspendLayout();
            absorbElementsEditor.SuspendLayout();
            cancelElementsEditor.SuspendLayout();
            halfElementsEditor.SuspendLayout();
            weakElementsEditor.SuspendLayout();
            equipmentEditor.SuspendLayout();
            innateStatusesEditor.SuspendLayout();
            statusImmunityEditor.SuspendLayout();
            startingStatusesEditor.SuspendLayout();

            if (ourContext != context)
            {
                ourContext = context;
                skillsetComboBox.Items.Clear();
                skillsetComboBox.Items.AddRange(SkillSet.GetDummySkillSets(context));
                foreach (ComboBoxWithDefault cb in new ComboBoxWithDefault[] { innateAComboBox, innateBComboBox, innateCComboBox, innateDComboBox })
                {
                    cb.Items.Clear();
                    cb.Items.AddRange(AllAbilities.GetDummyAbilities(context));
                }

                cmb_MPortrait.Items.Clear();
                cmb_MType.Items.Clear();
                System.Collections.Generic.IList <string> spriteNames = (ourContext == Context.US_PSX) ? PSXResources.Lists.SpriteFiles : PSPResources.Lists.SpriteFiles;
                int spriteNameCount = spriteNames.Count;
                cmb_MPortrait.Items.Add("00");
                cmb_MType.Items.Add("00");
                for (int index = 1; index < spriteNameCount; index++)
                {
                    string spriteName = spriteNames[index];

                    cmb_MPortrait.Items.Add(String.Format("{0} {1}", (index).ToString("X2"), spriteName));
                    if ((index >= 0x86) && (index <= 0x9A))
                    {
                        cmb_MType.Items.Add(String.Format("{0} {1}", (index - 0x85).ToString("X2"), spriteName));
                    }
                }
                for (int index = cmb_MType.Items.Count; index <= spriteNameCount; index++)
                {
                    cmb_MType.Items.Add(index.ToString("X2"));
                }
                for (int index = (spriteNameCount + 1); index < 0x100; index++)
                {
                    cmb_MPortrait.Items.Add(index.ToString("X2"));
                    cmb_MType.Items.Add(index.ToString("X2"));
                }
            }

            skillsetComboBox.SetValueAndDefault(job.SkillSet, job.Default.SkillSet, toolTip);
            foreach (NumericUpDownWithDefault s in spinners)
            {
                // TODO Update Default
                s.SetValueAndDefault(
                    ReflectionHelpers.GetFieldOrProperty <byte>(job, s.Tag.ToString()),
                    ReflectionHelpers.GetFieldOrProperty <byte>(job.Default, s.Tag.ToString()),
                    toolTip);
            }
            innateAComboBox.SetValueAndDefault(job.InnateA, job.Default.InnateA, toolTip);
            innateBComboBox.SetValueAndDefault(job.InnateB, job.Default.InnateB, toolTip);
            innateCComboBox.SetValueAndDefault(job.InnateC, job.Default.InnateC, toolTip);
            innateDComboBox.SetValueAndDefault(job.InnateD, job.Default.InnateD, toolTip);
            cmb_MPortrait.SetValueAndDefault(cmb_MPortrait.Items[job.MPortrait], cmb_MPortrait.Items[job.Default.MPortrait], toolTip);
            cmb_MType.SetValueAndDefault(cmb_MType.Items[job.MGraphic], cmb_MPortrait.Items[job.Default.MGraphic], toolTip);

            absorbElementsEditor.SetValueAndDefaults(job.AbsorbElement, job.Default.AbsorbElement);
            halfElementsEditor.SetValueAndDefaults(job.HalfElement, job.Default.HalfElement);
            cancelElementsEditor.SetValueAndDefaults(job.CancelElement, job.Default.CancelElement);
            weakElementsEditor.SetValueAndDefaults(job.WeakElement, job.Default.WeakElement);

            equipmentEditor.Equipment = null;
            //equipmentEditor.Equipment = job.Equipment;
            equipmentEditor.SetEquipment(job.Equipment, context);

            innateStatusesEditor.Statuses   = null;
            statusImmunityEditor.Statuses   = null;
            startingStatusesEditor.Statuses = null;
            //innateStatusesEditor.Statuses = job.PermanentStatus;
            //statusImmunityEditor.Statuses = job.StatusImmunity;
            //startingStatusesEditor.Statuses = job.StartingStatus;
            innateStatusesEditor.SetStatuses(job.PermanentStatus, context);
            statusImmunityEditor.SetStatuses(job.StatusImmunity, context);
            startingStatusesEditor.SetStatuses(job.StartingStatus, context);

            pnl_FormationSprites.Visible = (job.Value < 0x4A);

            ignoreChanges = false;
            absorbElementsEditor.ResumeLayout();
            cancelElementsEditor.ResumeLayout();
            halfElementsEditor.ResumeLayout();
            weakElementsEditor.ResumeLayout();
            equipmentEditor.ResumeLayout();
            innateStatusesEditor.ResumeLayout();
            statusImmunityEditor.ResumeLayout();
            startingStatusesEditor.ResumeLayout();
            this.ResumeLayout();
        }