Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f2cfc8e
Replace Size with Width and Height
Soothx Jan 18, 2026
6e74275
Add global function to calculate size
Soothx Jan 18, 2026
5526cfe
Use global function to calculate tex coords
Soothx Jan 18, 2026
e95c6e4
Adjust sizes, replace size with height and width slider
Soothx Jan 18, 2026
deda991
allow icon width/heights to be set by 0.1 step
Soothx Jan 18, 2026
a239ebe
Merge branch 'main' into icon-custom-width-height
Soothx Jan 19, 2026
46ddef5
Remove texture size calculation for castbar
Soothx Jan 19, 2026
cdcc546
Add defaults for Additional bar and trinket bar, as well as sliders
Soothx Jan 19, 2026
fd7d1d8
Merge branch 'main' into icon-custom-width-height
Soothx Jan 19, 2026
7ba7db2
Merge branch 'DaleHuntGB:main' into icon-custom-width-height
Soothx Jan 19, 2026
9ded2f9
Merge branch 'DaleHuntGB:main' into icon-custom-width-height
Soothx Jan 19, 2026
8ba13d1
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 21, 2026
7b31813
Add width/height to ItemSpell bar
Soothx Jan 21, 2026
58f1891
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 21, 2026
bed7df1
Fix CustomItemSpellViewer
Soothx Jan 21, 2026
80d3397
Fix last aspect ratio texture
Soothx Jan 21, 2026
3136e8a
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 21, 2026
778205a
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 22, 2026
bfe0ee6
Fix GUI layouts
Soothx Jan 22, 2026
027a866
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 23, 2026
a64791b
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 24, 2026
b364feb
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 24, 2026
3190c45
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 26, 2026
05875f5
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 26, 2026
a6f50a3
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 27, 2026
c36aea4
Merge remote-tracking branch 'upstream/main' into icon-custom-width-h…
Soothx Jan 29, 2026
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
24 changes: 16 additions & 8 deletions Core/Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ local Defaults = {
},
},
Essential = {
IconSize = 42,
IconWidth = 42,
IconHeight = 42,
Layout = {"CENTER", "CENTER", 0, -275.1},
Text = {
FontSize = 15,
Expand All @@ -114,7 +115,8 @@ local Defaults = {
},
},
Utility = {
IconSize = 36,
IconWidth = 36,
IconHeight = 36,
Layout = {"TOP", "EssentialCooldownViewer", "BOTTOM", 0, -1.1},
Text = {
FontSize = 15,
Expand All @@ -123,7 +125,8 @@ local Defaults = {
},
},
Buffs = {
IconSize = 32,
IconWidth = 32,
IconHeight = 32,
CenterBuffs = false,
Layout = {"BOTTOM", "BCDM_SecondaryPowerBar", "TOP", 0, 1.1},
Text = {
Expand Down Expand Up @@ -162,7 +165,8 @@ local Defaults = {
}
},
Custom = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
Expand Down Expand Up @@ -255,7 +259,8 @@ local Defaults = {
},
},
AdditionalCustom = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
Expand Down Expand Up @@ -348,7 +353,8 @@ local Defaults = {
},
},
Item = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
Expand All @@ -363,7 +369,8 @@ local Defaults = {
},
Trinket = {
Enabled = true,
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
Expand All @@ -377,7 +384,8 @@ local Defaults = {
Trinkets = {},
},
ItemSpell = {
IconSize = 38,
IconWidth = 38,
IconHeight = 38,
FrameStrata = "LOW",
Layout = {"CENTER", "NONE", "CENTER", 0, 0},
Spacing = 1,
Expand Down
26 changes: 17 additions & 9 deletions Core/GUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1253,24 +1253,32 @@ local function CreateCooldownViewerSettings(parentContainer, viewerType)
xOffsetSlider:SetValue(BCDM.db.profile.CooldownManager[viewerType].Layout[hasAnchorParent and 4 or 3])
xOffsetSlider:SetSliderValues(-3000, 3000, 0.1)
xOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CooldownManager[viewerType].Layout[hasAnchorParent and 4 or 3] = value BCDM:UpdateCooldownViewer(viewerType) end)
xOffsetSlider:SetRelativeWidth(isCustomViewer and 0.25 or 0.33)
xOffsetSlider:SetRelativeWidth(0.25)
layoutContainer:AddChild(xOffsetSlider)

local yOffsetSlider = AG:Create("Slider")
yOffsetSlider:SetLabel("Y Offset")
yOffsetSlider:SetValue(BCDM.db.profile.CooldownManager[viewerType].Layout[hasAnchorParent and 5 or 4])
yOffsetSlider:SetSliderValues(-3000, 3000, 0.1)
yOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CooldownManager[viewerType].Layout[hasAnchorParent and 5 or 4] = value BCDM:UpdateCooldownViewer(viewerType) end)
yOffsetSlider:SetRelativeWidth(isCustomViewer and 0.25 or 0.33)
yOffsetSlider:SetRelativeWidth(0.25)
layoutContainer:AddChild(yOffsetSlider)

local iconSizeSlider = AG:Create("Slider")
iconSizeSlider:SetLabel("Icon Size")
iconSizeSlider:SetValue(BCDM.db.profile.CooldownManager[viewerType].IconSize)
iconSizeSlider:SetSliderValues(16, 128, 0.1)
iconSizeSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CooldownManager[viewerType].IconSize = value BCDM:UpdateCooldownViewer(viewerType) end)
iconSizeSlider:SetRelativeWidth(isCustomViewer and 0.25 or 0.33)
layoutContainer:AddChild(iconSizeSlider)
local iconWidthSlider = AG:Create("Slider")
iconWidthSlider:SetLabel("Icon Width")
iconWidthSlider:SetValue(BCDM.db.profile.CooldownManager[viewerType].IconWidth)
iconWidthSlider:SetSliderValues(16, 128, 0.1)
iconWidthSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CooldownManager[viewerType].IconWidth = value BCDM:UpdateCooldownViewer(viewerType) end)
iconWidthSlider:SetRelativeWidth(0.25)
layoutContainer:AddChild(iconWidthSlider)

local iconHeightSlider = AG:Create("Slider")
iconHeightSlider:SetLabel("Icon Height")
iconHeightSlider:SetValue(BCDM.db.profile.CooldownManager[viewerType].IconHeight)
iconHeightSlider:SetSliderValues(16, 128, 0.1)
iconHeightSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CooldownManager[viewerType].IconHeight = value BCDM:UpdateCooldownViewer(viewerType) end)
iconHeightSlider:SetRelativeWidth(0.25)
layoutContainer:AddChild(iconHeightSlider)

if viewerType == "Essential" or viewerType == "Utility" or viewerType == "Buffs" then
local infoTag = CreateInformationTag(layoutContainer, "Updates To Sizes will be applied on closing the |cFF8080FFBetter|rCooldownManager Configuration Window.")
Expand Down
27 changes: 14 additions & 13 deletions Modules/AdditionalCustomCooldownViewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ local function CreateCustomIcon(spellId)
else
customIcon:SetBackdropBorderColor(0, 0, 0, 1)
end
customIcon:SetSize(CustomDB.IconSize, CustomDB.IconSize)
customIcon:SetSize(CustomDB.IconWidth, CustomDB.IconHeight)
local anchorParent = CustomDB.Layout[2] == "NONE" and UIParent or _G[CustomDB.Layout[2]]
customIcon:SetPoint(CustomDB.Layout[1], anchorParent, CustomDB.Layout[3], CustomDB.Layout[4], CustomDB.Layout[5])
customIcon:RegisterEvent("SPELL_UPDATE_COOLDOWN")
Expand Down Expand Up @@ -117,8 +117,8 @@ local function CreateCustomIcon(spellId)
local borderSize = BCDM.db.profile.CooldownManager.General.BorderSize
customIcon.Icon:SetPoint("TOPLEFT", customIcon, "TOPLEFT", borderSize, -borderSize)
customIcon.Icon:SetPoint("BOTTOMRIGHT", customIcon, "BOTTOMRIGHT", -borderSize, borderSize)
local iconZoom = BCDM.db.profile.CooldownManager.General.IconZoom * 0.5
customIcon.Icon:SetTexCoord(iconZoom, 1 - iconZoom, iconZoom, 1 - iconZoom)
local zoom = BCDM.db.profile.CooldownManager.General.IconZoom
customIcon.Icon:SetTexCoord(BCDM:CalculateTexCoords(zoom, CustomDB.IconWidth, CustomDB.IconHeight))
customIcon.Icon:SetTexture(C_Spell.GetSpellInfo(spellId).iconID)

return customIcon
Expand Down Expand Up @@ -186,7 +186,8 @@ local function LayoutAdditionalCustomCooldownViewer()

CreateCustomIcons(AdditionalCustomCooldownViewerIcons)

local iconSize = CustomDB.IconSize
local iconWidth = CustomDB.IconWidth
local iconHeight = CustomDB.IconHeight
local iconSpacing = CustomDB.Spacing

-- Calculate and set container size first
Expand All @@ -198,11 +199,11 @@ local function LayoutAdditionalCustomCooldownViewer()

local totalWidth, totalHeight = 0, 0
if useCenteredLayout or growthDirection == "RIGHT" or growthDirection == "LEFT" then
totalWidth = (#AdditionalCustomCooldownViewerIcons * iconSize) + ((#AdditionalCustomCooldownViewerIcons - 1) * iconSpacing)
totalHeight = iconSize
totalWidth = (#AdditionalCustomCooldownViewerIcons * iconWidth) + ((#AdditionalCustomCooldownViewerIcons - 1) * iconSpacing)
totalHeight = iconHeight
elseif growthDirection == "UP" or growthDirection == "DOWN" then
totalWidth = iconSize
totalHeight = (#AdditionalCustomCooldownViewerIcons * iconSize) + ((#AdditionalCustomCooldownViewerIcons - 1) * iconSpacing)
totalWidth = iconWidth
totalHeight = (#AdditionalCustomCooldownViewerIcons * iconHeight) + ((#AdditionalCustomCooldownViewerIcons - 1) * iconSpacing)
end
BCDM.AdditionalCustomCooldownViewerContainer:SetSize(totalWidth, totalHeight)
end
Expand All @@ -223,23 +224,23 @@ local function LayoutAdditionalCustomCooldownViewer()
local useCenteredLayout = (point == "TOP" or point == "BOTTOM") and (growthDirection == "LEFT" or growthDirection == "RIGHT")

if useCenteredLayout and #AdditionalCustomCooldownViewerIcons > 0 then
local totalWidth = (#AdditionalCustomCooldownViewerIcons * iconSize) + ((#AdditionalCustomCooldownViewerIcons - 1) * iconSpacing)
local startOffset = -(totalWidth / 2) + (iconSize / 2)
local totalWidth = (#AdditionalCustomCooldownViewerIcons * iconWidth) + ((#AdditionalCustomCooldownViewerIcons - 1) * iconSpacing)
local startOffset = -(totalWidth / 2) + (iconWidth / 2)

for i, spellIcon in ipairs(AdditionalCustomCooldownViewerIcons) do
spellIcon:SetParent(BCDM.AdditionalCustomCooldownViewerContainer)
spellIcon:SetSize(iconSize, iconSize)
spellIcon:SetSize(iconWidth, iconHeight)
spellIcon:ClearAllPoints()

local xOffset = startOffset + ((i - 1) * (iconSize + iconSpacing))
local xOffset = startOffset + ((i - 1) * (iconWidth + iconSpacing))
spellIcon:SetPoint("CENTER", BCDM.AdditionalCustomCooldownViewerContainer, "CENTER", xOffset, 0)
ApplyCooldownText()
spellIcon:Show()
end
else
for i, spellIcon in ipairs(AdditionalCustomCooldownViewerIcons) do
spellIcon:SetParent(BCDM.AdditionalCustomCooldownViewerContainer)
spellIcon:SetSize(iconSize, iconSize)
spellIcon:SetSize(iconWidth, iconHeight)
spellIcon:ClearAllPoints()

if i == 1 then
Expand Down
23 changes: 18 additions & 5 deletions Modules/CooldownManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ local function FetchCooldownTextRegion(cooldown)
end
end

function BCDM:CalculateTexCoords(zoom, iconWidth, iconHeight)
if not zoom or not iconWidth or not iconHeight or iconWidth == 0 then
return 0, 1, 0, 1
end

local aspectRatio = iconHeight / iconWidth
local horizontalCrop = math.max(0, (1 - (1 / aspectRatio)) / 2)
local verticalCrop = math.max(0, (1 - aspectRatio) / 2)
return zoom + horizontalCrop, 1 - zoom - horizontalCrop, zoom + verticalCrop, 1 - zoom - verticalCrop
end

-- local function FetchClassColour()
-- local CooldownManagerDB = BCDM.db.profile
-- local GeneralDB = CooldownManagerDB.General
Expand Down Expand Up @@ -208,8 +219,9 @@ local function StyleIcons()
if childFrame then
if childFrame.Icon then
BCDM:StripTextures(childFrame.Icon)
local iconZoomAmount = cooldownManagerSettings.General.IconZoom * 0.5
childFrame.Icon:SetTexCoord(iconZoomAmount, 1 - iconZoomAmount, iconZoomAmount, 1 - iconZoomAmount)
local zoom = cooldownManagerSettings.General.IconZoom
local viewerSettings = cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]]
childFrame.Icon:SetTexCoord(BCDM:CalculateTexCoords(zoom, viewerSettings.IconWidth, viewerSettings.IconHeight))
end
if childFrame.Cooldown then
local borderSize = cooldownManagerSettings.General.BorderSize
Expand All @@ -223,7 +235,7 @@ local function StyleIcons()
end
if childFrame.CooldownFlash then childFrame.CooldownFlash:SetAlpha(0) end
if childFrame.DebuffBorder then childFrame.DebuffBorder:SetAlpha(0) end
childFrame:SetSize(cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].IconSize, cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].IconSize)
childFrame:SetSize(cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].IconWidth, cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].IconHeight)
BCDM:AddBorder(childFrame)
if not childFrame.layoutIndex then childFrame:SetShown(false) end
end
Expand Down Expand Up @@ -363,7 +375,8 @@ function BCDM:UpdateCooldownViewer(viewerType)
if childFrame then
if childFrame.Icon and ShouldSkin() then
BCDM:StripTextures(childFrame.Icon)
childFrame.Icon:SetTexCoord(cooldownManagerSettings.General.IconZoom, 1 - cooldownManagerSettings.General.IconZoom, cooldownManagerSettings.General.IconZoom, 1 - cooldownManagerSettings.General.IconZoom)
local zoom = cooldownManagerSettings.General.IconZoom
childFrame.Icon:SetTexCoord(BCDM:CalculateTexCoords(zoom, cooldownManagerSettings[viewerType].IconWidth, cooldownManagerSettings[viewerType].IconHeight))
end
if childFrame.Cooldown then
childFrame.Cooldown:ClearAllPoints()
Expand All @@ -375,7 +388,7 @@ function BCDM:UpdateCooldownViewer(viewerType)
childFrame.Cooldown:SetSwipeTexture("Interface\\Buttons\\WHITE8X8")
end
if childFrame.CooldownFlash then childFrame.CooldownFlash:SetAlpha(0) end
childFrame:SetSize(cooldownManagerSettings[viewerType].IconSize, cooldownManagerSettings[viewerType].IconSize)
childFrame:SetSize(cooldownManagerSettings[viewerType].IconWidth, cooldownManagerSettings[viewerType].IconHeight)
end
end

Expand Down
27 changes: 14 additions & 13 deletions Modules/CustomCooldownViewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ local function CreateCustomIcon(spellId)
else
customIcon:SetBackdropBorderColor(0, 0, 0, 1)
end
customIcon:SetSize(CustomDB.IconSize, CustomDB.IconSize)
customIcon:SetSize(CustomDB.IconWidth, CustomDB.IconHeight)
local anchorParent = CustomDB.Layout[2] == "NONE" and UIParent or _G[CustomDB.Layout[2]]
customIcon:SetPoint(CustomDB.Layout[1], anchorParent, CustomDB.Layout[3], CustomDB.Layout[4], CustomDB.Layout[5])
customIcon:RegisterEvent("SPELL_UPDATE_COOLDOWN")
Expand Down Expand Up @@ -114,8 +114,8 @@ local function CreateCustomIcon(spellId)
local borderSize = BCDM.db.profile.CooldownManager.General.BorderSize
customIcon.Icon:SetPoint("TOPLEFT", customIcon, "TOPLEFT", borderSize, -borderSize)
customIcon.Icon:SetPoint("BOTTOMRIGHT", customIcon, "BOTTOMRIGHT", -borderSize, borderSize)
local iconZoom = BCDM.db.profile.CooldownManager.General.IconZoom * 0.5
customIcon.Icon:SetTexCoord(iconZoom, 1 - iconZoom, iconZoom, 1 - iconZoom)
local zoom = BCDM.db.profile.CooldownManager.General.IconZoom
customIcon.Icon:SetTexCoord(BCDM:CalculateTexCoords(zoom, CustomDB.IconWidth, CustomDB.IconHeight))
customIcon.Icon:SetTexture(C_Spell.GetSpellInfo(spellId).iconID)

return customIcon
Expand Down Expand Up @@ -183,7 +183,8 @@ local function LayoutCustomCooldownViewer()

CreateCustomIcons(customCooldownViewerIcons)

local iconSize = CustomDB.IconSize
local iconWidth = CustomDB.IconWidth
local iconHeight = CustomDB.IconHeight
local iconSpacing = CustomDB.Spacing

-- Calculate and set container size first
Expand All @@ -195,11 +196,11 @@ local function LayoutCustomCooldownViewer()

local totalWidth, totalHeight = 0, 0
if useCenteredLayout or growthDirection == "RIGHT" or growthDirection == "LEFT" then
totalWidth = (#customCooldownViewerIcons * iconSize) + ((#customCooldownViewerIcons - 1) * iconSpacing)
totalHeight = iconSize
totalWidth = (#customCooldownViewerIcons * iconWidth) + ((#customCooldownViewerIcons - 1) * iconSpacing)
totalHeight = iconHeight
elseif growthDirection == "UP" or growthDirection == "DOWN" then
totalWidth = iconSize
totalHeight = (#customCooldownViewerIcons * iconSize) + ((#customCooldownViewerIcons - 1) * iconSpacing)
totalWidth = iconWidth
totalHeight = (#customCooldownViewerIcons * iconHeight) + ((#customCooldownViewerIcons - 1) * iconSpacing)
end
BCDM.CustomCooldownViewerContainer:SetSize(totalWidth, totalHeight)
end
Expand All @@ -220,23 +221,23 @@ local function LayoutCustomCooldownViewer()
local useCenteredLayout = (point == "TOP" or point == "BOTTOM") and (growthDirection == "LEFT" or growthDirection == "RIGHT")

if useCenteredLayout and #customCooldownViewerIcons > 0 then
local totalWidth = (#customCooldownViewerIcons * iconSize) + ((#customCooldownViewerIcons - 1) * iconSpacing)
local startOffset = -(totalWidth / 2) + (iconSize / 2)
local totalWidth = (#customCooldownViewerIcons * iconWidth) + ((#customCooldownViewerIcons - 1) * iconSpacing)
local startOffset = -(totalWidth / 2) + (iconWidth / 2)

for i, spellIcon in ipairs(customCooldownViewerIcons) do
spellIcon:SetParent(BCDM.CustomCooldownViewerContainer)
spellIcon:SetSize(iconSize, iconSize)
spellIcon:SetSize(iconWidth, iconHeight)
spellIcon:ClearAllPoints()

local xOffset = startOffset + ((i - 1) * (iconSize + iconSpacing))
local xOffset = startOffset + ((i - 1) * (iconWidth + iconSpacing))
spellIcon:SetPoint("CENTER", BCDM.CustomCooldownViewerContainer, "CENTER", xOffset, 0)
ApplyCooldownText()
spellIcon:Show()
end
else
for i, spellIcon in ipairs(customCooldownViewerIcons) do
spellIcon:SetParent(BCDM.CustomCooldownViewerContainer)
spellIcon:SetSize(iconSize, iconSize)
spellIcon:SetSize(iconWidth, iconHeight)
spellIcon:ClearAllPoints()

if i == 1 then
Expand Down
Loading