From eec32923cb0ca08f4870be6aa61f11a3d6945a95 Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 10 Nov 2016 23:42:08 +0100 Subject: [PATCH] cooldown: add option to set the minimal cooldown to display --- modules/config.lua | 1 + modules/cooldown.lua | 4 ++-- modules/gui.lua | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/config.lua b/modules/config.lua index 23d08648..e2dadeff 100644 --- a/modules/config.lua +++ b/modules/config.lua @@ -7,6 +7,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("global", nil, "font_default", "arial") pfUI:UpdateConfig("global", nil, "font_square", "homespun") pfUI:UpdateConfig("global", nil, "font_combat", "diediedie") + pfUI:UpdateConfig("global", nil, "cooldown_min", "2") pfUI:UpdateConfig("unitframes", nil, "animation_speed", "5") pfUI:UpdateConfig("unitframes", nil, "portrait", "1") pfUI:UpdateConfig("unitframes", nil, "buff_size", "22") diff --git a/modules/cooldown.lua b/modules/cooldown.lua index 0cc59a06..10da824e 100644 --- a/modules/cooldown.lua +++ b/modules/cooldown.lua @@ -4,7 +4,7 @@ pfUI:RegisterModule("cooldown", function () -- disable animation this:SetPosition(1,1,1) - if ( start > 0 and duration > 2 and enable > 0) then + if ( start > 0 and duration > tonumber(pfUI_config.global.cooldown_min) and enable > 0) then this.start = start this.duration = duration this.stopping = 0 @@ -40,7 +40,7 @@ pfUI:RegisterModule("cooldown", function () local remaining = this.duration - (GetTime() - this.start) -- disable GCD notify - if (remaining >= 0 and this.duration > 2) then + if (remaining >= 0 and this.duration > tonumber(pfUI_config.global.cooldown_min)) then this.cd:Show() local unit = "" if remaining > 99 then diff --git a/modules/gui.lua b/modules/gui.lua index 86608907..eb8f0679 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -557,6 +557,7 @@ pfUI:RegisterModule("gui", function () pfUI.gui:CreateConfig(pfUI.gui.global, "Default Font", pfUI_config.global, "font_default", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.global, "Square Font", pfUI_config.global, "font_square", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.global, "Combat Font", pfUI_config.global, "font_combat", "dropdown", values) + pfUI.gui:CreateConfig(pfUI.gui.global, "Minimal Cooldown duration (seconds)", pfUI_config.global, "cooldown_min") -- modules pfUI.gui.modules = pfUI.gui:CreateConfigTab("Modules")