I have no way to test this but you could try:
Code:
local frame = CreateFrame('Frame')
frame:Hide()
for index = 1, MAX_RUNES do
frame[index] = _G['RuneButtonIndividual' .. index]
end
local OnEvent(self, event, arg1, arg2)
if event == 'RUNE_POWER_UPDATE' then
local _, _, isReady = GetRuneCooldown(arg1)
self[arg1]:SetAlpha(isReady and RHaic or RHaoc)
elseif event == 'PLAYER_REGEN_DISABLED' then
self:RegisterEvent('RUNE_POWER_UPDATE')
local isReady, _
for index = 1, MAX_RUNES do
_, _, isReady = GetRuneCooldown(index)
self[index]:SetAlpha(isReady and RHaic or RHaoc)
end
elseif event == 'PLAYER_REGEN_ENABLED' then
self:UnregisterEvent('RUNE_POWER_UPDATE')
for index = 1, MAX_RUNES do
self[index]:SetAlpha(RHaoc)
end
end
end
frame:SetScript('OnEvent', OnEvent)
frame:RegisterEvent('PLAYER_REGEN_DISABLED')
frame:RegisterEvent('PLAYER_REGEN_ENABLED')
OnEvent(InCombatLockdown() and 'PLAYER_REGEN_DISABLED' or 'PLAYER_REGEN_ENABLED')