-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hunterbar: add range based auto paging
- Loading branch information
Showing
10 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
pfUI:RegisterModule("hunterbar", function () | ||
local _,class = UnitClass("player") | ||
if class ~= "HUNTER" or pfUI_config.bars.hunterbar == "0" then return end | ||
|
||
pfUI.hunterbar = CreateFrame("Frame", "pfHunterBar", UIParent) | ||
pfUI.hunterbar.scanner = CreateFrame("GameTooltip", "pfHunterBarScanner", UIParent, "GameTooltipTemplate") | ||
pfUI.hunterbar.scanner:SetOwner(pfUI.hunterbar, "ANCHOR_NONE") | ||
|
||
pfUI.hunterbar.melee = nil | ||
pfUI.hunterbar.ranged = nil | ||
pfUI.hunterbar.current = 1 | ||
|
||
pfUI.hunterbar:RegisterEvent("ACTIONBAR_SLOT_CHANGED") | ||
pfUI.hunterbar:RegisterEvent("PLAYER_ENTERING_WORLD") | ||
pfUI.hunterbar:SetScript("OnEvent", function() | ||
for i=1,120 do | ||
if pfUI.hunterbar.melee and pfUI.hunterbar.ranged then return end | ||
|
||
pfUI.hunterbar.scanner:ClearLines() | ||
pfUI.hunterbar.scanner:SetAction(i) | ||
if pfHunterBarScannerTextLeft1 then | ||
if pfHunterBarScannerTextLeft1:GetText() == pfLocaleHunterbars[pfUI.cache["locale"]]["MELEE"] then | ||
pfUI.hunterbar.melee = i | ||
elseif pfHunterBarScannerTextLeft1:GetText() == pfLocaleHunterbars[pfUI.cache["locale"]]["RANGED"] then | ||
pfUI.hunterbar.ranged = i | ||
end | ||
end | ||
end | ||
end) | ||
|
||
pfUI.hunterbar:SetScript("OnUpdate", function() | ||
if not pfUI.hunterbar.melee or not pfUI.hunterbar.ranged then return end | ||
|
||
if IsActionInRange(pfUI.hunterbar.melee) == 1 and IsActionInRange(pfUI.hunterbar.ranged) == 0 then | ||
if pfUI.hunterbar.current ~= 0 then | ||
CURRENT_ACTIONBAR_PAGE = 9 | ||
ChangeActionBarPage() | ||
pfUI.hunterbar.current = 0 | ||
end | ||
else | ||
if pfUI.hunterbar.current ~= 1 then | ||
CURRENT_ACTIONBAR_PAGE = 1 | ||
ChangeActionBarPage() | ||
pfUI.hunterbar.current = 1 | ||
end | ||
end | ||
end) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters