mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
gui: add possibility for multicolumn buttons
This commit is contained in:
+40
-11
@@ -369,29 +369,45 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
return frame
|
return frame
|
||||||
end
|
end
|
||||||
|
|
||||||
function pfUI.gui:CreateConfig(parent, caption, category, config, widget, values)
|
function pfUI.gui:CreateConfig(parent, caption, category, config, widget, values, skip)
|
||||||
-- parent object placement
|
-- parent object placement
|
||||||
if parent.objectCount == nil then
|
if parent.objectCount == nil then
|
||||||
parent.objectCount = 1
|
parent.objectCount = 1
|
||||||
else
|
elseif not skip then
|
||||||
parent.objectCount = parent.objectCount + 1
|
parent.objectCount = parent.objectCount + 1
|
||||||
|
parent.lineCount = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if skip then
|
||||||
|
if parent.lineCount == nil then
|
||||||
|
parent.lineCount = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if skip then
|
||||||
|
parent.lineCount = parent.lineCount + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- basic frame
|
-- basic frame
|
||||||
local frame = CreateFrame("Frame", nil, parent)
|
local frame = CreateFrame("Frame", nil, parent)
|
||||||
frame:SetWidth(350)
|
frame:SetWidth(350)
|
||||||
frame:SetHeight(25)
|
frame:SetHeight(25)
|
||||||
frame:SetBackdrop(pfUI.backdrop_underline)
|
|
||||||
frame:SetBackdropBorderColor(1,1,1,.25)
|
|
||||||
frame:SetPoint("TOPLEFT", 25, parent.objectCount * -25)
|
frame:SetPoint("TOPLEFT", 25, parent.objectCount * -25)
|
||||||
|
|
||||||
-- caption
|
if not widget or (widget and widget ~= "button") then
|
||||||
frame.caption = frame:CreateFontString("Status", "LOW", "GameFontNormal")
|
|
||||||
frame.caption:SetFont(pfUI.font_default, pfUI_config.global.font_size + 2, "OUTLINE")
|
frame:SetBackdrop(pfUI.backdrop_underline)
|
||||||
frame.caption:SetAllPoints(frame)
|
frame:SetBackdropBorderColor(1,1,1,.25)
|
||||||
frame.caption:SetFontObject(GameFontWhite)
|
|
||||||
frame.caption:SetJustifyH("LEFT")
|
-- caption
|
||||||
frame.caption:SetText(caption)
|
frame.caption = frame:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||||
|
frame.caption:SetFont(pfUI.font_default, pfUI_config.global.font_size + 2, "OUTLINE")
|
||||||
|
frame.caption:SetAllPoints(frame)
|
||||||
|
frame.caption:SetFontObject(GameFontWhite)
|
||||||
|
frame.caption:SetJustifyH("LEFT")
|
||||||
|
frame.caption:SetText(caption)
|
||||||
|
end
|
||||||
|
|
||||||
frame.configCategory = category
|
frame.configCategory = category
|
||||||
frame.configEntry = config
|
frame.configEntry = config
|
||||||
|
|
||||||
@@ -498,6 +514,19 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- use button widget
|
||||||
|
if widget == "button" then
|
||||||
|
frame.button = CreateFrame("Button", "pfButton", frame, "UIPanelButtonTemplate")
|
||||||
|
pfUI.utils:CreateBackdrop(frame.button, nil, true)
|
||||||
|
pfUI.utils:SkinButton(frame.button)
|
||||||
|
frame.button:SetWidth(85)
|
||||||
|
frame.button:SetHeight(20)
|
||||||
|
frame.button:SetPoint("TOPRIGHT", -(parent.lineCount-1) * 90, -5)
|
||||||
|
frame.button:SetText(caption)
|
||||||
|
frame.button:SetTextColor(1,1,1,1)
|
||||||
|
frame.button:SetScript("OnClick", values)
|
||||||
|
end
|
||||||
|
|
||||||
-- use checkbox widget
|
-- use checkbox widget
|
||||||
if widget == "checkbox" then
|
if widget == "checkbox" then
|
||||||
-- input field
|
-- input field
|
||||||
|
|||||||
Reference in New Issue
Block a user