Foereaper / Eluna-AIO-StoreSystem

48 stars 40 forks source link

Question: Is there a way to reskin this button so that it matches the other ElvUI buttons? #6

Closed Aldori15 closed 6 months ago

Aldori15 commented 7 months ago

Screenshot speaks for itself. I use ElvUI as the UI overhaul and was wondering if you knew how to make it so that this button matches or inherits the ElvUI button properties?

image

Foereaper commented 6 months ago

https://github.com/Foereaper/Eluna-AIO-StoreSystem/blob/ea60eee3ed9f3d0cdbb04e432eca1472aef2249e/Server/Store_System/Store_Client.lua#L1189

You'd have to change this so the button has a proper identifier in the global namespace, then change elvUI to know that this button should be reskinned as well.

Aldori15 commented 6 months ago

Not sure if I'm understanding. So I've updated line 1189 by removing the local identifier and then changing nil to "StoreButton". image

Then in Elvui I'm trying to use the identifier. But the problem is when I try typing "StoreButton" on the Elvui one, it doesn't seem to recognize or try to populate it. I assume i'm not referencing it properly? image

Foereaper commented 6 months ago

It could be a call order issue, ie. the button not existing when ElvUI tries to reskin the buttons. Add a print in both functions and check which gets called first. I reckon ElvUI gets called first.

Aldori15 commented 6 months ago

Added both print statements and ElvUI definitely gets called first.

image

Foereaper commented 6 months ago

So yeah, the reskinning happens before the button even exists. You'll have to figure out how to call the re-skinning function then and call that after the store has been loaded.

Aldori15 commented 6 months ago

Just need to adjust some minor formatting but was able to get it working. Thanks for all of your help! :)

image