Ejemplo n.º 1
0
            public override void SetListText(ListViewItem lvi, SHDataObject selDataObject)
            {
                SHNPC npc = (SHNPC)(selDataObject);

                string szLoot = "None";

                if (lvi == null)
                {
                    return;
                }
                if (lvi.SubItems.Count > 1)
                {
                    lvi.SubItems.Clear();
                }

                npc.Compile();
                npc.Build(m_XmlCore);

                if (npc.Item_LootSpecified)
                {
                    szLoot = npc.Item_Loot.ToString();
                    if (m_XmlCore.Lootings.IsValid(npc.Item_Loot))
                    {
                        szLoot = m_XmlCore.Lootings[npc.Item_Loot].GetString(m_XmlCore);
                    }
                }

                lvi.Text = npc.id.ToString();
                lvi.SubItems.AddRange(new String[] {
                    (npc.Name != null) ? m_XmlCore.GetSafeString(npc.Name) : "",
                    (npc.Clan != null) ? m_XmlCore.GetSafeString(npc.Clan) : "",
                    npc.InteractCount.ToString(),
                    szLoot
                });

                if (npc.Type != null)
                {
                    if (npc.Type == "monster")
                    {
                        lvi.ImageIndex = 3;
                    }
                    else if (npc.Type == "npc")
                    {
                        lvi.ImageIndex = 5;
                    }
                    else if (npc.Type == "object")
                    {
                        lvi.ImageIndex = 8;
                    }
                }

                lvi.Tag       = npc;
                lvi.ForeColor = (npc.Passed) ? Color.Black : Color.Red;
                lvi.BackColor = (npc.Passed) ? Color.White : Color.Yellow;
                if (npc.InteractCount == 0)
                {
                    lvi.ForeColor = Color.Gray;
                }
            }