diff --git a/VuhDoBuffWatchBuilder.lua b/VuhDoBuffWatchBuilder.lua index 993441a6c9d2bcd741ed5265bbdbb7f0219f057c..e3a9677177722aade2ad7a92c465e89043016bf7 100644 --- a/VuhDoBuffWatchBuilder.lua +++ b/VuhDoBuffWatchBuilder.lua @@ -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 diff --git a/VuhDoEventHandler.lua b/VuhDoEventHandler.lua index db150287d129761d341f22e5810def155e9c3ce7..8b3d8fe64d6219dcc8ab994ce21df0d28cea3ff1 100644 --- a/VuhDoEventHandler.lua +++ b/VuhDoEventHandler.lua @@ -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" }; diff --git a/VuhDoOptions/VuhDoLocalization_de.lua b/VuhDoOptions/VuhDoLocalization_de.lua index 27eef9ffe8c976c8c918c075e7af22db04b7e5c3..40d1076604cecdf494469a4af24ac6a688355f16 100644 --- a/VuhDoOptions/VuhDoLocalization_de.lua +++ b/VuhDoOptions/VuhDoLocalization_de.lua @@ -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"; diff --git a/VuhDoOptions/VuhDoLocalization_en.lua b/VuhDoOptions/VuhDoLocalization_en.lua index 353186dc907082364ca47d08b5569a3b74499854..530f225025c9f5ab93e33649de9f8cad18ed3b3c 100644 --- a/VuhDoOptions/VuhDoLocalization_en.lua +++ b/VuhDoOptions/VuhDoLocalization_en.lua @@ -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"; diff --git a/VuhDoOptions/VuhDoLocalization_es.lua b/VuhDoOptions/VuhDoLocalization_es.lua index 1720e00c20c21229a7142316ac9e60a26377d7dc..255be66d7ee005688bf6db1bc68476f9e6cc1656 100644 --- a/VuhDoOptions/VuhDoLocalization_es.lua +++ b/VuhDoOptions/VuhDoLocalization_es.lua @@ -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"; diff --git a/VuhDoOptions/VuhDoLocalization_fr.lua b/VuhDoOptions/VuhDoLocalization_fr.lua index e60a32eaf96081b51f86549d76498d3db5e5e66f..93b6701491c6a1af7596e02b3b309d1bd7aed85b 100644 --- a/VuhDoOptions/VuhDoLocalization_fr.lua +++ b/VuhDoOptions/VuhDoLocalization_fr.lua @@ -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"; diff --git a/VuhDoOptions/VuhDoLocalization_ru.lua b/VuhDoOptions/VuhDoLocalization_ru.lua index 4873992fe7b08f80251b8c048a6007317a862dfc..325d229d96a33a2c7fcd6f9e70a0f6f61fcdbedb 100644 --- a/VuhDoOptions/VuhDoLocalization_ru.lua +++ b/VuhDoOptions/VuhDoLocalization_ru.lua @@ -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"; diff --git a/VuhDoOptions/VuhDoLocalization_zhCN.lua b/VuhDoOptions/VuhDoLocalization_zhCN.lua index 1a8f675c37379c88083950cb031a2f2f452caa0c..4bfa1c11058264c45406bbc120f43052abe78244 100644 --- a/VuhDoOptions/VuhDoLocalization_zhCN.lua +++ b/VuhDoOptions/VuhDoLocalization_zhCN.lua @@ -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"; diff --git a/VuhDoOptions/VuhDoLocalization_zhTW.lua b/VuhDoOptions/VuhDoLocalization_zhTW.lua index b933a61050d430c405ab70f9dc3123b000b6362b..0411d951b07359ab0f29f7e36083aebbde1f799c 100644 --- a/VuhDoOptions/VuhDoLocalization_zhTW.lua +++ b/VuhDoOptions/VuhDoLocalization_zhTW.lua @@ -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"; diff --git a/VuhDoOptions/VuhDoNewOptionsBuffsAppearance.xml b/VuhDoOptions/VuhDoNewOptionsBuffsAppearance.xml index 29b8fb1308ba6f3a09f4891e7c86d3fc83cce7ff..77f68fa0dc46cf7a424dba5e3d6676838a958c4c 100644 --- a/VuhDoOptions/VuhDoNewOptionsBuffsAppearance.xml +++ b/VuhDoOptions/VuhDoNewOptionsBuffsAppearance.xml @@ -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"> diff --git a/changelog.txt b/changelog.txt index 9b9e86550bb99198ab169a514027aae23cd64921..f822a51083cf7e2a2eab2c0553dcdbff1d76418a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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' --------------------------------------------------------------