diff --git a/IceElement.lua b/IceElement.lua index 9d44f52..f6a5d1e 100644 --- a/IceElement.lua +++ b/IceElement.lua @@ -116,6 +116,27 @@ function IceElement.prototype:Redraw() end +function IceElement.prototype:GetBarTypeDescription(barType) + local pre = "|cff00ff00" + local post = "|r" + local retval = "" + + if barType == "CD" then + retval = L["Cooldown"] + elseif barType == "Bar" then + retval = L["(De)Buff watcher"] + elseif barType == "Counter" then + retval = L["Counter"] + elseif barType == "Health" then + retval = HEALTH + elseif barType == "Mana" then + retval = MANA + end + + return string.format("%s%s%s", pre, retval, post) +end + + -- inheriting classes should override this and provide -- AceOptions table for configuration function IceElement.prototype:GetOptions() diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index d7bdb69..47fdc6f 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -175,6 +175,12 @@ function IceCustomBar.prototype:GetOptions() order = 20.2, } + opts["type"] = { + type = "description", + name = string.format("%s %s", L["Module type:"], tostring(self:GetBarTypeDescription("Bar"))), + order = 21, + } + opts["name"] = { type = 'input', name = L["Bar name"], diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index 30e02a2..d0e30be 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -160,6 +160,12 @@ function IceCustomCDBar.prototype:GetOptions() order = 20.2, } + opts["type"] = { + type = "description", + name = string.format("%s %s", L["Module type:"], tostring(self:GetBarTypeDescription("CD"))), + order = 21, + } + opts["name"] = { type = 'input', name = L["Bar name"], diff --git a/modules/CustomCount.lua b/modules/CustomCount.lua index 67f784a..029176e 100644 --- a/modules/CustomCount.lua +++ b/modules/CustomCount.lua @@ -48,6 +48,12 @@ function IceCustomCount.prototype:GetOptions() order = 20.2, } + opts["type"] = { + type = "description", + name = string.format("%s %s", L["Module type:"], tostring(self:GetBarTypeDescription("Counter"))), + order = 21, + } + opts["name"] = { type = 'input', name = L["Counter name"], diff --git a/modules/CustomHealth.lua b/modules/CustomHealth.lua index cbded36..e52aa02 100644 --- a/modules/CustomHealth.lua +++ b/modules/CustomHealth.lua @@ -63,6 +63,12 @@ function IceCustomHealth.prototype:GetOptions() order = 20.2, } + opts["type"] = { + type = "description", + name = string.format("%s %s", L["Module type:"], tostring(self:GetBarTypeDescription("Health"))), + order = 21, + } + opts["name"] = { type = 'input', name = L["Bar name"], diff --git a/modules/CustomMana.lua b/modules/CustomMana.lua index 48ae769..0182264 100644 --- a/modules/CustomMana.lua +++ b/modules/CustomMana.lua @@ -64,6 +64,12 @@ function IceCustomMana.prototype:GetOptions() order = 20.2, } + opts["type"] = { + type = "description", + name = string.format("%s %s", L["Module type:"], tostring(self:GetBarTypeDescription("Mana"))), + order = 21, + } + opts["name"] = { type = 'input', name = L["Bar name"],