diff --git a/Config/OptionsTables.lua b/Config/OptionsTables.lua index 93ae519..8d07e48 100644 --- a/Config/OptionsTables.lua +++ b/Config/OptionsTables.lua @@ -1503,6 +1503,26 @@ function Addon:MakeExtraOptions(categoryName, chatCmd, arg1, ...) CreateHide(opts, stat) end + + -- Cooldown + do + local stat = "Cooldown" + + local sampleCooldown = 10 + local defaultText = format(ITEM_COOLDOWN_TIME_MIN, sampleCooldown) + + local samples = {} + local defaultText, formattedText = GetFormattedText(stat, self.COLORS.WHITE, defaultText, defaultText) + tinsert(samples, {defaultText, formattedText}) + + local opts = GUI:CreateGroup(opts, stat, samples[1][2], nil, nil, disabled) + + CreateSamples(opts, samples) + + CreateColor(opts, stat) + + CreateHide(opts, stat) + end GUI:CreateGroup(opts, GUI:Order(), " ", nil, nil, true) -- Made By diff --git a/Data/Data.lua b/Data/Data.lua index 8fd8a07..05a6067 100644 --- a/Data/Data.lua +++ b/Data/Data.lua @@ -697,6 +697,9 @@ do end end + + -- Default color settings + self.statsInfo["Title"] = {color = self.COLORS.WHITE} self.statsInfo["Heroic"] = {color = self.COLORS.GREEN} @@ -724,6 +727,7 @@ do self.statsInfo["Charges"] = {color = self.COLORS.WHITE} self.statsInfo["NoCharges"] = {color = self.COLORS.RED} + self.statsInfo["Cooldown"] = {color = self.COLORS.RED} self.statsInfo["Durability"] = {color = self.COLORS.WHITE} diff --git a/Operations/CalculatePadding.lua b/Operations/CalculatePadding.lua index 64b222c..873410f 100644 --- a/Operations/CalculatePadding.lua +++ b/Operations/CalculatePadding.lua @@ -17,8 +17,8 @@ local enchantLines = { } local padLocations = { [-1] = { - BaseStat = function(line) return line.type == "BaseStat" or Addon:GetOption"combineStats" and (line.type == "SecondaryStat" or line.type == "Charges" or Addon:GetOption("doReorder", "EnchantOnUse") and line.type == "EnchantOnUse") end, - SecondaryStat = function(line) return(line.type == "SecondaryStat" or line.type == "Charges" or Addon:GetOption("doReorder", "EnchantOnUse") and (line.type == "EnchantOnUse" or line.type == "RequiredEnchantOnUse")) and not Addon:GetOption"combineStats" end, + BaseStat = function(line) return line.type == "BaseStat" or Addon:GetOption"combineStats" and (line.type == "SecondaryStat" or line.type == "Charges" or line.type == "Cooldown" or Addon:GetOption("doReorder", "EnchantOnUse") and line.type == "EnchantOnUse") end, + SecondaryStat = function(line) return(line.type == "SecondaryStat" or line.type == "Charges" or line.type == "Cooldown" or Addon:GetOption("doReorder", "EnchantOnUse") and (line.type == "EnchantOnUse" or line.type == "RequiredEnchantOnUse")) and not Addon:GetOption"combineStats" end, Enchant = function(line) return enchantLines[line.type] or not Addon:GetOption("doReorder", "EnchantOnUse") and line.type == "EnchantOnUse" end, WeaponEnchant = function(line) return line.type == "WeaponEnchant" end, Socket = function(line) return line.type == "Socket" end, @@ -26,8 +26,8 @@ local padLocations = { SetBonus = function(line) return line.type == "SetBonus" end, }, [1] = { - BaseStat = function(line) return line.type == "BaseStat" or Addon:GetOption"combineStats" and (line.type == "SecondaryStat" or line.type == "Charges" or Addon:GetOption("doReorder", "EnchantOnUse") and (line.type == "EnchantOnUse" or line.type == "RequiredEnchantOnUse")) end, - SecondaryStat = function(line) return(line.type == "SecondaryStat" or line.type == "Charges" or Addon:GetOption("doReorder", "EnchantOnUse") and (line.type == "EnchantOnUse" or line.type == "RequiredEnchantOnUse")) and not Addon:GetOption"combineStats" end, + BaseStat = function(line) return line.type == "BaseStat" or Addon:GetOption"combineStats" and (line.type == "SecondaryStat" or line.type == "Charges" or line.type == "Cooldown" or Addon:GetOption("doReorder", "EnchantOnUse") and (line.type == "EnchantOnUse" or line.type == "RequiredEnchantOnUse")) end, + SecondaryStat = function(line) return(line.type == "SecondaryStat" or line.type == "Charges" or line.type == "Cooldown" or Addon:GetOption("doReorder", "EnchantOnUse") and (line.type == "EnchantOnUse" or line.type == "RequiredEnchantOnUse")) and not Addon:GetOption"combineStats" end, Enchant = function(line) return enchantLines[line.type] or line.type == "RequiredEnchant" or not Addon:GetOption("doReorder", "EnchantOnUse") and (line.type == "EnchantOnUse" or line.type == "RequiredEnchantOnUse") end, WeaponEnchant = function(line) return line.type == "WeaponEnchant" end, SocketBonus = function(line) return line.type == "SocketBonus" or line.type == "Socket" or Addon:GetOption("doReorder", "SocketHint") and line.type == "SocketHint" end, diff --git a/Operations/RecognizeLineTypes.lua b/Operations/RecognizeLineTypes.lua index 92df3e4..4aba073 100644 --- a/Operations/RecognizeLineTypes.lua +++ b/Operations/RecognizeLineTypes.lua @@ -110,6 +110,7 @@ local contexts = Addon:MakeLookupTable({ "LastSetPiece", "SetBonus", "LastSetBonus", + "Cooldown", "MadeBy", "SocketHint", "Refundable", @@ -482,6 +483,11 @@ contextActions = Addon:Map({ return SetContext(i-1, tooltipData, line) end end, + Cooldown = function(i, tooltipData, line) + if MatchesAny(line.textLeftTextStripped, ITEM_COOLDOWN_TIME) then + return SetContext(i, tooltipData, line) + end + end, MadeBy = function(i, tooltipData, line) local madeType = line.colorLeft == Addon.COLORS.GREEN and MatchesAny(line.textLeftTextStripped, ITEM_CREATED_BY, ITEM_WRAPPED_BY, ITEM_WRITTEN_BY) if madeType then diff --git a/Operations/ReorderLines.lua b/Operations/ReorderLines.lua index 8326e25..73fd344 100644 --- a/Operations/ReorderLines.lua +++ b/Operations/ReorderLines.lua @@ -25,6 +25,7 @@ local function SortStats(tooltipData) BaseStat = {}, SecondaryStat = {}, Charges = {}, + Cooldown = {}, EnchantOnUse = {}, RequiredEnchantOnUse = {}, } @@ -54,6 +55,9 @@ local function SortStats(tooltipData) for i = #stats.Charges, 1, -1 do tinsert(stats.SecondaryStat, tblRemove(stats.Charges, 1)) end + for i = #stats.Cooldown, 1, -1 do + tinsert(stats.SecondaryStat, tblRemove(stats.Cooldown, 1)) + end if self:GetOption("doReorder", "EnchantOnUse") then for i = #stats.EnchantOnUse, 1, -1 do