Thread: Honor Tracking
View Single Post
02-07-17, 02:14 PM   #6
briskman3000
A Flamescale Wyrmkin
 
briskman3000's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 108
Originally Posted by Fizzlemizz View Post
You're probably creating a new fontstring or frame with the fontstring every time you set the text.

Create each once and then re-use the one fontstring:SetText(...)
That was my first thought, I was doing that with my original calls, so I changed it, but I am still getting the same issue:

Here is the basic code that prints out to the frame:

Code:
function events:PLAYER_ENTERING_WORLD(...)
	Addon:Show()
	lhprestige = UnitPrestige("Player");
	lhhonor = UnitHonor("player");
	lhhonormax = UnitHonorMax("player")
	lhhonorlevel = UnitHonorLevel("player")
	lhhonorneeded = lhhonormax - lhhonor;
	Addon.PlayerPrestigeLevel = Addon:CreateFontString("LegionHonor_PlayerPrestigeLevel", "OVERLAY", "GameFontNormal");
	Addon.PlayerPrestigeLevel:SetPoint("RIGHT", 0, 75);
	Addon.PlayerPrestigeLevel:SetText(lhprestige);
	Addon.PlayerHonorAmount = Addon:CreateFontString("LegionHonor_PlayerHonor", "OVERLAY", "GameFontNormal");
	Addon.PlayerHonorAmount:SetPoint("RIGHT", 0, -25);
	Addon.PlayerHonorAmount:SetText(lhhonor);
	Addon.PlayerHonorLevel = Addon:CreateFontString("LegionHonor_PlayerHonorLevel", "OVERLAY", "GameFontNormal");
	Addon.PlayerHonorLevel:SetPoint("RIGHT", 0, 25);
	Addon.PlayerHonorLevel:SetText(lhhonorlevel);
	Addon.PlayerHonorNeeded = Addon:CreateFontString("LegionHonor_PlayerHonorNeeded", "OVERLAY", "GameFontNormal");
	Addon.PlayerHonorNeeded:SetPoint("RIGHT", 0, -75);
	Addon.PlayerHonorNeeded:SetText(lhhonorneeded);
end

function events:PLAYER_PVP_KILLS_CHANGED(...)
	lhprestige = UnitPrestige("Player");
	lhhonor = UnitHonor("player");
	lhhonormax = UnitHonorMax("player")
	lhhonorlevel = UnitHonorLevel("player")
	lhhonorneeded = lhhonormax - lhhonor;	
	Addon.PlayerPrestigeLevel:SetText(lhprestige);
	Addon.PlayerHonorAmount:SetText(lhhonor);
	Addon.PlayerHonorLevel:SetText(lhhonorlevel);
	Addon.PlayerHonorNeeded:SetText(lhhonorneeded);
end
So from what I see, it should create the strings on PLAYER_ENTERING_WORLD calls, and then only update on PLAYER_PVP_KILLS_CHANGED calls ... but it still seems to just plop the new text on top of the old text
  Reply With Quote