protected override void OnEntityAdded(EntityWrapper entity) { if (!Settings.Enable || currentAlerts.ContainsKey(entity)) { return; } if (entity.HasComponent <WorldItem>()) { IEntity item = entity.GetComponent <WorldItem>().ItemEntity; ItemUsefulProperties props = EvaluateItem(item); if (props.IsWorthAlertingPlayer(currencyNames, Settings)) { AlertDrawStyle drawStyle = props.GetDrawStyle(); currentAlerts.Add(entity, drawStyle); CurrentIcons[entity] = new MapIcon(entity, new HudTexture("minimap_default_icon.png", drawStyle.Color), () => Settings.ShowItemOnMap, 8); if (Settings.PlaySound && !playedSoundsCache.Contains(entity.LongId)) { playedSoundsCache.Add(entity.LongId); Sounds.AlertSound.Play(); } } } }
public void EntityAdded(EntityWrapper entity) { if (!Settings.Enabled || currentAlerts.ContainsKey(entity)) { return; } if (!entity.HasComponent <WorldItem>()) { return; } EntityWrapper item = new EntityWrapper(model, entity.GetComponent <WorldItem>().ItemEntity); ItemUsefulProperties props = EvaluateItem(item); if (!props.IsWorthAlertingPlayer(Settings, currencyNames)) { return; } AlertDrawStyle drawStyle = props.GetDrawStyle(); currentAlerts.Add(entity, drawStyle); drawStyle.IconForMap = new MapIcon(entity, new HudTexture("minimap_default_icon.png", drawStyle.color), 8) { Type = MapIcon.IconType.Item }; if (Settings.PlaySound && drawStyle.soundToPlay != null && !playedSoundsCache.Contains(entity.LongId)) { playedSoundsCache.Add(entity.LongId); drawStyle.soundToPlay.Play(); } }
private void EntityList_OnEntityAdded(ExileBot.Entity entity) { if (!Settings.GetBool("ItemAlert") || this.currentAlerts.ContainsKey(entity)) { return; } if (entity.HasComponent <WorldItem>()) { ExileBot.Entity item = new ExileBot.Entity(this.poe, entity.GetComponent <WorldItem>().ItemEntity); ItemUsefulProperties props = this.EvaluateItem(item); if (props.IsWorthAlertingPlayer(currencyNames)) { this.DoAlert(entity, props); } } }