1. #1

    Coding with nameplates

    I know this much about coding with nameplates:

    They're tricky to deal with. The clickable area is a hard-coded width and height, and their actual positioning can't be moved via Lua however you can adjust the artwork of the nameplate to give the effect that you've bumped up nameplates 10px or so. I recall something about having to constantly check the screen every frame, which makes nameplate addons CPU 'intense.'

    What I do not recall off hand is if you are able to take information from mobs associated with the nameplates on the screen.

    IE: I'm tanking 5 mobs and they're all named "Little Bastard" but each one has a unique ID iirc. Is that ID associated with the nameplate? Are there ways to game the nameplates to get a roster of enemies 'on the field', list them and then query their buffs/target/spell-casting state ect?
    Moo.

  2. #2
    Quote Originally Posted by JonBoy2001 View Post
    I know this much about coding with nameplates:

    They're tricky to deal with. The clickable area is a hard-coded width and height, and their actual positioning can't be moved via Lua however you can adjust the artwork of the nameplate to give the effect that you've bumped up nameplates 10px or so. I recall something about having to constantly check the screen every frame, which makes nameplate addons CPU 'intense.'

    What I do not recall off hand is if you are able to take information from mobs associated with the nameplates on the screen.

    IE: I'm tanking 5 mobs and they're all named "Little Bastard" but each one has a unique ID iirc. Is that ID associated with the nameplate? Are there ways to game the nameplates to get a roster of enemies 'on the field', list them and then query their buffs/target/spell-casting state ect?
    The only way to get a specific GUID is to mouse over the nameplate at least once while it is shown. When you are mouseovered you can set a variable to the frame. You'll need to check if the highlight texture of the nameplate is shown and then set the value of UnitGUID("mouseover") into the nameplate. Another way to check the GUID is to see if UnitExists('target') and check if the alpha of the nameplate is equal to one.

    Code:
    function NP:CheckUnit_Guid(frame, ...)
    	if UnitExists("target") and frame:GetAlpha() == 1 and UnitName("target") == frame.hp.name:GetText() then
    		frame.guid = UnitGUID("target")
    		frame.unit = "target"
    		NP:UpdateAurasByUnitID("target")
    		frame.hp.shadow:SetAlpha(1)
    	elseif frame.overlay:IsShown() and UnitExists("mouseover") and UnitName("mouseover") == frame.hp.name:GetText() then
    		frame.guid = UnitGUID("mouseover")
    		frame.unit = "mouseover"
    		NP:UpdateAurasByUnitID("mouseover")
    		frame.hp.shadow:SetAlpha(0)
    	else
    		frame.unit = nil
    		frame.hp.shadow:SetAlpha(0)
    	end	
    end
    Note: You will have to hook a script upon the health statusbar hiding to set all these variables to nil.
    Last edited by Elv; 2012-07-30 at 11:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •