public void PaintTopInGame(ClipState clipState) { if (clipState != ClipState.BeforeClip) { return; } foreach (var player in Hud.Game.Players) { if (!player.Powers.BuffIsActive(Hud.Sno.SnoPowers.NemesisBracers.Sno)) { continue; } var item = Hud.Sno.SnoItems.Unique_Bracer_106_x1; var tex = Hud.Texture.GetItemTexture(item); var bgTex = Hud.Texture.GetTexture(3166997520); var portrait = player.PortraitUiElement.Rectangle; var width = portrait.Left * 1.2f; var rect = new RectangleF(width / 2, portrait.Top + portrait.Height / 2 - width, width, width * 2);//var rect = new RectangleF(width/2, portrait.Height/2.5f, width, width * 2); bgBrush.DrawRectangle(rect); bgTex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); tex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); } }
private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref) { var w = m.CurHealth * w2 / m.MaxHealth; var per = LightFont.GetTextLayout((m.CurHealth * 100 / m.MaxHealth).ToString(PercentageDescriptor) + "%"); var y = YPos + py * 8 * yref; IBrush cBrush = null; IFont cFont = null; //Brush selection switch (m.Rarity) { case ActorRarity.Boss: cBrush = BossBrush; break; case ActorRarity.Champion: cBrush = ChampionBrush; break; case ActorRarity.Rare: cBrush = RareBrush; break; case ActorRarity.RareMinion: cBrush = RareMinionBrush; break; default: cBrush = BackgroundBrush; break; } //Jugger Highlight if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut)) { cFont = RedFont; cBrush = RareJuggerBrush; } else { cFont = NameFont; } //Draw Rectangles BackgroundBrush.DrawRectangle(XPos, y, w2, h); BorderBrush.DrawRectangle(XPos, y, w2, h); cBrush.DrawRectangle(XPos, y, (float)w, h); LightFont.DrawText(per, XPos + 8 + w2, y - py); //Draw MonsterType if (ShowMonsterType) { var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized); cFont.DrawText(name, XPos + 3, y - py); } //increase linecount yref += 1.0f; }
private void PaintBuff(BuffPaintInfo info, float x, float y, float w, float h, IBrush brush) { if (Opacity == 0) { return; } //Draw backbround bar BackgroundBrush.Opacity = Opacity; BackgroundBrush.DrawRectangle(x, y, w, h); //Draw cooldown Bar brush.Opacity = Opacity; brush.DrawRectangle(x, y, (float)(w * info.TimeLeft / (info.TimeLeft + info.Elapsed)), h); //Draw time left number if (ShowTimeLeftNumbers) { var text = ""; if (info.TimeLeft > 1) { text = info.TimeLeft.ToString("F0", CultureInfo.InvariantCulture); } else { text = info.TimeLeft.ToString("F1", CultureInfo.InvariantCulture); } var layout = TimeLeftFont.GetTextLayout(text); TimeLeftFont.Opacity = Opacity; TimeLeftFont.DrawText(layout, x + (w - (float)Math.Ceiling(layout.Metrics.Width)) / 2.0f, y + (h - layout.Metrics.Height) / 2); } }
public void Paint(float x, float y, float radius, IBrush brush, IBrush shadowBrush) { if (shadowBrush != null) { shadowBrush.StrokeWidth = brush.StrokeWidth + 1; shadowBrush.DrawRectangle(x - radius, y - radius, radius * 2.0f, radius * 2.0f); } brush.DrawRectangle(x - radius, y - radius, radius * 2.0f, radius * 2.0f); }
private void DrawLabel(IBrush label, string buffText) { _activeBuffsCount++; _yPosTemp += YPosIncrement * SizeModifier; float xJump = CalculateJump(); BorderBrush.DrawRectangle(hudWidth * _xPosTemp - (lWidth * 1.05f * .5f) + xJump, hudHeight * _yPosTemp - lHeight * 1.1f, lWidth * 1.05f, lHeight * 1.2f); label.DrawRectangle(hudWidth * _xPosTemp - lWidth * .5f + xJump, hudHeight * _yPosTemp - lHeight, lWidth, lHeight); var layout = TextFont.GetTextLayout(buffText); TextFont.DrawText(layout, hudWidth * _xPosTemp - (layout.Metrics.Width * 0.5f) + xJump, hudHeight * _yPosTemp - (layout.Metrics.Height * 1.1f)); }
private void DrawSkillBrushes() { Hud.Game.Me.Powers.UsedSkills.ForEach(skill => { if (!settings.SnoToDefinitionGroups.TryGetValue(skill.SnoPower.Sno, out var definitionGroupsForSkill) || !definitionGroupsForSkill.active || !Settings.KeyToActive[skill.Key]) { inactiveSkillBrush.DrawRectangle(settings.Hud.Render.GetPlayerSkillUiElement(skill.Key).Rectangle); } else { activeSkillBrush.DrawRectangle(settings.Hud.Render.GetPlayerSkillUiElement(skill.Key).Rectangle); } }); }
public void PaintTopInGame(ClipState clipState) { watermark.DrawText(WATERMARK_TEXT, Hud.Window.Size.Width * 0.04f, Hud.Window.Size.Height * 0.966f); tableHeadingLayout = tableHeadingFont.GetTextLayout(heading); tableHeadingFont.DrawText(tableHeadingLayout, coordX, coordY); currentRowIndex = 0; var buffs = Hud.Game.Me.Powers.AllBuffs.Where(buff => buff.Active && !excludedBuffs.Contains(buff.SnoPower.Sno)) .OrderBy(power => power.SnoPower.Sno).ToList(); if (initialBuffs.Count == 0) { initialBuffs.AddRange(buffs); } var tableEntries = new List <string>(); buffs.ForEach(buff => { if (!initialBuffs.Contains(buff)) { buffDelta.Add(buff); return; } if (!(GetBuffRow(buff) is string row)) { return; } tableEntries.Add(row); }); var deltaTableEntries = GetDeltaBuffTableEntries(); background.DrawRectangle(coordX - 10, coordY - 10, Hud.Window.Size.Width * 0.7f, ((tableEntries.Count + deltaTableEntries.Count + 1) * 19f) + 20); tableEntries.ForEachWithIndex((entry, index) => { var font = index % 2 == 0 ? tableRow : tableRowB; font.DrawText(entry, coordX, coordY + ((index + 1) * 19f)); }); deltaTableEntries.ForEachWithIndex((entry, index) => { deltaTableRow.DrawText(entry, coordX, coordY + ((tableEntries.Count + index + 1) * 19f)); }); }
private void ShowEssence() { //var monsterCount = Hud.Game.AliveMonsters.Where(monster => monster.NormalizedXyDistanceToMe < 30 && monster.SummonerAcdDynamicId == 0).Count(); //var layout = SimulacrumRemainFont.GetTextLayout(string.Format("{0:N0}", Hud.Game.Me.Stats.ResourceCurEssence)); //SimulacrumRemainFont.DrawText(layout, HudWidth * 0.5f - (layout.Metrics.Width * 0.5f), HudHeight * (MonsterInBoneRangeYPos + 0.015f)); //_boneArmorSkill. //Hud.Game.Me.Stats.ResourceCurEssence var labelWidth = map(CurEssence, 0, MaxEssence, 1, 100); var color = (int)map(CurEssence, 0, MaxEssence, 0, 255); _essenceBrush = Hud.Render.CreateBrush(245, 255 - (int)(color * 0.8f), color, 0, 0); _essenceBrush.DrawRectangle(HudWidth * 0.5f - labelWidth * 0.5f, HudHeight * 0.485f, labelWidth, EssenceLabelHeight); _essenceBrush.DrawEllipse(HudWidth * 0.5f - labelWidth * 0.5f, HudHeight * 0.485f + EssenceLabelHeight / 2, EssenceLabelHeight / 2, EssenceLabelHeight / 2); _essenceBrush.DrawEllipse(HudWidth * 0.5f + labelWidth * 0.5f, HudHeight * 0.485f + EssenceLabelHeight / 2, EssenceLabelHeight / 2, EssenceLabelHeight / 2); }
public void PaintTopInGame(ClipState clipState) { if (clipState != ClipState.BeforeClip) { return; } if (!Hud.Game.Me.Powers.BuffIsActive(Hud.Sno.SnoPowers.AncientParthanDefenders.Sno)) { percent = 0; return; } var count = Hud.Game.AliveMonsters.Count(m => (m.Stunned || m.Frozen) && m.NormalizedXyDistanceToMe <= 25); if (count == 0) { return; } SetDamageReductionpercent(); var dr = 100 * (1 - Math.Pow(1 - percent * 0.01d, count)); var ui = Hud.Render.GetUiElement("Root.NormalLayer.minimap_dialog_backgroundScreen.minimap_dialog_pve.minimap_pve_main"); var XPos = ui.Rectangle.Left - ui.Rectangle.Width * XWidth; var YPos = ui.Rectangle.Bottom + ui.Rectangle.Width * YHeight; var w = ui.Rectangle.Height * 0.1f; var h = ui.Rectangle.Height * 0.2f; var tex = Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.Unique_Bracer_102_x1); var bgTex = Hud.Texture.GetTexture(3166997520); var rect = new RectangleF(XPos, YPos, w, h); if (Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height)) { Hud.Render.SetHint("古帕特效\r\n古帕触发数\r\n古帕总减伤"); } StackBrush.DrawRectangle(rect); bgTex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); tex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); AncientParthanDecorator.TextFunc = () => " " + percent.ToString() + "%" + "\r\n" + "\r\n" + "\r\n" + " " + count.ToString() + "\r\n" + dr.ToString("f2") + "%"; //AncientParthanDecorator.HintFunc = () => "古帕特效\r\n古帕触发数\r\n古帕总减伤"; AncientParthanDecorator.Paint(XPos, YPos, w, h, HorizontalAlign.Center); }
private void DrawHealthBar(WorldLayer layer, IMonster m, ref float yref) { if (m.Rarity == ActorRarity.RareMinion && !ShowRareMinions) { return; //no minions } if (m.SummonerAcdDynamicId != 0) { return; //no clones } var w = m.CurHealth * w2 / m.MaxHealth; var per = LightFont.GetTextLayout((m.CurHealth * 100 / m.MaxHealth).ToString(PercentageDescriptor) + "%"); var y = YPos + py * 8 * yref; IBrush cBrush = null; IFont cFont = null; //Brush selection switch (m.Rarity) { case ActorRarity.Boss: cBrush = BossBrush; break; case ActorRarity.Champion: cBrush = ChampionBrush; break; case ActorRarity.Rare: cBrush = RareBrush; break; case ActorRarity.RareMinion: cBrush = RareMinionBrush; break; default: cBrush = BackgroundBrush; break; } //Jugger Highlight if (JuggernautHighlight && m.Rarity == ActorRarity.Rare && HasAffix(m, MonsterAffix.Juggernaut)) { cFont = RedFont; cBrush = RareJuggerBrush; } else { cFont = NameFont; } //Missing Highlight if (MissingHighlight && (m.Rarity == ActorRarity.Champion || m.Rarity == ActorRarity.Rare) && !m.IsOnScreen) { var missing = RedFont.GetTextLayout("⚠"); RedFont.DrawText(missing, XPos - 17, y - py); } //Circle Non-Clones and Boss //if (CircleNonIllusion && m.SummonerAcdDynamicId == 0 && HasAffix(m, MonsterAffix.Illusionist) || m.Rarity == ActorRarity.Boss && ShowBossHitBox) // HitBoxDecorator.Paint(layer, m, m.FloorCoordinate, string.Empty); //Show Debuffs on Monster if (ShowDebuffAndCC) { string textDebuff = null; if (m.Locust) { textDebuff += (textDebuff == null ? "" : ", ") + "Locust"; } //if (m.Palmed) textDebuff += (textDebuff == null ? "" : ", ") + "Palm"; if (m.Haunted) { textDebuff += (textDebuff == null ? "" : ", ") + "Haunt"; } if (m.MarkedForDeath) { textDebuff += (textDebuff == null ? "" : ", ") + "Mark"; } if (m.Strongarmed) { textDebuff += (textDebuff == null ? "" : ", ") + "Strongarm"; } string textCC = null; //if (m.Frozen) textCC += (textCC == null ? "" : ", ") + "Frozen"; //if (m.Chilled) textCC += (textCC == null ? "" : ", ") + "Chill"; //if (m.Slow) textCC += (textCC == null ? "" : ", ") + "Slow"; //if (m.Stunned) textCC += (textCC == null ? "" : ", ") + "Stun"; if (m.Invulnerable) { textCC += (textCC == null ? "" : ", ") + "Invulnerable"; } //if (m.Blind) textCC += (textCC == null ? "" : ", ") + "Blind"; var d = LightFont.GetTextLayout(textDebuff + (textDebuff != null && textCC != null ? " | " : "") + textCC); LightFont.DrawText(d, XPos + 65 + w2, y - py); } //Draw Rectangles BackgroundBrush.DrawRectangle(XPos, y, w2, h); BorderBrush.DrawRectangle(XPos, y, w2, h); cBrush.DrawRectangle(XPos, y, (float)w, h); LightFont.DrawText(per, XPos + 8 + w2, y - py); //Draw MonsterType if (ShowMonsterType) { var name = cFont.GetTextLayout(m.SnoMonster.NameLocalized); cFont.DrawText(name, XPos + 3, y - py); } //increase linecount yref += 1.0f; }
public void PaintWorld(WorldLayer layer) { var actors = Hud.Game.Actors; var me = Hud.Game.Me; sbremaining = 1.25f - ((Hud.Game.CurrentGameTick - sbstarpactstarttict) / 60.0f); if (sbstarpacttimerRunning == true && sbremaining <= 0) { sbstarpacttimerRunning = false; } if (sbremaining < 0) { sbremaining = 0; } float x = Hud.Window.Size.Width / 2 - Hud.Window.Size.Width * 0.038f; float y = Hud.Window.Size.Height / 2 - Hud.Window.Size.Height * 0.4f; var rect = new RectangleF(x, y, 40.0f, 40.0f); if (coe == "V") { visionBrush.DrawRectangle(rect); edgeBrush.DrawRectangle(rect); } dynamoBrush.DrawRectangle(rect.X + 120.0f, rect.Y, 40.0f, 40.0f); var resourcetext = textFont.GetTextLayout(Math.Truncate(resourcesb).ToString()); textFont.DrawText(resourcetext, Hud.Window.Size.Width * 0.435f, Hud.Window.Size.Height * 0.1f); Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.P2_Unique_Ring_04).Draw(rect); if (String.IsNullOrEmpty(coe)) { coe = ""; } var coetext = StackFont.GetTextLayout(coe); StackFont.DrawText(coetext, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(coetext.Metrics.Width), rect.Bottom - coetext.Metrics.Height); Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(243141).NormalIconTextureId).Draw(rect.X + 40.0f, rect.Y, 40.0f, 40.0f); var layout = StackFont.GetTextLayout(blackHolesb.ToString()); StackFont.DrawText(layout, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(layout.Metrics.Width) + 40.0f, rect.Bottom - layout.Metrics.Height); Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(30796).NormalIconTextureId).Draw(rect.X + 80.0f, rect.Y, 40.0f, 40.0f); var layout1 = StackFont.GetTextLayout(waveOfForcesb.ToString()); StackFont.DrawText(layout1, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(layout1.Metrics.Width) + 80.0f, rect.Bottom - layout1.Metrics.Height); Hud.Texture.GetTexture(Hud.Sno.GetSnoPower(208823).NormalIconTextureId).Draw(rect.X + 120.0f, rect.Y, 40.0f, 40.0f); var layout2 = StackFont.GetTextLayout(arcaneDynamosb.ToString()); StackFont.DrawText(layout2, rect.Right - (rect.Width / 8.0f) - (float)Math.Ceiling(layout2.Metrics.Width) + 120.0f, rect.Bottom - layout2.Metrics.Height); if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && Hud.Game.Me.Stats.ResourceCurArcane > 0) { var skill = Hud.Game.Me.Powers.GetBuff(243141); if (skill != null && Hud.Game.Me.Powers.GetBuff(243141).IconCounts[5] > 0) { getv = true; blackHole = Hud.Game.Me.Powers.GetBuff(243141).IconCounts[5]; resource = Hud.Game.Me.Stats.ResourceCurArcane; } else if (getv == true) { resource = Hud.Game.Me.Stats.ResourceCurArcane; } else { blackHole = 0; } var skill1 = Hud.Game.Me.Powers.GetBuff(30796); if (skill1 != null && Hud.Game.Me.Powers.GetBuff(30796).IconCounts[2] > 0) { getv1 = true; waveOfForce = Hud.Game.Me.Powers.GetBuff(30796).IconCounts[2]; resource = Hud.Game.Me.Stats.ResourceCurArcane; } else if (getv1 == true) { resource = Hud.Game.Me.Stats.ResourceCurArcane; } else { waveOfForce = 0; } var skill2 = Hud.Game.Me.Powers.GetBuff(208823); if (skill2 != null && Hud.Game.Me.Powers.GetBuff(208823).IconCounts[1] > 0) { getv2 = true; arcaneDynamo = Hud.Game.Me.Powers.GetBuff(208823).IconCounts[1]; resource = Hud.Game.Me.Stats.ResourceCurArcane; } else if (getv2 == true) { resource = Hud.Game.Me.Stats.ResourceCurArcane; } else { arcaneDynamo = 0; } } foreach (var actor in actors) { switch (actor.SnoActor.Sno) { case 217142: if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard) { if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && me.Stats.ResourceCurArcane < 5) { if (!sbstarpacttimerRunning) { sbstarpactstarttict = Hud.Game.CurrentGameTick; sbstarpacttimerRunning = true; if (blackHole > 0) { blackHolesb = blackHole; } else { blackHolesb = 0; } if (waveOfForce > 0) { waveOfForcesb = waveOfForce; } else { waveOfForcesb = 0; } if (arcaneDynamo > 0) { arcaneDynamosb = arcaneDynamo; } else { arcaneDynamosb = 0; } resourcesb = resource; blackHole = 0; waveOfForce = 0; arcaneDynamo = 0; resource = 0; } break; } if (Hud.Game.Me.HeroClassDefinition.HeroClass == HeroClass.Wizard && sbremaining > 0) { if (sbstarpacttimerRunning) { sbstarpacttimerRunning = false; getv = false; getv1 = false; getv2 = false; } if (sbremaining < 0.1 && sbremaining > 0) { if (me.Powers.BuffIsActive(430674, 1)) { coe = "V"; } else if (me.Powers.BuffIsActive(430674, 2)) { coe = "C"; } else if (me.Powers.BuffIsActive(430674, 3)) { coe = "F"; } else if (me.Powers.BuffIsActive(430674, 5)) { coe = "L"; } else { coe = ""; } break; } break; } } break; } } }
public void DrawStackCount(IPlayer player) { if (!player.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 0)) { return; } int count = Hud.Game.AliveMonsters.Count(m => m.SnoMonster.Priority == MonsterPriority.boss); if (count == 0) { return; } var uiBar = Hud.Render.MonsterHpBarUiElement; var monster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1; if ((monster == null) || (uiBar == null) || (monster.SnoMonster.Priority != MonsterPriority.boss)) { return; } int HitnRng = 1; int _count = 0; _count = Hud.Game.AliveMonsters.Count(m => (player.FloorCoordinate.XYZDistanceTo(m.FloorCoordinate)) <= 10); if (_count < 1) { _count = 1; } Random rng; rng = new Random(Hud.Game.CurrentGameTick); HitnRng = rng.Next(1, _count); var w = uiBar.Rectangle.Height * 2; var h = uiBar.Rectangle.Height; var x = uiBar.Rectangle.Right + uiBar.Rectangle.Height * 5; var y = uiBar.Rectangle.Y + uiBar.Rectangle.Height * 0.3f; var bgTex = Hud.Texture.GetTexture(3166997520); var tex = Hud.Texture.GetItemTexture(Hud.Sno.SnoItems.Unique_Gem_018_x1); var rect = new RectangleF(uiBar.Rectangle.Right + uiBar.Rectangle.Height * 5f + xPos, uiBar.Rectangle.Y - uiBar.Rectangle.Height * 1.5f / 6, uiBar.Rectangle.Height * 1.5f, uiBar.Rectangle.Height * 1.5f); var index = player.PortraitIndex; if (player.Powers.BuffIsActive(Hud.Sno.SnoPowers.BaneOfTheStrickenPrimary.Sno, 2)) { if (!cooling[index]) { cooling[index] = true; if (HitnRng == 1) { StackCount[index]++; } } } else { cooling[index] = false; } StackCountDecorator.TextFunc = () => StackCount[index].ToString(); StackBrush.DrawRectangle(rect); bgTex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); tex.Draw(rect.Left, rect.Top, rect.Width, rect.Height); var layout = ClassFont.GetTextLayout(player.BattleTagAbovePortrait + "\n(" + classShorts[player.HeroClassDefinition.HeroClass] + ")"); if (DrawClassOnIcons || Hud.Window.CursorInsideRect(rect.X, rect.Y, rect.Width, rect.Height)) { ClassFont.DrawText(layout, x - (layout.Metrics.Width * 0.1f) + xPos, y - h * 3); } StackCountDecorator.Paint(x + xPos, y, w, h, HorizontalAlign.Center); xPos += rect.Width + h; }