Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.Csavo // Plugin for counting legendary drops
- {
- public class LegendaryCountPlugin : BasePlugin, IInGameTopPainter // beta 1.0
- {
- public bool ShowPerHour { get; set; }
- public int LegendaryCount { get; private set; }
- public int AncientCount { get; private set; }
- public int PrimalCount { get; private set; }
- public IFont TextFont { get; set; }
- private StringBuilder textBuilder;
- public LegendaryCountPlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- ShowPerHour = false;
- LegendaryCount = 0;
- AncientCount = 0;
- PrimalCount = 0;
- TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 255, 235, 170, false, false, true);
- textBuilder = new StringBuilder();
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (clipState != ClipState.BeforeClip) return;
- if (TextFont == null) return;
- var items = Hud.Game.Items.Where(i => i.Location == ItemLocation.Floor && i.Unidentified && i.SetSno != uint.MaxValue && i.AncientRank >= 0);
- foreach (var item in items)
- {
- if (item.AncientRank >= 0) LegendaryCount++;
- if (item.AncientRank == 1) AncientCount++;
- if (item.AncientRank == 2) PrimalCount++;
- }
- textBuilder.Clear();
- textBuilder.AppendFormat("Legs: {0} / {1} / {2}", LegendaryCount, AncientCount, PrimalCount);
- var layout = TextFont.GetTextLayout(textBuilder.ToString());
- var uiMinimap = Hud.Render.MinimapUiElement.Rectangle;
- TextFont.DrawText(layout, uiMinimap.Left, uiMinimap.Top);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement