ok so i had tried what you suggested, and came up with bad juju, it litteraly cut my current to next level in half and thats all
so here we go again i made some changes, just to get out of the bug fix coding as i was doing adn renamed things to what i though would be ok
im going to post the entire script here so all events are shown
what is happening.
before the fix, stack overflow issue
after the fix
no more stack overflow Errors
However
my druid shows 4 Mil / 39Mil which is correct
Pally shows 900 Mil / 4 Bil which is correct
Warrior shows 100 / 300 which is correct
and so on
my Desired Result if artifact xp to next and artifact currently in my stash
is more then 1,000,000
please for the love of god add a period and 2 digits behind.
i.e. 1.05 mil , 1.15 bil, 4.05 bil, 900 mil, 45 bil and so on
here is all of my code
someone please rip me appart and tell me what stupid crap ive done cause im goin batty
Lua Code:
--Thank you for your help
--SDPhantom
--Phanx
--Fizzlemizz
local AXP_COLOR = { r = 0.6, g = 0.2, b = 0.1 }
--Lets set up the Frame
local derArtifactBar = CreateFrame("Statusbar", "derArtifactBar",artifactFrame)
derArtifactBar:SetPoint("CENTER", 0, 0)
derArtifactBar:SetHeight(18)
derArtifactBar:SetWidth(artifactFrame:GetWidth() * .968)
derArtifactBar:SetStatusBarTexture("Interface\\AddOns\\_Deranjata\\media\\cast\\Waterline")
derArtifactBar:SetStatusBarColor(AXP_COLOR.r, AXP_COLOR.g, AXP_COLOR.b, 0.5)
derArtifactBar:SetBackdrop({
bgFile = "Interface\\AddOns\\_Deranjata\\media\\cast\\Lines",
insets = { left = 1, right = 1, top = 1, bottom = 1 }
})
derArtifactBar:SetBackdropColor(0.1, 0.1, 0.1)
derArtifactBar:SetBackdropBorderColor(0.6, 0.6, 0.6)
--lets clear any text then set out centerpoint
derArtifactBar.Text=derArtifactBar:CreateFontString(nil, "OVERLAY", "GameFontNormal")
derArtifactBar.Text:SetPoint("CENTER")
--Registering out watched events
derArtifactBar:RegisterEvent("PLAYER_ENTERING_WORLD")
derArtifactBar:RegisterEvent("ARTIFACT_XP_UPDATE")
derArtifactBar:RegisterEvent("UNIT_INVENTORY_CHANGED")
-- now lets update the position and text on the bar so we can always have accurate info
derArtifactBar:SetScript("OnEvent", function(self, event, ...)
if not HasArtifactEquipped() then self:Hide() return end
self:Show()
local itemID, altItemID, name, icon, xp, pointsSpent, quality, artifactAppearanceID, appearanceModID, itemAppearanceID, altItemAppearanceID, altOnTop, artifactTier = C_ArtifactUI.GetEquippedArtifactInfo()
local numPoints, artifactXP, xpForNextPoint = MainMenuBar_GetNumArtifactTraitsPurchasableFromXP(pointsSpent, xp, artifactTier)
self:SetMinMaxValues(0,xpForNextPoint)
self:SetValue(artifactXP)
--Begin Stack Overflow Fix
local setCurrentAXP
local appendCurrentAXP
local placeValue1 =("%%.%df"):format(places or 0)
if not (artifactXP) then
return 0
elseif (artifactXP) >= 1000000000000 then
setCurrentAXP = placeValue1:format(artifactXP / 1000000000000)
appendCurrentAXP =" Tril"
elseif artifactXP >= 1000000000 then
setCurrentAXP = placeValue1:format(artifactXP / 1000000000)
appendCurrentAXP =" Bil"
elseif artifactXP >= 1000000 then
setCurrentAXP = placeValue1:format(artifactXP / 1000000)
appendCurrentAXP =" Mil"
else
setCurrentAXP = artifactXP -- hundreds
appendCurrentAXP =" "
end
local setNextPoint
local setAppendNext
local placeValue = ("%%.%df"):format(places or 0)
if not (xpForNextPoint) then
return 0
elseif (xpForNextPoint) >= 1000000000000 then
setNextPoint = placeValue:format(xpForNextPoint / 1000000000000)
setAppendNext =" Tril"
elseif xpForNextPoint >= 1000000000 then
setNextPoint = placeValue:format(xpForNextPoint / 1000000000)
setAppendNext =" Bil"
elseif xpForNextPoint >= 1000000 then
setNextPoint = placeValue:format(xpForNextPoint / 1000000)
setAppendNext =" Mil"
else
setNextPoint = xpForNextPoint -- hundreds
setAppendNext =" "
end
--End Stack Overflow Fix **** also added the variable into the self.text:SetFormattedText Below
self.Text:SetFormattedText("Current %d%s/%d%s +%d Points",setCurrentAXP,appendCurrentAXP,setNextPoint,setAppendNext,numPoints)
end)