Add ascension cooldown keybind assignerer

This commit is contained in:
2024-11-17 16:55:55 +01:00
parent af21235bf2
commit 31bdda3c0b
3 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
function()
if not aura_env.scanned then
aura_env.lookup()
end
return aura_env.keybind
end

View File

@@ -0,0 +1,47 @@
aura_env.keybind = ""
aura_env.scanned = false
aura_env.bars = {
"ElvUI_Bar1", "ElvUI_Bar2", "ElvUI_Bar3", "ElvUI_Bar4", "ElvUI_Bar5",
"ElvUI_Bar6", "ElvUI_Bar7", "ElvUI_Bar8", "ElvUI_Bar9", "ElvUI_Bar10"
}
aura_env.lookup = function()
local spellid = 0
if not aura_env.states or aura_env.states == nil then
print("No states")
return
end
if not aura_env.states[2] then
print("No states[2]")
return
end
local triggerInfo = aura_env.states[2]
if triggerInfo then spellid = triggerInfo.trigger.spellName end
for _, bar in pairs(aura_env.bars) do
for i = 1, 12 do
local button = _G[bar .. "Button" .. i]
local slot = button:GetAttribute("action")
if slot then
local type, _, _, id = GetActionInfo(slot)
if type == "spell" then
print(id, spellid)
if id == spellid then
local bindid = button.keyBoundTarget
local keybind = GetBindingKey(bindid)
aura_env.keybind = keybind
break
end
end
end
end
end
aura_env.keybind = string.gsub(aura_env.keybind, "BUTTON", "B")
aura_env.keybind = string.gsub(aura_env.keybind, "SHIFT%-", "S")
aura_env.keybind = string.gsub(aura_env.keybind, "CTRL%-", "C")
aura_env.keybind = string.gsub(aura_env.keybind, "ALT%-", "A")
aura_env.scanned = true
end

View File

@@ -0,0 +1,41 @@
ElvUI_BarNButtonM
ACTIONBUTTON12
GetBindingKey
ActionButton_GetPagedID("ActionButton12")
ActionButton_CalculateAction("ElvUI_Bar1Button1")
ActionButton_GetPagedID("ElvUI_Bar1Button1")
ElvUI_Bar1Button1:GetAttribute("action")
GetActionInfo(1)
DevTools_Dump(aura_env.state[2])
[2]={
triggernum=2,
spellname="Shadow Word: Pain",
duration=7,
id="Test123",
expirationTime=20758.936,
show=false,
trigger={
type="spell",
subeventSuffix="_CAST_START",
spellName=25368, -- !!!!
use_genericShowOn=true,
genericShowOn="showAlways",
unit="player",
realSpellName="Shadow Word: Pain",
use_spellName=true,
spellIds={
},
subeventPrefix="SPELL",
event="Cooldown Progress (Spell)",
names={
},
use_track=true,
debuffType="HELPFUL"
},
name="Shadow Word: Pain",
autoHide=false,
changed=false,
icon="Interface\\Icons\\Spell_Shadow_ShadowWordPain",
progressType="timed"
},