From ce79a822a9f8ee6f2f7fb0e18fb9c4fc48892ad5 Mon Sep 17 00:00:00 2001 From: taijuten Date: Mon, 26 Jan 2026 18:16:56 +0000 Subject: [PATCH 1/3] Add customizable tick marks and upgrade LibEQOL Features: - Added support for up to 4 custom tick marks per resource type - Each tick can be configured with: * Enable/disable toggle * Resource type selection (9 power types supported) * Mode: Percentage (0-100%) or Fixed value * Numeric value input with validation - All tick settings grouped under collapsible 'Tick Settings' section - Ticks are filtered by resource type and rendered based on mode - Locale strings added for all new settings Library Updates: - Upgraded LibEQOL from 1.0.0 to 15.0.0-beta-2 - Leverages new Input setting type with built-in numeric validation --- Bars/Abstract/Bar.lua | 79 ++++++++++- Bars/PrimaryResourceBar.lua | 256 ++++++++++++++++++++++++++++++++---- Locales/enUS.lua | 13 ++ 3 files changed, 317 insertions(+), 31 deletions(-) mode change 100644 => 100755 Bars/Abstract/Bar.lua mode change 100644 => 100755 Bars/PrimaryResourceBar.lua mode change 100644 => 100755 Locales/enUS.lua diff --git a/Bars/Abstract/Bar.lua b/Bars/Abstract/Bar.lua old mode 100644 new mode 100755 index 6e36986..6ce7ae9 --- a/Bars/Abstract/Bar.lua +++ b/Bars/Abstract/Bar.lua @@ -10,6 +10,19 @@ local L = addonTable.L local BarMixin = {} +-- Power type to localized name mapping for custom ticks +local POWER_TYPE_LOCALIZED_NAMES = { + [Enum.PowerType.Mana] = L["MANA"], + [Enum.PowerType.Rage] = L["RAGE"], + [Enum.PowerType.Focus] = L["FOCUS"], + [Enum.PowerType.Energy] = L["ENERGY"], + [Enum.PowerType.RunicPower] = L["RUNIC_POWER"], + [Enum.PowerType.LunarPower] = L["LUNAR_POWER"], + [Enum.PowerType.Maelstrom] = L["MAELSTORM"], + [Enum.PowerType.Insanity] = L["INSANITY"], + [Enum.PowerType.Fury] = L["FURY"], +} + ------------------------------------------------------------ -- BAR FACTORY ------------------------------------------------------------ @@ -857,7 +870,11 @@ function BarMixin:UpdateTicksLayout(layoutName) end self.Ticks = self.Ticks or {} - if data.showTicks == false or not addonTable.tickedPowerTypes[resource] then + + -- Check if we should use custom ticks + local useCustomTicks = data.customTicks and #data.customTicks > 0 + + if data.showTicks == false or (not useCustomTicks and not addonTable.tickedPowerTypes[resource]) then for _, t in ipairs(self.Ticks) do t:Hide() end @@ -871,8 +888,58 @@ function BarMixin:UpdateTicksLayout(layoutName) local tickThickness = data.tickThickness or defaults.tickThickness or 1 local tickColor = data.tickColor or defaults.tickColor - local needed = max - 1 - for i = 1, needed do + local tickPositions = {} + + if useCustomTicks then + -- Use custom ticks, filtered by resource type + local currentMax = UnitPowerMax("player", resource) or max + if currentMax > 0 then + for _, tick in ipairs(data.customTicks) do + -- Skip if tick is disabled + if tick.enabled == true then + local tickResource = tick.resource + local matchesResource = false + + -- Match resource type - tick.resource is the localized name + if type(resource) == "number" then + -- Map power type enum to localized name + local resourceName = POWER_TYPE_LOCALIZED_NAMES[resource] + matchesResource = (tickResource == resourceName) + elseif type(resource) == "string" then + matchesResource = (tickResource == resource) + end + + if matchesResource and tick.value > 0 then + local tickPosition + if tick.mode == L["TICK_MODE_PERCENTAGE"] then + -- Percentage mode: tick.value is a percentage (0-100) + if tick.value < 100 then + tickPosition = tick.value / 100 + end + else + -- Fixed mode: tick.value is an absolute value + if tick.value < currentMax then + tickPosition = tick.value / currentMax + end + end + + if tickPosition then + table.insert(tickPositions, tickPosition) + end + end + end + end + end + else + -- Use default tick positions (evenly spaced) + local needed = max - 1 + for i = 1, needed do + table.insert(tickPositions, i / max) + end + end + + -- Render ticks at calculated positions + for i = 1, #tickPositions do local t = self.Ticks[i] if not t then t = self.Frame:CreateTexture(nil, "OVERLAY") @@ -881,11 +948,11 @@ function BarMixin:UpdateTicksLayout(layoutName) t:SetColorTexture(tickColor.r or 0, tickColor.g or 0, tickColor.b or 0, tickColor.a or 1) t:ClearAllPoints() if self.StatusBar:GetOrientation() == "VERTICAL" then - local y = (i / max) * height + local y = tickPositions[i] * height t:SetSize(width, tickThickness) t:SetPoint("BOTTOM", self.StatusBar, "BOTTOM", 0, y - (tickThickness) / 2) else - local x = (i / max) * width + local x = tickPositions[i] * width t:SetSize(tickThickness, height) t:SetPoint("LEFT", self.StatusBar, "LEFT", x - (tickThickness) / 2, 0) end @@ -893,7 +960,7 @@ function BarMixin:UpdateTicksLayout(layoutName) end -- Hide any extra ticks - for i = needed + 1, #self.Ticks do + for i = #tickPositions + 1, #self.Ticks do local t = self.Ticks[i] if t then t:Hide() diff --git a/Bars/PrimaryResourceBar.lua b/Bars/PrimaryResourceBar.lua old mode 100644 new mode 100755 index 135c641..87729de --- a/Bars/PrimaryResourceBar.lua +++ b/Bars/PrimaryResourceBar.lua @@ -100,12 +100,31 @@ addonTable.RegisteredBar.PrimaryResourceBar = { showTicks = true, tickColor = {r = 0, g = 0, b = 0, a = 1}, tickThickness = 1, + customTicks = { + { enabled = false, resource = L["MANA"], value = 25, mode = L["TICK_MODE_PERCENTAGE"] }, + { enabled = false, resource = L["MANA"], value = 50, mode = L["TICK_MODE_PERCENTAGE"] }, + { enabled = false, resource = L["MANA"], value = 75, mode = L["TICK_MODE_PERCENTAGE"] }, + { enabled = false, resource = L["MANA"], value = 100, mode = L["TICK_MODE_FIXED"] }, + }, useResourceAtlas = false, }, lemSettings = function(bar, defaults) local dbName = bar:GetConfig().dbName + + -- Resource type options for ticks + local resourceOptions = { + { text = L["MANA"] }, + { text = L["RAGE"] }, + { text = L["FOCUS"] }, + { text = L["ENERGY"] }, + { text = L["RUNIC_POWER"] }, + { text = L["LUNAR_POWER"] }, + { text = L["MAELSTORM"] }, + { text = L["INSANITY"] }, + { text = L["FURY"] }, + } - return { + local settings = { { parentId = L["CATEGORY_BAR_VISIBILITY"], order = 103, @@ -125,50 +144,237 @@ addonTable.RegisteredBar.PrimaryResourceBar = { tooltip = L["HIDE_MANA_ON_ROLE_PRIMARY_BAR_TOOLTIP"], }, { - parentId = L["CATEGORY_BAR_STYLE"], - order = 401, - name = L["USE_RESOURCE_TEXTURE_AND_COLOR"], - kind = LEM.SettingType.Checkbox, - default = defaults.useResourceAtlas, + order = 305, + name = L["CATEGORY_TICK_SETTINGS"], + kind = LEM.SettingType.Collapsible, + id = L["CATEGORY_TICK_SETTINGS"], + defaultCollapsed = true, + }, + { + parentId = L["CATEGORY_TICK_SETTINGS"], + order = 306, + name = L["SHOW_TICKS_WHEN_AVAILABLE"], + kind = LEM.SettingType.CheckboxColor, + default = defaults.showTicks, + colorDefault = defaults.tickColor, get = function(layoutName) local data = SenseiClassResourceBarDB[dbName][layoutName] - if data and data.useResourceAtlas ~= nil then - return data.useResourceAtlas + if data and data.showTicks ~= nil then + return data.showTicks else - return defaults.useResourceAtlas + return defaults.showTicks end end, + colorGet = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data and data.tickColor or defaults.tickColor + end, set = function(layoutName, value) SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) - SenseiClassResourceBarDB[dbName][layoutName].useResourceAtlas = value - bar:ApplyLayout(layoutName) + SenseiClassResourceBarDB[dbName][layoutName].showTicks = value + bar:UpdateTicksLayout(layoutName) + end, + colorSet = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + SenseiClassResourceBarDB[dbName][layoutName].tickColor = value + bar:UpdateTicksLayout(layoutName) end, }, { - parentId = L["CATEGORY_TEXT_SETTINGS"], - order = 505, - name = L["SHOW_MANA_AS_PERCENT"], - kind = LEM.SettingType.Checkbox, - default = defaults.showManaAsPercent, + parentId = L["CATEGORY_TICK_SETTINGS"], + order = 307, + name = L["TICK_THICKNESS"], + kind = LEM.SettingType.Slider, + default = defaults.tickThickness, + minValue = 1, + maxValue = 5, + valueStep = 1, get = function(layoutName) local data = SenseiClassResourceBarDB[dbName][layoutName] - if data and data.showManaAsPercent ~= nil then - return data.showManaAsPercent - else - return defaults.showManaAsPercent - end + return data and data.tickThickness or defaults.tickThickness end, set = function(layoutName, value) SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) - SenseiClassResourceBarDB[dbName][layoutName].showManaAsPercent = value - bar:UpdateDisplay(layoutName) + SenseiClassResourceBarDB[dbName][layoutName].tickThickness = value + bar:UpdateTicksLayout(layoutName) end, isEnabled = function(layoutName) local data = SenseiClassResourceBarDB[dbName][layoutName] - return data.showText + return data.showTicks end, - tooltip = L["SHOW_MANA_AS_PERCENT_TOOLTIP"], }, } + + -- Pre-generate settings for up to 4 custom ticks + for i = 1, 4 do + local tickIndex = i -- Capture the value for closures + local baseOrder = 310 + (tickIndex * 10) + + -- Divider + table.insert(settings, { + parentId = L["CATEGORY_TICK_SETTINGS"], + order = baseOrder, + kind = LEM.SettingType.Divider, + }) + + -- Enable checkbox + table.insert(settings, { + parentId = L["CATEGORY_TICK_SETTINGS"], + order = baseOrder + 1, + name = L["CUSTOM_TICK"] .. " " .. tickIndex, + kind = LEM.SettingType.Checkbox, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return (data.customTicks and data.customTicks[tickIndex] and data.customTicks[tickIndex].enabled == true) or false + end, + set = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + local data = SenseiClassResourceBarDB[dbName][layoutName] + -- Initialize customTicks if it doesn't exist + data.customTicks = data.customTicks or CopyTable(defaults.customTicks) + if data.customTicks and data.customTicks[tickIndex] then + data.customTicks[tickIndex].enabled = value + bar:UpdateTicksLayout(layoutName) + end + end, + }) + + -- Resource type dropdown + table.insert(settings, { + parentId = L["CATEGORY_TICK_SETTINGS"], + order = baseOrder + 2, + name = L["TICK_RESOURCE_TYPE"], + kind = LEM.SettingType.Dropdown, + values = resourceOptions, + useOldStyle = true, + isEnabled = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data and data.customTicks and data.customTicks[tickIndex] and data.customTicks[tickIndex].enabled or false + end, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return (data and data.customTicks and data.customTicks[tickIndex] and data.customTicks[tickIndex].resource) or L["MANA"] + end, + set = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + local data = SenseiClassResourceBarDB[dbName][layoutName] + -- Initialize customTicks if it doesn't exist + data.customTicks = data.customTicks or CopyTable(defaults.customTicks) + if data.customTicks and data.customTicks[tickIndex] then + data.customTicks[tickIndex].resource = value + bar:UpdateTicksLayout(layoutName) + end + end, + }) + + -- Mode dropdown (Percentage vs Fixed) + table.insert(settings, { + parentId = L["CATEGORY_TICK_SETTINGS"], + order = baseOrder + 3, + name = L["TICK_MODE"], + kind = LEM.SettingType.Dropdown, + values = { + { text = L["TICK_MODE_PERCENTAGE"] }, + { text = L["TICK_MODE_FIXED"] }, + }, + useOldStyle = true, + isEnabled = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data and data.customTicks and data.customTicks[tickIndex] and data.customTicks[tickIndex].enabled or false + end, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return (data and data.customTicks and data.customTicks[tickIndex] and data.customTicks[tickIndex].mode) or L["TICK_MODE_PERCENTAGE"] + end, + set = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + local data = SenseiClassResourceBarDB[dbName][layoutName] + -- Initialize customTicks if it doesn't exist + data.customTicks = data.customTicks or CopyTable(defaults.customTicks) + if data.customTicks and data.customTicks[tickIndex] then + data.customTicks[tickIndex].mode = value + bar:UpdateTicksLayout(layoutName) + end + end, + }) + + -- Value input + table.insert(settings, { + parentId = L["CATEGORY_TICK_SETTINGS"], + order = baseOrder + 4, + name = L["TICK_VALUE"], + kind = LEM.SettingType.Input, + numeric = true, + isEnabled = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data and data.customTicks and data.customTicks[tickIndex] and data.customTicks[tickIndex].enabled or false + end, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data.customTicks and data.customTicks[tickIndex] and data.customTicks[tickIndex].value or 50 + end, + set = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + local data = SenseiClassResourceBarDB[dbName][layoutName] + -- Initialize customTicks if it doesn't exist + data.customTicks = data.customTicks or CopyTable(defaults.customTicks) + if data.customTicks and data.customTicks[tickIndex] then + data.customTicks[tickIndex].value = value + bar:UpdateTicksLayout(layoutName) + end + end, + tooltip = L["TICK_VALUE"], + }) + end + + -- Add remaining settings + table.insert(settings, { + parentId = L["CATEGORY_BAR_STYLE"], + order = 401, + name = L["USE_RESOURCE_TEXTURE_AND_COLOR"], + kind = LEM.SettingType.Checkbox, + default = defaults.useResourceAtlas, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + if data and data.useResourceAtlas ~= nil then + return data.useResourceAtlas + else + return defaults.useResourceAtlas + end + end, + set = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + SenseiClassResourceBarDB[dbName][layoutName].useResourceAtlas = value + bar:ApplyLayout(layoutName) + end, + }) + + table.insert(settings, { + parentId = L["CATEGORY_TEXT_SETTINGS"], + order = 505, + name = L["SHOW_MANA_AS_PERCENT"], + kind = LEM.SettingType.Checkbox, + default = defaults.showManaAsPercent, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + if data and data.showManaAsPercent ~= nil then + return data.showManaAsPercent + else + return defaults.showManaAsPercent + end + end, + set = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + SenseiClassResourceBarDB[dbName][layoutName].showManaAsPercent = value + bar:UpdateDisplay(layoutName) + end, + isEnabled = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data.showText + end, + tooltip = L["SHOW_MANA_AS_PERCENT_TOOLTIP"], + }) + + return settings end, } \ No newline at end of file diff --git a/Locales/enUS.lua b/Locales/enUS.lua old mode 100644 new mode 100755 index 5e8c3c4..56966f2 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -19,6 +19,7 @@ local baseLocale = { ["IMPORT_DECODE_FAILED"] = "Decode failed", ["IMPORT_DECOMPRESSION_FAILED"] = "Decompression failed", ["IMPORT_DESERIALIZATION_FAILED"] = "Deserialization failed", + ["ENTER_TICK_VALUES"] = "Enter comma-separated tick values (e.g., 25, 50, 75):", -- Settings (Esc > Options > AddOns) ["SETTINGS_HEADER_POWER_COLORS"] = "Power Colors", @@ -102,11 +103,23 @@ local baseLocale = { -- Bar settings category - Edit Mode ["CATEGORY_BAR_SETTINGS"] = "Bar Settings", + ["CATEGORY_TICK_SETTINGS"] = "Tick Settings", ["FILL_DIRECTION"] = "Fill Direction", ["FASTER_UPDATES"] = "Faster Updates (Higher CPU Usage)", ["SMOOTH_PROGRESS"] = "Smooth Progress", ["SHOW_TICKS_WHEN_AVAILABLE"] = "Show Ticks When Available", ["TICK_THICKNESS"] = "Tick Thickness", + ["ENABLE_CUSTOM_TICK"] = "Enable Custom Ticks", + ["ADD_CUSTOM_TICK"] = "Add Custom Tick", + ["CUSTOM_TICK"] = "Custom Tick", + ["TICK_RESOURCE_TYPE"] = "Resource Type", + ["TICK_MODE"] = "Mode", + ["TICK_MODE_PERCENTAGE"] = "Percentage", + ["TICK_MODE_FIXED"] = "Fixed Value", + ["TICK_VALUE"] = "Value", + ["TICK_VALUE_PERCENTAGE_TOOLTIP"] = "Percentage of maximum resource (1-100%)", + ["TICK_VALUE_FIXED_TOOLTIP"] = "Fixed resource value", + ["REMOVE_TICK"] = "Remove", -- Bar style category - Edit Mode ["CATEGORY_BAR_STYLE"] = "Bar Style", From a283251f8febfbbb35d4f2a3ec885e5ab28d6f23 Mon Sep 17 00:00:00 2001 From: taijuten Date: Tue, 27 Jan 2026 08:41:17 +0000 Subject: [PATCH 2/3] Address PR feedback - Remove unused locale strings (ENTER_TICK_VALUES, ENABLE_CUSTOM_TICK, ADD_CUSTOM_TICK, TICK_VALUE_*_TOOLTIP, REMOVE_TICK) - Update tick settings order numbers to follow X00 pattern for categories (400 instead of 305) --- Bars/PrimaryResourceBar.lua | 8 ++++---- Locales/enUS.lua | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Bars/PrimaryResourceBar.lua b/Bars/PrimaryResourceBar.lua index 87729de..7652476 100755 --- a/Bars/PrimaryResourceBar.lua +++ b/Bars/PrimaryResourceBar.lua @@ -144,7 +144,7 @@ addonTable.RegisteredBar.PrimaryResourceBar = { tooltip = L["HIDE_MANA_ON_ROLE_PRIMARY_BAR_TOOLTIP"], }, { - order = 305, + order = 400, name = L["CATEGORY_TICK_SETTINGS"], kind = LEM.SettingType.Collapsible, id = L["CATEGORY_TICK_SETTINGS"], @@ -152,7 +152,7 @@ addonTable.RegisteredBar.PrimaryResourceBar = { }, { parentId = L["CATEGORY_TICK_SETTINGS"], - order = 306, + order = 401, name = L["SHOW_TICKS_WHEN_AVAILABLE"], kind = LEM.SettingType.CheckboxColor, default = defaults.showTicks, @@ -182,7 +182,7 @@ addonTable.RegisteredBar.PrimaryResourceBar = { }, { parentId = L["CATEGORY_TICK_SETTINGS"], - order = 307, + order = 402, name = L["TICK_THICKNESS"], kind = LEM.SettingType.Slider, default = defaults.tickThickness, @@ -208,7 +208,7 @@ addonTable.RegisteredBar.PrimaryResourceBar = { -- Pre-generate settings for up to 4 custom ticks for i = 1, 4 do local tickIndex = i -- Capture the value for closures - local baseOrder = 310 + (tickIndex * 10) + local baseOrder = 410 + (tickIndex * 10) -- Divider table.insert(settings, { diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 56966f2..779b36c 100755 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -19,7 +19,6 @@ local baseLocale = { ["IMPORT_DECODE_FAILED"] = "Decode failed", ["IMPORT_DECOMPRESSION_FAILED"] = "Decompression failed", ["IMPORT_DESERIALIZATION_FAILED"] = "Deserialization failed", - ["ENTER_TICK_VALUES"] = "Enter comma-separated tick values (e.g., 25, 50, 75):", -- Settings (Esc > Options > AddOns) ["SETTINGS_HEADER_POWER_COLORS"] = "Power Colors", @@ -109,17 +108,13 @@ local baseLocale = { ["SMOOTH_PROGRESS"] = "Smooth Progress", ["SHOW_TICKS_WHEN_AVAILABLE"] = "Show Ticks When Available", ["TICK_THICKNESS"] = "Tick Thickness", - ["ENABLE_CUSTOM_TICK"] = "Enable Custom Ticks", - ["ADD_CUSTOM_TICK"] = "Add Custom Tick", + ["CATEGORY_TICK_SETTINGS"] = "Tick Settings", ["CUSTOM_TICK"] = "Custom Tick", ["TICK_RESOURCE_TYPE"] = "Resource Type", ["TICK_MODE"] = "Mode", ["TICK_MODE_PERCENTAGE"] = "Percentage", ["TICK_MODE_FIXED"] = "Fixed Value", ["TICK_VALUE"] = "Value", - ["TICK_VALUE_PERCENTAGE_TOOLTIP"] = "Percentage of maximum resource (1-100%)", - ["TICK_VALUE_FIXED_TOOLTIP"] = "Fixed resource value", - ["REMOVE_TICK"] = "Remove", -- Bar style category - Edit Mode ["CATEGORY_BAR_STYLE"] = "Bar Style", From 3fbeeb4299b9754fc081dc6133a5c4f513ed5211 Mon Sep 17 00:00:00 2001 From: taijuten Date: Tue, 27 Jan 2026 09:12:26 +0000 Subject: [PATCH 3/3] Fix tick rendering position bug from merge Use tickPositions[i] instead of (i/max) for correct position calculation. Merge a9480c08 added pixel-perfect scaling but incorrectly changed the position lookup from the pre-calculated tickPositions array to a simple division based on loop index, causing ticks to render at wrong positions. --- Bars/Abstract/Bar.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bars/Abstract/Bar.lua b/Bars/Abstract/Bar.lua index f2872b6..34f459c 100755 --- a/Bars/Abstract/Bar.lua +++ b/Bars/Abstract/Bar.lua @@ -984,12 +984,12 @@ function BarMixin:UpdateTicksLayout(layoutName, data) t:SetColorTexture(tickColor.r or 0, tickColor.g or 0, tickColor.b or 0, tickColor.a or 1) t:ClearAllPoints() if self.StatusBar:GetOrientation() == "VERTICAL" then - local rawY = (i / max) * height + local rawY = tickPositions[i] * height local snappedY = addonTable.rounded(rawY / ppScale) * ppScale t:SetSize(width, pThickness) t:SetPoint("BOTTOM", self.StatusBar, "BOTTOM", 0, snappedY) else - local rawX = (i / max) * width + local rawX = tickPositions[i] * width local snappedX = addonTable.rounded(rawX / ppScale) * ppScale t:SetSize(pThickness, height) t:SetPoint("LEFT", self.StatusBar, "LEFT", snappedX, 0)