Conflict between Auctionator and Can I Mog It?
Kurisu68 opened this issue ยท 2 comments
Greetings! On their own, no conflict or noticeable issues with either Can I mog it or Auctionator. When only those two are loaded (no other addons), I get the following (have also opened a ticket for this to Can I Mog It):
Message: Interface/AddOns/CanIMogIt/Plugins/auctionator.lua:75: attempt to index field 'ScrollFrame' (a nil value)
Time: Tue Nov 8 22:44:58 2022
Count: 27
Stack: Interface/AddOns/CanIMogIt/Plugins/auctionator.lua:75: attempt to index field 'ScrollFrame' (a nil value)
[string "@Interface/AddOns/CanIMogIt/Plugins/auctionator.lua"]:75: in function <Interface/AddOns/CanIMogIt/Plugins/auctionator.lua:72>
Locals: (*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field 'ScrollFrame' (a nil value)"
This is an issue that needs fixing in Can I Mog It. This change will fix CIMI (give it to whoever manages the addon and they'll be able to add it):
diff --git a/Plugins/auctionator.lua b/Plugins/auctionator.lua
index 6e9a45c..3fe1988 100644
--- a/Plugins/auctionator.lua
+++ b/Plugins/auctionator.lua
@@ -65,69 +65,29 @@ if IsAddOnLoaded("Auctionator") then
end
end
- ------------------------
- -- Function hooks --
- ------------------------
-
- function AuctionatorFrame_CIMIOnValueChanged()
- -- Some other addons *coughTSMcough* prevent this frame from loading.
- if _G["AuctionatorShoppingFrame"] == nil then return end
- local buttons = _G["AuctionatorShoppingFrame"].ResultsListing.ScrollFrame.buttons
- if buttons == nil then
- return
- end
-
- for i, button in pairs(buttons) do
- -- This has a timer because it seems to have a race condition with the updating
- -- scroll frames.
- C_Timer.After(.1, function() AuctionatorFrame_CIMIUpdateIcon(button.CanIMogItOverlay) end)
- end
- end
-
----------------------------
-- Begin adding to frames --
----------------------------
- local function HookOverlayAuctionator(event)
- if event ~= "AUCTION_HOUSE_SHOW" then return end
+ local function HookOverlayAuctionator(event, ...)
+ local panelType = ...
+ if event ~= "PLAYER_INTERACTION_MANAGER_FRAME_SHOW" or panelType ~= Enum.PlayerInteractionType.Auctioneer then return end
-- Some other addons *coughTSMcough* prevent this frame from loading.
if _G["AuctionatorShoppingFrame"] == nil then return end
- -- Add hook for the Auction House frames.
- local buttons = _G["AuctionatorShoppingFrame"].ResultsListing.ScrollFrame.buttons
- if buttons == nil then
- return
- end
- for i, button in pairs(buttons) do
- local frame = button
- frame.CIMI_index = i
- if frame then
- CIMI_AddToFrame(frame, AuctionatorFrame_CIMIUpdateIcon, "AuctionatorShoppingList"..i, "AUCTIONATOR")
- end
- end
- local scrollBar = _G["AuctionatorShoppingFrame"].ResultsListing.ScrollFrame.scrollBar
- scrollBar:HookScript("OnValueChanged", AuctionatorFrame_CIMIOnValueChanged)
-
- -- This GetChildren returns an _unpacked_ value for some reason, so we have to pack it in a table.
- local headers = {AuctionatorShoppingFrame.ResultsListing.HeaderContainer:GetChildren()}
- for i, header in ipairs(headers) do
- header:HookScript("OnClick", AuctionatorFrame_CIMIOnValueChanged)
- end
+ local index = 0
+ AuctionatorShoppingFrame.ResultsListing.ScrollArea.ScrollBox:GetView():RegisterCallback(ScrollBoxListViewMixin.Event.OnAcquiredFrame, function(_, frame, elementData, new)
+ if new then
+ index = index + 1
+ CIMI_AddToFrame(frame, function() end, "AuctionatorShoppingList"..index, "AUCTIONATOR")
+ hooksecurefunc(frame, "Populate", function(frame)
+ AuctionatorFrame_CIMIUpdateIcon(frame.CanIMogItOverlay)
+ end)
+ end
+ end)
end
CanIMogIt.frame:AddEventFunction(HookOverlayAuctionator)
- ------------------------
- -- Event functions --
- ------------------------
-
- local function AuctionatorUpdateEvents(event, ...)
- if event ~= "AUCTION_HOUSE_NEW_RESULTS_RECEIVED" then return end
- C_Timer.After(.1, AuctionatorFrame_CIMIOnValueChanged)
- end
-
- CanIMogIt.frame:AddEventFunction(AuctionatorUpdateEvents)
-
-
end
diff --git a/options.lua b/options.lua
index ac94582..7180554 100644
--- a/options.lua
+++ b/options.lua
@@ -116,6 +116,7 @@ local EVENTS = {
"TRANSMOG_COLLECTION_UPDATED",
"PLAYER_LOGIN",
"AUCTION_HOUSE_SHOW",
+ "PLAYER_INTERACTION_MANAGER_FRAME_SHOW",
"AUCTION_HOUSE_BROWSE_RESULTS_UPDATED",
"AUCTION_HOUSE_NEW_RESULTS_RECEIVED",
"GET_ITEM_INFO_RECEIVED",