Thread Tools Display Modes
10-28-23, 09:38 AM   #1
Tair
A Deviate Faerie Dragon
Join Date: Aug 2020
Posts: 10
Hook to resize the CollectionsJournal frame

I am working on a simple addon to resize certain Blizzard frames to compensate for ElvUI's low recommended UI scale on my monitor.

I have found that certain frames need to be resized at the time of their opening, otherwise the frame appears to be inaccessible or otherwise resets its scale. The backpack, as an example:
Code:
hooksecurefunc("OpenBackpack", function()
	ContainerFrameCombinedBags:SetScale(scale)
end)
However, I am stuck on trying to set the scale of the collections journal using a similar approach:

Code:
hooksecurefunc("CollectionsJournal_OnShow", function()
	CollectionsJournal:SetScale(scale)
end)
This returns an error: hooksecurefunc(): CollectionsJournal_OnShow is not a function

I've confirmed that the function exists in Blizzard_Collections.lua, but I'm wondering if it's maybe inaccessible.

Any tips would be greatly appreciated. Thank you for reading.
  Reply With Quote
10-28-23, 10:17 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
The Blizzard_Collections is marked as LoadOnDemand (see the Blizzard_Collections.toc file) which means it's not loaded along with the core UI before 3rd party addons (usually loads in response to the player pressing a key or clicking a button).

Your addon will need to listen for the ADDON_LOADED event and check if "Blizzard_Collections" is the addon and if so, then set up your hooks.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-28-23, 10:44 AM   #3
Tair
A Deviate Faerie Dragon
Join Date: Aug 2020
Posts: 10
Thank you very much, Fizzlemizz. You taught me something new and helped me solve my problem. I appreciate your help and insight!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Hook to resize the CollectionsJournal frame


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off