From 0fc23444e20eb79f413a1fd63b1c77f2f4b1fc3b Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 20 Oct 2010 05:08:49 +0000 Subject: [PATCH] - added description text to each custom module explaining what type of module it is. it was pretty difficult to figure out what kind of custom module you were looking at in the config after you created it --- IceElement.lua | 21 +++++++++++++++++++++ modules/CustomBar.lua | 6 ++++++ modules/CustomCDBar.lua | 6 ++++++ modules/CustomCount.lua | 6 ++++++ modules/CustomHealth.lua | 6 ++++++ modules/CustomMana.lua | 6 ++++++ 6 files changed, 51 insertions(+) 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"],