Commit 0f0a1e31 authored by Ivaria's avatar Ivaria
Browse files

Fix the DK Runes bouquet validator and text provider to use GetRuneCooldown...

Fix the DK Runes bouquet validator and text provider to use GetRuneCooldown since UnitPower always returns UnitPowerMax for this power type
parent 169539f8
......@@ -527,9 +527,19 @@ end
--
local tIsRuneReady;
local function VUHDO_runesEqualsValidator(anInfo, someCustom)
if anInfo["connected"] and not anInfo["dead"] then
tPower = UnitPower(anInfo["unit"], VUHDO_UNIT_POWER_RUNES);
if anInfo["unit"] ~= "player" then
return false, nil, -1, -1, -1;
elseif anInfo["connected"] and not anInfo["dead"] then
tPower = 0;
for i = 1, 6 do
_, _, tIsRuneReady = GetRuneCooldown(i);
tPower = tPower + (tIsRuneReady and 1 or 0);
end
if tPower == someCustom["custom"][1] then
return true, nil, tPower, -1, UnitPowerMax(anInfo["unit"], VUHDO_UNIT_POWER_RUNES);
else
......
......@@ -688,6 +688,9 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
VUHDO_updateBouquetsForEvent(anArg1, VUHDO_UPDATE_PHASE);
end
elseif "RUNE_POWER_UPDATE" == anEvent then
VUHDO_updateBouquetsForEvent("player", 42); -- VUHDO_UPDATE_RUNES
else
VUHDO_Msg("Error: Unexpected event: " .. anEvent);
end
......@@ -1474,7 +1477,7 @@ local VUHDO_ALL_EVENTS = {
"LEARNED_SPELL_IN_TAB",
"PLAYER_FLAGS_CHANGED",
"PLAYER_LOGOUT",
"UNIT_DISPLAYPOWER", "UNIT_MAXPOWER", "UNIT_POWER_UPDATE",
"UNIT_DISPLAYPOWER", "UNIT_MAXPOWER", "UNIT_POWER_UPDATE", "RUNE_POWER_UPDATE",
"UNIT_SPELLCAST_SENT", "UNIT_SPELLCAST_SUCCEEDED",
"PARTY_MEMBER_ENABLE", "PARTY_MEMBER_DISABLE",
"COMBAT_LOG_EVENT_UNFILTERED",
......
......@@ -332,7 +332,6 @@ local VUHDO_BLIZZ_EVENTS = {
"READY_CHECK_CONFIRM",
"READY_CHECK_FINISHED",
"RUNE_POWER_UPDATE",
"RUNE_TYPE_UPDATE",
"UI_SCALE_CHANGED",
"UNIT_AURA",
"UNIT_CLASSIFICATION_CHANGED",
......
......@@ -57,9 +57,19 @@ end
--
local tReadyRuneCount;
local tIsRuneReady;
local function VUHDO_runesCalculator(anInfo)
if anInfo["connected"] and not anInfo["dead"] then
return UnitPower(anInfo["unit"], VUHDO_UNIT_POWER_RUNES), UnitPowerMax(anInfo["unit"], VUHDO_UNIT_POWER_RUNES);
if anInfo["connected"] and not anInfo["dead"] and anInfo["unit"] == "player" then
tReadyRuneCount = 0;
for i = 1, 6 do
_, _, tIsRuneReady = GetRuneCooldown(i);
tReadyRuneCount = tReadyRuneCount + (tIsRuneReady and 1 or 0);
end
return tReadyRuneCount, UnitPowerMax(anInfo["unit"], VUHDO_UNIT_POWER_RUNES);
else
return 0, 0;
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment