public void Apply() { Monster.NameId = Context.GetStringId(NameBox.Text, Monster.NameId); Monster.ImageId = (ImageBox.SelectedItem as Resource).ID; Monster.Row = (Row)RowBox.SelectedIndex; Monster.AiId = (AIBox.SelectedItem as Resource).ID; Monster.Experience = (uint)XPBox.Value; Monster.DropsId = (DropsBox.SelectedItem as Resource).ID; StatsBoxes.Apply(); Monster.Skills = SkillsList.Values.ToList(); Saved?.Invoke(this, null); }
public void Apply() { Item.NameId = Context.GetStringId(NameBox.Text, Item.NameId); Item.ImageId = (ImageBox.SelectedItem as Resource).ID; Item.Type = (ItemType)TypeBox.SelectedIndex; Item.Value = (uint)ValueBox.Value; Item.Special = (ItemSpecial)SpecialBox.SelectedIndex; Item.SpecialArg1 = (short)SArg1Box.Value; Item.SpecialArg2 = (short)SArg2Box.Value; StatsBoxes.Apply(); ItemFlags fl = ItemFlags.None; if (LightFlag.Checked) { fl |= ItemFlags.Light; } if (HeavyFlag.Checked) { fl |= ItemFlags.Heavy; } if (StackedFlag.Checked) { fl |= ItemFlags.Stacked; } if (MediumFlag.Checked) { fl |= ItemFlags.MediumRange; } if (LongFlag.Checked) { fl |= ItemFlags.LongRange; } if (DexterityFlag.Checked) { fl |= ItemFlags.DexterityWeapon; } Item.Flags = fl; Saved?.Invoke(this, null); }
private void OKBtn_Click(object sender, EventArgs e) { PCFlags flags = PCFlags.None; if (BackRowBox.Checked) { flags |= PCFlags.BackRow; } if (PartyBox.Checked) { flags |= PCFlags.InParty; } PC.Attitude = (short)AttitudeBox.Value; PC.Experience = (uint)XPBox.Value; PC.Flags = flags; PC.Job = (Job)JobBox.SelectedIndex; PC.NameId = Context.GetStringId(NameBox.Text, PC.NameId); PC.PortraitId = (PortraitBox.SelectedItem as Resource).ID; PC.Pronouns = (Pronouns)PronounsBox.SelectedIndex; StatsBoxes.Apply(); for (int i = 0; i < Globals.NumJobs; i++) { PC.JobLevels[i] = (ushort)jobLevels[i].Value; } for (int i = 0; i < Globals.InventorySize; i++) { items[i].Apply(); } PC.Skills = SkillsList.Values.ToList(); Saved?.Invoke(this, null); Context.UnsavedChanges = true; Close(); }