/keys now only show the player name, before was showing the player name and the realm name

This commit is contained in:
Tercio Jose
2023-01-02 16:02:48 -03:00
parent e98638cd83
commit 1e83cac1f2
9 changed files with 520 additions and 157 deletions
+45 -30
View File
@@ -3780,62 +3780,77 @@ local simple_list_box_SetData = function(self, t)
self.list_table = t
end
function detailsFramework:CreateSimpleListBox (parent, name, title, empty_text, list_table, onclick, options)
local f = CreateFrame("frame", name, parent, "BackdropTemplate")
function detailsFramework:CreateSimpleListBox(parent, name, title, emptyText, listTable, onClick, options)
local scroll = CreateFrame("frame", name, parent, "BackdropTemplate")
f.ResetWidgets = simple_list_box_ResetWidgets
f.GetOrCreateWidget = simple_list_box_GetOrCreateWidget
f.Refresh = simple_list_box_RefreshWidgets
f.SetData = simple_list_box_SetData
f.nextWidget = 1
f.list_table = list_table
f.func = function(self, button, value)
--onclick (value)
detailsFramework:QuickDispatch(onclick, value)
f:Refresh()
scroll.ResetWidgets = simple_list_box_ResetWidgets
scroll.GetOrCreateWidget = simple_list_box_GetOrCreateWidget
scroll.Refresh = simple_list_box_RefreshWidgets
scroll.SetData = simple_list_box_SetData
scroll.nextWidget = 1
scroll.list_table = listTable
scroll.func = function(self, button, value)
detailsFramework:QuickDispatch(onClick, value)
scroll:Refresh()
end
f.widgets = {}
scroll.widgets = {}
detailsFramework:ApplyStandardBackdrop(f)
detailsFramework:ApplyStandardBackdrop(scroll)
f.options = options or {}
self.table.deploy(f.options, default_options)
scroll.options = options or {}
self.table.deploy(scroll.options, default_options)
if (f.options.x_button_func) then
local original_X_function = f.options.x_button_func
f.options.x_button_func = function(self, button, value)
if (scroll.options.x_button_func) then
local original_X_function = scroll.options.x_button_func
scroll.options.x_button_func = function(self, button, value)
detailsFramework:QuickDispatch(original_X_function, value)
f:Refresh()
scroll:Refresh()
end
end
f:SetBackdropBorderColor(unpack(f.options.panel_border_color))
scroll:SetBackdropBorderColor(unpack(scroll.options.panel_border_color))
f:SetSize(f.options.width + 2, f.options.height)
scroll:SetSize(scroll.options.width + 2, scroll.options.height)
local name = detailsFramework:CreateLabel(f, title, 12, "silver")
local name = detailsFramework:CreateLabel(scroll, title, 12, "silver")
name:SetTemplate(detailsFramework:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
name:SetPoint("bottomleft", f, "topleft", 0, 2)
f.Title = name
name:SetPoint("bottomleft", scroll, "topleft", 0, 2)
scroll.Title = name
local emptyLabel = detailsFramework:CreateLabel(f, empty_text, 12, "gray")
local emptyLabel = detailsFramework:CreateLabel(scroll, emptyText, 12, "gray")
emptyLabel:SetAlpha(.6)
emptyLabel:SetSize(f.options.width-10, f.options.height)
emptyLabel:SetSize(scroll.options.width-10, scroll.options.height)
emptyLabel:SetPoint("center", 0, 0)
emptyLabel:Hide()
emptyLabel.align = "center"
f.EmptyLabel = emptyLabel
scroll.EmptyLabel = emptyLabel
return f
return scroll
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ~scrollbox
function detailsFramework:CreateScrollBox (parent, name, refreshFunc, data, width, height, lineAmount, lineHeight, createLineFunc, autoAmount, noScroll)
---create a scrollbox with the methods :Refresh() :SetData() :CreateLine()
---@param parent table
---@param name string
---@param refreshFunc function
---@param data table
---@param width number
---@param height number
---@param lineAmount number
---@param lineHeight number
---@param createLineFunc function|nil
---@param autoAmount boolean|nil
---@param noScroll boolean|nil
---@return table
function detailsFramework:CreateScrollBox(parent, name, refreshFunc, data, width, height, lineAmount, lineHeight, createLineFunc, autoAmount, noScroll)
--create the scrollframe, it is the base of the scrollbox
local scroll = CreateFrame("scrollframe", name, parent, "FauxScrollFrameTemplate, BackdropTemplate")
--apply the standard background color
detailsFramework:ApplyStandardBackdrop(scroll)
scroll:SetSize(width, height)