Hi,
PHP Code:
var portrait = player.PortraitUiElement.Rectangle;
is never used.
PHP Code:
var PointZero = Hud.Window.CreateWorldCoordinate((float)0, (float)0, (float)0);
is never used.
PHP Code:
0f //does the same as (float)0
do you want to paint your own BTTag ??
in case not, add
PHP Code:
if (player.IsMe) continue;
PHP Code:
foreach (var player in Hud.Game.Players.OrderBy(p => p.Index))
what is the point in ordering by index, if you switch your coordinates per index later....
is there a difference to
PHP Code:
foreach (var player in Hud.Game.Players)
-----------------------------
your code is quite long...
use arrays to shorten it.
note: not tested yet !!!
PHP Code:
private float[,,] bannerCoords = new float[5,4,3] {
//player_index = 0 {x,y,z} //player_index = 1 {x,y,z} ...
{ {381.154f, 551.850f, 33.3f}, {397.500f, 568.030f, 31.5f}, {403.000f, 539.500f, 37.3f}, {413.500f, 548.450f, 28.9f} }, //act 1
{ {318.500f, 263.600f, 4.5f }, {300.000f, 285.500f, 6.5f }, {319.000f, 304.900f, 7.6f }, {338.500f, 285.300f, 7.0f } }, //act 2
{ {382.500f, 411.900f, 10.2f}, {398.500f, 428.500f, 9.2f }, {408.500f, 405.800f, 19.4f}, {414.500f, 408.100f, 6.4f } }, //act 3
{ {382.500f, 411.900f, 10.2f}, {398.500f, 428.500f, 9.2f }, {408.500f, 405.800f, 19.4f}, {414.500f, 408.100f, 6.4f } }, //act 4
{ {571.000f, 756.600f, 6.1f }, {550.000f, 779.000f, 7.4f }, {551.500f, 739.000f, 9.5f }, {530.000f, 759.000f, 9.1f } } //act 5
};
PHP Code:
foreach (var player in Hud.Game.Players.OrderBy(p => p.Index))
{
if (player == null) continue;
var BTTag = player.BattleTagAbovePortrait;
var CurrentAct = Hud.Game.Me.SnoArea.Act;
var pIndex = player.Index;
var BannerPos = Hud.Window.CreateWorldCoordinate(bannerCoords[CurrentAct-1,pIndex,0],bannerCoords[CurrentAct-1,pIndex,1],bannerCoords[CurrentAct-1,pIndex,2]);
var BattleTagAboveBanner = Hud.Game.Actors.Where(x => x.SnoActor.Sno == 375094);
foreach (var actor in BattleTagAboveBanner.Take(1))
{
BattleTagAboveBannerDecorator.Paint(layer, actor, BannerPos, BTTag);
}
}
you can also remove act 4 line from array:
PHP Code:
var Act_index = (Hud.Game.Me.SnoArea.Act == 4 ? 2 : (Hud.Game.Me.SnoArea.Act == 5 ? 3 : Hud.Game.Me.SnoArea.Act - 1 ));
var BannerPos = Hud.Window.CreateWorldCoordinate(bannerCoords[Act_index,pIndex,0],bannerCoords[Act_index,pIndex,1],bannerCoords[Act_index,pIndex,2]);
-----------------------------
Originally Posted by
MrOne
greetz gjuz