Skip to content

Conversation

@opicron
Copy link

@opicron opicron commented Jan 11, 2026

I added code to allow for Masque button support. I'd love to be able to style my buttons ^^. Surely most of you alll have the same feeling. Hopefully you'll accept my PR.

This is the Masque addon: https://github.com/bkader/Masque-WoTLK

image image

@opicron
Copy link
Author

opicron commented Feb 1, 2026

I fixed the lint errors, would you mind pulling the PR?
Edit: NOW its fixed

@opicron
Copy link
Author

opicron commented Feb 3, 2026

Apologies for multiple failing lint commits. Im sure its correct now.

@Wishmaster117
Copy link
Owner

Apologies for multiple failing lint commits. Im sure its correct now.

Hi thanks for this PR.
The overall Masque integration is in good shape and should be safe. However, there’s one edge case: if Masque loads after MultiBot, existing buttons aren’t registered because registration is gated by IsLoaded and no late init hook exists. I suggest registering buttons even when Masque is not yet loaded and initializing when the Masque addon loads.

Current code:

-- Register a button with Masque
function MultiBot.RegisterButtonWithMasque(button)
	if not MultiBot.Masque.IsLoaded then
		MultiBot.InitializeMasque()
	end

	if not MultiBot.Masque.IsLoaded or not button then return end

	-- Store button reference
	MultiBot.Masque.Buttons[button] = true

	-- Add to Masque group if available
	if MultiBot.Masque.Group and button.icon then
		MultiBot.Masque.Group:AddButton(button, {
			Icon = button.icon,
			Normal = button:GetNormalTexture(),
			Pushed = button:GetPushedTexture(),
			Highlight = button:GetHighlightTexture(),
			Border = button.border
		})
	end
end

What do you think to do it like this?:

-- Register a button with Masque
function MultiBot.RegisterButtonWithMasque(button)
	if not button then return end

	-- Store button reference (even if Masque is not loaded yet)
	MultiBot.Masque.Buttons[button] = true

	if not MultiBot.Masque.IsLoaded then
		MultiBot.InitializeMasque()
	end

	if not MultiBot.Masque.IsLoaded then return end

	-- Add to Masque group if available
	if MultiBot.Masque.Group and button.icon then
		MultiBot.Masque.Group:AddButton(button, {
			Icon = button.icon,
			Normal = button:GetNormalTexture(),
			Pushed = button:GetPushedTexture(),
			Highlight = button:GetHighlightTexture(),
			Border = button.border
		})
	end
end

This ensures buttons are tracked even if Masque loads after MultiBot. Otherwise, the late-loaded Masque won’t skin already-created buttons.

In Core/MultiBotHandler.lua

Current code

if(event == "ADDON_LOADED" and arg1 == "MultiBot") then
    -- [...]
    -- Initialize Masque support
    if MultiBot.InitializeMasque then MultiBot.InitializeMasque() end
    -- [...]
end

What do you think to do it like this?:

if(event == "ADDON_LOADED" and arg1 == "Masque") then
	if MultiBot.InitializeMasque then MultiBot.InitializeMasque() end
end
if(event == "ADDON_LOADED" and arg1 == "MultiBot") then
    -- [...]
    -- Initialize Masque support
    if MultiBot.InitializeMasque then MultiBot.InitializeMasque() end
    -- [...]
end

If Masque is loaded after MultiBot, we need a hook to trigger initialization and apply the skin to already-created buttons.

@opicron
Copy link
Author

opicron commented Feb 3, 2026

I never considered that, nice fail save!

@opicron
Copy link
Author

opicron commented Feb 7, 2026

@Wishmaster117 I added your solution to the PR

@Wishmaster117
Copy link
Owner

@Wishmaster117 I added your solution to the PR

Hi sorry to be so long but I'm working in 3 projects lol, i try to test that tomorrow and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants