Klixxx / ElvUI_AdiBags

This is a modified version of AdiBags to make it look like ElvUI again!
17 stars 17 forks source link

Close button isn't skinned properly #1

Closed Meivyn closed 5 years ago

Meivyn commented 5 years ago

Basically, ElvUI's skin function is like:

function S:HandleCloseButton(f, point)
    f:StripTextures()

    if not f.Texture then
        f.Texture = f:CreateTexture(nil, 'OVERLAY')
        f.Texture:Point("CENTER")
        f.Texture:SetTexture(E.Media.Textures.Close)
        f.Texture:Size(12, 12)
        f:HookScript('OnEnter', handleCloseButtonOnEnter)
        f:HookScript('OnLeave', handleCloseButtonOnLeave)
        f:SetHitRectInsets(6, 6, 7, 7)
    end

    if point then
        f:Point("TOPRIGHT", point, "TOPRIGHT", 2, 2)
    end
end

And to skin it, you do:

ElvUI[1]:GetModule("Skins"):HandleCloseButton(self.CloseButton) -- ElvUI Mod!

And this is just running f:StripTextures() because f.Texture already exists, but I can't tell where it's handled, maybe when you are skinning the whole frame.

To fix it, just remove that line from the code.

Meivyn commented 5 years ago

Nevermind, it was an issue created with my personal attempt to skin AdiBags which conflicted with yours.

Klixxx commented 5 years ago

Awesome! Im glad it worked, ye that line is the only thing you need to write to skin the closebutton, elvui api will take care of the rest :)