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, ILootGeneratedHandler // 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; }
- 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);
- }
- public void OnLootGenerated(IItem item, bool gambled)
- {
- if (item.IsLegendary && item.SetSno != uint.MaxValue)
- {
- if (item.AncientRank >= 0) LegendaryCount++;
- if (item.AncientRank == 1) AncientCount++;
- if (item.AncientRank == 2) PrimalCount++;
- }
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (clipState != ClipState.BeforeClip) return;
- if (TextFont == null) return;
- var text = string.Format("Legs: {0} / {1} / {2}", LegendaryCount, AncientCount, PrimalCount);
- var layout = TextFont.GetTextLayout(text);
- var uiMinimap = Hud.Render.MinimapUiElement.Rectangle;
- TextFont.DrawText(layout, uiMinimap.Left, uiMinimap.Top);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement