View Single Post
Old 08/26/08, 7:18 AM   #137 (permalink)
Evolve
Von Kaiser
 
Evolve's Avatar
 
Tauren Druid
 
<Ave>
Magtheridon (EU)
Originally Posted by Meloeth View Post
The health seems to be updating just as on live by default. I have not seen such a option and I can't find any such option when looking for it either... where is it?
I have no idea if its in the actual interface options, but here is the relevant code taken from frameXML. It seems the cVar is called "predictedHealth"

function UnitFrameHealthBar_Initialize (unit, statusbar, statustext, frequentUpdates)
	if ( not statusbar ) then
		return;
	end
 
	statusbar.unit = unit;
	SetTextStatusBarText(statusbar, statustext);
	if ( GetCVarBool("predictedHealth") and frequentUpdates ) then
		statusbar:SetScript("OnUpdate", UnitFrameHealthBar_OnUpdate);
	else
		statusbar:RegisterEvent("UNIT_HEALTH");
	end
	statusbar:RegisterEvent("UNIT_MAXHEALTH");
	statusbar:SetScript("OnEvent", UnitFrameHealthBar_OnEvent);
 
	-- Setup newbie tooltip
	if ( statusbar and (statusbar:GetParent() == PlayerFrame) ) then
		statusbar.tooltipTitle = HEALTH;
		statusbar.tooltipText = NEWBIE_TOOLTIP_HEALTHBAR;
	else
		statusbar.tooltipTitle = nil;
		statusbar.tooltipText = nil;
	end
end
 
function UnitFrameHealthBar_OnEvent(self, event, ...)
	if ( event == "CVAR_UPDATE" ) then
		TextStatusBar_OnEvent(self, event, ...);
	else
		UnitFrameHealthBar_Update(self, ...);
	end
end
 
function UnitFrameHealthBar_OnUpdate(self)
	if ( not self.disconnected ) then
		local currValue = UnitHealth(self.unit);
		if ( currValue ~= self.currValue ) then
			self:SetValue(currValue);
			self.currValue = currValue;
			TextStatusBar_UpdateTextString(self);
		end
	end
end

It's not a tank's job to keep everyone alive, it's the tank's job to keep the competent people alive. if that's the entire party, it's a good day
 
User is offline.
Reply With Quote