Skip to content

Commit

Permalink
support for xp menu on right-click
Browse files Browse the repository at this point in the history
  • Loading branch information
bkader committed Apr 19, 2022
1 parent 1ccba7e commit 9b8bd83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dominos/Dominos.toc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Version: 1.18.7
## SavedVariables: DominosDB, DominosVersion
## OptionalDeps: Ace3, LibKeyBound-1.0, ButtonFacade
## X-Date: 2022-01-25 @ 12:44 AM |cff808080UTC|r
## X-Date: 2022-04-19 @ 04:16 PM |cff808080UTC|r

libs\_load.xml
locales\_load.xml
Expand Down
14 changes: 11 additions & 3 deletions Dominos/modules/xpBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ function XP:Load()
self:UpdateTextShown()
end

local wfxf = nil -- frostmourne specific
local wflv = UnitLevel("player")
function XP:OnClick(button)
if button == "RightButton" and _G.FFF_ReputationWatchBar_OnClick then
self:SetAlwaysShowXP(false)
FFF_ReputationWatchBar_OnClick(self, button)
if button == "RightButton" then
wfxf = _G.MainMenuExpBar and _G.MainMenuExpBar:GetScript("OnMouseDown")
if wfxf and not IsModifierKeyDown() and wflv < 80 then
wfxf(_G.MainMenuExpBar, button)
elseif (not wfxf or IsModifierKeyDown()) and _G.FFF_ReputationWatchBar_OnClick then
self:SetAlwaysShowXP(false)
FFF_ReputationWatchBar_OnClick(self, button)
end
else
self:SetAlwaysShowXP(not self.sets.alwaysShowXP)
self:OnEnter()
Expand Down Expand Up @@ -172,6 +179,7 @@ function XP:UpdateExperience()
local value = UnitXP("player")
local max = UnitXPMax("player")
local pct = math.floor((value / math.max(max, 1)) * 100 + 0.5)
wflv = UnitLevel("player")

self.value:SetMinMaxValues(0, max)
self.value:SetValue(value)
Expand Down

0 comments on commit 9b8bd83

Please sign in to comment.