public void AddCharacter(UnitWrapper2 wrapper) { SavegameOverviewEntry entry = new SavegameOverviewEntry(); entry.EntrySelectedEvent += new EntrySelected(entry_EntrySelectedEvent); entry.Tag = wrapper; entry.CharacterName = wrapper.Name; entry.Gender = wrapper.CharacterWrapper.Gender.ToString(); entry.Class = wrapper.CharacterWrapper.ClassName; entry.Level = wrapper.CharacterWrapper.CharacterValues.Level.ToString(); entry.Palladium = string.Format("{0:N0}", wrapper.CharacterWrapper.CharacterValues.Palladium); entry.Playtime = wrapper.CharacterWrapper.CharacterValues.PlayTimeString; entry.Location = new Point(0, this.Controls.Count * entry.Height); this.Controls.Add(entry); }
void savegameOverviewControl1_EntrySelectedEvent(object sender, EventArgs e) { SavegameOverviewEntry entry = (SavegameOverviewEntry)sender; UnitWrapper2 unit = (UnitWrapper2)entry.Tag; this.Text = unit.Name; treeViewSkills.Nodes.Clear(); CharacterSkills skills = unit.CharacterWrapper.CharacterSkills; CharacterValues values = unit.CharacterWrapper.CharacterValues; CharacterInventory inventory = unit.CharacterWrapper.CharacterInventory; AddCharacterStats(values); AddGeneralSkills(skills); AddCharacterSkills(skills); AddCharacterItems(inventory); }