Add ascension cooldown keybind assignerer
This commit is contained in:
6
FreshShit/__Ascension/Cooldowner/display.lua
Normal file
6
FreshShit/__Ascension/Cooldowner/display.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
function()
|
||||||
|
if not aura_env.scanned then
|
||||||
|
aura_env.lookup()
|
||||||
|
end
|
||||||
|
return aura_env.keybind
|
||||||
|
end
|
||||||
47
FreshShit/__Ascension/Cooldowner/init.lua
Normal file
47
FreshShit/__Ascension/Cooldowner/init.lua
Normal 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
|
||||||
41
FreshShit/__Ascension/Cooldowner/test.lua
Normal file
41
FreshShit/__Ascension/Cooldowner/test.lua
Normal 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"
|
||||||
|
},
|
||||||
Reference in New Issue
Block a user