Keybinding can't be changed via lua edit
Jeirs opened this issue ยท 5 comments
Just generally towards the end of the file (or even in a separate addon that's dependent on Dominos). I think the call should actually be:
hooksecurefunc(Dominos.BindableButton, "AddQuickBindingSupport", function(self, button)
button.HotKey:SetFont("Fonts\\FRIZQT__.ttf", 18, "OUTLINE")
end)
Originally posted by @Tuller in #463 (comment)
Thank you Tuller for updating Dominos.
I am re-opening this issue as the previous code snippet is not working anymore. I guess Dragonflight got some changes or something.
I don't know if this is still an issue for you, but I made a Weakaura to manually change the font. This means there's no need problems with changing this addon's files:
function(event, ...)
-- addon not loaded
if not Dominos then return end
local SML = LibStub:GetLibrary("LibSharedMedia-3.0")
if not SML then print("Dominos change font: Error loading SharedMedia"); return end
-- evaluates to a path, so alternatively use a path like "Fonts\\FRIZQT__.TTF"
local sharedFont = SML:Fetch(SML.MediaType.FONT, "Expressway")
-- see https://warcraft.wiki.gg/wiki/API_FontInstance_SetFont
local fontOptions = "OUTLINE"
local fontSize = 16
-- RGBA
local fontColour = {1, 1, 1, 1}
for k, v in Dominos.Frame:GetAll() do
if tonumber(k, 10) then
for i=1,v:NumButtons() do
local actionButton = v:AcquireButton(i)
actionButton.HotKey:SetFont(sharedFont, fontSize, fontOptions)
actionButton.HotKey:SetTextColor(unpack(fontColour))
actionButton.Name:SetFont(sharedFont, fontSize, fontOptions)
actionButton.Name:SetTextColor(unpack(fontColour))
actionButton.Count:SetFont(sharedFont, fontSize, fontOptions)
actionButton.Count:SetTextColor(unpack(fontColour))
end
end
end
end