ArkInventory overlay broken after update
When ArkInventory updated to 8.0 they changed how their item frames were created which broke our overlay.
Curseforge ticket: https://wow.curseforge.com/projects/can-i-mog-it/issues/175
vincentSDSH on Jul 22, 2018
Using the 8.x versions of ArkInventory, CanIMogIt's icons are not displayed unless the bank or guild bank is opened.
CIMI_ArkInventoryAddFrame() is triggered from "PLAYER_LOGIN", "BANKFRAME_OPENED", and "GUILDBANKFRAME_OPENED" however ArkInventory's itemobjects do not seem to be built at PLAYER_LOGIN (except for the first item in each bag) until ArkInventory is first opened.
I created a workaround to call CIMI_ArkInventoryAddFrame() when the ArkInventory frame is shown, it's excessive but it seems to work reliably in the interim.
joevt on Jul 23, 2018
ArkInventory now has its own Transmog icons, but I prefer those used by Can I Mog It? and ALL THE THINGS.
ArkInventory -> Config -> Settings -> Designs -> Default - Bag -> Items -> Status Icons -> Transmogrify -> Enabled.
Maybe instead of the current method used by CanIMogIt's arkinventory plugin, it could modify functions in ArkInventory to do the drawing (if that were more efficient/performant).
seclipse99
same issue here, i prefers can i mog it icons to arks and even if i disable arks icons can i mog its will not show. this just ahppened recently as ive been using these two for months without issue
vincentSDSH
Here's my quick-and-dirty-solution should anyone want to try it before AmiYuy and company find a better solution
function CIMI_ArkInventoryAddFrame(event) if event == "PLAYER_LOGIN" then -- MouseUI Workaround for lazyloading in ArkInventory local frame = ArkInventory.Frame_Main_Get( ArkInventory.Const.Location.Bag ) hooksecurefunc(frame, "Show", function() if not frame.faux_CIMI_PLAYER_LOGIN_RUN then CIMI_ArkInventoryAddFrame("BANKFRAME_OPENED") frame.faux_CIMI_PLAYER_LOGIN_RUN = true end end) end
Arkayenro
the reason its no longer working is probably because i no longer to pre-build 50 of the item frames for each bag to get around loading while in-combat issues, they get created as required now. if youre in-combat then a temporary frame is created, and replaced once you leave combat.
secure hook the
ArkInventory.Frame_Item_OnLoad
functionits called when i need to create a new item frame, regardless of location so its the safest way to ensure whatever you need gets added to every item
function args are ( frame, tainted )
frame is the item frame
tainted is a boolean. if true dont do anything as the frame was created in combat (thus tainted) and is only temporary, it will get replaced when out of combat, if its false then do what you need to do
note: when displaying the icons you should probably check if the location being displayed is offline or not in arkinventory as youre using bag/slot ids which wont work when AI is displaying another characters data.
Arkayenro
i think this should work, but not sure as i dont use mogit
replace existing lines with these where they overlap, the rest of the code underneath this probably doesnt need to be changed (its not the best way to do it but it works so im not touching it)
the event functions section only has one change, the second line is commented out, thats it
---------------------------- -- UpdateIcon functions -- ---------------------------- function ArkInventoryItemButton_CIMIUpdateIcon(self) if not self or not self:GetParent() then return end local frame = self:GetParent( ) if not frame.ARK_Data then return end if not CIMI_CheckOverlayIconEnabled(self) then self.CIMIIconTexture:SetShown(false) self:SetScript("OnUpdate", nil) return end local h, sb, bag, slot if ArkInventory.Global.Location[frame.ARK_Data.loc_id].isOffline then local i = ArkInventory.Frame_Item_GetDB(frame) h = i.h else bag = self.ARK_Data.blizzard_id slot = self.ARK_Data.slot_id end CIMI_SetIcon(self, ArkInventoryItemButton_CIMIUpdateIcon, CanIMogIt:GetTooltipText(h, bag, slot)) end ---------------------------- -- Begin adding to frames -- ---------------------------- function CIMI_ArkInventoryAddFrame(frame,tainted) if not tainted then -- Add to frames CIMI_AddToFrame(frame, ArkInventoryItemButton_CIMIUpdateIcon) end end hooksecurefunc(ArkInventory, "Frame_Item_OnLoad", CIMI_ArkInventoryAddFrame) ------------------------ -- Event functions -- ------------------------ function CIMI_ArkInventoryUpdate() -- Make sure all CIMI frames exist --CIMI_ArkInventoryAddFrame(nil, "BANKFRAME_OPENED") -- Bags for i=1,NUM_CONTAINER_FRAMES do for j=1,MAX_CONTAINER_ITEMS do
Calesta
Thanks @Arkayenro for the reply! Hopefully the author or one of the maintainers will see it and update accordingly!