Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Options/locales/enUS.lua
- ===================================================================
- --- Options/locales/enUS.lua (revision 638)
- +++ Options/locales/enUS.lua (working copy)
- @@ -594,6 +594,19 @@
- L["Maximum shield amount"] = true
- L["Maximum shield amount value. Only used by bar indicators."] = true
- +L["Shield-Color1-Name"] = "Normal"
- +L["Shield-Color2-Name"] = "Medium"
- +L["Shield-Color3-Name"] = "Low"
- +
- +L["Shield-Color1-Desc"] = "Normal shield color"
- +L["Shield-Color2-Desc"] = "Medium shield color"
- +L["Shield-Color3-Desc"] = "Low shield color"
- +
- +L["Low shield threshold"] = true
- +L["The value below which a shield is considered low."] = true
- +L["Medium shield threshold"] = true
- +L["The value below which a shield is considered medium."] = true
- +
- -- aoe heals
- L["aoe-"] = true
- L["neighbors"] = true
- Index: Options/GridStatuses.lua
- ===================================================================
- --- Options/GridStatuses.lua (revision 638)
- +++ Options/GridStatuses.lua (working copy)
- @@ -532,8 +532,26 @@
- end
- function Grid2Options:MakeStatusShieldsOptions(status, options, optionParams)
- +
- + -- Ugly hack to upgrade status config in ace database
- + if not status.dbx.colorCount or status.dbx.colorCount < 3 then status.dbx.colorCount = 3 end
- + if not status.dbx.color2 then status.dbx.color2 = { r = 1, g = 0.5, b = 0, a = 1 } end
- + if not status.dbx.color3 then status.dbx.color3 = { r = 1, g = 0, b = 0, a = 1 } end
- + if not status.dbx.thresholdMedium then status.dbx.thresholdMedium = 15000 end
- + if not status.dbx.thresholdLow then status.dbx.thresholdLow = 6000 end
- +
- options = options or {}
- - options = Grid2Options:MakeStatusColorOptions(status, options, optionParams)
- + options = Grid2Options:MakeStatusColorOptions(status, options, {
- + color1 = L["Shield-Color1-Name"],
- + colorDesc1 = L["Shield-Color1-Desc"],
- + color2 = L["Shield-Color2-Name"],
- + colorDesc2 = L["Shield-Color1-Desc"],
- + color3 = L["Shield-Color3-Name"],
- + colorDesc3 = L["Shield-Color1-Desc"],
- + })
- +
- + options.spacer1 = { type = "header", order = 28, name = "", }
- +
- options.maxShieldAmount = {
- type = "range",
- order = 30,
- @@ -548,6 +566,38 @@
- status:UpdateDB()
- end,
- }
- + options.thresholdMedium = {
- + type = "range",
- + order = 32,
- + name = L["Medium shield threshold"],
- + desc = L["The value below which a shield is considered medium."],
- + min = 0,
- + softMax = 100000,
- + bigStep = 100,
- + step = 1,
- + get = function () return status.dbx.thresholdMedium end,
- + set = function (_, v)
- + if status.dbx.thresholdLow > v then v = status.dbx.thresholdLow end
- + status.dbx.thresholdMedium = v
- + status:UpdateDB()
- + end,
- + }
- + options.thresholdLow = {
- + type = "range",
- + order = 34,
- + name = L["Low shield threshold"],
- + desc = L["The value below which a shield is considered low."],
- + min = 0,
- + softMax = 100000,
- + bigStep = 100,
- + step = 1,
- + get = function () return status.dbx.thresholdLow end,
- + set = function (_, v)
- + if status.dbx.thresholdMedium < v then v = status.dbx.thresholdMedium end
- + status.dbx.thresholdLow = v
- + status:UpdateDB()
- + end,
- + }
- options.filter = {
- type = "group",
- order = 40,
- Index: GridDefaults.lua
- ===================================================================
- --- GridDefaults.lua (revision 638)
- +++ GridDefaults.lua (working copy)
- @@ -386,7 +386,7 @@
- color4 = {r=1,g=1 ,b=0 ,a=1}, -- energy
- color5 = {r=0,g=0.8,b=0.8,a=1}, -- runic power
- })
- - Grid2:DbSetMissingValue( "statuses", "shields", { type = "shields", color1 = {r=0,g=1,b=0,a=1} })
- + Grid2:DbSetMissingValue( "statuses", "shields", { type = "shields", colorCount = 3, color1 = {r=0,g=1,b=0,a=1}, color2 = {r=1,g=0.5,b=0,a=1}, color3 = {r=1,g=0,b=0,a=1}, thresholdMedium = 15000, thresholdLow = 6000 })
- if Grid2:DbSetMissingValue( "statuses", "resurrection", { type = "resurrection", colorCount = 2,
- color1 = { r = 0, g = 1, b = 0, a=1 },
- color2 = { r = 1, g = 1, b = 0, a=0.75 }, })
- Index: modules/StatusShields.lua
- ===================================================================
- --- modules/StatusShields.lua (revision 638)
- +++ modules/StatusShields.lua (working copy)
- @@ -104,7 +104,18 @@
- end
- function Shields:GetColor(unit)
- - local c = self.dbx.color1
- + local c
- + local amount = shields_tot[unit]
- + local db = self.dbx
- +
- + if amount > db.thresholdMedium then
- + c = db.color1
- + elseif amount > db.thresholdLow then
- + c = db.color2
- + else
- + c = db.color3
- + end
- +
- return c.r, c.g, c.b, c.a
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement