Skip to content

Instantly share code, notes, and snippets.

@Konctantin
Last active June 19, 2019 18:08
Show Gist options
  • Save Konctantin/66d729abdb9379e79e7eff3a5060475d to your computer and use it in GitHub Desktop.
Save Konctantin/66d729abdb9379e79e7eff3a5060475d to your computer and use it in GitHub Desktop.
/run frame=CreateFrame("Frame");frame:SetScript("OnEvent",function(s,e,...) if e == "COMBAT_LOG_EVENT_UNFILTERED" then print(CombatLogGetCurrentEventInfo()) end end);frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");frame:Show()
/dump C_ActionBar.FindSpellActionButtons(123);
local ACTION_BAR_TYPES = { 'Action', 'MultiBarBottomLeft', 'MultiBarBottomRight', 'MultiBarRight', 'MultiBarLeft' };
function GetHotKeyBySpellId(spellId)
local actionList = C_ActionBar.FindSpellActionButtons(spellId);
if actionList and #actionList > 0 then
for _, actionID in ipairs(actionList) do
for _, barName in pairs(ACTION_BAR_TYPES) do
for i = 1, 12 do
local button = _G[barName .. 'Button' .. i];
if button and button.action == actionID then
local hotKey = string.upper(tostring(button.HotKey:GetText()));
local color = BOMBER_KEYMAP[hotKey]
if color then
return hotKey;
end
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment