ok so i figured out how to make it work, but when going into the billions i want to force 3 numbers deep,
so instead of it saying 4 billion only, i want it to say,.... 4.25 or 6.99 or so on, here is my code the fix is at the bottom
starting at
local bugfix and continuing to the end
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)
--self.Text:SetFormattedText("Artifact XP: %d / %d +%d Points",artifactXP,xpForNextPoint,numPoints)
--if artifactXP >= 1000000000 then
-- local bugFix = artifactXP/1000000--xpForNextPoint
-- else
-- local bugFix = 9494949--artifactXP/1000000
-- end
local bugFix
local append
local placeValue = ("%%.%df"):format(places or 0)
if not (artifactXP) then
return 0
elseif (artifactXP) >= 1000000000000 then
bugFix = placeValue:format(artifactXP / 1000000000000)-- .. --" Tril" -- trillion
append =" Tril"
elseif artifactXP >= 1000000000 then
bugFix = placeValue:format(artifactXP / 1000000000)-- ..-- " Bil" -- billion
append =" Bil"
elseif artifactXP >= 1000000 then
bugFix = placeValue:format(artifactXP / 1000000) --.. --" Mil" -- million
append =" Mil"
else
bugFix = artifactXP -- hundreds
end
local nextPoint
local appendNext
local placeValue = ("%%.%df"):format(places or 0)
if not (xpForNextPoint) then
return 0
elseif (xpForNextPoint) >= 1000000000000 then
nextPoint = placeValue:format(xpForNextPoint / 1000000000000)-- .. --" Tril" -- trillion
appendNext =" Tril"
elseif xpForNextPoint >= 1000000000 then
nextPoint = placeValue:format(xpForNextPoint / 1000000000)-- ..-- " Bil" -- billion
appendNext =" Bil"
elseif xpForNextPoint >= 1000000 then
nextPoint = placeValue:format(xpForNextPoint / 1000000) --.. --" Mil" -- million
appendNext =" Mil"
else
nextPoint = xpForNextPoint -- hundreds
end
self.Text:SetFormattedText("Current %d%s/%d%s +%d Points",bugFix,append,nextPoint,appendNext,numPoints)
end)