Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // KeyTrackerPlugin
- // Shows a label on Rift Obelisk tracking your rift keys amount.
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.Extended.Inventory
- {
- public class KeyTrackerPlugin : BasePlugin, IInGameWorldPainter
- {
- public TopLabelDecorator ObeliskDecorator { get; set; }
- private string obeliskText { get; set; }
- public KeyTrackerPlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- ObeliskDecorator = new TopLabelDecorator(Hud)
- {
- TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 210, 210, 210, true, false, 250, 50, 15, 40, true),
- TextFunc = () => obeliskText,
- };
- }
- public void PaintWorld(WorldLayer layer)
- {
- if (!Hud.Game.IsInTown) return;
- var obeliskPos = Hud.Game.Actors.Where(x => x.SnoActor.Sno == ActorSnoEnum._x1_openworld_lootrunobelisk_b && x.IsOnScreen);
- var actualKeys = Hud.Game.Me.Materials.GreaterRiftKeystone;
- obeliskText = actualKeys.ToString();
- var GRK = Hud.Inventory.GetSnoItem(2835237830);
- var KeyTexture = Hud.Texture.GetItemTexture(GRK);
- var ScreenWidth = Hud.Window.Size.Width;
- var ScreenHeight = Hud.Window.Size.Height;
- foreach (var actor in obeliskPos)
- {
- KeyTexture.Draw(actor.ScreenCoordinate.X - (ScreenWidth / 60f), actor.ScreenCoordinate.Y + (ScreenWidth / 22f), 50f, 50f, 1f);
- ObeliskDecorator.Paint(actor.ScreenCoordinate.X - (ScreenWidth / 24f), actor.ScreenCoordinate.Y + (ScreenWidth / 17.8f), (float)(ScreenWidth / 13), (float)(ScreenHeight / 28), HorizontalAlign.Center);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement