Hi,
im using the following code to override the micro menu button textures:
Lua Code:
local buttonIndex = {
[1] = "MainMenuMicroButton",
[2] = "CharacterMicroButton",
[3] = "SpellbookMicroButton",
[4] = "TalentMicroButton",
[5] = "AchievementMicroButton",
[6] = "QuestLogMicroButton",
[7] = "GuildMicroButton",
[8] = "LFDMicroButton",
[9] = "EJMicroButton",
[10] = "CollectionsMicroButton",
[11] = ((not C_StorePublic.IsEnabled()) and (GetCurrentRegionName() == "CN")) and "HelpMicroButton" or "StoreMicroButton",
[12] = (C_StorePublic.IsEnabled() and (GetCurrentRegionName() ~= "CN")) and "HelpMicroButton"
}
function MicroBlizzard:UpdateButtons()
TABLES:ForEach(_G.MICRO_BUTTONS, function(i, _)
local button = _G[buttonIndex[i]]
local db = self.db.profile.buttons.entries[buttonIndex[i]].texture
button:GetNormalTexture():SetTextureFromDb(db, CORE.VALUES.Button.States.Normal)
button:GetPushedTexture():SetTextureFromDb(db, CORE.VALUES.Button.States.Pushed)
if (button:GetDisabledTexture()) then
button:GetDisabledTexture():SetTextureFromDb(db, CORE.VALUES.Button.States.Disabled)
end
end)
end
local function SetTextureFromDb(frame, texture, type, relative)
if (frame and texture) then
if (type == CORE.VALUES.Button.States.Normal) then
frame:SetInside(relative, texture.normal.offset.x, texture.normal.offset.y);
frame:SetTexture(texture.normal.texture)
frame:SetVertexColor(COLORS:Unpack(texture.color.default))
elseif (type == CORE.VALUES.Button.States.Pushed) then
frame:SetInside(relative, texture.pushed.offset.x, texture.pushed.offset.y);
frame:SetTexture(texture.pushed.texture)
frame:SetVertexColor(COLORS:Unpack(texture.color.accent))
elseif (type == CORE.VALUES.Button.States.Highlight) then
frame:SetInside(relative, texture.highlight.offset.x, texture.highlight.offset.y);
frame:SetTexture(texture.highlight.texture)
frame:SetVertexColor(COLORS:Unpack(texture.color.accent))
elseif (type == CORE.VALUES.Button.States.Disabled) then
frame:SetInside(relative, texture.disabled.offset.x, texture.disabled.offset.y);
frame:SetTexture(texture.disabled.texture)
frame:SetVertexColor(COLORS:Unpack(texture.color.disabled))
end
end
end
This works for all buttons except the MainMenuMicroButton, See screenshot:
https://ibb.co/pWKHn1N
What is so special about the MainMenuMicroButton that it wont override the textures?