private void _processPlayerAdd(Player player) { bool enemy = player.Enemy; HudList playersView = enemy ? _enemyListView : _friendlyListView; int icon = enemy ? EnemyIcon : FriendlyIcon; D3DObj playerIcon = CoreManager.Current.D3DService.MarkObjectWithShape(player.Id, D3DShape.Sphere, Color.Red.ToArgb()); playerIcon.Scale(enemy ? 0.3f : 0.3f); playerIcon.Anchor(player.Id, 0.2f, 0.0f, 0.0f, 2.5f); playerIcon.Color = enemy ? Color.FromArgb(200, Color.Red).ToArgb() : Color.FromArgb(220, Color.LightBlue).ToArgb(); playerIcon.OrientToCamera(true); _playerIcons.Add(_playerIconFactory(player.Id, playerIcon)); HudList.HudListRowAccessor row = playersView.AddRow(); ((HudPictureBox)row[0]).Image = icon; ((HudStaticText)row[1]).Text = player.Name; ((HudStaticText)row[1]).TextColor = enemy ? Color.Red : Color.LightBlue; if (!enemy) { ((HudStaticText)row[1]).TextColor = Color.LightGreen; ((HudPictureBox)row[2]).Image = 100670841; ((HudPictureBox)row[3]).Image = 100670842; } }
private void _playerManager_PlayerUpdated(object sender, Player player) { try { PlayerIcon playerIcon = _playerIcons.Find(icon => icon.Id == player.Id); float fade = player.LowHealth ? 0.2f : 0; playerIcon.Icon.PFade = fade; Predicate <DebuffObj> debuffed = obj => obj.Id == player.Id; foreach (var obj in _debuffObjects.FindAll(debuffed)) { obj.D3DObject.Visible = false; obj.D3DObject.Dispose(); _debuffObjects.Remove(obj); } int index = 0; foreach (DebuffInformation info in player.Debuffs) { int spell = info.Spell; if (info.MapDebuffToIcon(spell) != null && WorldObjectService.IsValidObject(player.Id)) { int icon = (int)info.MapDebuffToIcon(spell); D3DObj obj = CoreManager.Current.D3DService.MarkObjectWithIcon(player.Id, icon); float dz = _globals.Host.Actions.Underlying.ObjectHeight(player.Id) + ((float)0 * 0.5f); obj.Scale(0.5f); obj.Anchor(player.Id, 0.2f, 0.0f, 0.0f, dz); obj.PBounce = 0.0f; obj.Autoscale = false; obj.HBounce = 0.0f; obj.OrientToCamera(true); obj.POrbit = 2f; obj.ROrbit = 0.5f; obj.AnimationPhaseOffset = index * ((2f / 8f)); obj.Visible = true; DebuffObj debuffObj = _debuffObjFactory( player.Id, info.Spell, icon, obj); _debuffObjects.Add(debuffObj); ++index; } } } catch (Exception ex) { _logger.Error(ex); } }
public static D3DObj CreateD3DObject(HUDControl pc, int targetID, int icon) { try { float num = lib.MyHost.Underlying.Hooks.ObjectHeight(targetID); D3DObj d3DObj = lib.MyCore.D3DService.NewD3DObj(); d3DObj.SetIcon(icon); d3DObj.Anchor(targetID, 0.2f, 0f, 0f, num - pc.CurrentProfile.MonsterHeightOffset); d3DObj.Scale(pc.CurrentProfile.FloatingDebuffSizeF); d3DObj.ROrbit = 0f; d3DObj.OrientToCamera(true); d3DObj.Visible = true; return(d3DObj); } catch (Exception ex) { Repo.RecordException(ex); } return(null); }