Thread Tools Display Modes
10-06-11, 05:53 AM   #1
FaulTier
A Theradrim Guardian
 
FaulTier's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 61
how to use "power.frequentUpdates"

Hey everybody!

Since energy- and focus-tags are to slow updated (for me), I want to increase the updatefrequency, found "power.frequentUpdates" in oUF -> Elements -> power.lua

So, my question, where do i need to cut it in to work? I've really no clue, but regarding to oUF@GitHub it needs to be placed in "Initialisation"...
Here's everything thats belongs to power:

tags.lua
Code:
oUF.Tags['fauli:power']  = function(u) 
    local min, max = UnitPower(u), UnitPowerMax(u)
	if min~=max then 
		return SVal(min).."/"..SVal(max)
	else
		return SVal(max)
	end
end
oUF.TagEvents['fauli:power'] = 'UNIT_POWER UNIT_MAXPOWER'
lib.lua
Code:
    if self.mystyle == "player" or self.mystyle == "target" then
    local mp = setFont(self.Health, cfg.font, 12, "NONE", retVal(self,2,2,1))
	mp:SetPoint("BOTTOMRIGHT", self.Health, "BOTTOMRIGHT", -1, 1, retVal(self,-2,-2,-1), retVal(self,-3,-1,-11))
	mp:SetJustifyH("RIGHT")
	self:Tag(mp, "[fauli:color][fauli:power]")    
    end
core.lua
Code:
target = function(self)
		-- unit 
		self.mystyle = "target"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		-- framesize
		self:SetScale(cfg.frameScale)
		self:SetWidth(250)
		self:SetHeight(58)
		
		-- healthbar/powerbar
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(250, 32)
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
		
		self.Power:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', 0, 0)
		self.Power:SetSize(250, 20)
		self.Power.colorTapping = true
		self.Power.colorDisconnected = true
		self.Power.colorHappiness = false
		self.Power.colorReaction = false
		self.Power.colorPower = true
		self.Power.bg.multiplier = 0.3
		
        local myBar = CreateFrame("Statusbar", nil, self.Health)
        myBar:SetWidth(self.Health:GetWidth())
        myBar:SetStatusBarTexture(cfg.statusBarTexture)
        myBar:SetStatusBarColor(0, 1, 0, 0.5)
        myBar:SetPoint("TOPLEFT", self.Health:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
        myBar:SetPoint("BOTTOMLEFT", self.Health:GetStatusBarTexture(), "BOTTOMRIGHT", 0, 0)
        myBar:SetFrameLevel(1)
    
        local otherBar = CreateFrame("Statusbar", nil, self.Health)
        otherBar:SetWidth(self.Health:GetWidth())
        otherBar:SetStatusBarTexture(cfg.statusBarTexture)
        otherBar:SetStatusBarColor(0, 1, 0, 0.5)
        otherBar:SetPoint("TOPLEFT", myBar:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
        otherBar:SetPoint("BOTTOMLEFT", myBar:GetStatusBarTexture(), "BOTTOMRIGHT", 0, 0)
        otherBar:SetFrameLevel(1)
    
    self.HealPrediction = {
    myBar = myBar,
    otherBar = otherBar,
    maxOverflow = 1.05 -- means 5 % overflow
}
        
		lib.addTextTags(self, 17)
		
		lib.addIcons(self)
				
		lib.addCastBar(self, true)
        
	end,
	
	pet = function(self)
		-- unit
		self.mystyle = "pet"
		lib.addHealthBar(self)
		lib.addPowerBar(self)
		
		-- framesize
		self:SetScale(cfg.frameScale)
		self:SetWidth(120)
		self:SetHeight(21)
		
		-- healthbar/powerbar
		self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
		self.Health:SetSize(self:GetWidth(), self:GetHeight())
		self.Health:SetStatusBarColor(unpack(cfg.healthBarColor))
		self.Health.bg:SetVertexColor(unpack(cfg.healthBgColor))
        
		self.Power:SetPoint('BOTTOM', self, 'BOTTOM', 0, 3)
		self.Power:SetSize(self:GetWidth()-7, 2)
		self.Power:SetStatusBarColor(1, 1, 1)
		self.Power.bg:SetVertexColor(1, 1, 1, 0.6)
		
		lib.addTextTags(self, 12)
		
		lib.addIcons(self)

	end,
So, where goes the magic "power.frequentUpdates = 0.1"?

Greetings, Faultier
__________________
  Reply With Quote
10-06-11, 06:22 AM   #2
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
I would put it in the core.lua, just to all your other Power-related stuff:

lua Code:
  1. self.Power:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', 0, 0)
  2. self.Power:SetSize(250, 20)
  3. self.Power.colorTapping = true
  4. self.Power.colorDisconnected = true
  5. self.Power.colorHappiness = false
  6. self.Power.colorReaction = false
  7. self.Power.colorPower = true
  8. self.Power.frequentUpdates = 0.1
  9. self.Power.bg.multiplier = 0.3
__________________
  Reply With Quote
10-06-11, 06:32 AM   #3
FaulTier
A Theradrim Guardian
 
FaulTier's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 61
neither "self.Power.frequentUpdates = true" nor "self.Power.frequentUpdate = 0.1" (or = 0.5) changed anything.

Other Ideas?
__________________
  Reply With Quote
10-06-11, 06:33 AM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
The tag element has its own event and frequentUpdate system, which is completely detached from the one used elsewhere in oUF.

To force the tag to poll updates you have to do:
Code:
    if self.mystyle == "player" or self.mystyle == "target" then
    local mp = setFont(self.Health, cfg.font, 12, "NONE", retVal(self,2,2,1))
    mp.frequentUpdates = .1
	mp:SetPoint("BOTTOMRIGHT", self.Health, "BOTTOMRIGHT", -1, 1, retVal(self,-2,-2,-1), retVal(self,-3,-1,-11))
	mp:SetJustifyH("RIGHT")
	self:Tag(mp, "[fauli:color][fauli:power]")    
    end
You can also do 'frequentUpdates = true', which is equal to 'frequentUpdates = .5' on tags.

Also note that frequentUpdates on the power element isn't throttled by a timer. So doing 'frequentUpdates = .1' on it is equal to doing 'frequentUpdates = true' or 'frequentUpdates = 300'.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
10-06-11, 06:41 AM   #5
FaulTier
A Theradrim Guardian
 
FaulTier's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 61
Works perfect!
Thanks!
__________________
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » how to use "power.frequentUpdates"


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off