Skip to content

Commit

Permalink
Fixed artifact module text with overloaded artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonaza committed Jun 27, 2018
1 parent 8f46987 commit 90abaa0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.4.1
* Fixed artifact module text with overloaded artifacts.

## 2.4.0
* TOC bump for patch 7.3.0.
* Updated artifact module to support tallying Artifact Power tokens that reward billions of AP. Support is lacking for Spanish and Russian localizations (and the rest are Google translated and may be incorrect anyway).
Expand Down
2 changes: 1 addition & 1 deletion Experiencer.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Experiencer
## Notes: Simple and Advanced Experience and Reputation Progress Bar
## Author: Sonaza
## Version: 2.4.0
## Version: 2.4.1
## OptionalDeps: Ace3
## SavedVariables: ExperiencerDB, ExperiencerDB_module_experience, ExperiencerDB_module_reputation, ExperiencerDB_module_artifact, ExperiencerDB_module_honor

Expand Down
59 changes: 39 additions & 20 deletions modules/artifact.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,19 @@ function module:GetText()
local progress = artifactXP / (xpForNextPoint > 0 and xpForNextPoint or 1);
local progressColor = Addon:GetProgressColor(progress);

local currentPoints = pointsSpent + numPoints;

tinsert(primaryText,
("|cffffecB3%s|r (Rank %d):"):format(name, pointsSpent + numPoints)
("|cffffecB3%s|r (Rank %d):"):format(name, currentPoints)
);

if(currentPoints >= 126) then
tinsert(primaryText,
"|cff00ff00Overloaded!|r"
);
return table.concat(primaryText, " "), table.concat(secondaryText, " ");
end

if(self.db.global.ShowRemaining) then
tinsert(primaryText,
("%s%s|r (%s%.1f|r%%)"):format(progressColor, module:FormatNumber(remaining), progressColor, 100 - progress * 100)
Expand Down Expand Up @@ -189,24 +198,28 @@ function module:GetChatMessage()
local remaining = xpForNextPoint - artifactXP;
local progress = artifactXP / (xpForNextPoint > 0 and xpForNextPoint or 1);

local currentPoints = pointsSpent + numPoints;

tinsert(outputText, ("%s is currently rank %s"):format(
name,
pointsSpent + numPoints
currentPoints
));

if(pointsSpent > 0) then
tinsert(outputText, ("at %s/%s power (%.1f%%) with %s to go"):format(
module:FormatNumber(artifactXP),
module:FormatNumber(xpForNextPoint),
progress * 100,
module:FormatNumber(remaining)
));
end

if(self.db.global.UnspentInChatMessage and numPoints > 0) then
tinsert(outputText,
(" (%d unspent point%s)"):format(numPoints, numPoints == 1 and "" or "s")
);
if(currentPoints < 126) then
if(pointsSpent > 0) then
tinsert(outputText, ("at %s/%s power (%.1f%%) with %s to go"):format(
module:FormatNumber(artifactXP),
module:FormatNumber(xpForNextPoint),
progress * 100,
module:FormatNumber(remaining)
));
end

if(self.db.global.UnspentInChatMessage and numPoints > 0) then
tinsert(outputText,
(" (%d unspent point%s)"):format(numPoints, numPoints == 1 and "" or "s")
);
end
end

return table.concat(outputText, " ");
Expand All @@ -229,12 +242,18 @@ function module:GetBarData()
data.id = itemID;

data.level = pointsSpent + numPoints or 0;
data.max = xpForNextPoint;
data.current = artifactXP;

if(self.db.global.VisualizeBagArtifactPower) then
local totalPower = module:FindPowerItemsInInventory();
data.visual = totalPower;
if(data.level < 126) then
data.max = xpForNextPoint;
data.current = artifactXP;

if(self.db.global.VisualizeBagArtifactPower) then
local totalPower = module:FindPowerItemsInInventory();
data.visual = totalPower;
end
else
data.max = 1
data.current = 1
end
end

Expand Down

0 comments on commit 90abaa0

Please sign in to comment.