Commit fd28beed authored by Ivaria's avatar Ivaria
Browse files

-- CTRL+SHIFT+ALT+RIGHTBUTTON now adds debuff icons to the blacklist

parent 4aa6d1b0
......@@ -50,6 +50,7 @@ function VUHDO_customDebuffIconsInitLocalOverrides()
sIsName = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isName"];
sStaticConfig = {
["isStaticConfig"] = true,
["animate"] = VUHDO_CONFIG["CUSTOM_DEBUFF"]["animate"],
["timer"] = VUHDO_CONFIG["CUSTOM_DEBUFF"]["timer"],
["isStacks"] = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isStacks"],
......@@ -81,6 +82,14 @@ local tIsIconGlow;
local function VUHDO_animateDebuffIcon(aButton, anIconInfo, aNow, anIconIndex, anIsInit, aUnit)
tCuDeStoConfig = sCuDeStoredSettings[anIconInfo[3]] or sCuDeStoredSettings[tostring(anIconInfo[7])] or sStaticConfig;
if tCuDeStoConfig["isStaticConfig"] and
(VUHDO_DEBUFF_BLACKLIST[anIconInfo[3]] or VUHDO_DEBUFF_BLACKLIST[tostring(anIconInfo[7])]) then
VUHDO_removeDebuffIcon(aUnit, anIconInfo[3]);
return;
end
tIsAnim = tCuDeStoConfig["animate"] and VUHDO_MAY_DEBUFF_ANIM;
tIsBarGlow = tCuDeStoConfig["isBarGlow"];
tIsIconGlow = tCuDeStoConfig["isIconGlow"];
......@@ -240,7 +249,7 @@ function VUHDO_addDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration,
VUHDO_animateDebuffIcon(tButton, tIconInfo, GetTime(), tSlot + 39, true, aUnit);
tFrame = VUHDO_getBarIconFrame(tButton, tSlot + 39);
tFrame["debuffInfo"], tFrame["isBuff"], tFrame["debuffCnt"] = aName, anIsBuff, aCnt;
tFrame["debuffInfo"], tFrame["debuffSpellId"], tFrame["isBuff"], tFrame["debuffCnt"] = aName, aSpellId, anIsBuff, aCnt;
end
tIconInfo[2] = GetTime();
......@@ -270,7 +279,7 @@ function VUHDO_updateDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDurati
for _, tButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
tFrame = VUHDO_getBarIconFrame(tButton, tCnt + 39);
tFrame["debuffInfo"], tFrame["isBuff"], tFrame["debuffCnt"] = aName, anIsBuff, aCnt;
tFrame["debuffInfo"], tFrame["debuffSpellId"], tFrame["isBuff"], tFrame["debuffCnt"] = aName, aSpellId, anIsBuff, aCnt;
end
end
end
......@@ -303,6 +312,7 @@ function VUHDO_removeDebuffIcon(aUnit, aName)
tFrame:SetAlpha(0);
tFrame["debuffInfo"] = nil;
tFrame["debuffSpellId"] = nil;
tFrame["isBuff"] = nil;
tFrame["debuffCnt"] = nil;
end
......@@ -324,11 +334,18 @@ function VUHDO_removeAllDebuffIcons(aUnit)
if not tAllButtons3 then return; end
for _, tButton3 in pairs(tAllButtons3) do
VUHDO_LibCustomGlow.PixelGlow_Stop(tButton3, VUHDO_CUSTOM_GLOW_CUDE_FRAME_KEY);
for tCnt3 = 40, 39 + sMaxIcons do
tFrame = VUHDO_getBarIconFrame(tButton3, tCnt3);
if tFrame then
VUHDO_LibCustomGlow.PixelGlow_Stop(tFrame, VUHDO_CUSTOM_GLOW_CUDE_ICON_KEY);
tFrame:SetAlpha(0);
tFrame["debuffInfo"] = nil;
tFrame["debuffSpellId"] = nil;
tFrame["isBuff"] = nil;
tFrame["debuffCnt"] = nil;
end
end
......
......@@ -470,4 +470,5 @@ VUHDO_I18N_DEF_PLAYER_RUNES = "Player Runes";
VUHDO_I18N_BOUQUET_OWN_RUNES_EQUALS = "Flag: Own Runes ==";
VUHDO_I18N_DEF_PLAYER_ARCANE_CHARGES = "Player Arcane Charges";
VUHDO_I18N_BOUQUET_OWN_ARCANE_CHARGES_EQUALS = "Flag: Own Arcane Charges ==";
VUHDO_I18N_DEBUFF_BLACKLIST_ADDED = "Added \"[%s] %s\" to the debuff backlist.";
......@@ -479,4 +479,5 @@ VUHDO_I18N_DEF_PLAYER_RUNES = "Player Runes";
VUHDO_I18N_BOUQUET_OWN_RUNES_EQUALS = "Flag: Own Runes ==";
VUHDO_I18N_DEF_PLAYER_ARCANE_CHARGES = "Player Arcane Charges";
VUHDO_I18N_BOUQUET_OWN_ARCANE_CHARGES_EQUALS = "Flag: Own Arcane Charges ==";
VUHDO_I18N_DEBUFF_BLACKLIST_ADDED = "Added \"[%s] %s\" to the debuff backlist.";
......@@ -480,4 +480,5 @@ VUHDO_I18N_DEF_PLAYER_RUNES = "Player Runes";
VUHDO_I18N_BOUQUET_OWN_RUNES_EQUALS = "Flag: Own Runes ==";
VUHDO_I18N_DEF_PLAYER_ARCANE_CHARGES = "Player Arcane Charges";
VUHDO_I18N_BOUQUET_OWN_ARCANE_CHARGES_EQUALS = "Flag: Own Arcane Charges ==";
VUHDO_I18N_DEBUFF_BLACKLIST_ADDED = "Added \"[%s] %s\" to the debuff backlist.";
......@@ -478,4 +478,5 @@ VUHDO_I18N_DEF_PLAYER_RUNES = "Player Runes";
VUHDO_I18N_BOUQUET_OWN_RUNES_EQUALS = "Flag: Own Runes ==";
VUHDO_I18N_DEF_PLAYER_ARCANE_CHARGES = "Player Arcane Charges";
VUHDO_I18N_BOUQUET_OWN_ARCANE_CHARGES_EQUALS = "Flag: Own Arcane Charges ==";
VUHDO_I18N_DEBUFF_BLACKLIST_ADDED = "Added \"[%s] %s\" to the debuff backlist.";
......@@ -544,4 +544,5 @@ VUHDO_I18N_DEF_PLAYER_RUNES = "Player Runes";
VUHDO_I18N_BOUQUET_OWN_RUNES_EQUALS = "Flag: Own Runes ==";
VUHDO_I18N_DEF_PLAYER_ARCANE_CHARGES = "Player Arcane Charges";
VUHDO_I18N_BOUQUET_OWN_ARCANE_CHARGES_EQUALS = "Flag: Own Arcane Charges ==";
VUHDO_I18N_DEBUFF_BLACKLIST_ADDED = "Added \"[%s] %s\" to the debuff backlist.";
......@@ -472,4 +472,5 @@ VUHDO_I18N_DEF_PLAYER_RUNES = "Player Runes";
VUHDO_I18N_BOUQUET_OWN_RUNES_EQUALS = "Flag: Own Runes ==";
VUHDO_I18N_DEF_PLAYER_ARCANE_CHARGES = "Player Arcane Charges";
VUHDO_I18N_BOUQUET_OWN_ARCANE_CHARGES_EQUALS = "Flag: Own Arcane Charges ==";
VUHDO_I18N_DEBUFF_BLACKLIST_ADDED = "Added \"[%s] %s\" to the debuff backlist.";
......@@ -472,4 +472,5 @@ VUHDO_I18N_DEF_PLAYER_RUNES = "Player Runes";
VUHDO_I18N_BOUQUET_OWN_RUNES_EQUALS = "Flag: Own Runes ==";
VUHDO_I18N_DEF_PLAYER_ARCANE_CHARGES = "Player Arcane Charges";
VUHDO_I18N_BOUQUET_OWN_ARCANE_CHARGES_EQUALS = "Flag: Own Arcane Charges ==";
VUHDO_I18N_DEBUFF_BLACKLIST_ADDED = "Added \"[%s] %s\" to the debuff backlist.";
......@@ -86,7 +86,27 @@
<OnLoad>
self.addLevel = 9;
self:SetScript("PreClick", VuhDoActionPreClick);
self:SetScript("PostClick", VuhDoActionPostClick);
self:SetScript("PostClick", function(self, aButton)
if aButton == "RightButton" and
IsShiftKeyDown() and IsControlKeyDown() and IsAltKeyDown() then
local debuffName = self["debuffInfo"];
if debuffName then
local debuffSpellId = strtrim(self["debuffSpellId"]);
if not VUHDO_DEBUFF_BLACKLIST[debuffSpellId] then
VUHDO_DEBUFF_BLACKLIST[debuffSpellId] = true;
VUHDO_updateAllDebuffIcons(false);
VUHDO_initDebuffIgnoreComboModel();
VUHDO_Msg(format(VUHDO_I18N_DEBUFF_BLACKLIST_ADDED, debuffSpellId, debuffName), 1, 0.4, 0.4);
end
end
end
VuhDoActionPostClick(self);
end)
</OnLoad>
</Scripts>
</Button>
......
......@@ -36,6 +36,7 @@ Improvements:
-- Added new text provider 'Arcane Charges: <#n>'
-- Added default custom debuffs for Crucible of Storms raid
-- Added new slash command "/vd about"
-- CTRL+SHIFT+ALT+RIGHTBUTTON now adds debuff icons to the blacklist
--------------------------------------------------------------
......
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