Harden Altoholic frames against partial alt records (no-value char getters)
DataStore char-based getters return *no value* for any module that hasn't scanned a given char (DataStore.lua: 'if not arg1.lastUpdate then return end'). Fresh CoA alts have partial per-module data, so the frames crashed feeding 'no value' into format()/concat/arithmetic/pairs. Guarded every such site: AccountSummary, Activity, BagUsage, Quests, Reputations, TabCharacters, DrawCharacterTooltip, recipe tooltip. No DataStore contract change.
This commit is contained in:
@@ -100,8 +100,8 @@ function ns:Update()
|
||||
_G[entry..i.."Name"]:SetWidth(170)
|
||||
_G[entry..i.."Name"]:SetPoint("TOPLEFT", 10, 0)
|
||||
_G[entry..i.."NameNormalText"]:SetWidth(170)
|
||||
_G[entry..i.."NameNormalText"]:SetText(icon .. format("%s (%s)", DS:GetColoredCharacterName(character), DS:GetCharacterClass(character)))
|
||||
_G[entry..i.."Level"]:SetText(GREEN .. DS:GetCharacterLevel(character))
|
||||
_G[entry..i.."NameNormalText"]:SetText(icon .. format("%s (%s)", DS:GetColoredCharacterName(character) or "?", DS:GetCharacterClass(character) or ""))
|
||||
_G[entry..i.."Level"]:SetText(GREEN .. (DS:GetCharacterLevel(character) or 0))
|
||||
|
||||
local color
|
||||
local num = DS:GetNumMails(character) or 0
|
||||
@@ -112,7 +112,7 @@ function ns:Update()
|
||||
color = GREEN -- green by default, red if at least one mail is about to expire
|
||||
|
||||
local threshold = DataStore:GetOption("DataStore_Mails", "MailWarningThreshold")
|
||||
if DS:GetNumExpiredMails(character, threshold) > 0 then
|
||||
if (DS:GetNumExpiredMails(character, threshold) or 0) > 0 then
|
||||
color = RED
|
||||
end
|
||||
end
|
||||
@@ -182,17 +182,17 @@ function ns:OnEnter(self)
|
||||
AltoTooltip:SetOwner(self, "ANCHOR_RIGHT");
|
||||
|
||||
AltoTooltip:AddDoubleLine(DS:GetColoredCharacterName(character), DS:GetColoredCharacterFaction(character))
|
||||
AltoTooltip:AddLine(format("%s %s |r%s %s", L["Level"],
|
||||
GREEN..DS:GetCharacterLevel(character), DS:GetCharacterRace(character), DS:GetCharacterClass(character)),1,1,1)
|
||||
AltoTooltip:AddLine(format("%s %s |r%s %s", L["Level"],
|
||||
GREEN..(DS:GetCharacterLevel(character) or 0), DS:GetCharacterRace(character) or "", DS:GetCharacterClass(character) or ""),1,1,1)
|
||||
|
||||
local zone, subZone = DS:GetLocation(character)
|
||||
AltoTooltip:AddLine(format("%s: %s |r(%s|r)", L["Zone"], GOLD..zone, GOLD..subZone),1,1,1)
|
||||
|
||||
AltoTooltip:AddLine(EXPERIENCE_COLON .. " "
|
||||
.. GREEN .. DS:GetXP(character) .. WHITE .. "/"
|
||||
.. GREEN .. DS:GetXPMax(character) .. WHITE .. " ("
|
||||
.. GREEN .. DS:GetXPRate(character) .. "%"
|
||||
.. WHITE .. ")",1,1,1);
|
||||
AltoTooltip:AddLine(format("%s: %s |r(%s|r)", L["Zone"], GOLD..(zone or "?"), GOLD..(subZone or "")),1,1,1)
|
||||
|
||||
AltoTooltip:AddLine(EXPERIENCE_COLON .. " "
|
||||
.. GREEN .. (DS:GetXP(character) or 0) .. WHITE .. "/"
|
||||
.. GREEN .. (DS:GetXPMax(character) or 0) .. WHITE .. " ("
|
||||
.. GREEN .. (DS:GetXPRate(character) or 0) .. "%"
|
||||
.. WHITE .. ")",1,1,1);
|
||||
|
||||
local restXP = DS:GetRestXP(character)
|
||||
if restXP and restXP > 0 then
|
||||
|
||||
Reference in New Issue
Block a user