Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.glq
- {
- public class GLQ_BeenToRecordPlugin : BasePlugin, IInGameWorldPainter, IInGameTopPainter, IAfterCollectHandler, INewAreaHandler
- {
- private Dictionary<ISnoArea, string> BeenToList { get; set; } = new Dictionary<ISnoArea, string>();
- public IFont Font { get; set; }
- public WorldDecoratorCollection Decorator { get; set; }
- public GLQ_BeenToRecordPlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- Font = Hud.Render.CreateFont("tahoma", 6f, 255, 255, 128, 128, true, false, 160, 0, 0, 0, true);
- Decorator = new WorldDecoratorCollection(
- new MapLabelDecorator(Hud)
- {
- LabelFont = Hud.Render.CreateFont("tahoma", 6f, 255, 255, 128, 128, false, false, 160, 0, 0, 0, true),
- RadiusOffset = 20.0f,
- }
- );
- }
- public void OnNewArea(bool newGame, ISnoArea area)
- {
- if (newGame)
- {
- BeenToList.Clear();
- }
- }
- public void PaintWorld(WorldLayer layer)
- {
- foreach (var portal in Hud.Game.Portals)
- {
- if (!portal.TargetArea.IsTown && BeenToList.Keys.Contains(portal.TargetArea))
- {//小地图过图点显示
- Decorator.Paint(layer, null, portal.FloorCoordinate, BeenToList[portal.TargetArea] + " " + "Been There");
- }
- }
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (Hud.Render.UiHidden)
- return;
- if (clipState != ClipState.AfterClip)
- return;
- if (!Hud.Render.WorldMapUiElement.Visible || Hud.Render.ActMapUiElement.Visible)
- return;
- var mapCurrentAct = Hud.Game.ActMapCurrentAct;
- if (mapCurrentAct == BountyAct.None)
- return;
- 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 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);
- if (BeenToList.Keys.Contains(waypoint.TargetSnoArea) && !waypoint.TargetSnoArea.IsTown)
- {//世界地图上显示
- var layout = Font.GetTextLayout(BeenToList[waypoint.TargetSnoArea] + " " + "Been There");
- Font.DrawText(layout, x + ((w - layout.Metrics.Width) / 2), y + (float)Math.Ceiling(h * 0.7f));
- }
- }
- }
- public void AfterCollect()
- {
- var players = Hud.Game.Players;
- foreach (var player in players)
- {
- ISnoArea SnoArea = player.SnoArea;
- if (player.SnoArea.IsTown || player.SnoArea.NameEnglish.Contains("Rift Level"))//城镇和秘境不显示
- continue;
- if (!BeenToList.Keys.Contains(SnoArea))
- {
- BeenToList.Add(SnoArea, player.BattleTagAbovePortrait);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement