private void subLootAddSoul_Click(object sender, EventArgs e) { SHLootSoul soul = new SHLootSoul(); soul.min = 0; soul.max = 1; soul.rate = 10; soul.type = SHLootSoulType.C; if (lvLootList.Tag != null && lvLootList.Tag.GetType() == typeof(SHLoot)) { soul.Compile(); soul.Build(xmlCore); ((SHLoot)lvLootList.Tag).Add(soul); ListViewItem lvi = new ListViewItem(); ProcessLootSoul(lvi, soul); lvLootList.Items.Add(lvi); SHListViewUtil.SelectIndex(lvLootList, lvi.Index); m_ListViewController.SetListText(pgLoot.Tag as ListViewItem, lvLootList.Tag as SHLoot); } Global._VelixianForms.FindForm("LOOTING").Touch(); }
private void LootableDetail_ValueChanged(ListViewItem lvi) { if (lvi != null) { if (lvi.Tag.GetType() == typeof(SHLootSilver)) { SHLootSilver silver = (SHLootSilver)lvi.Tag; silver.Compile(); silver.Build(xmlCore); ProcessLootSilver(lvi, silver); } else if (lvi.Tag.GetType() == typeof(SHLootItem)) { SHLootItem item = (SHLootItem)lvi.Tag; item.Compile(); item.Build(xmlCore); ProcessLootItem(lvi, item); } else if (lvi.Tag.GetType() == typeof(SHLootSoul)) { SHLootSoul soul = (SHLootSoul)lvi.Tag; soul.Compile(); soul.Build(xmlCore); ProcessLootSoul(lvi, soul); } } Global._VelixianForms.FindForm("LOOTING").Touch(); }
private void ProcessLootSoul(ListViewItem lvi, SHLootSoul soul) { if (lvi == null || soul == null) { return; } lvi.SubItems.Clear(); lvi.Text = (soul.typeSpecified) ? "Soul " + soul.type.ToString() + "Rank" : "(Undefined)"; lvi.SubItems.AddRange(new String[] { soul.rate.ToString() + "%", (soul.minSpecified) ? soul.min.ToString() : "(Undefined)", (soul.maxSpecified) ? soul.max.ToString() : "(Undefined)" }); lvi.Tag = soul; lvi.ImageIndex = 11; lvi.ForeColor = (soul.Passed) ? Color.Black : Color.Red; lvi.BackColor = (soul.Passed) ? Color.White : Color.Yellow; }