1. #1

    Class Resources (Holy Power bla bla) With oUF.

    So.. i started making a new UI in WoW and iv always wanted to get into oUF as i just feel its alot nicer to get the things you want then with addons like stUF (Still an amazing addon) but i hit a wall, I started with the Zork simple frames and edited to how i like them. But now im not sure how id even define / start with the different classes resources. Been digging into other oUF layouts to see if there is anything there to help but it just confused me more as it seems people do it in loads of different ways :P

    So was wondering if anyone could give me a jump in the right direction of how they got there different class holy power and burning embers and such. Thank you

  2. #2
    Field Marshal Senit's Avatar
    10+ Year Old Account
    Join Date
    Jul 2012
    Location
    Darnassus
    Posts
    87
    I'd be glad to help you out, but do you have a more specific request?

    This is my "Generate Holy Power" function. Feel free to use it as reference.

    Code:
    lib.genHoly = function(self)
    	if select(2, UnitClass("player")) ~= "PALADIN" then return end
    
    	local ClassIcons = CreateFrame("Frame", nil, self)
    	ClassIcons:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, 7)
    	ClassIcons:SetSize(140, 20) -- 5 icons * 20 width + 4 spaces * 10 width
    	
    	for i = 1, 5 do
    		local Icon = CreateFrame("StatusBar", nil, ClassIcons)
    		Icon:SetSize(20, 20)
    		Icon:SetStatusBarTexture(config.statusbar_texture)
    		Icon:GetStatusBarTexture():SetHorizTile(false)
    
    		Icon:SetBackdrop(backdrop)
    		Icon:SetBackdropColor(0,0,0,1)
    
    		-- Map the method oUF tries to call to one that actually exists:
    		Icon.SetVertexColor = noop
    
    		if i == 1 then
    			Icon:SetPoint("LEFT", ClassIcons)
    		else
    			Icon:SetPoint("LEFT", ClassIcons[i-1], "RIGHT", 10, 0)
    		end
    		ClassIcons[i] = Icon
    	end
    
        ClassIcons[1]:SetStatusBarColor(230/255, 175/255, 0)
        ClassIcons[2]:SetStatusBarColor(230/255, 175/255, 0)
        ClassIcons[3]:SetStatusBarColor(230/255, 175/255, 0)
        ClassIcons[4]:SetStatusBarColor(230/255, 175/255, 0)
        ClassIcons[5]:SetStatusBarColor(230/255, 175/255, 0)
    	
    	self.ClassIcons = ClassIcons
    end
    Code:
    local noop = function() return end
    Last edited by Senit; 2012-09-17 at 06:42 PM.
    Senit UI -- outdated. Update... soon... maybe...

  3. #3
    Well... im trying to write my own unitframes with OUF, i can get there shape / size and what not its pretty simple, getting the Combo points, holypower, and other things like that, totems i think you get it :P confuses me alot why i wanted some help ^^

  4. #4
    Field Marshal Senit's Avatar
    10+ Year Old Account
    Join Date
    Jul 2012
    Location
    Darnassus
    Posts
    87
    So ya that function is what you're looking for.
    Senit UI -- outdated. Update... soon... maybe...

Posting Permissions

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