Commit c8e9756f authored by Ivaria's avatar Ivaria
Browse files

Added option to hide buff watch while out of combat under 'VuhDo Options > Buffs > General'

parent e3d62b33
......@@ -222,9 +222,26 @@ end
--
local sIsOutOfCombat = false;
function VUHDO_setIsOutOfCombat(anIsEnded)
sIsOutOfCombat = anIsEnded;
if VuhDoBuffWatchMainFrame and sIsOutOfCombat and VUHDO_BUFF_SETTINGS["CONFIG"]["HIDE_OUT_OF_COMBAT"] then
VuhDoBuffWatchMainFrame:Hide();
else
VUHDO_reloadBuffPanel();
end
end
--
function VUHDO_reloadBuffPanel()
if InCombatLockdown() or sIsForceHide then return; end
if InCombatLockdown() or sIsForceHide or (VUHDO_BUFF_SETTINGS["CONFIG"]["HIDE_OUT_OF_COMBAT"] and sIsOutOfCombat) then
if VuhDoBuffWatchMainFrame then VuhDoBuffWatchMainFrame:Hide(); end
return;
end
if not VUHDO_BUFF_SETTINGS["CONFIG"] then
if VuhDoBuffWatchMainFrame then VuhDoBuffWatchMainFrame:Hide(); end
......
......@@ -361,7 +361,13 @@ local function VUHDO_init()
VUHDO_initPanelModels();
VUHDO_initFromSpellbook();
VUHDO_initBuffs();
if not InCombatLockdown() then
VUHDO_setIsOutOfCombat(true);
end
VUHDO_initDebuffs(); -- Too soon obviously => ReloadUI
VUHDO_clearUndefinedModelEntries();
VUHDO_registerAllBouquets(true);
......@@ -471,6 +477,11 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
end
end
VUHDO_setIsOutOfCombat(true);
elseif "PLAYER_REGEN_DISABLED" == anEvent then
VUHDO_setIsOutOfCombat(false);
elseif "UNIT_MAXHEALTH" == anEvent then
if (VUHDO_RAID or tEmptyRaid)[anArg1] then VUHDO_updateHealth(anArg1, VUHDO_UPDATE_HEALTH_MAX); end
......@@ -749,13 +760,13 @@ function VUHDO_slashCmd(aCommand)
elseif tCommandWord == "proff" then
SetCVar("scriptProfile", "0");
ReloadUI();
--[[elseif (strfind(tCommandWord, "chkvars")) then
elseif (strfind(tCommandWord, "chkvars")) then
table.wipe(VUHDO_DEBUG);
for tFName, tData in pairs(_G) do
if(strsub(tFName, 1, 1) == "t" or strsub(tFName, 1, 1) == "s") then
VUHDO_Msg("Emerging local variable " .. tFName);
end
end]]
end
elseif strfind(tCommandWord, "mm")
or strfind(tCommandWord, "map") then
VUHDO_CONFIG["SHOW_MINIMAP"] = VUHDO_forceBooleanValue(VUHDO_CONFIG["SHOW_MINIMAP"]);
......@@ -1413,7 +1424,7 @@ local VUHDO_ALL_EVENTS = {
"UNIT_FACTION",
"INCOMING_RESURRECT_CHANGED",
"PET_BATTLE_CLOSE", "PET_BATTLE_OPENING_START",
"PLAYER_REGEN_ENABLED",
"PLAYER_REGEN_ENABLED", "PLAYER_REGEN_DISABLED",
"UNIT_ABSORB_AMOUNT_CHANGED"
};
......
......@@ -613,6 +613,7 @@ VUHDO_I18N_TT.K554 = "Make the selected key layout the default for all new chara
VUHDO_I18N_TT.K555 = "Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode.";
VUHDO_I18N_TT.K556 = "Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore).";
VUHDO_I18N_TT.K557 = "Body of the custom flag function. Must return true or false. Example: return (\"YOURNAME\" == anInfo\[\"name\"\])";
VUHDO_I18N_TT.K558 = "Hide buff watch while out of combat.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -1088,3 +1089,5 @@ VUHDO_I18N_HEALTH_COLOR = "Farbe Leben";
VUHDO_I18N_HIDE = "Verstecken";
VUHDO_I18N_LEAVE_ALONE = "Unverändert";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
......@@ -612,6 +612,7 @@ VUHDO_I18N_TT.K554 = "Make the selected key layout the default for all new chara
VUHDO_I18N_TT.K555 = "Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode.";
VUHDO_I18N_TT.K556 = "Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore).";
VUHDO_I18N_TT.K557 = "Body of the custom flag function. Must return true or false. Example: return (\"YOURNAME\" == anInfo\[\"name\"\])";
VUHDO_I18N_TT.K558 = "Hide buff watch while out of combat.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -621,7 +622,7 @@ VUHDO_I18N_ADD = "Add";
VUHDO_I18N_SELECT = "Select";
VUHDO_I18N_NEW_COLOR = "New Color";
VUHDO_I18N_OLD_COLOR = "Old Color";
VUHDO_I18N_HIDE_CHARGES = "hide charges";
VUHDO_I18N_HIDE_CHARGES = "Hide\nCharges";
VUHDO_I18N_POWERS = "Powers";
VUHDO_I18N_HOT_COLORS = "HoT Colors";
VUHDO_I18N_ICONS = "Icons";
......@@ -1089,3 +1090,4 @@ VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_READY_CHECK = "Ready\nCheck";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
......@@ -620,6 +620,7 @@ VUHDO_I18N_TT.K554 = "Make the selected key layout the default for all new chara
VUHDO_I18N_TT.K555 = "Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode.";
VUHDO_I18N_TT.K556 = "Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore).";
VUHDO_I18N_TT.K557 = "Body of the custom flag function. Must return true or false. Example: return (\"YOURNAME\" == anInfo\[\"name\"\])";
VUHDO_I18N_TT.K558 = "Hide buff watch while out of combat.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -1103,3 +1104,5 @@ VUHDO_I18N_HEALTH_COLOR = "Health\nColor";
VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
......@@ -622,6 +622,7 @@ VUHDO_I18N_TT.K554 = "Make the selected key layout the default for all new chara
VUHDO_I18N_TT.K555 = "Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode.";
VUHDO_I18N_TT.K556 = "Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore).";
VUHDO_I18N_TT.K557 = "Body of the custom flag function. Must return true or false. Example: return (\"YOURNAME\" == anInfo\[\"name\"\])";
VUHDO_I18N_TT.K558 = "Hide buff watch while out of combat.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -1104,3 +1105,5 @@ VUHDO_I18N_HEALTH_COLOR = "Health\nColor";
VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
......@@ -720,6 +720,7 @@ VUHDO_I18N_TT.K554 = "Make the selected key layout the default for all new chara
VUHDO_I18N_TT.K555 = "Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode.";
VUHDO_I18N_TT.K556 = "Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore).";
VUHDO_I18N_TT.K557 = "Body of the custom flag function. Must return true or false. Example: return (\"YOURNAME\" == anInfo\[\"name\"\])";
VUHDO_I18N_TT.K558 = "Hide buff watch while out of combat.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -1268,3 +1269,5 @@ VUHDO_I18N_HEALTH_COLOR = "Health\nColor";
VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
......@@ -614,6 +614,7 @@ VUHDO_I18N_TT.K554 = "Make the selected key layout the default for all new chara
VUHDO_I18N_TT.K555 = "Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode.";
VUHDO_I18N_TT.K556 = "Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore).";
VUHDO_I18N_TT.K557 = "Body of the custom flag function. Must return true or false. Example: return (\"YOURNAME\" == anInfo\[\"name\"\])";
VUHDO_I18N_TT.K558 = "Hide buff watch while out of combat.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -1090,3 +1091,5 @@ VUHDO_I18N_HEALTH_COLOR = "Health\nColor";
VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
......@@ -614,6 +614,7 @@ VUHDO_I18N_TT.K554 = "Make the selected key layout the default for all new chara
VUHDO_I18N_TT.K555 = "Check to allow the VuhDo menu command to be bound even when using Clique compatibility mode.";
VUHDO_I18N_TT.K556 = "Check this to have an extra panel for boss encounter NPCs (eg. shards on Tectus, mushrooms on Brackenspore).";
VUHDO_I18N_TT.K557 = "Body of the custom flag function. Must return true or false. Example: return (\"YOURNAME\" == anInfo\[\"name\"\])";
VUHDO_I18N_TT.K558 = "Hide buff watch while out of combat.";
VUHDO_I18N_DEFAULT_PROFILE = "Default Profile";
VUHDO_I18N_DEFAULT_LAYOUT = "Default Layout";
......@@ -1090,3 +1091,5 @@ VUHDO_I18N_HEALTH_COLOR = "Health\nColor";
VUHDO_I18N_HIDE = "Hide";
VUHDO_I18N_LEAVE_ALONE = "Leave alone";
VUHDO_I18N_HIDE_OUT_OF_COMBAT = "Show Only\nIn Combat";
......@@ -70,7 +70,7 @@
<Frame name="$parentGeneralPanel" inherits="VuhDoPanelTemplate">
<Size>
<AbsDimension x="158" y="245" />
<AbsDimension x="173" y="285" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
......@@ -83,12 +83,12 @@
<Frame name="$parentRefreshSlider" inherits="VuhDoHSliderTemplate">
<Size>
<AbsDimension x="132" y="32" />
<AbsDimension x="147" y="32" />
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="13" y="-202" />
<AbsDimension x="13" y="-242" />
</Offset>
</Anchor>
</Anchors>
......@@ -102,6 +102,23 @@
</Scripts>
</Frame>
<CheckButton name="$parentHideOutOfCombatCheckButton" text="VUHDO_I18N_HIDE_OUT_OF_COMBAT" inherits="VuhDoCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="28" y="-192" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
VUHDO_lnfSetModel(self, "VUHDO_BUFF_SETTINGS.CONFIG.HIDE_OUT_OF_COMBAT");
VUHDO_lnfSetTooltip(self, VUHDO_I18N_TT.K558);
VUHDO_lnfAddConstraint(self, VUHDO_LF_CONSTRAINT_DISABLE, "VUHDO_BUFF_SETTINGS.CONFIG.SHOW", false);
</OnLoad>
</Scripts>
</CheckButton>
<CheckButton name="$parentHideChargesCheckButton" text="VUHDO_I18N_HIDE_CHARGES" inherits="VuhDoCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT">
......
......@@ -25,6 +25,8 @@ Improvements:
-- the relevant unit information.
-- Example below returns true if the unit is named 'Ivaria':
-- return ("Ivaria" == anInfo["name"])
-- Added option to hide buff watch while out of combat
-- Under 'VuhDo Options > Buffs > General'
--------------------------------------------------------------
......
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