Ejemplo n.º 1
0
 private void UpdateWorldObject(WorldObject obj, HudList hl)
 {
     try
     {
         if (obj.Container != 0)
         {
             RemoveWorldObject(obj.Id, hl);
         }
         else
         {
             for (int i = 0; i < hl.RowCount; i++)
             {
                 HudList.HudListRowAccessor hudListRowAccessor = hl[i];
                 HudStaticText hudStaticText = (HudStaticText)hudListRowAccessor[5];
                 if (Convert.ToInt32(hudStaticText.Text) == obj.Id)
                 {
                     bool flag = false;
                     if (!flag && hl.Equals(MainView.CorpseList) && obj.ObjectClass == ObjectClass.Corpse)
                     {
                         flag = true;
                     }
                     if (!flag && hl.Equals(MainView.PortalList) && obj.ObjectClass == ObjectClass.Portal)
                     {
                         flag = true;
                     }
                     if (!flag && obj.ObjectClass == ObjectClass.Player)
                     {
                         if (hl.Equals(MainView.GuildList) && obj.Id == lib.MyCore.CharacterFilter.Id)
                         {
                             flag = true;
                         }
                         else if (hl.Equals(MainView.GuildList) && IsFriend(obj))
                         {
                             flag = true;
                         }
                         else if (hl.Equals(MainView.PlayerList) && IsEnemy(obj))
                         {
                             flag = true;
                         }
                         else if (hl.Equals(MainView.GuildList) && obj.Values(LongValueKey.Monarch) == lib.moncheck && obj.Id != lib.MyCore.CharacterFilter.Id)
                         {
                             flag = true;
                         }
                         else if (hl.Equals(MainView.PlayerList) && obj.Values(LongValueKey.Monarch) != lib.moncheck && obj.Id != lib.MyCore.CharacterFilter.Id)
                         {
                             flag = true;
                         }
                     }
                     if (flag)
                     {
                         UpdateRow(obj, hudListRowAccessor);
                     }
                     else
                     {
                         RemoveWorldObject(obj.Id, hl);
                     }
                 }
             }
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }