mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 20:20:01 +00:00
unitframes: add 40y-rangecheck
This commit is contained in:
@@ -864,6 +864,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Portrait Alpha", C.unitframes, "portraitalpha")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable 2D Portraits As Fallback", C.unitframes, "portraittexture", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Unit Frame Layout", C.unitframes, "layout", "dropdown", { "default", "tukui" })
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Aggressive 40y-Range Check (Will break stuff)", C.unitframes, "rangecheck", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "40y-Range Check Interval", C.unitframes, "rangechecki")
|
||||
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Buff- And Debuff Indicators", nil, nil, "header")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Show Hots as Buff Indicators", C.unitframes, "show_hots", "checkbox")
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
pfUI:RegisterModule("rangecheck", function ()
|
||||
local _,class = UnitClass("player")
|
||||
|
||||
if C.unitframes.rangecheck == "0" then return end
|
||||
|
||||
pfUI.rangecheck = CreateFrame("Frame", "pfRangecheck", UIParent)
|
||||
pfUI.rangecheck.scanner = CreateFrame("GameTooltip", "pfRangecheckScanner", UIParent, "GameTooltipTemplate")
|
||||
pfUI.rangecheck.scanner:SetOwner(pfUI.rangecheck, "ANCHOR_NONE")
|
||||
|
||||
pfUI.rangecheck.slot = nil
|
||||
pfUI.rangecheck.interval = C.unitframes.rangechecki
|
||||
|
||||
pfUI.rangecheck:RegisterEvent("ACTIONBAR_SLOT_CHANGED")
|
||||
pfUI.rangecheck:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.rangecheck:SetScript("OnEvent", function()
|
||||
pfUI.rangecheck.slot = nil
|
||||
|
||||
for i=1,120 do
|
||||
if pfUI.rangecheck.slot then return end
|
||||
|
||||
pfUI.rangecheck.scanner:ClearLines()
|
||||
pfUI.rangecheck.scanner:SetAction(i)
|
||||
|
||||
if pfRangecheckScannerTextLeft1 and pfRangecheckScannerTextLeft1:GetText() then
|
||||
if pfRangecheckScannerTextLeft1:GetText() == L["rangecheck"][class] then
|
||||
pfUI.rangecheck.slot = i
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user