forked from TehCheat/IconsBuilder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
NpcIcon.cs
31 lines (28 loc) · 1.15 KB
/
NpcIcon.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using ExileCore;
using ExileCore.PoEMemory.Components;
using ExileCore.PoEMemory.MemoryObjects;
using ExileCore.Shared;
using ExileCore.Shared.Abstract;
using ExileCore.Shared.Enums;
using ExileCore.Shared.Helpers;
namespace IconsBuilder
{
public class NpcIcon : BaseIcon
{
public NpcIcon(Entity entity, GameController gameController, IconsBuilderSettings settings) : base(entity, settings)
{
if (!_HasIngameIcon) MainTexture = new HudTexture("Icons.png");
MainTexture.Size = settings.SizeNpcIcon;
var component = entity.GetComponent<Render>();
Text = component?.Name.Split(',')[0];
Show = () => entity.IsValid;
if (_HasIngameIcon) return;
if (entity.Path.StartsWith("Metadata/NPC/League/Cadiro"))
MainTexture.UV = SpriteHelper.GetUV(MapIconsIndex.QuestObject);
else if (entity.Path.StartsWith("Metadata/Monsters/LeagueBetrayal/MasterNinjaCop"))
MainTexture.UV = SpriteHelper.GetUV(MapIconsIndex.BetrayalSymbolDjinn);
else
MainTexture.UV = SpriteHelper.GetUV(MapIconsIndex.NPC);
}
}
}