modernist wrote:semtex89 wrote:Have a question
Is it possible to remove showing hunter/lock pets nameplates?
not as far as i know I'm afraid — i'll have a quick look later though
I'm testing an experimental feature in CustomNameplates for just this.
It works pretty well but the performance when initially populating the player and playerpet registry is abominable.
It smooths out after it has scanned new players in the vicinity but when entering a heavily populated area for the first time it stutters visibly.
The concept is that in the scanning part where you populate a table with players you do this instead:
- Code: Select all
if UnitIsPlayer("target") then
local _, class = UnitClass("target") -- use the locale-agnostic value
table_insert(Players, name)
Players[name] = {["class"] = class}
elseif UnitPlayerControlled("target") and UnitCreatureFamily("target")~=nil then -- should be a player pet
PlayerPets[name] = true
end
Then you can
- Code: Select all
if PlayerPets[name] then --[[hide]] end
someplace else.
I took a look at your nameplates, I see they borrow heavily from the original addon I used for CustomNameplates, so you probably can benefit from some of the optimizations I've done (for example not looping through all the cosmetic pet names for each check)
Hope it helps, I'm not using modui myself but it's a great UI

PS. table_insert is an upvalue of table.insert and PlayerPets is a table initialized elsewhere.
PPS. My work in progress code:
https://github.com/Dridzt/CustomNameplates