Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Defaults/Layout_Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ Cell.defaults.layout = {
["position"] = {"BOTTOMLEFT", nil, "BOTTOMLEFT", 0, 0},
["frameLevel"] = 5,
["height"] = 4,
["texture"] = "Cell ".._G.DEFAULT,
["color"] = {1, 1, 0, 1},
["onlyShowOvershields"] = false,
}, -- 16
Expand Down
1 change: 1 addition & 0 deletions Defaults/Layout_Defaults_Cata_Wrath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ Cell.defaults.layout = {
["position"] = {"BOTTOMLEFT", nil, "BOTTOMLEFT", 0, 0},
["frameLevel"] = 5,
["height"] = 4,
["texture"] = "Cell ".._G.DEFAULT,
["color"] = {1, 1, 0, 1},
["onlyShowOvershields"] = false,
}, -- 16
Expand Down
14 changes: 12 additions & 2 deletions Indicators/Built-in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ local P = Cell.pixelPerfectFuncs

local LCG = LibStub("LibCustomGlow-1.0")
local LibTranslit = LibStub("LibTranslit-1.0")
local LSM = LibStub("LibSharedMedia-3.0", true)

local function noop() end

Expand Down Expand Up @@ -2096,7 +2097,16 @@ function I.CreateShieldBar(parent)
shieldBar.parentHealthBar = parent.widgets.healthBar

function shieldBar:SetColor(r, g, b, a)
tex:SetColorTexture(r, g, b, a)
tex:SetVertexColor(r, g, b, a)
end

function shieldBar:SetTexture(name, ...)
local barTextures = F.Copy(LSM:HashTable("statusbar"))
if barTextures[name] then
tex:SetTexture(barTextures[name], ...)
else
tex:SetTexture(name, ...)
end
end

function shieldBar:UpdatePixelPerfect()
Expand Down Expand Up @@ -2462,4 +2472,4 @@ function I.ShowMissingBuff(unit, icon)
if missingBuffsCounter[unit] > 3 then return end

F.HandleUnitButton("unit", unit, ShowMissingBuff, missingBuffsCounter[unit], icon)
end
end
7 changes: 4 additions & 3 deletions Modules/Indicators/Indicators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ if Cell.isRetail or Cell.isMists then
["aggroBlink"] = {"enabled", "size", "position", "frameLevel"},
["aggroBorder"] = {"enabled", "thickness", "frameLevel"},
["aggroBar"] = {"enabled", "size", "position", "frameLevel"},
["shieldBar"] = {"enabled", "checkbutton:onlyShowOvershields", "color-alpha", "height", "shieldBarPosition", "frameLevel"},
["shieldBar"] = {"enabled", "checkbutton:onlyShowOvershields", "bartexture", "color-alpha", "height", "shieldBarPosition", "frameLevel"},
["aoeHealing"] = {"|cffb7b7b7"..L["Display a gradient texture when the unit receives a heal from your certain healing spells."], "enabled", "builtInAoEHealings", "customAoEHealings", "color", "height"},
["externalCooldowns"] = {L["Even if disabled, the settings below affect \"Externals + Defensives\" indicator"], "enabled", "builtInExternals", "customExternals", "durationVisibility", "checkbutton:showAnimation", "glowOptions", "size", "num:5", "orientation", "position", "frameLevel", "font1:stackFont", "font2:durationFont"},
["defensiveCooldowns"] = {L["Even if disabled, the settings below affect \"Externals + Defensives\" indicator"], "enabled", "builtInDefensives", "customDefensives", "durationVisibility", "checkbutton:showAnimation", "glowOptions", "size", "num:5", "orientation", "position", "frameLevel", "font1:stackFont", "font2:durationFont"},
Expand Down Expand Up @@ -1610,7 +1610,7 @@ elseif Cell.isCata or Cell.isWrath then
["aggroBlink"] = {"enabled", "size", "position", "frameLevel"},
["aggroBorder"] = {"enabled", "thickness", "frameLevel"},
["aggroBar"] = {"enabled", "size", "position", "frameLevel"},
["shieldBar"] = {"enabled", "checkbutton:onlyShowOvershields", "color-alpha", "height", "shieldBarPosition", "frameLevel"},
["shieldBar"] = {"enabled", "checkbutton:onlyShowOvershields", "bartexture", "color-alpha", "height", "shieldBarPosition", "frameLevel"},
["powerWordShield"] = {L["To show shield value, |cffff2727Glyph of Power Word: Shield|r is required"], "enabled", "checkbutton:shieldByMe", "shape", "size-square", "position", "frameLevel"},
["aoeHealing"] = {"|cffb7b7b7"..L["Display a gradient texture when the unit receives a heal from your certain healing spells."], "enabled", "builtInAoEHealings", "customAoEHealings", "color", "height"},
["externalCooldowns"] = {L["Even if disabled, the settings below affect \"Externals + Defensives\" indicator"], "enabled", "builtInExternals", "customExternals", "durationVisibility", "checkbutton:showAnimation", "glowOptions", "size", "num:5", "orientation", "position", "frameLevel", "font1:stackFont", "font2:durationFont"},
Expand Down Expand Up @@ -1753,6 +1753,7 @@ local function ShowIndicatorSettings(id)
if currentSetting == "barOrientation" then currentSetting = "orientation" end
if currentSetting == "durationVisibility" then currentSetting = "showDuration" end
if currentSetting == "powerFormat" then currentSetting = "format" end
if currentSetting == "bartexture" then currentSetting = "texture" end

-- enabled
if currentSetting == "enabled" then
Expand Down Expand Up @@ -2349,4 +2350,4 @@ local function IndicatorsChanged(layout)
listButtons[1]:Click()
end
end
Cell.RegisterCallback("IndicatorsChanged", "IndicatorsTab_IndicatorsChanged", IndicatorsChanged)
Cell.RegisterCallback("IndicatorsChanged", "IndicatorsTab_IndicatorsChanged", IndicatorsChanged)
61 changes: 60 additions & 1 deletion Widgets/Widgets_IndicatorSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local I = Cell.iFuncs
---@type PixelPerfectFuncs
local P = Cell.pixelPerfectFuncs
local LCG = LibStub("LibCustomGlow-1.0")
local LSM = LibStub("LibSharedMedia-3.0", true)

-----------------------------------------
-- Color
Expand Down Expand Up @@ -4088,6 +4089,63 @@ local function CreateSetting_Texture(parent)
return widget
end

local function CreateSetting_BarTexture(parent)
local widget

if not settingWidgets["bartexture"] then
widget = Cell.CreateFrame("CellIndicatorSettings_BarTexture", parent, 240, 50)
settingWidgets["bartexture"] = widget

widget.textureDropdown = Cell.CreateDropdown(widget, 245, "texture")
widget.textureDropdown:SetPoint("TOPLEFT", 5, -20)

local items = {}
local textures, textureNames
local defaultTexture, defaultTextureName = "Interface\\AddOns\\Cell\\Media\\statusbar.tga", "Cell ".._G.DEFAULT

textures, textureNames = F.Copy(LSM:HashTable("statusbar")), F.Copy(LSM:List("statusbar"))

-- make default texture first
F.TRemove(textureNames, defaultTextureName)
tinsert(textureNames, 1, defaultTextureName)

for _, name in pairs(textureNames) do
tinsert(items, {
["text"] = name,
["texture"] = textures[name],
["onClick"] = function()
widget.func(name)
end,
})
end

widget.textureDropdown:SetItems(items)

widget.durationVisibilityText = widget:CreateFontString(nil, "OVERLAY", font_name)
widget.durationVisibilityText:SetText(L["Texture"])
widget.durationVisibilityText:SetPoint("BOTTOMLEFT", widget.textureDropdown, "TOPLEFT", 0, 1)

-- callback
function widget:SetFunc(func)
widget.func = func
end

-- show db value
function widget:SetDBValue(value)
if textures[value] then
widget.textureDropdown:SetSelected(value, textures[value])
else
widget.textureDropdown:SetSelected(defaultTextureName, defaultTexture)
end
end
else
widget = settingWidgets["bartexture"]
end

widget:Show()
return widget
end

local function CreateAuraButtons(parent, auraButtons, auraTable, noUpDownButtons, isZeroValid, hasColorPicker, updateHeightFunc)
local n = #auraTable

Expand Down Expand Up @@ -6781,6 +6839,7 @@ local builders = {
["targetedSpellsGlow"] = CreateSetting_Glow,
["texture"] = CreateSetting_Texture,
["builtInAoEHealings"] = CreateSetting_BuiltIns,
["bartexture"] = CreateSetting_BarTexture,
["builtInDefensives"] = CreateSetting_BuiltIns,
["builtInExternals"] = CreateSetting_BuiltIns,
["builtInCrowdControls"] = CreateSetting_BuiltIns,
Expand Down Expand Up @@ -6847,4 +6906,4 @@ function Cell.CreateIndicatorSettings(parent, settingsTable)
end

return widgetsTable
end
end