mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 02:16:02 +00:00
unitframes: add option to set indicator spacing
This commit is contained in:
@@ -394,6 +394,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", unit, "indicator_time", "1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "indicator_stacks", "1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "indicator_size", "10")
|
||||
pfUI:UpdateConfig("unitframes", unit, "indicator_spacing","1")
|
||||
pfUI:UpdateConfig("unitframes", unit, "indicator_pos", "TOPLEFT")
|
||||
|
||||
pfUI:UpdateConfig("unitframes", unit, "clickcast", "0")
|
||||
|
||||
+5
-3
@@ -1794,6 +1794,7 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks)
|
||||
local showstacks = frame.config.indicator_stacks == "1" and true or nil
|
||||
local position = frame.config.indicator_pos or "TOPLEFT"
|
||||
local iconsize = tonumber(frame.config.indicator_size)
|
||||
local spacing = tonumber(frame.config.indicator_spacing)
|
||||
|
||||
if not frame.hp then return end
|
||||
local frame = frame.hp.bar
|
||||
@@ -1817,12 +1818,13 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks)
|
||||
end
|
||||
|
||||
-- update icon configuration
|
||||
if frame.icon[pos].iconsize ~= iconsize then
|
||||
if frame.icon[pos].iconsize ~= iconsize or frame.icon[pos].spacing ~= spacing then
|
||||
frame.icon[pos]:SetWidth(iconsize)
|
||||
frame.icon[pos]:SetHeight(iconsize)
|
||||
frame.icon[pos]:SetPoint("TOPLEFT", frame.icon, "TOPLEFT", (pos-1)*iconsize, 0)
|
||||
frame.icon[pos]:SetPoint("TOPLEFT", frame.icon, "TOPLEFT", (pos-1)*(iconsize + spacing), 0)
|
||||
frame.icon[pos].stacks:SetFont(pfUI.font_unit, math.max(iconsize/3, 10), "OUTLINE")
|
||||
frame.icon[pos].iconsize = iconsize
|
||||
frame.icon[pos].spacing = spacing
|
||||
end
|
||||
|
||||
-- update icon
|
||||
@@ -1859,7 +1861,7 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks)
|
||||
end
|
||||
|
||||
frame.icon[pos]:Show()
|
||||
frame.icon:SetWidth(pos*iconsize)
|
||||
frame.icon:SetWidth((pos-1)*(iconsize+spacing)+iconsize)
|
||||
end
|
||||
|
||||
function pfUI.uf:HideIcon(frame, pos)
|
||||
|
||||
@@ -1672,6 +1672,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
||||
CreateConfig(U[c], T["Show Time Left"], C.unitframes[c], "indicator_time", "checkbox")
|
||||
CreateConfig(U[c], T["Show Stacks"], C.unitframes[c], "indicator_stacks", "checkbox")
|
||||
CreateConfig(U[c], T["Indicator Size"], C.unitframes[c], "indicator_size")
|
||||
CreateConfig(U[c], T["Indicator Spacing"], C.unitframes[c], "indicator_spacing", "dropdown", pfUI.gui.dropdowns.spacing)
|
||||
CreateConfig(U[c], T["Indicator Position"], C.unitframes[c], "indicator_pos", "dropdown", pfUI.gui.dropdowns.positions)
|
||||
CreateConfig(U[c], T["Show Custom Indicators"], C.unitframes[c], "custom_indicator", "list")
|
||||
CreateConfig(U[c], T["Show Buff Indicators"], C.unitframes[c], "show_buffs", "checkbox")
|
||||
|
||||
Reference in New Issue
Block a user