From ba7d0a8ff46033d864292edfb8601ce91eace1b7 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Thu, 1 Feb 2018 20:05:11 +0700 Subject: [PATCH] Added the option to use hotkey text as OOM indicator --- config/bars.lua | 21 ++++++++++++++++++--- core/defaults.lua | 1 + embeds/LibActionButton-1.0 | 2 +- locales/enUS.lua | 1 + modules/bars/actionbars.lua | 1 + 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/config/bars.lua b/config/bars.lua index 739f060a..44ade047 100644 --- a/config/bars.lua +++ b/config/bars.lua @@ -30,7 +30,7 @@ local flyout_dirs = { RIGHT = L["RIGHT"], } -local range_indicators = { +local button_indicators = { button = L["ICON"], hotkey = L["KEYBIND_TEXT"], } @@ -545,8 +545,8 @@ function CONFIG.CreateActionBarsPanel(_, order) range_indicator = { order = 12, type = "select", - values = range_indicators, name = L["OOR_INDICATOR"], + values = button_indicators, disabled = function() return not BARS:IsInit() end, get = function() return C.db.profile.bars.range_indicator @@ -557,8 +557,23 @@ function CONFIG.CreateActionBarsPanel(_, order) BARS:UpdateBars("UpdateButtonConfig") end, }, - desaturate_on_cd = { + mana_indicator = { order = 13, + type = "select", + name = L["OOM_INDICATOR"], + values = button_indicators, + disabled = function() return not BARS:IsInit() end, + get = function() + return C.db.profile.bars.mana_indicator + end, + set = function(_, value) + C.db.profile.bars.mana_indicator = value + BARS:UpdateBars("UpdateConfig") + BARS:UpdateBars("UpdateButtonConfig") + end, + }, + desaturate_on_cd = { + order = 14, type = "toggle", name = L["DESATURATE_ON_COOLDOWN"], disabled = function() return not BARS:IsInit() end, diff --git a/core/defaults.lua b/core/defaults.lua index df655879..82213627 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -2062,6 +2062,7 @@ D.profile = { }, }, bars = { + mana_indicator = "button", -- hotkey range_indicator = "button", -- hotkey lock = true, -- watch: LOCK_ACTIONBAR rightclick_selfcast = false, diff --git a/embeds/LibActionButton-1.0 b/embeds/LibActionButton-1.0 index eebe5d71..5019154e 160000 --- a/embeds/LibActionButton-1.0 +++ b/embeds/LibActionButton-1.0 @@ -1 +1 @@ -Subproject commit eebe5d71885dbe731fd46d33a612e16d50376edc +Subproject commit 5019154eaa81a3ad225a8a6085960a3ea75ab75e diff --git a/locales/enUS.lua b/locales/enUS.lua index ab2d31ea..a629ea32 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -228,6 +228,7 @@ L["NPE_FRAME"] = "NPE Tutorial Frame" L["NUM_BUTTONS"] = "Number of Buttons" L["NUM_ROWS"] = "Number of Rows" L["OBJECTIVE_TRACKER"] = "Objective Tracker" +L["OOM_INDICATOR"] = "Out-of-Mana Indicator" L["OOR_INDICATOR"] = "Out-of-Range Indicator" L["OPEN_CONFIG"] = "Open Config" L["ORBS"] = "Orbs" diff --git a/modules/bars/actionbars.lua b/modules/bars/actionbars.lua index bf2afd88..e7ef67c3 100644 --- a/modules/bars/actionbars.lua +++ b/modules/bars/actionbars.lua @@ -136,6 +136,7 @@ local function bar_UpdateButtonConfig(self) self.buttonConfig.desaturateOnCooldown = C.db.profile.bars.desaturate_on_cd self.buttonConfig.flyoutDirection = self._config.flyout_dir + self.buttonConfig.outOfManaColoring = C.db.profile.bars.mana_indicator self.buttonConfig.outOfRangeColoring = C.db.profile.bars.range_indicator self.buttonConfig.showGrid = self._config.grid