Files
pfQuest/porting/pfQuest-turtle-map-scripts.patch

61 lines
2.9 KiB
Diff

diff --git patchtable.lua patchtable.lua
index 8139d2c..3448ac8 100644
--- patchtable.lua
+++ patchtable.lua
@@ -1,2 +1,6 @@
setfenv(1, pfQuestEnv) -- Initialize all static variables
+-- The companion can also run with an older core that stored its legacy getter on the widget.
+if not pfQuestGetFrameScript then
+ function pfQuestGetFrameScript(frame, name) return frame:GetScript(name) end
+end
local loc = GetLocale()
@@ -884,4 +888,4 @@ pfMap.UpdateNode = function(self, frame, node, color, obj, distance)
-- spawn pin rather than relying on the map-level click callback.
- if frame.spawnid and frame:GetScript("OnClick") ~= MinimapLootNodeClick then
- frame.lootPanelOriginalClick = frame:GetScript("OnClick")
+ if frame.spawnid and pfQuestGetFrameScript(frame, "OnClick") ~= MinimapLootNodeClick then
+ frame.lootPanelOriginalClick = pfQuestGetFrameScript(frame, "OnClick")
frame:SetScript("OnClick", MinimapLootNodeClick)
@@ -899,3 +903,3 @@ local function RebindUnitResultTooltips()
if not button.rankTooltipHooked then
- local originalOnEnter = button:GetScript("OnEnter")
+ local originalOnEnter = pfQuestGetFrameScript(button, "OnEnter")
button:SetScript("OnEnter", function()
@@ -921,3 +925,3 @@ end)
if pfBrowser and pfBrowser.input then
- local previous = pfBrowser.input:GetScript("OnTextChanged")
+ local previous = pfQuestGetFrameScript(pfBrowser.input, "OnTextChanged")
pfBrowser.input:SetScript("OnTextChanged", function()
diff --git pfQuest-config-resize.lua pfQuest-config-resize.lua
index cd6446d..95f2583 100644
--- pfQuest-config-resize.lua
+++ pfQuest-config-resize.lua
@@ -68,3 +68,3 @@ local function InstallConfigResize()
-- restores the user's saved size after any later rebuild.
- local previousOnShow = pfQuestConfig:GetScript("OnShow")
+ local previousOnShow = pfQuestGetFrameScript(pfQuestConfig, "OnShow")
pfQuestConfig:SetScript("OnShow", function()
diff --git pfQuest-nameplates.lua pfQuest-nameplates.lua
index 7b9777e..52259f6 100644
--- pfQuest-nameplates.lua
+++ pfQuest-nameplates.lua
@@ -510,3 +510,3 @@ local objectiveScan = CreateFrame("Frame")
local function QueueObjectiveScan()
- if objectiveScan:GetScript("OnUpdate") then return end
+ if pfQuestGetFrameScript(objectiveScan, "OnUpdate") then return end
objectiveScan.elapsed = 0
@@ -590,3 +590,3 @@ local function HookConfigWindow()
if pfQuestConfig then
- local originalOnHide = pfQuestConfig:GetScript("OnHide")
+ local originalOnHide = pfQuestGetFrameScript(pfQuestConfig, "OnHide")
pfQuestConfig:SetScript("OnHide", function()
diff --git pfquest-arrow.lua pfquest-arrow.lua
index 1390a23..41a1614 100644
--- pfquest-arrow.lua
+++ pfquest-arrow.lua
@@ -90,3 +90,3 @@ local corpseMessages = {
-local originalArrowOnUpdate = pfQuest.route.arrow:GetScript("OnUpdate")
+local originalArrowOnUpdate = pfQuestGetFrameScript(pfQuest.route.arrow, "OnUpdate")
local corpseMessage = ""