I've tried to make it work but it's hard to impossible as there is no API to detect if you have the mouse above any NPC.
I can hide all of the interaction texts and then you would not see ANY anymore (no loot possibility, no harvest possibility, no wayshrine, no doors, ...).
Or else it can only find out by checking if the unit below the cursor is a friend (and even that does not always work and does not match all NPCs) and if you can talk with him (would be any npc, companion, ...) and then hide the name at the cursor.
Here is my code tried, maybe someone else got an idea and make it work for you:
Lua Code:
SecurePostHook(RETICLE, "UpdateInteractText", function(selfVAr, currentFrameTimeSeconds)
if IsGameCameraActive() and not IsGameCameraUIModeActive() then
if IsPlayerGroundTargeting() then return end
local interactionType = GetInteractionType()
local interactionExists, interactionAvailableNow, questInteraction, questTargetBased, questJournalIndex, questToolIndex, questToolOnCooldown = GetGameCameraInteractableInfo()
if interactionExists == true and interactionAvailableNow == true and DoesUnitExist("reticleover") then
local reaction = GetUnitReaction("reticleover")
local isAttackable = IsUnitAttackable("reticleover")
--d(">reaction: " ..tostring(reaction) .. ", isAttackable: " .. tostring(isAttackable))
if (reaction == UNIT_REACTION_NEUTRAL or reaction == UNIT_REACTION_NPC_ALLY or reaction == UNIT_REACTION_COMPANION) then
RETICLE.interact:SetHidden(true)
end
end
end
end)
It will hide companions and NPCs and maybe also other' name at the reticle!
You can copy the whole code block from SecurePostHook to end) to any existing addon's
callback function of EVENT_ADD_ON_LOADED.
Example:
If you see this at an addon (mostly it is at the bottom)
Code:
EVENT_MANAGER:RegisterForEvent("AnyNameHere", EVENT_ADD_ON_LOADED, AddonLoaded)
Then search for "function AddonLoaded"
and in that function before the closing end of that function drop that code block so it looks like this:
Lua Code:
function AddonLoaded(eventId, addonName)
--some other code here
--drop here
SecurePostHook(RETICLE, "UpdateInteractText", function(selfVAr, currentFrameTimeSeconds)
if IsGameCameraActive() and not IsGameCameraUIModeActive() then
if IsPlayerGroundTargeting() then return end
local interactionType = GetInteractionType()
local interactionExists, interactionAvailableNow, questInteraction, questTargetBased, questJournalIndex, questToolIndex, questToolOnCooldown = GetGameCameraInteractableInfo()
if interactionExists == true and interactionAvailableNow == true and DoesUnitExist("reticleover") then
local reaction = GetUnitReaction("reticleover")
local isAttackable = IsUnitAttackable("reticleover")
--d(">reaction: " ..tostring(reaction) .. ", isAttackable: " .. tostring(isAttackable))
if (reaction == UNIT_REACTION_NEUTRAL or reaction == UNIT_REACTION_NPC_ALLY or reaction == UNIT_REACTION_COMPANION) then
RETICLE.interact:SetHidden(true)
end
end
end
end)
end --closing end of the function AddonLoaded