View Single Post
08/31/23, 05:18 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,000
Originally Posted by Calamath View Post
I'm writing this after giving up coffee before the start of work.
I think you have to create a top level control and make the texture control its child.
Yes, I'm pretty sure this needs to be done here.
Without a TLC the controls do not properly show, at least not at the GuiRoot!

But it would show if you do not anchor it to GuiRoot but some other existing control of the UI, like Inventory or similar.


So use
Lua Code:
  1. CreateTopLevelWindow("YourUniqueAddonNameTLC")
It will automatically anchor to the GuiRoot.

And then anchor your texture control to YourUniqueAddonNameTLC, instead of GuiRoot
Remember to use YourUniqueAddonNameTLC:SetHidden(false) too, if needed.
The hidden state of the child controls, like your texture, will reflect the same state as the TLC (if you do not manually change it).


btw: Don't forget, in your function addon.OnAddOnLoaded(event, loadedAddonName), to unregister the event EVENT_ADD_ON_LOADED again once your addon was loaded! Else that function addon.OnAddOnLoaded will be run again and again for each next addon loaded, where there is no need to do so anymore (as that event will be executed for each addon loaded once -> that's why you compare the addonName with the parameter to detect YOUR CURRENT addon loading).


And the current APIVersion is 101039, not 101036.
It does nothing else than show you ingame "You got outdated addons" warning once after a patch, and at the addon manager it will show as outdated then if your txt (manifest) APIVersion does not match the current version.
But you should keep it updated if you create new addons or update your addons ;-)

You can get the current API version by API function GetAPIVersion() ingame.
You can use a tool addon like "merTorchbug updated" to run such functions via /tb GetAPIVersion() and see the result in chat.
torchbug is also greatt o inspect cotrols below the mouse cursor via /tbm and see it's anchors, width, height -> and even change that in the torchbug UI.
zgoo would be another tool one could use to inspect those variables and controls.

Else you would need to run it manually via /script command and to see the output use d() debug function around it like this:
/script d(GetAPIVersion())

Last edited by Baertram : 08/31/23 at 05:27 AM.
  Reply With Quote