ArtOfShred / LuiExtended

Lui Extended addon for ESO
http://www.esoui.com/downloads/fileinfo.php?id=818
Other
36 stars 21 forks source link

Proposed feature to hide the Info Panel while in combat #274

Open brainsnorkel opened 7 months ago

brainsnorkel commented 7 months ago

Is your feature request related to a problem? Please describe.

Some folks like a more distraction-free combat. Most of the info on the info panel isn't relevant to combat. I made a version of LuiExtended with a setting to hide the info panel in combat.

Describe the solution you'd like

A setting to select if the info panel should disappear in combat.

Additional context

Git patch below (for the 6.6.9 version)

Translations are machine-generated, and the DE localisation seems to be English so ¯\(ツ)

diff --git a/i18n/settings/Settings_de.lua b/i18n/settings/Settings_de.lua
index 176ce67..a018199 100644
--- a/i18n/settings/Settings_de.lua
+++ b/i18n/settings/Settings_de.lua
@@ -1362,6 +1362,7 @@ local strings = {
     -- Module: Info Panel
     LUIE_STRING_LAM_PNL = "Info Panel",
     LUIE_STRING_LAM_PNL_ENABLE = "Info Panel Module",
+    LUIE_STRING_LAM_PNL_HIDE_IN_COMBAT = "Hide Info Panel in Combat",
     LUIE_STRING_LAM_PNL_DESCRIPTION = "Displays a panel with potentially useful information on it such as Latency, Time, FPS, Durability and Weapon Charge, etc...",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO = "Disable colors on read-only values",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO_TP = "Disable value-dependent color of the information label for items that you don't have direct control: Currently this includes FPS and Latency labels.",
diff --git a/i18n/settings/Settings_en.lua b/i18n/settings/Settings_en.lua
index 8c0d402..b683543 100644
--- a/i18n/settings/Settings_en.lua
+++ b/i18n/settings/Settings_en.lua
@@ -1362,6 +1362,7 @@ local strings = {
     -- Module: Info Panel
     LUIE_STRING_LAM_PNL = "Info Panel",
     LUIE_STRING_LAM_PNL_ENABLE = "Info Panel Module",
+    LUIE_STRING_LAM_PNL_HIDE_IN_COMBAT = "Hide Info Panel in Combat",
     LUIE_STRING_LAM_PNL_DESCRIPTION = "Displays a panel with potentially useful information on it such as Latency, Time, FPS, Durability and Weapon Charge, etc...",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO = "Disable colors on read-only values",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO_TP = "Disable value-dependent color of the information label for items that you don't have direct control: Currently this includes FPS and Latency labels.",
diff --git a/i18n/settings/Settings_fr.lua b/i18n/settings/Settings_fr.lua
index 4297362..ebf3e27 100644
--- a/i18n/settings/Settings_fr.lua
+++ b/i18n/settings/Settings_fr.lua
@@ -1362,6 +1362,7 @@ local strings = {
     -- Module: Info Panel
     LUIE_STRING_LAM_PNL = "Panneau d'informations",
     LUIE_STRING_LAM_PNL_ENABLE = "Module du panneau d'informations",
+    LUIE_STRING_LAM_PNL_HIDE_IN_COMBAT = "Masquer le panneau d'informations en combat",
     LUIE_STRING_LAM_PNL_DESCRIPTION = "Affiche un panneau avec des informations utiles comme la latence, les FPS, l'usage de l'armure et les charges des armes, etc...",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO = "Désactiver les couleurs des données en lecture seule",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO_TP = "Disable value-dependent color of the information label for items that you don't have direct control: Currently this includes FPS and Latency labels.",
diff --git a/i18n/settings/Settings_ru.lua b/i18n/settings/Settings_ru.lua
index 508da2d..a419943 100644
--- a/i18n/settings/Settings_ru.lua
+++ b/i18n/settings/Settings_ru.lua
@@ -1362,6 +1362,7 @@ local strings = {
     -- Module: Info Panel
     LUIE_STRING_LAM_PNL = "Инфо-панель",
     LUIE_STRING_LAM_PNL_ENABLE = "Инфо-панель",
+    UIE_STRING_LAM_PNL_HIDE_IN_COMBAT = "Скрыть информационную панель в бою",
     LUIE_STRING_LAM_PNL_DESCRIPTION = "Показывает панель с потенциально полезной информацией, такой как: задержка, время, FPS, прочность брони, заряд оружия и прочее...",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO = "Отключить цвет значений только для чтения",
     LUIE_STRING_LAM_PNL_DISABLECOLORSRO_TP = "Отключает цвет в зависимости от значения для таких вещей, которые игрок не может контролировать: На текущий момент это включает FPS и Задержку (пинг).",
diff --git a/modules/InfoPanel/InfoPanel.lua b/modules/InfoPanel/InfoPanel.lua
index f835f6f..e893e5c 100644
--- a/modules/InfoPanel/InfoPanel.lua
+++ b/modules/InfoPanel/InfoPanel.lua
@@ -418,6 +418,10 @@ local function FormatClock(clockFormat)
 end

 function InfoPanel.OnUpdate01()
+    -- Hide Info Panel in Combat 
+    if InfoPanel.SV.Hide_In_Combat then
+        uiPanel:SetHidden(IsUnitInCombat("player"))
+    end
     -- Update time
     uiClock.label:SetText(FormatClock(InfoPanel.SV.ClockFormat))

diff --git a/settings/InfoPanel.lua b/settings/InfoPanel.lua
index 909c16b..896ea7e 100644
--- a/settings/InfoPanel.lua
+++ b/settings/InfoPanel.lua
@@ -69,6 +69,20 @@ function InfoPanel.CreateSettings()
         resetFunc = InfoPanel.ResetPosition,
     }

+    -- Hide InfoPanel In Combat
+    optionsDataInfoPanel[#optionsDataInfoPanel+1] = {
+        type = "checkbox",
+        name = GetString(LUIE_STRING_LAM_PNL_HIDE_IN_COMBAT),
+        getFunc = function ()
+            return Settings.Hide_In_Combat
+        end,
+        setFunc = function (value)
+            Settings.Hide_In_Combat = value
+        end,
+        width = "full",
+        default = false,
+    }
+
     -- InfoPanel scale
     optionsDataInfoPanel[#optionsDataInfoPanel+1] = {
         type = "slider",