private void DrawPlayerSkills(IPlayer player) { var size = Hud.Window.Size.Width * SkillRatio; var portraitRect = player.PortraitUiElement.Rectangle; var index = 0; var passivesX = portraitRect.Right; foreach (var skill in player.Powers.SkillSlots) { if (skill != null) { index = skill.Key <= ActionKey.RightSkill ? (int)skill.Key + 4 : (int)skill.Key - 2; var y = portraitRect.Y + YOffset; var rect = new RectangleF(currentX + passivesX, y, size, size); SkillPainter.Paint(skill, rect); if (Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height)) { Hud.Render.SetHint(skill.RuneNameLocalized); } } currentX += size; } index = 0; }
private void DrawPlayerSkills(IPlayer player) { var portraitRect = player.PortraitUiElement.Rectangle; var size = portraitRect.Width * 0.3f; var passivesX = portraitRect.Right; YOffset = portraitRect.Height * 0.095f; foreach (var skill in player.Powers.SkillSlots) { if (skill != null && (List.ContainsKey(skill.SnoPower.Sno.ToString()) || AllSkill)) { var y = portraitRect.Y + YOffset; var rect = new RectangleF(passivesX + currentX, y, size, size); SkillPainter.Paint(skill, rect); if (Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height)) { Hud.Render.SetHint(skill.RuneNameLocalized); } currentX += size; } } }
private void DrawPlayerSkills(IPlayer player) { var size = Hud.Window.Size.Width * SkillRatio; var portraitRect = player.PortraitUiElement.Rectangle; var index = 0; var passivesX = currentX; foreach (int i in new int[] { 2, 3, 4, 5, 0, 1 }) { var skill = player.Powers.SkillSlots[i]; if (skill != null) { index = skill.Key <= ActionKey.RightSkill ? (int)skill.Key + 4 : (int)skill.Key - 2; var y = portraitRect.Y + currY - portraitRect.Width * 0.1f; var rect = new RectangleF(currentX, y, size, size); SkillPainter.Paint(skill, rect); if (Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height)) { Hud.Render.SetHint(skill.RuneNameLocalized); } } currentX += size; } index = 0; foreach (var skill in player.Powers.UsedPassives) { if (skill != null) { var y = portraitRect.Y + currY + size + portraitRect.Width * 0.1f; var rect = new RectangleF(passivesX, y, size, size); var texture = Hud.Texture.GetTexture(skill.NormalIconTextureId); texture.Draw(rect.X, rect.Y, rect.Width, rect.Height); if (Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height)) { Hud.Render.SetHint(skill.NameLocalized); } } passivesX += size * 1.666666f; index++; } currentX += gap; }
public void PaintTopInGame(ClipState clipState) { if (clipState != ClipState.BeforeClip || !ShowInTown && Hud.Game.Me.IsInTown || OnlyInGR && Hud.Game.SpecialArea != SpecialArea.GreaterRift) { return; } if (_size <= 0) { _size = HudWidth * SizeRatio; } var xPos = HudWidth * StartXPos; foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroId)) { if (player.IsMe && !ShowSelf || !player.IsMe && ShowOnlyMe) { continue; } var found = false; var firstIter = true; foreach (var i in _skillOrder) { var skill = player.Powers.SkillSlots[i]; if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno)) { continue; } found = true; if (firstIter) { var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + _classShorts[player.HeroClassDefinition.HeroClass] + ")"); ClassFont.DrawText(layout, xPos - (layout.Metrics.Width * 0.1f), HudHeight * StartYPos); firstIter = false; } var rect = new RectangleF(xPos, HudHeight * (StartYPos + 0.03f), _size, _size); SkillPainter.Paint(skill, rect); xPos += _size * 1.1f; } if (found) { xPos += _size * 1.1f; } } }
public void PaintTopInGame(ClipState clipState) { if (clipState != ClipState.BeforeClip) { return; } var xPos = HudWidth * StartXPos; var index = 0; foreach (var player in Hud.Game.Players.OrderBy(p => p.HeroClassDefinition.HeroClass)) { var foundCarrySkill = false; var flagIsFirstIterator = true; var yPos = HudHeight * StartYPos; foreach (var skill in player.Powers.UsedSkills.OrderBy(p => p.SnoPower.Sno)) { if (skill == null || !WatchedSnos.Contains(skill.SnoPower.Sno)) { continue; } foundCarrySkill = true; if (flagIsFirstIterator) { var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + _classShortName[player.HeroClassDefinition.HeroClass]); ClassFont.DrawText(layout, xPos, yPos); flagIsFirstIterator = false; yPos += 0.035f * HudHeight; } var rect = new SharpDX.RectangleF(xPos, yPos, _size, _size); SkillPainter.Paint(skill, rect); yPos += _size * 1.1f; } var CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Sno); switch (player.HeroClassDefinition.HeroClass) { case HeroClass.Necromancer: CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Sno); break; case HeroClass.Wizard: CheatDeathBuff = player.Powers.GetBuff(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Sno); break; } if (CheatDeathBuff != null && CheatDeathBuff.TimeLeftSeconds[1] > 0.0) { if (flagIsFirstIterator) { var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + _classShortName[player.HeroClassDefinition.HeroClass]); ClassFont.DrawText(layout, xPos, yPos); foundCarrySkill = true; yPos += 0.03f * HudHeight; } var Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.WitchDoctor_Passive_SpiritVessel.Icons[1].TextureId); switch (player.HeroClassDefinition.HeroClass) { case HeroClass.Necromancer: Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Necromancer_Passive_FinalService.Icons[1].TextureId); break; case HeroClass.Wizard: Texture = Hud.Texture.GetTexture(Hud.Sno.SnoPowers.Wizard_Passive_UnstableAnomaly.Icons[1].TextureId); break; } if (Texture != null) { Texture.Draw(xPos, yPos, _size, _size); } var layout2 = ClassFont.GetTextLayout(CheatDeathBuff.TimeLeftSeconds[1].ToString("0")); ClassFont.DrawText(layout2, xPos + (_size - (float)Math.Ceiling(layout2.Metrics.Width)) / 2, yPos + (_size - layout2.Metrics.Height) / 2); } if (foundCarrySkill) { xPos += _size * 2.5f; } index++; } }