Commit 1d58f0dc authored by Ivaria's avatar Ivaria

Merge branch 'master' into 'master'

add option to show debuffs only for friendly units

- add option "Show only for friendly" into Debuffs->Visuals->Misc
- default value is "false" (the old functionality is working by default)
- debuff icons are not add or updated for any "non friendly" units if this flag set to true
- localization is done for 'en' and 'ru' all others are copy from 'en'

See merge request !22
parents 66daa74f b0dd2fe2
......@@ -61,6 +61,7 @@ function VUHDO_customDebuffIconsInitLocalOverrides()
["isBarGlow"] = false,
["isIconGlow"] = false,
};
sIsShowOnlyForFriendly = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isShowOnlyForFriendly"];
end
......@@ -284,7 +285,7 @@ function VUHDO_updateDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDurati
end
end
if not tFound then
if not tFound and (not sIsShowOnlyForFriendly or UnitIsFriend("player", aUnit)) then
VUHDO_addDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration, anIsBuff, aSpellId, aCnt);
end
......
......@@ -99,6 +99,7 @@ function VUHDO_debuffsInitLocalOverrides()
sColorArray[tCnt] = { };
end
end]]
sIsShowOnlyForFriendly = VUHDO_CONFIG["CUSTOM_DEBUFF"]["isShowOnlyForFriendly"];
end
----------------------------------------------------
......@@ -400,23 +401,25 @@ function VUHDO_determineDebuff(aUnit)
for tName, tDebuffInfo in pairs(sCurIcons) do
if not VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName] then
-- tExpiry, tStacks, tIcon
VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName] = { tDebuffInfo[2], tDebuffInfo[3], tDebuffInfo[1], tDebuffInfo[7] };
if not sIsShowOnlyForFriendly or UnitIsFriend("player", aUnit) then
-- tExpiry, tStacks, tIcon
VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName] = { tDebuffInfo[2], tDebuffInfo[3], tDebuffInfo[1], tDebuffInfo[7] };
VUHDO_addDebuffIcon(aUnit, tDebuffInfo[1], tName, tDebuffInfo[2], tDebuffInfo[3], tDebuffInfo[4], tDebuffInfo[5], tDebuffInfo[6], tDebuffInfo[7]);
VUHDO_addDebuffIcon(aUnit, tDebuffInfo[1], tName, tDebuffInfo[2], tDebuffInfo[3], tDebuffInfo[4], tDebuffInfo[5], tDebuffInfo[6], tDebuffInfo[7]);
if not VUHDO_IS_CONFIG and VUHDO_MAY_DEBUFF_ANIM then
-- the key used to store the debuff settings is either the debuff name or spell ID
tDebuffSettings = sAllDebuffSettings[tName] or sAllDebuffSettings[tostring(tDebuffInfo[6])];
if not VUHDO_IS_CONFIG and VUHDO_MAY_DEBUFF_ANIM then
-- the key used to store the debuff settings is either the debuff name or spell ID
tDebuffSettings = sAllDebuffSettings[tName] or sAllDebuffSettings[tostring(tDebuffInfo[6])];
if tDebuffSettings then -- particular custom debuff sound?
VUHDO_playDebuffSound(tDebuffSettings["SOUND"], tName);
elseif VUHDO_CONFIG["CUSTOM_DEBUFF"]["SOUND"] then -- default custom debuff sound?
VUHDO_playDebuffSound(VUHDO_CONFIG["CUSTOM_DEBUFF"]["SOUND"], tName);
if tDebuffSettings then -- particular custom debuff sound?
VUHDO_playDebuffSound(tDebuffSettings["SOUND"], tName);
elseif VUHDO_CONFIG["CUSTOM_DEBUFF"]["SOUND"] then -- default custom debuff sound?
VUHDO_playDebuffSound(VUHDO_CONFIG["CUSTOM_DEBUFF"]["SOUND"], tName);
end
end
end
VUHDO_updateBouquetsForEvent(aUnit, 29); -- VUHDO_UPDATE_CUSTOM_DEBUFF
VUHDO_updateBouquetsForEvent(aUnit, 29); -- VUHDO_UPDATE_CUSTOM_DEBUFF
end
-- update number of stacks?
elseif VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName][1] ~= tDebuffInfo[2]
or VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName][2] ~= tDebuffInfo[3]
......
......@@ -594,6 +594,7 @@ local VUHDO_DEFAULT_CONFIG = {
["timer"] = true,
["max_num"] = 3,
["isNoRangeFade"] = false,
["showOnlyForFriendly"] = false,
["isIcon"] = true,
["isColor"] = false,
["isStacks"] = false,
......
......@@ -1141,3 +1141,5 @@ VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "Ignore List Modifier Key";
VUHDO_I18N_NICKNAME = "Details!\nNickname"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Show only\nfor friendly";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Shows debuffs only for friendly units";
......@@ -1141,3 +1141,5 @@ VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "Ignore List Modifier Key";
VUHDO_I18N_NICKNAME = "Details!\nNickname"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Show only\nfor friendly";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Shows debuffs only for friendly units";
......@@ -1156,3 +1156,5 @@ VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "Ignore List Modifier Key";
VUHDO_I18N_NICKNAME = "Details!\nNickname"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Show only\nfor friendly";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Shows debuffs only for friendly units";
......@@ -1157,3 +1157,5 @@ VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "Ignore List Modifier Key";
VUHDO_I18N_NICKNAME = "Details!\nNickname"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Show only\nfor friendly";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Shows debuffs only for friendly units";
......@@ -1147,3 +1147,5 @@ VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "무시 목록 수정 키";
VUHDO_I18N_NICKNAME = "Details!\nNickname"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Show only\nfor friendly";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Shows debuffs only for friendly units";
......@@ -1321,3 +1321,5 @@ VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "Ignore List Modifier Key";
VUHDO_I18N_NICKNAME = "Details!\nNickname"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Показывать только\nдля дружественных";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Показывать дэбафы только для дружественных юнитов";
......@@ -1143,3 +1143,5 @@ VUHDO_I18N_ICON_GLOW_COLOR = "图标闪光";
VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "忽略修改键列表";
VUHDO_I18N_NICKNAME = "Details!\n昵称"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Show only\nfor friendly";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Shows debuffs only for friendly units";
......@@ -1143,3 +1143,5 @@ VUHDO_I18N_BLACKLIST_KEY_MODIFIES = "Ignore List Modifier Key";
VUHDO_I18N_NICKNAME = "Details!\nNickname"
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT = "Show only\nfor friendly";
VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP = "Shows debuffs only for friendly units";
......@@ -265,7 +265,7 @@
<Frame name="$parentMiscPanel" inherits="VuhDoPanelTemplate">
<Size>
<AbsDimension x="126" y="70" />
<AbsDimension x="126" y="110" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
......@@ -291,6 +291,21 @@
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentShowOnlyForFriendlyCheckButton" text="VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TEXT" inherits="VuhDoCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="13" y="-65" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
VUHDO_lnfSetModel(self, "VUHDO_CONFIG.CUSTOM_DEBUFF.isShowOnlyForFriendly");
VUHDO_lnfSetTooltip(self, VUHDO_I18N_DEBUFF_SHOW_ONLY_FOR_FRIENDLY_TOOLTIP);
</OnLoad>
</Scripts>
</CheckButton>
<Frame name="$parentTitleLabel" inherits="VuhDoLabelFrameTemplate">
<Layers>
......
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