Skip to content

Commit 0b290c2

Browse files
authored
Merge pull request #264 from Gateswong/master
When converting spell to macro, try pre-define name, icon and a "/cast" in macro.
2 parents 974751c + 9e19211 commit 0b290c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Clicked/BindingConfig/BindingConfig.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,22 @@ function Addon.BindingConfig.Window:CreateTreeFrame()
990990
for _, binding in ipairs(objects) do
991991
if binding.actionType ~= type then
992992
first = first or binding
993+
994+
-- When converting spell to macro, try pre-define name, icon and a "/cast" in macro.
995+
if binding.actionType == Clicked.ActionType.SPELL and type == Clicked.ActionType.MACRO then
996+
if binding.action.spellValue then
997+
local spellName = C_Spell.GetSpellName(binding.action.spellValue)
998+
local iconId, _ = C_Spell.GetSpellTexture(binding.action.spellValue)
999+
if spellName then
1000+
binding.action.macroName = "Cast " .. spellName .. " (Macro)"
1001+
binding.action.macroValue = "/cast " .. spellName
1002+
end
1003+
if iconId then
1004+
binding.action.macroIcon = iconId
1005+
end
1006+
end
1007+
end
1008+
9931009
binding.actionType = type
9941010

9951011
Addon:ReloadBinding(binding, true)

0 commit comments

Comments
 (0)