Example #1
0
            protected override bool CheckFilter(SHDataObject dataObject, string strHead, string strFilter)
            {
                SHNPC npc = (SHNPC)(dataObject);

                if (strHead.ToLower() == "id")
                {
                    return(ExistFilterString(strFilter, npc.id.ToString()));
                }
                if (strHead.ToLower() == "name" || strHead == "이름")
                {
                    return(ExistFilterString(strFilter, npc.Name));
                }
                if (strHead.ToLower() == "clan" || strHead == "소속")
                {
                    return(ExistFilterString(strFilter, npc.Clan));
                }

                if (ExistFilterString(strFilter, npc.id.ToString()))
                {
                    return(true);
                }
                if (ExistFilterString(strFilter, npc.Name))
                {
                    return(true);
                }
                if (ExistFilterString(strFilter, npc.Clan))
                {
                    return(true);
                }

                return(false);
            }
Example #2
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;
                }
            }
Example #3
0
            protected override int GetDataObjectID(object listViewItemTag)
            {
                if (listViewItemTag.GetType() != typeof(SHNPC))
                {
                    return(0);
                }

                SHNPC selNPC = (SHNPC)listViewItemTag;

                if (selNPC != null)
                {
                    return(selNPC.id);
                }
                return(0);
            }
Example #4
0
 private void lvNPCs_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lvNPCs.SelectedItems.Count > 0)
     {
         ListViewItem lvi = lvNPCs.SelectedItems[0];
         if (lvi != null && lvi.Tag != null && lvi.Tag.GetType() == typeof(SHNPC))
         {
             SHNPC npc = (SHNPC)lvi.Tag;
             if (npc != null)
             {
                 wbNPCDetail.DocumentText = npc.GetHTML(xmlCore);
                 Global._mainForm.SetStatusLabelText(npc.CompiledMessage);
             }
         }
     }
     m_ListViewController.OnSelectedIndexChanged();
 }