void corpseTracker_ItemsAdded(System.Collections.Generic.ICollection <TrackedCorpse> items) { try { foreach (var item in items) { if (item.Opened) { return; } HudList.HudListRowAccessor newRow = hudList.InsertRow(1); ((HudStaticText)newRow[0]).Text = item.TimeStamp.ToString("ddd HH:mm"); ((HudStaticText)newRow[1]).Text = item.Description; CoordsObject newCords = Mag.Shared.Util.GetCoords(item.LandBlock, item.LocationX, item.LocationY); ((HudStaticText)newRow[2]).Text = newCords.ToString(); ((HudStaticText)newRow[3]).Text = item.Id.ToString(CultureInfo.InvariantCulture); } } catch (Exception ex) { Debug.LogException(ex); } }
void playerTracker_ItemAdded(TrackedPlayer item) { try { HudList.HudListRowAccessor newRow = hudList.InsertRow(1); ((HudStaticText)newRow[1]).Text = item.Name; playerTracker_ItemChanged(item); } catch (Exception ex) { Debug.LogException(ex); } }
void consumableTracker_ItemsAdded(ICollection <TrackedInventory> items) { try { foreach (var item in items) { int zIndex = GetZIndex(item.ObjectClass); for (int row = 7; row <= hudList.RowCount; row++) { if (row == hudList.RowCount) { HudList.HudListRowAccessor newRow = hudList.AddRow(); ((HudPictureBox)newRow[0]).Image = item.Icon + 0x6000000; ((HudStaticText)newRow[1]).Text = item.Name; ((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right; ((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right; ((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right; ((HudStaticText)newRow[5]).TextAlignment = VirindiViewService.WriteTextFormats.Right; cachedInventory.Add(item); break; } if ((cachedInventory[row - 7].ObjectClass == item.ObjectClass && cachedInventory[row - 7].ItemValue < item.ItemValue) || (GetZIndex(cachedInventory[row - 7].ObjectClass) > zIndex)) { HudList.HudListRowAccessor newRow = hudList.InsertRow(row); ((HudPictureBox)newRow[0]).Image = item.Icon + 0x6000000; ((HudStaticText)newRow[1]).Text = item.Name; ((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right; ((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right; ((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right; ((HudStaticText)newRow[5]).TextAlignment = VirindiViewService.WriteTextFormats.Right; cachedInventory.Insert(row - 7, item); break; } } UpdateInventoryItem(item); } } catch (Exception ex) { Debug.LogException(ex); } }
void playerTracker_ItemsAdded(ICollection <TrackedPlayer> items) { try { foreach (var item in items) { HudList.HudListRowAccessor newRow = hudList.InsertRow(1); ((HudStaticText)newRow[1]).Text = item.Name; UpdateItem(item); } SortList(); } catch (Exception ex) { Debug.LogException(ex); } }
public void AddItem(LoggedChat item) { Util.ChatChannels chatChannels = Util.ChatChannels.None; if (settings.Area.Value) { chatChannels |= Util.ChatChannels.Area; } if (settings.Tells.Value) { chatChannels |= Util.ChatChannels.Tells; } if (settings.Fellowship.Value) { chatChannels |= Util.ChatChannels.Fellowship; } if (settings.General.Value) { chatChannels |= Util.ChatChannels.General; } if (settings.Trade.Value) { chatChannels |= Util.ChatChannels.Trade; } if (settings.Allegiance.Value) { chatChannels |= Util.ChatChannels.Allegiance; } if ((chatChannels & item.ChatType) != 0) { // Limit the list to no more than 10,000 rows if (hudList.RowCount >= 10000) { for (int i = hudList.RowCount - 1; i > 9000; i--) { hudList.RemoveRow(i); } } HudList.HudListRowAccessor newRow = hudList.InsertRow(1); ((HudStaticText)newRow[0]).Text = item.TimeStamp.ToString("yy/MM/dd HH:mm"); ((HudStaticText)newRow[1]).Text = Util.CleanMessage(item.Message); } }
private void AddWorldObject(WorldObject obj, HudList hl) { try { bool flag = false; 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) { flag = true; break; } } if (flag) { UpdateWorldObject(obj, hl); } else { CoordsObject coordsObject = obj.Coordinates(); string text; if (coordsObject.NorthSouth >= 0.0) { text = string.Format("{0:N1}", coordsObject.NorthSouth) + "N, "; } else { text = string.Format("{0:N1}", coordsObject.NorthSouth * -1.0) + "S, "; } if (coordsObject.EastWest >= 0.0) { text = text + string.Format("{0:N1}", coordsObject.EastWest) + "E"; } else { text = text + string.Format("{0:N1}", coordsObject.EastWest * -1.0) + "W"; } double num = CoreManager.Current.WorldFilter.Distance(obj.Id, CoreManager.Current.CharacterFilter.Id) * 240.0; int num2 = 0; HudList.HudListRowAccessor hudListRowAccessor; if (hl.RowCount > 0) { num2 = hl.RowCount; for (int j = 0; j < hl.RowCount; j++) { hudListRowAccessor = hl[j]; HudStaticText hudStaticText2 = (HudStaticText)hudListRowAccessor[1]; if (hudStaticText2.Text.Trim().CompareTo(obj.Name.Trim()) > 0) { num2 = j; break; } } } hudListRowAccessor = hl.InsertRow(num2); ((HudPictureBox)hudListRowAccessor[0]).Image = obj.Icon; ((HudStaticText)hudListRowAccessor[1]).Text = obj.Name; ((HudStaticText)hudListRowAccessor[2]).Text = text; ((HudStaticText)hudListRowAccessor[3]).Text = string.Format("{0:N1}", num); ((HudPictureBox)hudListRowAccessor[4]).Image = 100667896; ((HudStaticText)hudListRowAccessor[5]).Text = obj.Id.ToString(); ((HudStaticText)hudListRowAccessor[5]).Visible = false; } } catch (Exception ex) { Repo.RecordException(ex); } }