mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-21 03:40:49 +00:00
Utilizing ClassicAPI 1.6.0
commit d63057474083aa67fda2aa28ee6301334ffc4fdf Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon Jul 6 00:59:17 2026 -0500 Use C_Map.GetMapOverlays instead of hardcoded pfMapOverlayData ClassicAPI's C_Map.GetMapOverlays reads WorldMapOverlay.dbc directly and returns the full overlay list for a zone (explored + unexplored) — the data vanilla's GetMapOverlayInfo withholds. mapreveal now iterates it straight (named fields: textureName/texturePath/width/height/offsets), dropping unpack_hash and the pfMapOverlayData tables entirely. Also fixes the explored-check: it compared the full texture path against GetMapOverlayInfo's bare-name keys, so the magnifying glass never suppressed on explored overlays. Now matches on the bare name. Removes ~870 lines of hand-measured overlay data (base + Turtle). commit ad12c8209a80cd1211fe08e83f7013d24b5efd2d Author: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun Jul 5 23:45:09 2026 -0500 utilize HookScript from ClassicAPI
This commit is contained in:
-13
@@ -542,19 +542,6 @@ do -- create a scope so we don't have to worry about upvalue collisions
|
||||
end
|
||||
end
|
||||
|
||||
-- [ HookScript ]
|
||||
-- Securely post-hooks a script handler.
|
||||
-- 'f' [frame] the frame which needs a hook
|
||||
-- 'script' [string] the handler to hook
|
||||
-- 'func' [function] the function that should be added
|
||||
function HookScript(f, script, func)
|
||||
local prev = f:GetScript(script)
|
||||
f:SetScript(script, function(a1,a2,a3,a4,a5,a6,a7,a8,a9)
|
||||
if prev then prev(a1,a2,a3,a4,a5,a6,a7,a8,a9) end
|
||||
func(a1,a2,a3,a4,a5,a6,a7,a8,a9)
|
||||
end)
|
||||
end
|
||||
|
||||
-- [ HookAddonOrVariable ]
|
||||
-- Sets a function to be called automatically once an addon gets loaded
|
||||
-- 'addon' [string] addon or variable name
|
||||
|
||||
+3
-5
@@ -569,7 +569,7 @@ end
|
||||
-- 'frame' [frame] the modelframe that should be used
|
||||
function pfUI.api.EnableClickRotate(frame)
|
||||
frame:EnableMouse(true)
|
||||
HookScript(frame, "OnUpdate", function()
|
||||
frame:HookScript("OnUpdate", function()
|
||||
if this.rotate then
|
||||
local x,_ = GetCursorPosition()
|
||||
if this.curx > x then
|
||||
@@ -582,14 +582,14 @@ function pfUI.api.EnableClickRotate(frame)
|
||||
end
|
||||
end)
|
||||
|
||||
HookScript(frame, "OnMouseDown", function()
|
||||
frame:HookScript("OnMouseDown", function()
|
||||
if arg1 == "LeftButton" then
|
||||
this.rotate = true
|
||||
this.curx, this.cury = GetCursorPosition()
|
||||
end
|
||||
end)
|
||||
|
||||
HookScript(frame, "OnMouseUp", function()
|
||||
frame:HookScript("OnMouseUp", function()
|
||||
this.rotate, this.curx, this.cury = nil, nil, nil
|
||||
end)
|
||||
end
|
||||
@@ -615,7 +615,6 @@ function pfUI.api.SetHighlight(frame, cr, cg, cb)
|
||||
frame.rr, frame.rg, frame.rb, frame.ra = GetStringColor(pfUI_config.appearance.border.color)
|
||||
|
||||
if not frame.pfEnterLeave then
|
||||
if not frame.HookScript then frame.HookScript = HookScript end
|
||||
local enter, leave = frame:GetScript("OnEnter"), frame:GetScript("OnLeave")
|
||||
|
||||
if enter then
|
||||
@@ -844,7 +843,6 @@ function pfUI.api.SkinScrollbar(frame, always)
|
||||
-- always show parent frame
|
||||
if always then
|
||||
RunOOC(function()
|
||||
if not parent.HookScript then parent.HookScript = HookScript end
|
||||
parent:HookScript("OnHide", function() this:Show() end)
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user