Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonaza committed Aug 11, 2016
2 parents cdc00fc + 63e76ff commit ee4d54d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.5
* Clamp drop down menu within screen area.
* Fixed experience bar for when expansion releases (to work without relogin or reload, obviously untested though).

## 2.0.4
* Fixed bug with experience module when reaching level cap.

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.0.4
## Version: 2.0.5
## OptionalDeps: Ace3
## SavedVariables: ExperiencerDB, ExperiencerDB_module_experience, ExperiencerDB_module_reputation, ExperiencerDB_module_artifact, ExperiencerDB_module_honor

Expand Down
1 change: 1 addition & 0 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ function Addon:OpenContextMenu(anchorFrame)

DropDownList1:ClearAllPoints();
DropDownList1:SetPoint(point, anchorFrame, relativePoint, mouseX / scale - GetScreenWidth() / 2, 5 * sign);
DropDownList1:SetClampedToScreen(true);
end

function Experiencer_OnEnter(self)
Expand Down
15 changes: 14 additions & 1 deletion modules/experience.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ function module:Initialize()
self:RegisterEvent("UNIT_INVENTORY_CHANGED");
self:RegisterEvent("QUEST_LOG_UPDATE");

self:RegisterEvent("UPDATE_EXPANSION_LEVEL");

module.playerCanLevel = not module:IsPlayerMaxLevel();

module:RestoreSession();
end

Expand Down Expand Up @@ -382,7 +386,7 @@ function module:ResetSession()
end

function module:IsPlayerMaxLevel(level)
return MAX_PLAYER_LEVEL == (level or UnitLevel("player"));
return MAX_PLAYER_LEVEL_TABLE[GetExpansionLevel()] == (level or UnitLevel("player"));
end

function module:CalculateHourlyXP()
Expand Down Expand Up @@ -522,6 +526,13 @@ function module:CalculateQuestLogXP()
return completeXP * multiplier, incompleteXP * multiplier, (completeXP + incompleteXP) * multiplier;
end

function module:UPDATE_EXPANSION_LEVEL()
if(not playerCanLevel and not module:IsPlayerMaxLevel()) then
DEFAULT_CHAT_FRAME:AddMessage(("|cfffaad07Experiencer|r %s"):format("Expansion level upgraded, you are able to gain experience again."));
end
module.playerCanLevel = not module:IsPlayerMaxLevel();
end

function module:QUEST_LOG_UPDATE()
Addon:UpdateText();
end
Expand Down Expand Up @@ -606,4 +617,6 @@ function module:PLAYER_LEVEL_UP(event, level)
local remaining_xp = module.session.MaxXP - UnitXP("player");
module.session.QuestsToLevel = ceil(remaining_xp / module.session.AverageQuestXP) - 1;
end

module.playerCanLevel = not module:IsPlayerMaxLevel(level);
end

0 comments on commit ee4d54d

Please sign in to comment.