Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.DAV
- {
- public class DAV_BossQuestsPlugin : BasePlugin, IInGameTopPainter {
- public float offsetY { get; set; }
- public string textRemove { get; set; }
- public IFont HighlightFont { get; set; }
- private List<ISnoQuest> bossQuest { get; } = new List<ISnoQuest>();
- public DAV_BossQuestsPlugin() {
- Enabled = true;
- Order = 30000;
- }
- public override void Load(IController hud) {
- base.Load(hud);
- offsetY = 0f;
- textRemove = "Bounty: "; // Bounty: // 懸賞:
- HighlightFont = Hud.Render.CreateFont("Arial", 7f, 255, 255, 128, 51, true, true, 160, 51, 51, 51, true);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillTheSkeletonKing_361234); // Act 1
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillQueenAraneae_345528);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillTheButcher_347032);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillMaghda_347558); // Act 2
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillZoltunKulle_347656);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillBelial_358353);
- // bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillVidian_474066);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillGhom_346166); // Act 3
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillTheSiegebreakerAssaultBeast_349242);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillCydaea_349224);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillAzmodan_349244);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillRakanoth_349262); // Act 4
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillIzual_361421);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillDiablo_349288);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillAdria_359915); // Act 5
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillUrzael_359919);
- bossQuest.Add(Hud.Sno.SnoQuests.Bounty_KillMalthael_359927);
- }
- public void PaintTopInGame(ClipState clipState) {
- if (clipState != ClipState.AfterClip) return;
- if (!Hud.Render.WorldMapUiElement.Visible || Hud.Render.ActMapUiElement.Visible) return;
- var mapCurrentAct = Hud.Game.ActMapCurrentAct;
- var w = 220 * Hud.Window.HeightUiRatio;
- var h = 100 * Hud.Window.HeightUiRatio;
- foreach (var waypoint in Hud.Game.ActMapWaypoints.Where(x => x.BountyAct == mapCurrentAct)) {
- var quest = bossQuest.FirstOrDefault(z => z.BountySnoArea == waypoint.TargetSnoArea);
- if (quest == null) continue;
- var x = Hud.Render.WorldMapUiElement.Rectangle.X + waypoint.CoordinateOnMapUiElement.X * Hud.Window.HeightUiRatio;
- var y = Hud.Render.WorldMapUiElement.Rectangle.Y + waypoint.CoordinateOnMapUiElement.Y * Hud.Window.HeightUiRatio;
- var layout = HighlightFont.GetTextLayout(quest.NameLocalized.Replace(textRemove,""));
- HighlightFont.DrawText(layout, x + (w - layout.Metrics.Width) / 2, y /*- (float)Math.Ceiling(h * 0.32f) */- layout.Metrics.Height + offsetY);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement