Code:
using System.Collections.Generic;
using System.Linq;
using Turbo.Plugins.Default;
namespace Turbo.Plugins.iWin
{
public class BannerPlugin : BasePlugin, IInGameWorldPainter
{
public WorldDecoratorCollection Decorator { get; set; }
public List<string> BattleTags = new List<string>();
public BannerPlugin()
{
Enabled = true;
}
public override void Load(IController hud)
{
base.Load(hud);
Decorator = new WorldDecoratorCollection(
new MapShapeDecorator(Hud)
{
ShapePainter = new RotatingTriangleShapePainter(Hud),
Brush = Hud.Render.CreateBrush(160, 128, 255, 0, 10),
ShadowBrush = Hud.Render.CreateBrush(96, 0, 0, 0, 1),
Radius = 2,
},
new GroundCircleDecorator(Hud)
{
Brush = Hud.Render.CreateBrush(150, 128, 255, 0, 0),
Radius = 1.125f,
},
new GroundLabelDecorator(Hud)
{
BackgroundBrush = Hud.Render.CreateBrush(90, 0, 0, 0, 0),
TextFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 255, true, false, 100, 0, 0, 0, true),
},
new MapLabelDecorator(Hud)
{
LabelFont = Hud.Render.CreateFont("tahoma", 6f, 192, 128, 255, 55, false, false, 128, 0, 0, 0, true),
RadiusOffset = 5.0f,
}
);
}
public void PaintWorld(WorldLayer layer)
{
BattleTags.Clear();
foreach (var player in Hud.Game.Players)
{
BattleTags.Add(player.BattleTagAbovePortrait);
}
var actors = Hud.Game.Actors;
foreach (var actor in actors)
{
switch (actor.SnoActor.Sno)
{
case ActorSnoEnum._emotebanner_player_1:
Decorator.Paint(layer, actor, actor.FloorCoordinate, BattleTags[0]);
break;
case ActorSnoEnum._emotebanner_player_2:
Decorator.Paint(layer, actor, actor.FloorCoordinate, BattleTags[1]);
break;
case ActorSnoEnum._emotebanner_player_3:
Decorator.Paint(layer, actor, actor.FloorCoordinate, BattleTags[2]);
break;
case ActorSnoEnum._emotebanner_player_4:
Decorator.Paint(layer, actor, actor.FloorCoordinate, BattleTags[3]);
break;
}
}
}
}
}
you could edit as ya please or change the list to dictionary to store more info than just name of banner holder