lib update
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
BlizOptionsGroup Container
|
||||
Simple container widget for the integration of AceGUI into the Blizzard Interface Options
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "BlizOptionsGroup", 21
|
||||
local Type, Version = "BlizOptionsGroup", 26
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
@ -99,7 +99,7 @@ local methods = {
|
||||
Constructor
|
||||
-------------------------------------------------------------------------------]]
|
||||
local function Constructor()
|
||||
local frame = CreateFrame("Frame")
|
||||
local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
|
||||
frame:Hide()
|
||||
|
||||
-- support functions for the Blizzard Interface Options
|
||||
@ -108,6 +108,11 @@ local function Constructor()
|
||||
frame.default = default
|
||||
frame.refresh = refresh
|
||||
|
||||
-- 10.0 support function aliases (cancel has been removed)
|
||||
frame.OnCommit = okay
|
||||
frame.OnDefault = default
|
||||
frame.OnRefresh = refresh
|
||||
|
||||
frame:SetScript("OnHide", OnHide)
|
||||
frame:SetScript("OnShow", OnShow)
|
||||
|
||||
|
@ -125,7 +125,7 @@ local function Constructor()
|
||||
dropdown.frame:Show()
|
||||
dropdown:SetLabel("")
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", 0, -26)
|
||||
border:SetPoint("BOTTOMRIGHT", 0, 3)
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
@ -1,7 +1,7 @@
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Frame Container
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "Frame", 27
|
||||
local Type, Version = "Frame", 30
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
@ -13,10 +13,6 @@ local wipe = table.wipe
|
||||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: CLOSE
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Scripts
|
||||
-------------------------------------------------------------------------------]]
|
||||
@ -83,6 +79,7 @@ local methods = {
|
||||
["OnAcquire"] = function(self)
|
||||
self.frame:SetParent(UIParent)
|
||||
self.frame:SetFrameStrata("FULLSCREEN_DIALOG")
|
||||
self.frame:SetFrameLevel(100) -- Lots of room to draw under it
|
||||
self:SetTitle()
|
||||
self:SetStatusText()
|
||||
self:ApplyStatus()
|
||||
@ -179,16 +176,21 @@ local PaneBackdrop = {
|
||||
}
|
||||
|
||||
local function Constructor()
|
||||
local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
|
||||
frame:Hide()
|
||||
|
||||
frame:EnableMouse(true)
|
||||
frame:SetMovable(true)
|
||||
frame:SetResizable(true)
|
||||
frame:SetFrameStrata("FULLSCREEN_DIALOG")
|
||||
frame:SetFrameLevel(100) -- Lots of room to draw under it
|
||||
frame:SetBackdrop(FrameBackdrop)
|
||||
frame:SetBackdropColor(0, 0, 0, 1)
|
||||
frame:SetMinResize(400, 200)
|
||||
if frame.SetResizeBounds then -- WoW 10.0
|
||||
frame:SetResizeBounds(400, 200)
|
||||
else
|
||||
frame:SetMinResize(400, 200)
|
||||
end
|
||||
frame:SetToplevel(true)
|
||||
frame:SetScript("OnShow", Frame_OnShow)
|
||||
frame:SetScript("OnHide", Frame_OnClose)
|
||||
@ -201,7 +203,7 @@ local function Constructor()
|
||||
closebutton:SetWidth(100)
|
||||
closebutton:SetText(CLOSE)
|
||||
|
||||
local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local statusbg = CreateFrame("Button", nil, frame, "BackdropTemplate")
|
||||
statusbg:SetPoint("BOTTOMLEFT", 15, 15)
|
||||
statusbg:SetPoint("BOTTOMRIGHT", -132, 15)
|
||||
statusbg:SetHeight(24)
|
||||
@ -269,7 +271,7 @@ local function Constructor()
|
||||
line2:SetHeight(8)
|
||||
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
||||
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
||||
local x = 0.1 * 8/17
|
||||
x = 0.1 * 8/17
|
||||
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
|
||||
|
||||
local sizer_s = CreateFrame("Frame", nil, frame)
|
||||
|
@ -75,7 +75,7 @@ local function Constructor()
|
||||
titletext:SetJustifyH("LEFT")
|
||||
titletext:SetHeight(18)
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", 0, -17)
|
||||
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
@ -2,22 +2,18 @@
|
||||
TabGroup Container
|
||||
Container that uses tabs on top to switch between groups.
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "TabGroup", 37
|
||||
local Type, Version = "TabGroup", 38
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
-- Lua APIs
|
||||
local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, wipe
|
||||
local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, table.wipe
|
||||
|
||||
-- WoW APIs
|
||||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: PanelTemplates_TabResize, PanelTemplates_SetDisabledTabState, PanelTemplates_SelectTab, PanelTemplates_DeselectTab
|
||||
|
||||
-- local upvalue storage used by BuildTabs
|
||||
local widths = {}
|
||||
local rowwidths = {}
|
||||
@ -26,6 +22,143 @@ local rowends = {}
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
||||
local function PanelTemplates_TabResize(tab, padding, absoluteSize, minWidth, maxWidth, absoluteTextSize)
|
||||
local tabName = tab:GetName();
|
||||
|
||||
local buttonMiddle = tab.Middle or tab.middleTexture or _G[tabName.."Middle"];
|
||||
local buttonMiddleDisabled = tab.MiddleDisabled or (tabName and _G[tabName.."MiddleDisabled"]);
|
||||
local left = tab.Left or tab.leftTexture or _G[tabName.."Left"];
|
||||
local sideWidths = 2 * left:GetWidth();
|
||||
local tabText = tab.Text or _G[tab:GetName().."Text"];
|
||||
local highlightTexture = tab.HighlightTexture or (tabName and _G[tabName.."HighlightTexture"]);
|
||||
|
||||
local width, tabWidth;
|
||||
local textWidth;
|
||||
if ( absoluteTextSize ) then
|
||||
textWidth = absoluteTextSize;
|
||||
else
|
||||
tabText:SetWidth(0);
|
||||
textWidth = tabText:GetWidth();
|
||||
end
|
||||
-- If there's an absolute size specified then use it
|
||||
if ( absoluteSize ) then
|
||||
if ( absoluteSize < sideWidths) then
|
||||
width = 1;
|
||||
tabWidth = sideWidths
|
||||
else
|
||||
width = absoluteSize - sideWidths;
|
||||
tabWidth = absoluteSize
|
||||
end
|
||||
tabText:SetWidth(width);
|
||||
else
|
||||
-- Otherwise try to use padding
|
||||
if ( padding ) then
|
||||
width = textWidth + padding;
|
||||
else
|
||||
width = textWidth + 24;
|
||||
end
|
||||
-- If greater than the maxWidth then cap it
|
||||
if ( maxWidth and width > maxWidth ) then
|
||||
if ( padding ) then
|
||||
width = maxWidth + padding;
|
||||
else
|
||||
width = maxWidth + 24;
|
||||
end
|
||||
tabText:SetWidth(width);
|
||||
else
|
||||
tabText:SetWidth(0);
|
||||
end
|
||||
if (minWidth and width < minWidth) then
|
||||
width = minWidth;
|
||||
end
|
||||
tabWidth = width + sideWidths;
|
||||
end
|
||||
|
||||
if ( buttonMiddle ) then
|
||||
buttonMiddle:SetWidth(width);
|
||||
end
|
||||
if ( buttonMiddleDisabled ) then
|
||||
buttonMiddleDisabled:SetWidth(width);
|
||||
end
|
||||
|
||||
tab:SetWidth(tabWidth);
|
||||
|
||||
if ( highlightTexture ) then
|
||||
highlightTexture:SetWidth(tabWidth);
|
||||
end
|
||||
end
|
||||
|
||||
local function PanelTemplates_DeselectTab(tab)
|
||||
local name = tab:GetName();
|
||||
|
||||
local left = tab.Left or _G[name.."Left"];
|
||||
local middle = tab.Middle or _G[name.."Middle"];
|
||||
local right = tab.Right or _G[name.."Right"];
|
||||
left:Show();
|
||||
middle:Show();
|
||||
right:Show();
|
||||
--tab:UnlockHighlight();
|
||||
tab:Enable();
|
||||
local text = tab.Text or _G[name.."Text"];
|
||||
text:SetPoint("CENTER", tab, "CENTER", (tab.deselectedTextX or 0), (tab.deselectedTextY or 2));
|
||||
|
||||
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
|
||||
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
|
||||
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
|
||||
leftDisabled:Hide();
|
||||
middleDisabled:Hide();
|
||||
rightDisabled:Hide();
|
||||
end
|
||||
|
||||
local function PanelTemplates_SelectTab(tab)
|
||||
local name = tab:GetName();
|
||||
|
||||
local left = tab.Left or _G[name.."Left"];
|
||||
local middle = tab.Middle or _G[name.."Middle"];
|
||||
local right = tab.Right or _G[name.."Right"];
|
||||
left:Hide();
|
||||
middle:Hide();
|
||||
right:Hide();
|
||||
--tab:LockHighlight();
|
||||
tab:Disable();
|
||||
tab:SetDisabledFontObject(GameFontHighlightSmall);
|
||||
local text = tab.Text or _G[name.."Text"];
|
||||
text:SetPoint("CENTER", tab, "CENTER", (tab.selectedTextX or 0), (tab.selectedTextY or -3));
|
||||
|
||||
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
|
||||
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
|
||||
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
|
||||
leftDisabled:Show();
|
||||
middleDisabled:Show();
|
||||
rightDisabled:Show();
|
||||
|
||||
if GameTooltip:IsOwned(tab) then
|
||||
GameTooltip:Hide();
|
||||
end
|
||||
end
|
||||
|
||||
local function PanelTemplates_SetDisabledTabState(tab)
|
||||
local name = tab:GetName();
|
||||
local left = tab.Left or _G[name.."Left"];
|
||||
local middle = tab.Middle or _G[name.."Middle"];
|
||||
local right = tab.Right or _G[name.."Right"];
|
||||
left:Show();
|
||||
middle:Show();
|
||||
right:Show();
|
||||
--tab:UnlockHighlight();
|
||||
tab:Disable();
|
||||
tab.text = tab:GetText();
|
||||
-- Gray out text
|
||||
tab:SetDisabledFontObject(GameFontDisableSmall);
|
||||
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
|
||||
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
|
||||
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
|
||||
leftDisabled:Hide();
|
||||
middleDisabled:Hide();
|
||||
rightDisabled:Hide();
|
||||
end
|
||||
|
||||
local function UpdateTabLook(frame)
|
||||
if frame.disabled then
|
||||
PanelTemplates_SetDisabledTabState(frame)
|
||||
@ -103,11 +236,64 @@ local methods = {
|
||||
|
||||
["CreateTab"] = function(self, id)
|
||||
local tabname = ("AceGUITabGroup%dTab%d"):format(self.num, id)
|
||||
local tab = CreateFrame("Button", tabname, self.border, "OptionsFrameTabButtonTemplate")
|
||||
local tab = CreateFrame("Button", tabname, self.border)
|
||||
tab:SetSize(115, 24)
|
||||
tab.deselectedTextY = -3
|
||||
tab.selectedTextY = -2
|
||||
|
||||
tab.LeftDisabled = tab:CreateTexture(tabname .. "LeftDisabled", "BORDER")
|
||||
tab.LeftDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
|
||||
tab.LeftDisabled:SetSize(20, 24)
|
||||
tab.LeftDisabled:SetPoint("BOTTOMLEFT", 0, -3)
|
||||
tab.LeftDisabled:SetTexCoord(0, 0.15625, 0, 1.0)
|
||||
|
||||
tab.MiddleDisabled = tab:CreateTexture(tabname .. "MiddleDisabled", "BORDER")
|
||||
tab.MiddleDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
|
||||
tab.MiddleDisabled:SetSize(88, 24)
|
||||
tab.MiddleDisabled:SetPoint("LEFT", tab.LeftDisabled, "RIGHT")
|
||||
tab.MiddleDisabled:SetTexCoord(0.15625, 0.84375, 0, 1.0)
|
||||
|
||||
tab.RightDisabled = tab:CreateTexture(tabname .. "RightDisabled", "BORDER")
|
||||
tab.RightDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
|
||||
tab.RightDisabled:SetSize(20, 24)
|
||||
tab.RightDisabled:SetPoint("LEFT", tab.MiddleDisabled, "RIGHT")
|
||||
tab.RightDisabled:SetTexCoord(0.84375, 1.0, 0, 1.0)
|
||||
|
||||
tab.Left = tab:CreateTexture(tabname .. "Left", "BORDER")
|
||||
tab.Left:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
|
||||
tab.Left:SetSize(20, 24)
|
||||
tab.Left:SetPoint("TOPLEFT")
|
||||
tab.Left:SetTexCoord(0, 0.15625, 0, 1.0)
|
||||
|
||||
tab.Middle = tab:CreateTexture(tabname .. "Middle", "BORDER")
|
||||
tab.Middle:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
|
||||
tab.Middle:SetSize(88, 24)
|
||||
tab.Middle:SetPoint("LEFT", tab.Left, "RIGHT")
|
||||
tab.Middle:SetTexCoord(0.15625, 0.84375, 0, 1.0)
|
||||
|
||||
tab.Right = tab:CreateTexture(tabname .. "Right", "BORDER")
|
||||
tab.Right:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
|
||||
tab.Right:SetSize(20, 24)
|
||||
tab.Right:SetPoint("LEFT", tab.Middle, "RIGHT")
|
||||
tab.Right:SetTexCoord(0.84375, 1.0, 0, 1.0)
|
||||
|
||||
tab.Text = tab:CreateFontString(tabname .. "Text")
|
||||
tab:SetFontString(tab.Text)
|
||||
|
||||
tab:SetNormalFontObject(GameFontNormalSmall)
|
||||
tab:SetHighlightFontObject(GameFontHighlightSmall)
|
||||
tab:SetDisabledFontObject(GameFontHighlightSmall)
|
||||
tab:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight", "ADD")
|
||||
tab.HighlightTexture = tab:GetHighlightTexture()
|
||||
tab.HighlightTexture:ClearAllPoints()
|
||||
tab.HighlightTexture:SetPoint("LEFT", tab, "LEFT", 10, -4)
|
||||
tab.HighlightTexture:SetPoint("RIGHT", tab, "RIGHT", -10, -4)
|
||||
_G[tabname .. "HighlightTexture"] = tab.HighlightTexture
|
||||
|
||||
tab.obj = self
|
||||
tab.id = id
|
||||
|
||||
tab.text = _G[tabname .. "Text"]
|
||||
tab.text = tab.Text -- compat
|
||||
tab.text:ClearAllPoints()
|
||||
tab.text:SetPoint("LEFT", 14, -3)
|
||||
tab.text:SetPoint("RIGHT", -12, -3)
|
||||
@ -316,7 +502,7 @@ local function Constructor()
|
||||
titletext:SetHeight(18)
|
||||
titletext:SetText("")
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", 1, -27)
|
||||
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
@ -2,22 +2,18 @@
|
||||
TreeGroup Container
|
||||
Container that uses a tree control to switch between groups.
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "TreeGroup", 45
|
||||
local Type, Version = "TreeGroup", 47
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
-- Lua APIs
|
||||
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
|
||||
local math_min, math_max, floor = math.min, math.max, floor
|
||||
local math_min, math_max, floor = math.min, math.max, math.floor
|
||||
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat
|
||||
|
||||
-- WoW APIs
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: FONT_COLOR_CODE_CLOSE
|
||||
|
||||
-- Recycling functions
|
||||
local new, del
|
||||
do
|
||||
@ -567,7 +563,11 @@ local methods = {
|
||||
if maxtreewidth > 100 and status.treewidth > maxtreewidth then
|
||||
self:SetTreeWidth(maxtreewidth, status.treesizable)
|
||||
end
|
||||
treeframe:SetMaxResize(maxtreewidth, 1600)
|
||||
if treeframe.SetResizeBounds then
|
||||
treeframe:SetResizeBounds(100, 1, maxtreewidth, 1600)
|
||||
else
|
||||
treeframe:SetMaxResize(maxtreewidth, 1600)
|
||||
end
|
||||
end,
|
||||
|
||||
["OnHeightSet"] = function(self, height)
|
||||
@ -637,7 +637,7 @@ local function Constructor()
|
||||
local num = AceGUI:GetNextWidgetNum(Type)
|
||||
local frame = CreateFrame("Frame", nil, UIParent)
|
||||
|
||||
local treeframe = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local treeframe = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
treeframe:SetPoint("TOPLEFT")
|
||||
treeframe:SetPoint("BOTTOMLEFT")
|
||||
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
|
||||
@ -646,13 +646,17 @@ local function Constructor()
|
||||
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
|
||||
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
treeframe:SetResizable(true)
|
||||
treeframe:SetMinResize(100, 1)
|
||||
treeframe:SetMaxResize(400, 1600)
|
||||
if treeframe.SetResizeBounds then -- WoW 10.0
|
||||
treeframe:SetResizeBounds(100, 1, 400, 1600)
|
||||
else
|
||||
treeframe:SetMinResize(100, 1)
|
||||
treeframe:SetMaxResize(400, 1600)
|
||||
end
|
||||
treeframe:SetScript("OnUpdate", FirstFrameUpdate)
|
||||
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
|
||||
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
|
||||
|
||||
local dragger = CreateFrame("Frame", nil, treeframe, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local dragger = CreateFrame("Frame", nil, treeframe, "BackdropTemplate")
|
||||
dragger:SetWidth(8)
|
||||
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
|
||||
dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT")
|
||||
@ -677,7 +681,7 @@ local function Constructor()
|
||||
scrollbg:SetAllPoints(scrollbar)
|
||||
scrollbg:SetColorTexture(0,0,0,0.4)
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
|
||||
border:SetPoint("BOTTOMRIGHT")
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
@ -7,10 +7,6 @@ local pairs, assert, type = pairs, assert, type
|
||||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GameFontNormal
|
||||
|
||||
----------------
|
||||
-- Main Frame --
|
||||
----------------
|
||||
@ -21,7 +17,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
]]
|
||||
do
|
||||
local Type = "Window"
|
||||
local Version = 6
|
||||
local Version = 8
|
||||
|
||||
local function frameOnShow(this)
|
||||
this.obj:Fire("OnShow")
|
||||
@ -186,7 +182,11 @@ do
|
||||
|
||||
frame:SetScript("OnShow",frameOnShow)
|
||||
frame:SetScript("OnHide",frameOnClose)
|
||||
frame:SetMinResize(240,240)
|
||||
if frame.SetResizeBounds then -- WoW 10.0
|
||||
frame:SetResizeBounds(240,240)
|
||||
else
|
||||
frame:SetMinResize(240,240)
|
||||
end
|
||||
frame:SetToplevel(true)
|
||||
|
||||
local titlebg = frame:CreateTexture(nil, "BACKGROUND")
|
||||
@ -300,7 +300,7 @@ do
|
||||
line2:SetHeight(8)
|
||||
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
||||
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
||||
local x = 0.1 * 8/17
|
||||
x = 0.1 * 8/17
|
||||
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
|
||||
|
||||
local sizer_s = CreateFrame("Frame",nil,frame)
|
||||
|
@ -12,10 +12,6 @@ local select, pairs = select, pairs
|
||||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: SetDesaturation, GameFontHighlight
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
@ -199,14 +195,14 @@ local methods = {
|
||||
["SetDescription"] = function(self, desc)
|
||||
if desc then
|
||||
if not self.desc then
|
||||
local desc = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
desc:ClearAllPoints()
|
||||
desc:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
|
||||
desc:SetWidth(self.frame.width - 30)
|
||||
desc:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
|
||||
desc:SetJustifyH("LEFT")
|
||||
desc:SetJustifyV("TOP")
|
||||
self.desc = desc
|
||||
local f = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
f:ClearAllPoints()
|
||||
f:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
|
||||
f:SetWidth(self.frame.width - 30)
|
||||
f:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
|
||||
f:SetJustifyH("LEFT")
|
||||
f:SetJustifyV("TOP")
|
||||
self.desc = f
|
||||
end
|
||||
self.desc:Show()
|
||||
--self.text:SetFontObject(GameFontNormal)
|
||||
|
@ -11,10 +11,6 @@ local pairs = pairs
|
||||
-- WoW APIs
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: ColorPickerFrame, OpacitySliderFrame
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -1,4 +1,4 @@
|
||||
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1202 2019-05-15 23:11:22Z nevcairiel $ ]]--
|
||||
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1272 2022-08-29 15:56:35Z nevcairiel $ ]]--
|
||||
|
||||
local AceGUI = LibStub("AceGUI-3.0")
|
||||
|
||||
@ -41,7 +41,7 @@ local ItemBase = {
|
||||
-- NOTE: The ItemBase version is added to each item's version number
|
||||
-- to ensure proper updates on ItemBase changes.
|
||||
-- Use at least 1000er steps.
|
||||
version = 1000,
|
||||
version = 2000,
|
||||
counter = 0,
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ function ItemBase.Create(type)
|
||||
highlight:Hide()
|
||||
self.highlight = highlight
|
||||
|
||||
local check = frame:CreateTexture("OVERLAY")
|
||||
local check = frame:CreateTexture(nil, "OVERLAY")
|
||||
check:SetWidth(16)
|
||||
check:SetHeight(16)
|
||||
check:SetPoint("LEFT",frame,"LEFT",3,-1)
|
||||
@ -186,7 +186,7 @@ function ItemBase.Create(type)
|
||||
check:Hide()
|
||||
self.check = check
|
||||
|
||||
local sub = frame:CreateTexture("OVERLAY")
|
||||
local sub = frame:CreateTexture(nil, "OVERLAY")
|
||||
sub:SetWidth(16)
|
||||
sub:SetHeight(16)
|
||||
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
--[[ $Id: AceGUIWidget-DropDown.lua 1239 2020-09-20 10:22:02Z nevcairiel $ ]]--
|
||||
--[[ $Id: AceGUIWidget-DropDown.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]--
|
||||
local AceGUI = LibStub("AceGUI-3.0")
|
||||
|
||||
-- Lua APIs
|
||||
@ -11,10 +11,6 @@ local PlaySound = PlaySound
|
||||
local UIParent, CreateFrame = UIParent, CreateFrame
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: CLOSE
|
||||
|
||||
local function fixlevels(parent,...)
|
||||
local i = 1
|
||||
local child = select(i, ...)
|
||||
@ -253,7 +249,7 @@ do
|
||||
|
||||
local function Constructor()
|
||||
local count = AceGUI:GetNextWidgetNum(widgetType)
|
||||
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, "BackdropTemplate")
|
||||
local self = {}
|
||||
self.count = count
|
||||
self.type = widgetType
|
||||
@ -304,7 +300,7 @@ do
|
||||
scrollFrame.obj = self
|
||||
itemFrame.obj = self
|
||||
|
||||
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, "BackdropTemplate")
|
||||
slider:SetOrientation("VERTICAL")
|
||||
slider:SetHitRectInsets(0, 0, -10, 0)
|
||||
slider:SetBackdrop(sliderBackdrop)
|
||||
@ -351,7 +347,7 @@ end
|
||||
|
||||
do
|
||||
local widgetType = "Dropdown"
|
||||
local widgetVersion = 35
|
||||
local widgetVersion = 36
|
||||
|
||||
--[[ Static data ]]--
|
||||
|
||||
@ -376,7 +372,6 @@ do
|
||||
|
||||
local function Dropdown_TogglePullout(this)
|
||||
local self = this.obj
|
||||
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
|
||||
if self.open then
|
||||
self.open = nil
|
||||
self.pullout:Close()
|
||||
|
@ -14,10 +14,6 @@ local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, Get
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: AceGUIEditBoxInsertLink, ChatFontNormal, OKAY
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -13,10 +13,6 @@ local pairs = pairs
|
||||
local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: NOT_BOUND
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Scripts
|
||||
-------------------------------------------------------------------------------]]
|
||||
@ -214,7 +210,7 @@ local function Constructor()
|
||||
label:SetJustifyH("CENTER")
|
||||
label:SetHeight(18)
|
||||
|
||||
local msgframe = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local msgframe = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
|
||||
msgframe:SetHeight(30)
|
||||
msgframe:SetBackdrop(ControlBackdrop)
|
||||
msgframe:SetBackdropColor(0,0,0)
|
||||
|
@ -2,7 +2,7 @@
|
||||
Label Widget
|
||||
Displays text and optionally an icon.
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "Label", 27
|
||||
local Type, Version = "Label", 28
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
@ -12,10 +12,6 @@ local max, select, pairs = math.max, select, pairs
|
||||
-- WoW APIs
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GameFontHighlightSmall
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
@ -129,12 +125,16 @@ local methods = {
|
||||
end,
|
||||
|
||||
["SetFont"] = function(self, font, height, flags)
|
||||
self.label:SetFont(font, height, flags)
|
||||
UpdateImageAnchor(self)
|
||||
if not self.fontObject then
|
||||
self.fontObject = CreateFont("AceGUI30LabelFont" .. AceGUI:GetNextWidgetNum(Type))
|
||||
end
|
||||
self.fontObject:SetFont(font, height, flags)
|
||||
self:SetFontObject(self.fontObject)
|
||||
end,
|
||||
|
||||
["SetFontObject"] = function(self, font)
|
||||
self:SetFont((font or GameFontHighlightSmall):GetFont())
|
||||
self.label:SetFontObject(font or GameFontHighlightSmall)
|
||||
UpdateImageAnchor(self)
|
||||
end,
|
||||
|
||||
["SetImageSize"] = function(self, width, height)
|
||||
|
@ -1,4 +1,4 @@
|
||||
local Type, Version = "MultiLineEditBox", 29
|
||||
local Type, Version = "MultiLineEditBox", 32
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
@ -10,10 +10,6 @@ local GetCursorInfo, GetSpellInfo, ClearCursor = GetCursorInfo, GetSpellInfo, Cl
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: ACCEPT, ChatFontNormal
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
@ -145,6 +141,14 @@ local function OnVerticalScroll(self, offset)
|
||||
editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight())
|
||||
end
|
||||
|
||||
local function OnScrollRangeChanged(self, xrange, yrange)
|
||||
if yrange == 0 then
|
||||
self.obj.editBox:SetHitRectInsets(0, 0, 0, 0)
|
||||
else
|
||||
OnVerticalScroll(self, self:GetVerticalScroll())
|
||||
end
|
||||
end
|
||||
|
||||
local function OnShowFocus(frame)
|
||||
frame.obj.editBox:SetFocus()
|
||||
frame:SetScript("OnShow", nil)
|
||||
@ -257,8 +261,6 @@ local methods = {
|
||||
["SetCursorPosition"] = function(self, ...)
|
||||
return self.editBox:SetCursorPosition(...)
|
||||
end,
|
||||
|
||||
|
||||
}
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
@ -297,7 +299,7 @@ local function Constructor()
|
||||
text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -5, 1)
|
||||
text:SetJustifyV("MIDDLE")
|
||||
|
||||
local scrollBG = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local scrollBG = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
scrollBG:SetBackdrop(backdrop)
|
||||
scrollBG:SetBackdropColor(0, 0, 0)
|
||||
scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
@ -321,6 +323,7 @@ local function Constructor()
|
||||
scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag)
|
||||
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
|
||||
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll)
|
||||
scrollFrame:HookScript("OnScrollRangeChanged", OnScrollRangeChanged)
|
||||
|
||||
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame)
|
||||
editBox:SetAllPoints()
|
||||
|
@ -14,10 +14,6 @@ local tonumber, pairs = tonumber, pairs
|
||||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GameFontHighlightSmall
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
@ -31,13 +27,13 @@ local function UpdateText(self)
|
||||
end
|
||||
|
||||
local function UpdateLabels(self)
|
||||
local min, max = (self.min or 0), (self.max or 100)
|
||||
local min_value, max_value = (self.min or 0), (self.max or 100)
|
||||
if self.ispercent then
|
||||
self.lowtext:SetFormattedText("%s%%", (min * 100))
|
||||
self.hightext:SetFormattedText("%s%%", (max * 100))
|
||||
self.lowtext:SetFormattedText("%s%%", (min_value * 100))
|
||||
self.hightext:SetFormattedText("%s%%", (max_value * 100))
|
||||
else
|
||||
self.lowtext:SetText(min)
|
||||
self.hightext:SetText(max)
|
||||
self.lowtext:SetText(min_value)
|
||||
self.hightext:SetText(max_value)
|
||||
end
|
||||
end
|
||||
|
||||
@ -175,13 +171,13 @@ local methods = {
|
||||
self.label:SetText(text)
|
||||
end,
|
||||
|
||||
["SetSliderValues"] = function(self, min, max, step)
|
||||
["SetSliderValues"] = function(self, min_value, max_value, step)
|
||||
local frame = self.slider
|
||||
frame.setup = true
|
||||
self.min = min
|
||||
self.max = max
|
||||
self.min = min_value
|
||||
self.max = max_value
|
||||
self.step = step
|
||||
frame:SetMinMaxValues(min or 0,max or 100)
|
||||
frame:SetMinMaxValues(min_value or 0,max_value or 100)
|
||||
UpdateLabels(self)
|
||||
frame:SetValueStep(step or 1)
|
||||
if self.value then
|
||||
@ -225,7 +221,7 @@ local function Constructor()
|
||||
label:SetJustifyH("CENTER")
|
||||
label:SetHeight(15)
|
||||
|
||||
local slider = CreateFrame("Slider", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local slider = CreateFrame("Slider", nil, frame, "BackdropTemplate")
|
||||
slider:SetOrientation("HORIZONTAL")
|
||||
slider:SetHeight(15)
|
||||
slider:SetHitRectInsets(0, 0, -10, 0)
|
||||
@ -247,7 +243,7 @@ local function Constructor()
|
||||
local hightext = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
||||
hightext:SetPoint("TOPRIGHT", slider, "BOTTOMRIGHT", -2, 3)
|
||||
|
||||
local editbox = CreateFrame("EditBox", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local editbox = CreateFrame("EditBox", nil, frame, "BackdropTemplate")
|
||||
editbox:SetAutoFocus(false)
|
||||
editbox:SetFontObject(GameFontHighlightSmall)
|
||||
editbox:SetPoint("TOP", slider, "BOTTOM")
|
||||
|
Reference in New Issue
Block a user