1. #1
    Deleted

    Manipulate standard nameplates

    Is there anyway to manipulate the standard nameplates very simple?

    Like hide the textures around the bar, change the bar texture and but a simple border around it.

    I don't like using big nameplate addons that create totally new frames.

    I'm looking for something like

    NameplatesBorder:SetTexture(nil)
    NameplatesElite:SetTexture(nil

    but I doubt that will work. I can't find any frame names or texture names in the Github repo for the wow source code, so no Idea how to do it :/

  2. #2
    They dun have anything like that as far as I remember, cuz nameplates are implemented in C/C++, not in LUA.

    First, you have to "catch" a nameplate frame among all the frames on the screen. You have to hook WorldFrames OnUpdate script, my hook function looks like this:

    Code:
    local prevNumChildren = 0
    local function WorldFrame_OnUpdate(self, elapsed)
    	self.elapsed = (self.elapsed or 0) + elapsed
    
    	if self.elapsed > 0.1 then
    		local curNumChildren = WorldFrame:GetNumChildren()
    
    		if curNumChildren ~= prevNumChildren  then
    			for i = prevNumChildren + 1, curNumChildren do
    				local f = select(i, WorldFrame:GetChildren())
    
    				local name = f:GetName()
    				if (name and match(name, "^NamePlate%d")) and not NP.plates[f] then -- I also have a table of all handled nameplates
    					HandleNamePlate(f) -- that's my function I use to customise templates
    				end
    			end
    
    			prevNumChildren = curNumChildren
    		end
    
    		-- more code here
    
    		self.elapsed = 0
    	end
    end
    Then inside my HandleNamePlate function I get frame's children and regions:
    Code:
    local function HandleNamePlate(self)
    	self.barFrame, self.nameFrame = self:GetChildren() -- textures and name
    	self.health, self.cast = self.barFrame:GetChildren() -- health bar and cast bar
    
    	self.threat, self.border, self.highlight, self.level, self.bossIcon, self.raidIcon, self.eliteIcon = self.barFrame:GetRegions()
    	self.name = self.nameFrame:GetRegions()
    	self.health.texture = self.health:GetRegions()
    	self.cast.texture, self.cast.border, self.cast.shield, self.cast.icon, self.cast.text, self.cast.textShadow = self.cast:GetRegions()
    
    	-- more code here
    
    end

    Not optimised code though, I consider rewriting it, cuz too many table lookups occur later on.

  3. #3
    Deleted
    Thanks. I'll guess I have to do look into this more intense.

    I was looking for a simple nameplate solution for my personal interface, guess I'll try to write my own.

  4. #4
    Quote Originally Posted by Danielps1 View Post
    Thanks. I'll guess I have to do look into this more intense.

    I was looking for a simple nameplate solution for my personal interface, guess I'll try to write my own.
    Yeah, when first started writing nameplate module for my UI, I also hoped for a better solution... Good luck

Posting Permissions

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