diff --git a/lua/ui/addons/detailmonitor/menu_platforms.xpl.lua b/lua/ui/addons/detailmonitor/menu_platforms.xpl.lua
index 0cb08d5..bea7953 100644
--- a/lua/ui/addons/detailmonitor/menu_platforms.xpl.lua
+++ b/lua/ui/addons/detailmonitor/menu_platforms.xpl.lua
@@ -125,6 +125,20 @@ menu.onShowMenu = function ()
return
end
+
+local function NPCsorter(a, b)
+ local a_entitytype, a_name = GetComponentData(a, "typename", "name")
+ local b_entitytype, b_name = GetComponentData(b, "typename", "name")
+
+ if a_entitytype == b_entitytype then
+ return a_name < b_name
+ else
+ return a_entitytype < b_entitytype
+ end
+
+ return
+end
+
menu.displayMenu = function ()
Helper.removeAllButtonScripts(menu)
@@ -166,6 +180,7 @@ menu.displayMenu = function ()
for _, platform in ipairs(menu.platforms) do
local npcs = GetPrioritizedPlatformNPCs(platform)
+ table.sort(npcs, NPCsorter)
setup.addSimpleRow(setup, {
Helper.createButton(Helper.createButtonText((menu.extendedcategories[tostring(platform)] and "-") or "+", "center", Helper.standardFont, Helper.standardFontSize, 255, 255, 255, 100), nil, false, 0 < #npcs, 0, 0, 0, Helper.standardTextHeight),
GetComponentData(platform, "name") .. " (" .. #npcs .. ")"
@@ -179,11 +194,16 @@ menu.displayMenu = function ()
if 0 < #npcs and menu.extendedcategories[tostring(platform)] then
for _, npc in ipairs(npcs) do
- local name, typestring, typeicon, typename, owner = GetComponentData(npc, "name", "typestring", "typeicon", "typename", "owner")
+ local name, typestring, typeicon, typename, owner, isenemy = GetComponentData(npc, "name", "typestring", "typeicon", "typename", "owner", "isenemy")
+ local color = menu.white
+
+ if isenemy then
+ color = menu.red
+ end
setup.addSimpleRow(setup, {
- Helper.createIcon(typeicon, false, 255, 255, 255, 100, 0, 0, Helper.standardTextHeight, Helper.standardButtonWidth),
- typename .. " " .. name
+ Helper.createIcon(typeicon, false, color.r, color.g, color.b, color.a, 0, 0, Helper.standardTextHeight, Helper.standardButtonWidth),
+ Helper.createFontString(typename .. " " .. name, false, "left", color.r, color.g, color.b, color.a)
}, {
"npc",
npc