Port XML templates to Lua, update AceGUI/AceConfig, fix $parent nil frame issues on our game version

This commit is contained in:
NoM0Re
2025-07-29 18:02:22 +02:00
committed by GitHub
parent dce683db43
commit 9d0cc562b9
48 changed files with 1235 additions and 1128 deletions
+4 -5
View File
@@ -123,7 +123,7 @@ globals = {
"SecondsFormatterMixin",
"SecureButton_GetModifiedUnit",
"SlashCmdList",
"SearchBoxTemplate_OnTextChanged",
"WA_SearchBoxTemplate_OnTextChanged",
"SmoothStatusBarMixin",
"STATICPOPUP_NUMDIALOGS",
"StaticPopup_Show",
@@ -19551,7 +19551,6 @@ globals = {
"ZOOM_OUT",
"ZOOM_OUT_BUTTON_TEXT",
"_RECORDING_WARNING_CORRUPTED",
"GetNumPartyMembers", "GetNumRaidMembers", "noop", "tInvert", "DeltaLerp",
"GetNumEquipmentSets", "GetEquipmentSetInfo", "CR_HASTE_MELEE", "CR_HASTE_RANGED",
"CR_CRIT_TAKEN_MELEE", "CR_CRIT_TAKEN_RANGED", "CR_CRIT_TAKEN_SPELL",
@@ -19566,12 +19565,12 @@ globals = {
"CreateFontStringPool", "ActorPoolMixin", "ActorPool_Hide", "ActorPool_HideAndClearModel",
"CreateActorPool", "FramePoolCollectionMixin", "CreateFramePoolCollection",
"FixedSizeFramePoolCollectionMixin", "CreateFixedSizeFramePoolCollection",
"WA_MaximizeMinimizeButtonFrame_Mixin", "WA_PortraitFrameTemplate_Mixin",
"WA_UpdateNineSliceBorders", "SecondsToMinutes", "MinutesToSeconds", "HasTimePassed",
"SecondsToMinutes", "MinutesToSeconds", "HasTimePassed",
"SecondsFormatterConstants", "ConvertSecondsToUnits", "SecondsToClock",
"MinutesToTime", "FormatShortDate", "NUMBER_ABBREVIATION_DATA", "WeakAurasProfilingReportTitleText",
"WeakAurasRealTimeProfiling", "WeakAurasRealTimeProfilingTitleText", "seconds", "NUM_CHAT_WINDOWS",
"GetNumGlyphSockets", "GetGlyphLink", "GetGlyphSocketInfo", "APIDocumentationMixin", "BaseAPIMixin",
"EventsAPIMixin", "FieldsAPIMixin", "FunctionsAPIMixin", "SystemsAPIMixin", "TablesAPIMixin",
"CopyToClipboard", "ChatFrame_OpenChat", "ChatTypeInfo"
"CopyToClipboard", "ChatFrame_OpenChat", "ChatTypeInfo", "EditBox_ClearFocus", "EditBox_ClearHighlight",
"EditBox_HighlightText"
}
+2 -2
View File
@@ -24,7 +24,7 @@ do -- boilerplate & static values
Archivist.storeMap = {}
Archivist.activeStores = {}
namespace.Archivist = Archivist
local unloader = CreateFrame("FRAME")
local unloader = CreateFrame("Frame")
unloader:RegisterEvent("PLAYER_LOGOUT")
unloader:SetScript("OnEvent", function()
Archivist:DeInitialize()
@@ -33,7 +33,7 @@ do -- boilerplate & static values
-- Archivist is installed as a standalone addon.
-- The Archive is in the default location, ACHV_DB
_G.Archivist = Archivist
local loader = CreateFrame("frame")
local loader = CreateFrame("Frame")
loader:RegisterEvent("ADDON_LOADED")
loader:SetScript("OnEvent", function(self, _, addon)
if addon == addonName then
+6 -3
View File
@@ -13,7 +13,8 @@ profileData.auras = {}
local currentProfileState, ProfilingTimer
local RealTimeProfilingWindow = CreateFrame("Frame", "WeakAurasRealTimeProfiling", UIParent, "WA_PortraitFrameTemplate")
local RealTimeProfilingWindow = CreateFrame("Frame", "WeakAurasRealTimeProfiling", UIParent)
WeakAuras.XMLTemplates["PortraitFrameTemplate"](RealTimeProfilingWindow)
RealTimeProfilingWindow:HidePortrait(RealTimeProfilingWindow)
Private.frames["RealTime Profiling Window"] = RealTimeProfilingWindow
RealTimeProfilingWindow.width = 500
@@ -57,7 +58,8 @@ end
local profilePopup
local function CreateProfilePopup()
local frame = CreateFrame("Frame", "WeakAurasProfilingReport", UIParent, "WA_PortraitFrameTemplate")
local frame = CreateFrame("Frame", "WeakAurasProfilingReport", UIParent)
WeakAuras.XMLTemplates["PortraitFrameTemplate"](frame)
frame:HidePortrait(frame)
WeakAurasProfilingReportTitleText:SetText(L["WeakAuras Profiling Report"])
frame:SetMovable(true)
@@ -598,7 +600,8 @@ function RealTimeProfilingWindow:Init()
self.statsFrameText = statsFrameText
statsFrameText:SetPoint("BOTTOMLEFT", 15, 25)
local minimizeButton = CreateFrame("Button", nil, self, "WA_MaximizeMinimizeButtonFrameTemplate")
local minimizeButton = CreateFrame("Button", nil, self)
WeakAuras.XMLTemplates["MaximizeMinimizeButtonFrameTemplate"](minimizeButton)
minimizeButton:SetPoint("RIGHT", self.CloseButton, "LEFT")
minimizeButton:SetOnMaximizedCallback(function()
self.minimized = false
+458 -111
View File
@@ -1,129 +1,476 @@
if not WeakAuras.IsLibsOK() then return end
function WA_MaximizeMinimizeButtonFrame_Mixin(frame)
if frame and frame.init then return end
frame.init = true
frame.isMinimized = false
frame.maximizedCallback = nil
frame.minimizedCallback = nil
local methods = {
OnShow = function(self)
if self.isMinimized then
self:SetMaximizedLook()
else
self:SetMinimizedLook()
end
end,
IsMinimized = function(self)
return self.isMinimized
end,
SetOnMaximizedCallback = function(self, callback)
self.maximizedCallback = callback
end,
SetOnMinimizedCallback = function(self, callback)
self.minimizedCallback = callback
end,
Maximize = function(self, skipCallback)
if self.maximizedCallback and not skipCallback then
self:maximizedCallback()
end
self.isMinimized = false
self:SetMinimizedLook()
end,
Minimize = function(self, skipCallback)
if self.minimizedCallback and not skipCallback then
self:minimizedCallback()
end
self.isMinimized = true
self:SetMaximizedLook()
end,
SetMinimizedLook = function(self)
self.MaximizeButton:Hide()
self.MinimizeButton:Show()
end,
SetMaximizedLook = function(self)
self.MaximizeButton:Show()
self.MinimizeButton:Hide()
end,
}
for name, func in pairs(methods) do
frame[name] = func
end
end
function WA_PortraitFrameTemplate_Mixin(frame)
if frame and frame.init then return end
frame.init = true
frame.Bg:SetVertexColor(0.5882, 0.6275, 0.6706, 0.8) -- approx. PANEL_BACKGROUND_COLOR #ff1f1e21
frame.layoutType = "PortraitMode"
local methods = {
ShowPortrait = function(self)
self.PortraitContainer:Show();
self.NineSlice.TopLeftCorner:Show();
self.NineSlice.TopLeftCornerNoPortrait:Hide();
self.layoutType = "PortraitMode"
end,
HidePortrait = function(self)
self.PortraitContainer:Hide();
self.NineSlice.TopLeftCorner:Hide();
self.NineSlice.TopLeftCornerNoPortrait:Show();
self.layoutType = "NoPortraitMode"
end,
GetFrameLayoutType = function(self)
return self.layoutType or self:GetParent().layoutType;
end
}
for name, func in pairs(methods) do
frame[name] = func
end
end
local AddonName = ...
local Private = select(2, ...)
local function setCorner(corner, point, relativeTo, x, y, width, height)
corner:ClearAllPoints()
corner:SetPoint(point, relativeTo, x, y)
corner:SetSize(width, height)
corner:ClearAllPoints()
corner:SetPoint(point, relativeTo, x, y)
corner:SetSize(width, height)
end
local function setEdge(edge, point1, relativeTo1, point2, relativeTo2, width, height)
edge:ClearAllPoints()
edge:SetSize(width, height)
edge:SetPoint(point1, relativeTo1, point2, 0, 0)
edge:SetPoint(point2, relativeTo2, point1, 0, 0)
edge:ClearAllPoints()
edge:SetSize(width, height)
edge:SetPoint(point1, relativeTo1, point2, 0, 0)
edge:SetPoint(point2, relativeTo2, point1, 0, 0)
end
function WA_UpdateNineSliceBorders(frame)
local NineSlice = frame.NineSlice
if not NineSlice then return end
local PortaitMode = frame:GetFrameLayoutType() == "PortraitMode"
local function UpdateNineSliceBorders(frame)
local NineSlice = frame.NineSlice
local PortaitMode = frame:GetFrameLayoutType() == "PortraitMode"
local topLeftCorner = PortaitMode and NineSlice.TopLeftCorner or NineSlice.TopLeftCornerNoPortrait
local topEdgeRelativeTo = PortaitMode and NineSlice.TopLeftCorner or NineSlice.TopLeftCornerNoPortrait
local leftEdgeRelativeTo = PortaitMode and NineSlice.TopLeftCorner or NineSlice.TopLeftCornerNoPortrait
-- Top Left Corner
setCorner(topLeftCorner, "TOPLEFT", NineSlice, -13, 16, 75, 75)
-- Top Right Corner
setCorner(NineSlice.TopRightCorner, "TOPRIGHT", NineSlice, 4, 16, 75, 75)
-- Bottom Left Corner
setCorner(NineSlice.BottomLeftCorner, "BOTTOMLEFT", NineSlice, -13, -3, 32, 32)
-- Bottom Right Corner
setCorner(NineSlice.BottomRightCorner, "BOTTOMRIGHT", NineSlice, 4, -3, 32, 32)
-- Top Edge
setEdge(NineSlice.TopEdge, "TOPLEFT", topEdgeRelativeTo, "TOPRIGHT", NineSlice.TopRightCorner, 32, 75)
-- Bottom Edge
setEdge(NineSlice.BottomEdge, "BOTTOMLEFT", NineSlice.BottomLeftCorner, "BOTTOMRIGHT", NineSlice.BottomRightCorner, 32, 32)
-- Left Edge
setEdge(NineSlice.LeftEdge, "TOPLEFT", leftEdgeRelativeTo, "BOTTOMLEFT", NineSlice.BottomLeftCorner, 75, 8)
-- Right Edge
setEdge(NineSlice.RightEdge, "TOPLEFT", NineSlice.TopRightCorner, "BOTTOMLEFT", NineSlice.BottomRightCorner, 75, 8)
end
local topLeftCorner = PortaitMode and NineSlice.TopLeftCorner or NineSlice.TopLeftCornerNoPortrait
local topEdgeRelativeTo = PortaitMode and NineSlice.TopLeftCorner or NineSlice.TopLeftCornerNoPortrait
local leftEdgeRelativeTo = PortaitMode and NineSlice.TopLeftCorner or NineSlice.TopLeftCornerNoPortrait
local function InputBoxInstructions_OnTextChanged(self)
if self:GetText() == "" then
self.Instructions:Show();
else
self.Instructions:Hide();
end
end
local function InputBoxInstructions_UpdateColorForEnabledState(self, color)
if color then
self:SetTextColor(color.r, color.g, color.b, color.a);
end
end
local function InputBoxInstructions_OnDisable(self)
InputBoxInstructions_UpdateColorForEnabledState(self, self.disabledColor);
end
local function InputBoxInstructions_OnEnable(self)
InputBoxInstructions_UpdateColorForEnabledState(self, self.enabledColor);
end
local function SearchBoxTemplate_OnEditFocusLost(self)
if ( self:GetText() == "" ) then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6);
self.clearButton:Hide();
end
end
local function SearchBoxTemplate_OnEditFocusGained(self)
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0);
self.clearButton:Show();
end
function WA_SearchBoxTemplate_OnTextChanged(self)
if ( not self:HasFocus() and self:GetText() == "" ) then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6);
self.clearButton:Hide();
else
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0);
self.clearButton:Show();
end
InputBoxInstructions_OnTextChanged(self);
end
local function SearchBoxTemplate_ClearText(self)
self:SetText("");
self:ClearFocus();
end
local function SearchBoxTemplateClearButton_OnClick(self)
PlaySound("igMainMenuOptionCheckBoxOn");
SearchBoxTemplate_ClearText(self:GetParent());
end
local function GetParentName(frame)
return frame:GetName() or frame
end
WeakAuras.XMLTemplates = {
-- InputBoxTemplate (Retail 11.1.7 (61967))
["InputBoxTemplate"] = function(frame)
frame:EnableMouse(true)
-- Left Texture
local left = frame:CreateTexture(nil, "BACKGROUND")
left:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\CommonSearch")
left:SetSize(8, 20)
left:SetPoint("LEFT", frame, "LEFT", -5, 0)
left:SetTexCoord(0.886719, 0.949219, 0.335938, 0.648438)
frame.Left = left
-- Right Texture
local right = frame:CreateTexture(nil, "BACKGROUND")
right:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\CommonSearch")
right:SetSize(8, 20)
right:SetPoint("RIGHT", frame, "RIGHT", 0, 0)
right:SetTexCoord(0.00390625, 0.0664062, 0.664062, 0.976562)
frame.Right = right
-- Middle Texture (zwischen Left und Right)
local middle = frame:CreateTexture(nil, "BACKGROUND")
middle:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\CommonSearch")
middle:SetSize(10, 20)
middle:SetTexCoord(0.00390625, 0.878906, 0.335938, 0.648438)
middle:SetPoint("LEFT", left, "RIGHT")
middle:SetPoint("RIGHT", right, "LEFT")
frame.Middle = middle
-- FontString
local fontString = frame:CreateFontString(nil, "ARTWORK", "ChatFontNormal")
frame.FontString = fontString
-- Scripts
frame:SetScript("OnEscapePressed", function(self)
EditBox_ClearFocus(self)
end)
frame:SetScript("OnEditFocusLost", function(self)
EditBox_ClearHighlight(self)
end)
frame:SetScript("OnEditFocusGained", function(self)
EditBox_HighlightText(self)
end)
end,
-- InputBoxInstructionsTemplate (Retail 11.1.7 (61967))
["InputBoxInstructionsTemplate"] = function(frame)
WeakAuras.XMLTemplates["InputBoxTemplate"](frame) -- Inherits from InputBoxTemplate
--[[ Optional
frame.disabledColor = { r = 0.35, g = 0.35, b = 0.35, a = 1 }
frame.enabledColor = { r = 1, g = 1, b = 1, a = 1 }
]]
-- Instructions FontString
local instructions = frame:CreateFontString(nil, "ARTWORK", "GameFontDisableSmall")
instructions:SetJustifyH("LEFT")
instructions:SetJustifyV("MIDDLE")
instructions:SetAllPoints(frame)
instructions:SetTextColor(0.35, 0.35, 0.35)
frame.Instructions = instructions
-- Skripts
frame:SetScript("OnTextChanged", InputBoxInstructions_OnTextChanged)
frame:SetScript("OnDisable", InputBoxInstructions_OnDisable)
frame:SetScript("OnEnable", InputBoxInstructions_OnEnable)
-- FontObject
frame:SetFontObject("GameFontHighlightSmall")
end,
-- SearchBoxTemplate (Retail 11.1.7 (61967))
["SearchBoxTemplate"] = function(frame)
WeakAuras.XMLTemplates["InputBoxInstructionsTemplate"](frame) -- Inherits from InputBoxInstructionsTemplate
frame:SetAutoFocus(false)
frame:SetTextInsets(16, 20, 0, 0);
frame.instructionText = SEARCH
frame.Instructions:SetText(frame.instructionText);
frame.Instructions:ClearAllPoints();
frame.Instructions:SetPoint("TOPLEFT", frame, "TOPLEFT", 16, 0);
frame.Instructions:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -20, 0);
-- Search-Icon
local searchIcon = frame:CreateTexture(GetParentName(frame) .. "SearchIcon", "OVERLAY")
searchIcon:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\CommonSearch")
searchIcon:SetSize(10, 10)
searchIcon:SetPoint("LEFT", 1, -1)
searchIcon:SetTexCoord(0.0742188, 0.167969, 0.664062, 0.851562)
searchIcon:SetVertexColor(0.6, 0.6, 0.6);
frame.searchIcon = searchIcon
-- Clear-Button
local clearButton = CreateFrame("Button", GetParentName(frame) .. "ClearButton", frame)
clearButton:SetSize(17, 17)
clearButton:SetPoint("RIGHT", -3, 0)
clearButton:Hide()
frame.clearButton = clearButton
local texture = clearButton:CreateTexture(nil, "ARTWORK")
texture:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\CommonSearch")
texture:SetAlpha(0.5)
texture:SetSize(10, 10)
texture:SetPoint("TOPLEFT", 3, -3)
texture:SetTexCoord(0.175781, 0.253906, 0.664062, 0.820312)
clearButton.texture = texture
-- Clear-Button Scripts
clearButton:SetScript("OnEnter", function(self)
self.texture:SetAlpha(1.0)
end)
clearButton:SetScript("OnLeave", function(self)
self.texture:SetAlpha(0.5)
end)
clearButton:SetScript("OnMouseDown", function(self)
if self:IsEnabled() then
self.texture:SetPoint("TOPLEFT", self, "TOPLEFT", 4, -4)
end
end)
clearButton:SetScript("OnMouseUp", function(self)
self.texture:SetPoint("TOPLEFT", self, "TOPLEFT", 3, -3)
end)
clearButton:SetScript("OnClick", SearchBoxTemplateClearButton_OnClick)
-- EditBox Scripts
frame:SetScript("OnEscapePressed", EditBox_ClearFocus)
frame:SetScript("OnEnterPressed", EditBox_ClearFocus)
frame:SetScript("OnEditFocusLost", SearchBoxTemplate_OnEditFocusLost)
frame:SetScript("OnEditFocusGained", SearchBoxTemplate_OnEditFocusGained)
frame:SetScript("OnTextChanged", WA_SearchBoxTemplate_OnTextChanged)
end,
-- PortraitFrameTemplate (Retail 11.1.7 (61967))
-- This is an empty frame with space for a portrait/icon in the top left corner.
["PortraitFrameTemplate"] = function(frame)
frame:SetSize(338, 424)
-- NineSlice Borders
local nineSlice = CreateFrame("Frame", nil, frame)
nineSlice:SetAllPoints(frame)
nineSlice:SetFrameLevel(125)
frame.NineSlice = nineSlice
-- Top Left Corner
setCorner(topLeftCorner, "TOPLEFT", NineSlice, -13, 16, 75, 75)
local topLeftCorner = nineSlice:CreateTexture(nil, "OVERLAY")
topLeftCorner:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetal2x")
topLeftCorner:SetSize(75, 75)
topLeftCorner:SetPoint("TOPLEFT", frame, "TOPLEFT", -13, 16)
topLeftCorner:SetTexCoord(0.00195312, 0.294922, 0.298828, 0.591797)
nineSlice.TopLeftCorner = topLeftCorner
-- Top Left Corner No Portrait
local topLeftCornerNoPortrait = nineSlice:CreateTexture(nil, "OVERLAY")
topLeftCornerNoPortrait:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetal2x")
topLeftCornerNoPortrait:SetSize(75, 75)
topLeftCornerNoPortrait:SetPoint("TOPLEFT", frame, "TOPLEFT", -8, 16)
topLeftCornerNoPortrait:SetTexCoord(0.00195312, 0.294922, 0.00195312, 0.294922)
topLeftCornerNoPortrait:Hide()
nineSlice.TopLeftCornerNoPortrait = topLeftCornerNoPortrait
-- Top Right Corner
setCorner(NineSlice.TopRightCorner, "TOPRIGHT", NineSlice, 4, 16, 75, 75)
local topRightCorner = nineSlice:CreateTexture(nil, "OVERLAY")
topRightCorner:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetal2x")
topRightCorner:SetSize(75, 75)
topRightCorner:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 4, 16)
topRightCorner:SetTexCoord(0.298828, 0.591797, 0.00195312, 0.294922)
nineSlice.TopRightCorner = topRightCorner
-- Bottom Left Corner
setCorner(NineSlice.BottomLeftCorner, "BOTTOMLEFT", NineSlice, -13, -3, 32, 32)
local bottomLeftCorner = nineSlice:CreateTexture(nil, "OVERLAY")
bottomLeftCorner:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetal2x")
bottomLeftCorner:SetSize(32, 32)
bottomLeftCorner:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", -13, -3)
bottomLeftCorner:SetTexCoord(0.298828, 0.423828, 0.298828, 0.423828)
nineSlice.BottomLeftCorner = bottomLeftCorner
-- Bottom Right Corner
setCorner(NineSlice.BottomRightCorner, "BOTTOMRIGHT", NineSlice, 4, -3, 32, 32)
local bottomRightCorner = nineSlice:CreateTexture(nil, "OVERLAY")
bottomRightCorner:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetal2x")
bottomRightCorner:SetSize(32, 32)
bottomRightCorner:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 4, -3)
bottomRightCorner:SetTexCoord(0.427734, 0.552734, 0.298828, 0.423828)
nineSlice.BottomRightCorner = bottomRightCorner
-- Top Edge
setEdge(NineSlice.TopEdge, "TOPLEFT", topEdgeRelativeTo, "TOPRIGHT", NineSlice.TopRightCorner, 32, 75)
local topEdge = nineSlice:CreateTexture(nil, "OVERLAY")
topEdge:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetalHorizontal2x")
topEdge:SetSize(32, 75)
topEdge:SetPoint("TOPLEFT", topLeftCorner, "TOPRIGHT", 0, 0)
topEdge:SetPoint("TOPRIGHT", topRightCorner, "TOPLEFT", 0, 0)
topEdge:SetHorizTile(true)
topEdge:SetTexCoord(0.0, 1.0, 0.00390625, 0.589844)
nineSlice.TopEdge = topEdge
-- Bottom Edge
setEdge(NineSlice.BottomEdge, "BOTTOMLEFT", NineSlice.BottomLeftCorner, "BOTTOMRIGHT", NineSlice.BottomRightCorner, 32, 32)
local bottomEdge = nineSlice:CreateTexture(nil, "OVERLAY")
bottomEdge:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetalHorizontal2x")
bottomEdge:SetSize(32, 32)
bottomEdge:SetPoint("BOTTOMLEFT", bottomLeftCorner, "BOTTOMRIGHT", 0, 0)
bottomEdge:SetPoint("BOTTOMRIGHT", bottomRightCorner, "BOTTOMLEFT", 0, 0)
bottomEdge:SetHorizTile(true)
bottomEdge:SetTexCoord(0.0, 0.5, 0.597656, 0.847656)
nineSlice.BottomEdge = bottomEdge
-- Left Edge
setEdge(NineSlice.LeftEdge, "TOPLEFT", leftEdgeRelativeTo, "BOTTOMLEFT", NineSlice.BottomLeftCorner, 75, 8)
local leftEdge = nineSlice:CreateTexture(nil, "OVERLAY")
leftEdge:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetalVertical2x")
leftEdge:SetSize(75, 8)
leftEdge:SetPoint("TOPLEFT", topLeftCorner, "BOTTOMLEFT", 0, 0)
leftEdge:SetPoint("BOTTOMLEFT", bottomLeftCorner, "TOPLEFT", 0, 0)
leftEdge:SetVertTile(true)
leftEdge:SetTexCoord(0.00195312, 0.294922, 0.0, 1.0)
nineSlice.LeftEdge = leftEdge
-- Right Edge
setEdge(NineSlice.RightEdge, "TOPLEFT", NineSlice.TopRightCorner, "BOTTOMLEFT", NineSlice.BottomRightCorner, 75, 8)
end
local rightEdge = nineSlice:CreateTexture(nil, "OVERLAY")
rightEdge:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameMetalVertical2x")
rightEdge:SetSize(75, 8)
rightEdge:SetPoint("TOPLEFT", topRightCorner, "BOTTOMLEFT", 0, 0)
rightEdge:SetPoint("BOTTOMLEFT", bottomRightCorner, "TOPLEFT", 0, 0)
rightEdge:SetVertTile(true)
rightEdge:SetTexCoord(0.298828, 0.591797, 0.0, 1.0)
nineSlice.RightEdge = rightEdge
-- Portrait Container
local portraitContainer = CreateFrame("Frame", nil, frame)
portraitContainer:SetSize(1, 1)
portraitContainer:SetPoint("TOPLEFT")
portraitContainer:SetFrameLevel(120)
frame.PortraitContainer = portraitContainer
-- Portrait
local portrait = portraitContainer:CreateTexture(nil, "ARTWORK")
portrait:SetSize(62, 62)
portrait:SetPoint("TOPLEFT", portraitContainer, "TOPLEFT", -5, 7)
portraitContainer.portrait = portrait
-- Title Container
local titleContainer = CreateFrame("Frame", nil, frame)
titleContainer:SetSize(0, 20)
titleContainer:SetPoint("TOPLEFT", frame, "TOPLEFT", 58, -1)
titleContainer:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -24, -1)
titleContainer:SetFrameLevel(126)
frame.TitleContainer = titleContainer
-- Title Text
local titleText = titleContainer:CreateFontString(GetParentName(frame) .. "TitleText", "OVERLAY", "GameFontNormal")
titleText:SetText("")
titleText:SetWordWrap(false)
titleText:SetPoint("TOP", titleContainer, "TOP", 0, -5)
titleText:SetPoint("LEFT", titleContainer, "LEFT")
titleText:SetPoint("RIGHT", titleContainer, "RIGHT")
titleContainer.TitleText = titleText
-- Close Button
local closeButton = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
closeButton:SetSize(24, 24)
closeButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, 0)
closeButton:SetFrameLevel(128)
frame.CloseButton = closeButton
closeButton:SetNormalTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
closeButton:GetNormalTexture():SetTexCoord(0.152344, 0.292969, 0.0078125, 0.304688)
closeButton:SetPushedTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
closeButton:GetPushedTexture():SetTexCoord(0.152344, 0.292969, 0.320312, 0.617188)
closeButton:SetDisabledTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
closeButton:GetDisabledTexture():SetTexCoord(0.152344, 0.292969, 0.632812, 0.929688)
closeButton:SetHighlightTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x", "ADD")
closeButton:GetHighlightTexture():SetTexCoord(0.449219, 0.589844, 0.0078125, 0.304688)
-- Background
local bgTexture = frame:CreateTexture(nil, "BACKGROUND")
bgTexture:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UI-Background-Rock")
bgTexture:SetHorizTile(true)
bgTexture:SetVertTile(true)
bgTexture:SetPoint("TOPLEFT", frame, "TOPLEFT", 2, -21)
bgTexture:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 2)
frame.Bg = bgTexture
-- Border
local topTileStreaks = frame:CreateTexture(nil, "BORDER")
topTileStreaks:SetTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\UIFrameHorizontal")
topTileStreaks:SetSize(256, 43)
topTileStreaks:SetPoint("TOPLEFT", frame, "TOPLEFT", 6, -21)
topTileStreaks:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -2, -21)
topTileStreaks:SetHorizTile(true)
topTileStreaks:SetTexCoord(0.0, 1.0, 0.0078125, 0.34375)
frame.TopTileStreaks = topTileStreaks
-- Mixin
frame.Bg:SetVertexColor(0.5882, 0.6275, 0.6706, 0.8) -- approx. PANEL_BACKGROUND_COLOR #ff1f1e21
frame.layoutType = "PortraitMode"
frame.ShowPortrait = function(self)
self.PortraitContainer:Show();
self.NineSlice.TopLeftCorner:Show();
self.NineSlice.TopLeftCornerNoPortrait:Hide();
self.layoutType = "PortraitMode"
end
frame.HidePortrait = function(self)
self.PortraitContainer:Hide();
self.NineSlice.TopLeftCorner:Hide();
self.NineSlice.TopLeftCornerNoPortrait:Show();
self.layoutType = "NoPortraitMode"
end
frame.GetFrameLayoutType = function(self)
return self.layoutType or self:GetParent().layoutType;
end
-- update NineSlice Borders on SizeChanged, since they like to be scuffed when the frame is resized
frame:SetScript("OnSizeChanged", function(self)
UpdateNineSliceBorders(self);
end)
end,
-- MaximizeMinimizeButtonFrameTemplate (Retail 11.1.7 (61967))
["MaximizeMinimizeButtonFrameTemplate"] = function(frame)
frame:SetSize(24, 24)
frame:SetFrameLevel(127)
-- Maximize Button
local maximizeButton = CreateFrame("Button", "MaximizeButton", frame)
maximizeButton:SetAllPoints(frame)
maximizeButton:Hide()
frame.MaximizeButton = maximizeButton
maximizeButton:SetNormalTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
maximizeButton:GetNormalTexture():SetTexCoord(0.300781, 0.441406, 0.0078125, 0.304688)
maximizeButton:SetPushedTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
maximizeButton:GetPushedTexture():SetTexCoord(0.300781, 0.441406, 0.320312, 0.617188)
maximizeButton:SetDisabledTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
maximizeButton:GetDisabledTexture():SetTexCoord(0.300781, 0.441406, 0.632812, 0.929688)
maximizeButton:SetHighlightTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x", "ADD")
maximizeButton:GetHighlightTexture():SetTexCoord(0.449219, 0.589844, 0.0078125, 0.304688)
-- Minimize Button
local minimizeButton = CreateFrame("Button", "MinimizeButton", frame)
minimizeButton:SetAllPoints(frame)
frame.MinimizeButton = minimizeButton
minimizeButton:SetNormalTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
minimizeButton:GetNormalTexture():SetTexCoord(0.00390625, 0.144531, 0.0078125, 0.304688)
minimizeButton:SetPushedTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
minimizeButton:GetPushedTexture():SetTexCoord(0.00390625, 0.144531, 0.320312, 0.617188)
minimizeButton:SetDisabledTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x")
minimizeButton:GetDisabledTexture():SetTexCoord(0.00390625, 0.144531, 0.632812, 0.929688)
minimizeButton:SetHighlightTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\redbutton2x", "ADD")
minimizeButton:GetHighlightTexture():SetTexCoord(0.449219, 0.589844, 0.0078125, 0.304688)
-- Mixin
frame.isMinimized = false
frame.OnShow = function(self)
if self.isMinimized then
self:SetMaximizedLook()
else
self:SetMinimizedLook()
end
end
frame.IsMinimized = function(self)
return self.isMinimized
end
frame.SetOnMaximizedCallback = function(self, callback)
self.maximizedCallback = callback
end
frame.SetOnMinimizedCallback = function(self, callback)
self.minimizedCallback = callback
end
frame.Maximize = function(self, skipCallback)
if self.maximizedCallback and not skipCallback then
self:maximizedCallback()
end
self.isMinimized = false
self:SetMinimizedLook()
end
frame.Minimize = function(self, skipCallback)
if self.minimizedCallback and not skipCallback then
self:minimizedCallback()
end
self.isMinimized = true
self:SetMaximizedLook()
end
frame.SetMinimizedLook = function(self)
self.MaximizeButton:Hide()
self.MinimizeButton:Show()
end
frame.SetMaximizedLook = function(self)
self.MaximizeButton:Show()
self.MinimizeButton:Hide()
end
frame:SetScript("OnShow", function(self)
self:OnShow();
end)
maximizeButton:SetScript("OnClick", function(self)
self:GetParent():Maximize();
PlaySound("igMainMenuOptionCheckBoxOn");
end)
minimizeButton:SetScript("OnClick", function(self)
self:GetParent():Minimize();
PlaySound("igMainMenuOptionCheckBoxOn");
end)
end,
}
-342
View File
@@ -1,342 +0,0 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<!--
*******************************************************************************
PortraitFrameTemplate (Retail 11.0.5 (57171))
This is an empty frame with space for a portrait/icon in the top left corner.
*******************************************************************************
-->
<Frame name="WA_PortraitFrameTemplate" virtual="true" frameLevel="1">
<Size x="338" y="424"/>
<Frames>
<!-- NineSlice Borders -->
<Frame name="$parentNineSlice" parentKey="NineSlice" setAllPoints="true" frameLevel="3">
<Layers>
<Layer level="OVERLAY">
<!-- Top Left Corner -->
<Texture name="$parentTopLeftCorner" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetal2x" parentKey="TopLeftCorner">
<Size x="75" y="75"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-13" y="16"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.00195312" right="0.294922" top="0.298828" bottom="0.591797"/>
</Texture>
<Texture name="$parentTopLeftCornerNoPortrait" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetal2x" parentKey="TopLeftCornerNoPortrait" hidden="true">
<Size x="75" y="75"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-8" y="16"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.00195312" right="0.294922" top="0.00195312" bottom="0.294922"/>
</Texture>
<!-- Top Right Corner -->
<Texture name="$parentTopRightCorner" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetal2x" parentKey="TopRightCorner">
<Size x="75" y="75"/>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="4" y="16"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.298828" right="0.591797" top="0.00195312" bottom="0.294922"/>
</Texture>
<!-- Bottom Left Corner -->
<Texture name="$parentBottomLeftCorner" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetal2x" parentKey="BottomLeftCorner">
<Size x="32" y="32"/>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="-13" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.298828" right="0.423828" top="0.298828" bottom="0.423828"/>
</Texture>
<!-- Bottom Right Corner -->
<Texture name="$parentBottomRightCorner" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetal2x" parentKey="BottomRightCorner">
<Size x="32" y="32"/>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="4" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.427734" right="0.552734" top="0.298828" bottom="0.423828"/>
</Texture>
<!-- Top Edge -->
<Texture name="$parentTopEdge" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetalHorizontal2x" parentKey="TopEdge" horizTile="true">
<Size x="32" y="75"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeftCorner" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parentTopRightCorner" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.00000000" right="1.00000000" top="0.00390625" bottom="0.589844"/>
</Texture>
<!-- Bottom Edge -->
<Texture name="$parentBottomEdge" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetalHorizontal2x" parentKey="BottomEdge" horizTile="true">
<Size x="32" y="32"/>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeftCorner" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRightCorner" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.00000000" right="0.50000000" top="0.597656" bottom="0.847656"/>
</Texture>
<!-- Left Edge -->
<Texture name="$parentLeftEdge" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetalVertical2x" parentKey="LeftEdge" vertTile="true">
<Size x="75" y="8"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeftCorner" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeftCorner" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.00195312" right="0.294922" top="0" bottom="1"/>
</Texture>
<!-- Right Edge -->
<Texture name="$parentRightEdge" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameMetalVertical2x" parentKey="RightEdge" vertTile="true">
<Size x="75" y="8"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopRightCorner" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomRightCorner" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.298828" right="0.591797" top="0" bottom="1"/>
</Texture>
</Layer>
</Layers>
</Frame>
<!-- Portrait Container -->
<Frame parentKey="PortraitContainer" frameLevel="3">
<Size x="1" y="1"/>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<!-- Portrait -->
<Texture name="$parentPortrait" parentKey="portrait">
<Size x="62" y="62"/>
<Anchors>
<Anchor point="TOPLEFT" x="-5" y="7"/>
</Anchors>
</Texture>
</Layer>
</Layers>
</Frame>
<!-- Title Container -->
<Frame parentKey="TitleContainer" frameLevel="4">
<Size x="0" y="20"/>
<Anchors>
<Anchor point="TOPLEFT" x="58" y="-1"/>
<Anchor point="TOPRIGHT" x="-24" y="-1"/>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString name="$parentTitleText" inherits="GameFontNormal" text="" parentKey="TitleText" wordwrap="false">
<Anchors>
<Anchor point="TOP" x="0" y="-5"/>
<Anchor point="LEFT"/>
<Anchor point="RIGHT"/>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<!-- Close Button -->
<Button parentKey="CloseButton" inherits="UIPanelCloseButton" frameLevel="4">
<Size x="24" y="24"/>
<Anchors>
<Anchor point="TOPRIGHT" x="0" y="0"/>
</Anchors>
<NormalTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.152344" right="0.292969" top="0.0078125" bottom="0.304688"/>
</NormalTexture>
<PushedTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.152344" right="0.292969" top="0.320312" bottom="0.617188"/>
</PushedTexture>
<DisabledTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.152344" right="0.292969" top="0.632812" bottom="0.929688"/>
</DisabledTexture>
<HighlightTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x" alphaMode="ADD">
<TexCoords left="0.449219" right="0.589844" top="0.0078125" bottom="0.304688"/>
</HighlightTexture>
</Button>
</Frames>
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="Bg" file="Interface\AddOns\WeakAuras\Media\Textures\UI-Background-Rock" horizTile="true" vertTile="true">
<Anchors>
<Anchor point="TOPLEFT" x="2" y="-21"/>
<Anchor point="BOTTOMRIGHT" x="-2" y="2"/>
</Anchors>
</Texture>
</Layer>
<Layer level="BORDER">
<Texture parentKey="TopTileStreaks" file="Interface\AddOns\WeakAuras\Media\Textures\UIFrameHorizontal" horizTile="true">
<Size x="256" y="43"/>
<Anchors>
<Anchor point="TOPLEFT" x="6" y="-21"/>
<Anchor point="TOPRIGHT" x="-2" y="-21"/>
</Anchors>
<TexCoords left="0.00000000" right="1.00000000" top="0.0078125" bottom="0.34375"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
WA_PortraitFrameTemplate_Mixin(self);
</OnLoad>
<OnSizeChanged>
WA_UpdateNineSliceBorders(self);
</OnSizeChanged>
</Scripts>
</Frame>
<!--
*******************************************************************************
MaximizeMinimizeButtonFrameTemplate (Retail 11.0.5 (57171))
Maximize and Minimize Button with mixedin Callbacks.
*******************************************************************************
-->
<Frame name="WA_MaximizeMinimizeButtonFrameTemplate" virtual="true" frameLevel="4">
<Size x="24" y="24"/>
<Frames>
<Button name="MaximizeButton" parentKey="MaximizeButton" setAllPoints="true" hidden="true">
<Scripts>
<OnClick>
self:GetParent():Maximize();
PlaySound("igMainMenuOptionCheckBoxOn");
</OnClick>
</Scripts>
<NormalTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.300781" right="0.441406" top="0.0078125" bottom="0.304688"/>
</NormalTexture>
<PushedTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.300781" right="0.441406" top="0.320312" bottom="0.617188"/>
</PushedTexture>
<DisabledTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.300781" right="0.441406" top="0.632812" bottom="0.929688"/>
</DisabledTexture>
<HighlightTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x" alphaMode="ADD">
<TexCoords left="0.449219" right="0.589844" top="0.0078125" bottom="0.304688"/>
</HighlightTexture>
</Button>
<Button name="$parentMinimizeButton" parentKey="MinimizeButton" setAllPoints="true">
<Scripts>
<OnClick>
self:GetParent():Minimize();
PlaySound("igMainMenuOptionCheckBoxOn");
</OnClick>
</Scripts>
<NormalTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.00390625" right="0.144531" top="0.0078125" bottom="0.304688"/>
</NormalTexture>
<PushedTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.00390625" right="0.144531" top="0.320312" bottom="0.617188"/>
</PushedTexture>
<DisabledTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x">
<TexCoords left="0.00390625" right="0.144531" top="0.632812" bottom="0.929688"/>
</DisabledTexture>
<HighlightTexture file="Interface\AddOns\WeakAuras\Media\Textures\redbutton2x" alphaMode="ADD">
<TexCoords left="0.449219" right="0.589844" top="0.0078125" bottom="0.304688"/>
</HighlightTexture>
</Button>
</Frames>
<Scripts>
<OnLoad>
WA_MaximizeMinimizeButtonFrame_Mixin(self);
</OnLoad>
<OnShow>
self:OnShow();
</OnShow>
</Scripts>
</Frame>
<!--
*******************************************************************************
InputBoxTemplate (Retail 11.0.5 (57171))
*******************************************************************************
-->
<EditBox name="WA_InputBoxTemplate" enableMouse="true" virtual="true">
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" parentKey="Left" file="Interface\AddOns\WeakAuras\Media\Textures\CommonSearch">
<Size x="8" y="20"/>
<Anchors>
<Anchor point="LEFT" x="-5" y="0"/>
</Anchors>
<TexCoords left="0.886719" right="0.949219" top="0.335938" bottom="0.648438"/>
</Texture>
<Texture name="$parentRight" parentKey="Right" file="Interface\AddOns\WeakAuras\Media\Textures\CommonSearch">
<Size x="8" y="20"/>
<Anchors>
<Anchor point="RIGHT" x="0" y="0"/>
</Anchors>
<TexCoords left="0.00390625" right="0.0664062" top="0.664062" bottom="0.976562"/>
</Texture>
<Texture name="$parentMiddle" parentKey="Middle" file="Interface\AddOns\WeakAuras\Media\Textures\CommonSearch">
<Size x="10" y="20"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
<Anchor point="RIGHT" relativeTo="$parentRight" relativePoint="LEFT"/>
</Anchors>
<TexCoords left="0.00390625" right="0.878906" top="0.335938" bottom="0.648438"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnEscapePressed>
EditBox_ClearFocus(self);
</OnEscapePressed>
<OnEditFocusLost>
EditBox_ClearHighlight(self);
</OnEditFocusLost>
<OnEditFocusGained>
EditBox_HighlightText(self);
</OnEditFocusGained>
</Scripts>
<FontString inherits="ChatFontNormal"/>
</EditBox>
</Ui>
+1 -2
View File
@@ -21,14 +21,13 @@
## SavedVariables: WeakAurasSaved
## OptionalDeps: Ace3, LibCompress, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, Masque, GTFO, LibButtonGlow-1.0, LibSpellRange-1.0, LibRangeCheck-2.0, LibDBIcon-1.0, LibGetFrame-1.0, LibGroupTalents, !!AddonLocale, CustomNames, BigWigs, DBM-Core
Templates.lua
Templates.xml
Compatibility.lua
Pools.lua
# External code + initialization
embeds.xml
Init.lua
Templates.lua
locales.xml
TimeUtil.lua
ArchiveTypes\Repository.lua
@@ -54,7 +54,8 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local widgetNum = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", Type .. widgetNum, UIParent)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
--Container Support
@@ -644,7 +644,7 @@ local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
local treeframe = CreateFrame("Frame", nil, frame)
local treeframe = CreateFrame("Frame", ("AceConfigDialogTreeFrame%d"):format(num), frame)
treeframe:SetPoint("TOPLEFT")
treeframe:SetPoint("BOTTOMLEFT")
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
@@ -1828,7 +1828,8 @@ local function Constructor()
view.visibility = 0;
local renamebox = CreateFrame("EditBox", nil, button, "WA_InputBoxTemplate");
local renamebox = CreateFrame("EditBox", nil, button);
WeakAuras.XMLTemplates["InputBoxTemplate"](renamebox)
renamebox:SetHeight(14);
renamebox:SetPoint("TOP", button, "TOP");
renamebox:SetPoint("LEFT", icon, "RIGHT", 6, 0);
@@ -309,11 +309,11 @@ local backdrop = {
}
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local widgetNum = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", ("%s%Frame"):format(Type, widgetNum), UIParent)
frame:Hide()
frame:SetScript("OnShow", OnFrameShow);
local widgetNum = AceGUI:GetNextWidgetNum(Type)
local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
label:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, -4)
@@ -284,10 +284,9 @@ local backdrop = {
}
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
frame:Hide()
local widgetNum = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", ("%s%Frame"):format(Type, widgetNum), UIParent)
frame:Hide()
local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
label:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, -4)
@@ -194,7 +194,8 @@ local function Constructor()
deleteButton:SetPushedTexture(delPushed)
button.deleteHighlight = delHighlight
local renameEditBox = CreateFrame("EditBox", nil, button, "WA_InputBoxTemplate")
local renameEditBox = CreateFrame("EditBox", nil, button)
WeakAuras.XMLTemplates["InputBoxTemplate"](renameEditBox)
renameEditBox:SetHeight(14)
renameEditBox:SetPoint("TOPLEFT", title, "TOPLEFT")
renameEditBox:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT")
@@ -306,7 +306,8 @@ local function Constructor()
rightbutton:SetDisabledTexture("Interface\\AddOns\\WeakAuras\\Media\\Textures\\spinboxrightp")
rightbutton:SetScript("OnClick", SpinBox_OnValueUp)
local editbox = CreateFrame("EditBox", nil, frame, "WA_InputBoxTemplate")
local editbox = CreateFrame("EditBox", nil, frame)
WeakAuras.XMLTemplates["InputBoxTemplate"](editbox)
editbox:SetAutoFocus(false)
editbox:SetFontObject(ChatFontNormal)
editbox:SetHeight(19)
@@ -3,7 +3,7 @@
-- as well as associate it with a slash command.
-- @class file
-- @name AceConfig-3.0
-- @release $Id: AceConfig-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceConfig-3.0.lua 1335 2024-05-05 19:35:16Z nevcairiel $
--[[
AceConfig-3.0
@@ -27,7 +27,7 @@ if not AceConfig then return end
local pcall, error, type, pairs = pcall, error, type, pairs
-- -------------------------------------------------------------------
-- :RegisterOptionsTable(appName, options, slashcmd, persist)
-- :RegisterOptionsTable(appName, options, slashcmd)
--
-- - appName - (string) application name
-- - options - table or function ref, see AceConfigRegistry
@@ -5,4 +5,4 @@
<Include file="AceConfigDialog-3.0\AceConfigDialog-3.0.xml"/>
<!--<Include file="AceConfigDropdown-3.0\AceConfigDropdown-3.0.xml"/>-->
<Script file="AceConfig-3.0.lua"/>
</Ui>
</Ui>
@@ -1,7 +1,7 @@
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames.
-- @class file
-- @name AceConfigCmd-3.0
-- @release $Id: AceConfigCmd-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceConfigCmd-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
--[[
AceConfigCmd-3.0
@@ -37,17 +37,10 @@ local error, assert = error, assert
-- WoW APIs
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: LibStub, SELECTED_CHAT_FRAME, DEFAULT_CHAT_FRAME
local L = setmetatable({}, { -- TODO: replace with proper locale
__index = function(self,k) return k end
})
local function print(msg)
(SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg)
end
@@ -401,7 +394,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
return
end
local str = strsub(info.input,inputpos);
local strInput = strsub(info.input,inputpos);
if tab.type=="execute" then
------------ execute --------------------------------------------
@@ -414,21 +407,21 @@ local function handle(info, inputpos, tab, depth, retfalse)
local res = true
if tab.pattern then
if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end
if not strmatch(str, tab.pattern) then
usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
if type(tab.pattern)~="string" then err(info, inputpos, "'pattern' - expected a string") end
if not strmatch(strInput, tab.pattern) then
usererr(info, inputpos, "'"..strInput.."' - " .. L["invalid input"])
return
end
end
do_final(info, inputpos, tab, "set", str)
do_final(info, inputpos, tab, "set", strInput)
elseif tab.type=="toggle" then
------------ toggle --------------------------------------------
local b
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str=="" then
b = callmethod(info, inputpos, tab, "get")
@@ -465,9 +458,9 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="range" then
------------ range --------------------------------------------
local val = tonumber(str)
local val = tonumber(strInput)
if not val then
usererr(info, inputpos, "'"..str.."' - "..L["expected number"])
usererr(info, inputpos, "'"..strInput.."' - "..L["expected number"])
return
end
if type(info.step)=="number" then
@@ -487,7 +480,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="select" then
------------ select ------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
local values = tab.values
if type(values) == "function" or type(values) == "string" then
@@ -528,7 +521,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="multiselect" then
------------ multiselect -------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
local values = tab.values
if type(values) == "function" or type(values) == "string" then
@@ -565,7 +558,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
--check that the opt is valid
local ok
for k,v in pairs(values) do
for k in pairs(values) do
if strlower(k)==opt then
opt = k -- overwrite with key (in case of case mismatches)
ok = true
@@ -634,7 +627,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="color" then
------------ color --------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str == "" then
--TODO: Show current value
return
@@ -706,7 +699,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="keybinding" then
------------ keybinding --------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str == "" then
--TODO: Show current value
return
@@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AceConfigCmd-3.0.lua"/>
</Ui>
</Ui>
@@ -1,13 +1,13 @@
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
-- @class file
-- @name AceConfigDialog-3.0
-- @release $Id: AceConfigDialog-3.0.lua 1225 2019-08-06 13:37:52Z nevcairiel $
-- @release $Id: AceConfigDialog-3.0.lua 1351 2024-07-24 18:23:24Z funkehdude $
local LibStub = LibStub
local gui = LibStub("AceGUI-3.0")
local reg = LibStub("AceConfigRegistry-3.0")
local MAJOR, MINOR = "AceConfigDialog-3.0", 78
local MAJOR, MINOR = "AceConfigDialog-3.0", 87
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigDialog then return end
@@ -15,69 +15,39 @@ if not AceConfigDialog then return end
AceConfigDialog.OpenFrames = AceConfigDialog.OpenFrames or {}
AceConfigDialog.Status = AceConfigDialog.Status or {}
AceConfigDialog.frame = AceConfigDialog.frame or CreateFrame("Frame")
AceConfigDialog.tooltip = AceConfigDialog.tooltip or CreateFrame("GameTooltip", "AceConfigDialogTooltip", UIParent, "GameTooltipTemplate")
AceConfigDialog.frame.apps = AceConfigDialog.frame.apps or {}
AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {}
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {}
-- Lua APIs
local tconcat, tinsert, tsort, tremove = table.concat, table.insert, table.sort, table.remove
local tinsert, tsort, tremove, wipe = table.insert, table.sort, table.remove, table.wipe
local strmatch, format = string.match, string.format
local assert, loadstring, error = assert, loadstring, error
local pairs, next, select, type, unpack, wipe = pairs, next, select, type, unpack, wipe
local rawset, tostring, tonumber = rawset, tostring, tonumber
local error = error
local pairs, next, select, type, unpack, ipairs = pairs, next, select, type, unpack, ipairs
local tostring, tonumber = tostring, tonumber
local math_min, math_max, math_floor = math.min, math.max, math.floor
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: NORMAL_FONT_COLOR, GameTooltip, StaticPopupDialogs, ACCEPT, CANCEL, StaticPopup_Show
-- GLOBALS: PlaySound, GameFontHighlight, GameFontHighlightSmall, GameFontHighlightLarge
-- GLOBALS: CloseSpecialWindows, InterfaceOptions_AddCategory, geterrorhandler
local emptyTbl = {}
--[[
xpcall safecall implementation
pcall safecall implementation
]]
local xpcall = xpcall
local pcall = pcall
local function errorhandler(err)
return geterrorhandler()(err)
end
local function CreateDispatcher(argCount)
local code = [[
local xpcall, eh = ...
local method, ARGS
local function call() return method(ARGS) end
local function dispatch(func, ...)
method = func
if not method then return end
ARGS = ...
return xpcall(call, eh)
end
return dispatch
]]
local ARGS = {}
for i = 1, argCount do ARGS[i] = "arg"..i end
code = code:gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
end
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
Dispatchers[0] = function(func)
return xpcall(func, errorhandler)
end
local function safecall(func, ...)
return Dispatchers[select("#", ...)](func, ...)
if func then
local ret = {pcall(func, ...)}
if not ret[1] then
errorhandler(ret[2])
end
return unpack(ret)
end
end
local width_multiplier = 170
@@ -181,6 +151,7 @@ local stringIsLiteral = {
width = true,
image = true,
fontSize = true,
tooltipHyperlink = true
}
--Is Never a function or method
@@ -222,9 +193,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
--We have a function to call
local info = new()
--traverse the options table, picking up the handler and filling the info with the path
local handler
local group = options
handler = group.handler or handler
local handler = group.handler
for i = 1, #path do
group = GetSubOption(group, path[i])
@@ -533,8 +503,17 @@ local function OptionOnMouseOver(widget, event)
local options = user.options
local path = user.path
local appName = user.appName
local tooltip = AceConfigDialog.tooltip
tooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT")
local tooltipHyperlink = GetOptionsMemberValue("tooltipHyperlink", opt, options, path, appName)
if tooltipHyperlink then
tooltip:SetHyperlink(tooltipHyperlink)
tooltip:Show()
return
end
GameTooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT")
local name = GetOptionsMemberValue("name", opt, options, path, appName)
local desc = GetOptionsMemberValue("desc", opt, options, path, appName)
local usage = GetOptionsMemberValue("usage", opt, options, path, appName)
@@ -542,98 +521,147 @@ local function OptionOnMouseOver(widget, event)
if descStyle and descStyle ~= "tooltip" then return end
GameTooltip:SetText(name, 1, .82, 0, 1)
tooltip:SetText(name, 1, .82, 0, 1)
if opt.type == "multiselect" then
GameTooltip:AddLine(user.text,0.5, 0.5, 0.8, 1)
tooltip:AddLine(user.text, 0.5, 0.5, 0.8, 1)
end
if type(desc) == "string" then
GameTooltip:AddLine(desc, 1, 1, 1, 1)
tooltip:AddLine(desc, 1, 1, 1, 1)
end
if type(usage) == "string" then
GameTooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1)
tooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1)
end
GameTooltip:Show()
tooltip:Show()
end
local function OptionOnMouseLeave(widget, event)
GameTooltip:Hide()
AceConfigDialog.tooltip:Hide()
end
local function GetFuncName(option)
local type = option.type
if type == "execute" then
if option.type == "execute" then
return "func"
else
return "set"
end
end
local function confirmPopup(appName, rootframe, basepath, info, message, func, ...)
if not StaticPopupDialogs["ACECONFIGDIALOG30_CONFIRM_DIALOG"] then
StaticPopupDialogs["ACECONFIGDIALOG30_CONFIRM_DIALOG"] = {}
end
local t = StaticPopupDialogs["ACECONFIGDIALOG30_CONFIRM_DIALOG"]
for k in pairs(t) do
t[k] = nil
end
t.text = message
t.button1 = ACCEPT
t.button2 = CANCEL
t.preferredIndex = STATICPOPUP_NUMDIALOGS
local dialog, oldstrata
t.OnAccept = function()
safecall(func, unpack(t))
if dialog and oldstrata then
dialog:SetFrameStrata(oldstrata)
end
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
del(info)
end
t.OnCancel = function()
if dialog and oldstrata then
dialog:SetFrameStrata(oldstrata)
end
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
del(info)
end
for i = 1, select("#", ...) do
t[i] = select(i, ...) or false
end
t.timeout = 0
t.whileDead = 1
t.hideOnEscape = 1
do
local InCombatLockdown = InCombatLockdown
local frame = AceConfigDialog.popup
if not frame or oldminor < 81 then
frame = CreateFrame("Frame", nil, UIParent)
AceConfigDialog.popup = frame
frame:Hide()
frame:SetPoint("CENTER", UIParent, "CENTER")
frame:SetSize(320, 72)
frame:EnableMouse(true) -- Do not allow click-through on the frame
frame:SetFrameStrata("TOOLTIP")
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetScript("OnKeyDown", function(self, key)
if key == "ESCAPE" then
if not InCombatLockdown() then
self:SetPropagateKeyboardInput(false)
end
if self.cancel:IsShown() then
self.cancel:Click()
else -- Showing a validation error
self:Hide()
end
elseif not InCombatLockdown() then
self:SetPropagateKeyboardInput(true)
end
end)
dialog = StaticPopup_Show("ACECONFIGDIALOG30_CONFIRM_DIALOG")
if dialog then
oldstrata = dialog:GetFrameStrata()
dialog:SetFrameStrata("TOOLTIP")
local border = CreateFrame("Frame", nil, frame)
border:SetAllPoints(frame)
frame.realSetFrameStrata = frame.SetFrameStrata
frame.realSetFrameLevel = frame.SetFrameLevel
frame.SetFrameStrata = function() end -- frame:SetFixedFrameStrata(true)
frame.SetFrameLevel = function() end -- frame:SetFixedFrameLevel(true)
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
text:SetSize(290, 0)
text:SetPoint("TOP", 0, -16)
frame.text = text
local function newButton(newText)
local button = CreateFrame("Button", nil, frame)
button:SetSize(128, 21)
button:SetNormalFontObject(GameFontNormal)
button:SetHighlightFontObject(GameFontHighlight)
button:SetNormalTexture("Interface\\Buttons\\UI-DialogBox-Button-Up")
button:GetNormalTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
button:SetPushedTexture("Interface\\Buttons\\UI-DialogBox-Button-Down")
button:GetPushedTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
button:SetHighlightTexture("Interface\\Buttons\\UI-DialogBox-Button-Highlight")
button:GetHighlightTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
button:SetText(newText)
return button
end
local accept = newButton(ACCEPT)
accept:SetPoint("BOTTOMRIGHT", frame, "BOTTOM", -6, 16)
frame.accept = accept
local cancel = newButton(CANCEL)
cancel:SetPoint("LEFT", accept, "RIGHT", 13, 0)
frame.cancel = cancel
end
end
local function confirmPopup(appName, rootframe, basepath, info, message, func, ...)
local frame = AceConfigDialog.popup
frame:Show()
frame.text:SetText(message)
-- From StaticPopup.lua
-- local height = 32 + text:GetHeight() + 2;
-- height = height + 6 + accept:GetHeight()
-- We add 32 + 2 + 6 + 21 (button height) == 61
local height = 61 + frame.text:GetHeight()
frame:SetHeight(height)
frame.accept:ClearAllPoints()
frame.accept:SetPoint("BOTTOMRIGHT", frame, "BOTTOM", -6, 16)
frame.cancel:Show()
local t = {...}
local tCount = select("#", ...)
frame.accept:SetScript("OnClick", function(self)
safecall(func, unpack(t, 1, tCount)) -- Manually set count as unpack() stops on nil (bug with #table)
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
frame:Hide()
self:SetScript("OnClick", nil)
frame.cancel:SetScript("OnClick", nil)
del(info)
end)
frame.cancel:SetScript("OnClick", function(self)
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
frame:Hide()
self:SetScript("OnClick", nil)
frame.accept:SetScript("OnClick", nil)
del(info)
end)
end
local function validationErrorPopup(message)
if not StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] then
StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] = {}
end
local t = StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"]
t.text = message
t.button1 = OKAY
t.preferredIndex = STATICPOPUP_NUMDIALOGS
local dialog, oldstrata
t.OnAccept = function()
if dialog and oldstrata then
dialog:SetFrameStrata(oldstrata)
end
end
t.timeout = 0
t.whileDead = 1
t.hideOnEscape = 1
local frame = AceConfigDialog.popup
frame:Show()
frame.text:SetText(message)
-- From StaticPopup.lua
-- local height = 32 + text:GetHeight() + 2;
-- height = height + 6 + accept:GetHeight()
-- We add 32 + 2 + 6 + 21 (button height) == 61
local height = 61 + frame.text:GetHeight()
frame:SetHeight(height)
dialog = StaticPopup_Show("ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG")
if dialog then
oldstrata = dialog:GetFrameStrata()
dialog:SetFrameStrata("TOOLTIP")
end
frame.accept:ClearAllPoints()
frame.accept:SetPoint("BOTTOM", frame, "BOTTOM", 0, 16)
frame.cancel:Hide()
frame.accept:SetScript("OnClick", function()
frame:Hide()
end)
end
local function ActivateControl(widget, event, ...)
@@ -656,7 +684,7 @@ local function ActivateControl(widget, event, ...)
if group[funcname] ~= nil then
func = group[funcname]
end
handler = group.handler or handler
handler = group.handler
confirm = group.confirm
validate = group.validate
for i = 1, #path do
@@ -720,7 +748,6 @@ local function ActivateControl(widget, event, ...)
end
end
local rootframe = user.rootframe
if not validated or type(validated) == "string" then
if not validated then
if usage then
@@ -735,8 +762,8 @@ local function ActivateControl(widget, event, ...)
end
-- show validate message
if rootframe.SetStatusText then
rootframe:SetStatusText(validated)
if user.rootframe.SetStatusText then
user.rootframe:SetStatusText(validated)
else
validationErrorPopup(validated)
end
@@ -773,14 +800,14 @@ local function ActivateControl(widget, event, ...)
if type(confirm) == "boolean" then
if confirm then
if not confirmText then
local name, desc = option.name, option.desc
if type(name) == "function" then
name = name(info)
local option_name, desc = option.name, option.desc
if type(option_name) == "function" then
option_name = option_name(info)
end
if type(desc) == "function" then
desc = desc(info)
end
confirmText = name
confirmText = option_name
if desc then
confirmText = confirmText.." - "..desc
end
@@ -886,7 +913,7 @@ end
local function MultiControlOnClosed(widget, event, ...)
local user = widget:GetUserDataTable()
if user.valuechanged then
if user.valuechanged and not widget:IsReleasing() then
local iscustom = user.rootframe:GetUserData("iscustom")
local basepath = user.rootframe:GetUserData("basepath") or emptyTbl
if iscustom then
@@ -1122,8 +1149,6 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
--Control to feed
local control
local name = GetOptionsMemberValue("name", v, options, path, appName)
if v.type == "execute" then
local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
@@ -1226,7 +1251,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
end
tsort(sorting, sortTblAsStrings)
end
for k, value in ipairs(sorting) do
for _, value in ipairs(sorting) do
local text = values[value]
local radio = gui:Create("CheckBox")
radio:SetLabel(text)
@@ -1308,8 +1333,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
control:SetWidth(width_multiplier)
end
--check:SetTriState(v.tristate)
for i = 1, #valuesort do
local key = valuesort[i]
for s = 1, #valuesort do
local key = valuesort[s]
local value = GetOptionsMemberValue("get",v, options, path, appName, key)
control:SetItemValue(key,value)
end
@@ -1321,8 +1346,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
control:PauseLayout()
local width = GetOptionsMemberValue("width",v,options,path,appName)
for i = 1, #valuesort do
local value = valuesort[i]
for s = 1, #valuesort do
local value = valuesort[s]
local text = values[value]
local check = gui:Create("CheckBox")
check:SetLabel(text)
@@ -1389,7 +1414,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
local image, width, height = GetOptionsMemberValue("image",v, options, path, appName)
if type(image) == "string" then
if type(image) == "string" or type(image) == "number" then
if not width then
width = GetOptionsMemberValue("imageWidth",v, options, path, appName)
end
@@ -1409,8 +1434,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
end
control:SetImageSize(width, height)
end
local width = GetOptionsMemberValue("width",v,options,path,appName)
control.width = not width and "fill"
local controlWidth = GetOptionsMemberValue("width",v,options,path,appName)
control.width = not controlWidth and "fill"
end
--Common Init
@@ -1462,6 +1487,7 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
local option = user.option
local path = user.path
local appName = user.appName
local tooltip = AceConfigDialog.tooltip
local feedpath = new()
for i = 1, #path do
@@ -1478,24 +1504,25 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
local name = GetOptionsMemberValue("name", group, options, feedpath, appName)
local desc = GetOptionsMemberValue("desc", group, options, feedpath, appName)
GameTooltip:SetOwner(button, "ANCHOR_NONE")
tooltip:SetOwner(button, "ANCHOR_NONE")
tooltip:ClearAllPoints()
if widget.type == "TabGroup" then
GameTooltip:SetPoint("BOTTOM",button,"TOP")
tooltip:SetPoint("BOTTOM",button,"TOP")
else
GameTooltip:SetPoint("LEFT",button,"RIGHT")
tooltip:SetPoint("LEFT",button,"RIGHT")
end
GameTooltip:SetText(name, 1, .82, 0, 1)
tooltip:SetText(name, 1, .82, 0, true)
if type(desc) == "string" then
GameTooltip:AddLine(desc, 1, 1, 1, 1)
tooltip:AddLine(desc, 1, 1, 1, true)
end
GameTooltip:Show()
tooltip:Show()
end
local function TreeOnButtonLeave(widget, event, value, button)
GameTooltip:Hide()
AceConfigDialog.tooltip:Hide()
end
@@ -1663,29 +1690,29 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
elseif grouptype == "select" then
local select = gui:Create("DropdownGroup")
select:SetTitle(name)
InjectInfo(select, options, group, path, rootframe, appName)
select:SetCallback("OnGroupSelected", GroupSelected)
local selectGroup = gui:Create("DropdownGroup")
selectGroup:SetTitle(name)
InjectInfo(selectGroup, options, group, path, rootframe, appName)
selectGroup:SetCallback("OnGroupSelected", GroupSelected)
local status = AceConfigDialog:GetStatusTable(appName, path)
if not status.groups then
status.groups = {}
end
select:SetStatusTable(status.groups)
selectGroup:SetStatusTable(status.groups)
local grouplist, orderlist = BuildSelect(group, options, path, appName)
select:SetGroupList(grouplist, orderlist)
select:SetUserData("grouplist", grouplist)
select:SetUserData("orderlist", orderlist)
selectGroup:SetGroupList(grouplist, orderlist)
selectGroup:SetUserData("grouplist", grouplist)
selectGroup:SetUserData("orderlist", orderlist)
local firstgroup = orderlist[1]
if firstgroup then
select:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
selectGroup:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
end
select.width = "fill"
select.height = "fill"
selectGroup.width = "fill"
selectGroup.height = "fill"
container:AddChild(select)
container:AddChild(selectGroup)
--assume tree group by default
--if parenttype is tree then this group is already a node on that tree
@@ -1913,13 +1940,13 @@ end
-- convert pre-39 BlizOptions structure to the new format
if oldminor and oldminor < 39 and AceConfigDialog.BlizOptions then
local old = AceConfigDialog.BlizOptions
local new = {}
local newOpt = {}
for key, widget in pairs(old) do
local appName = widget:GetUserData("appName")
if not new[appName] then new[appName] = {} end
new[appName][key] = widget
if not newOpt[appName] then newOpt[appName] = {} end
newOpt[appName][key] = widget
end
AceConfigDialog.BlizOptions = new
AceConfigDialog.BlizOptions = newOpt
else
AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {}
end
@@ -1952,6 +1979,7 @@ end
-- @param parent The parent to use in the interface options tree.
-- @param ... The path in the options table to feed into the interface options panel.
-- @return The reference to the frame registered into the Interface Options.
-- @return The category ID to pass to Settings.OpenToCategory (or InterfaceOptionsFrame_OpenToCategory)
function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
local BlizOptions = AceConfigDialog.BlizOptions
@@ -1967,7 +1995,6 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
if not BlizOptions[appName][key] then
local group = gui:Create("BlizOptionsGroup")
BlizOptions[appName][key] = group
group:SetName(name or appName, parent)
group:SetTitle(name or appName)
group:SetUserData("appName", appName)
@@ -1980,8 +2007,30 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
end
group:SetCallback("OnShow", FeedToBlizPanel)
group:SetCallback("OnHide", ClearBlizPanel)
InterfaceOptions_AddCategory(group.frame)
return group.frame
if Settings and Settings.RegisterCanvasLayoutCategory then
local categoryName = name or appName
if parent then
local category = Settings.GetCategory(parent)
if not category then
error(("The parent category '%s' was not found"):format(parent), 2)
end
local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName)
-- force the generated ID to be used for subcategories, as these can have very simple names like "Profiles"
group:SetName(subcategory.ID, parent)
else
local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName)
-- using appName here would be cleaner, but would not be 100% compatible
-- but for top-level categories it should be fine, as these are typically addon names
category.ID = categoryName
group:SetName(categoryName, parent)
Settings.RegisterAddOnCategory(category)
end
else
group:SetName(name or appName, parent)
InterfaceOptions_AddCategory(group.frame)
end
return group.frame, group.frame.name
else
error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2)
end
@@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AceConfigDialog-3.0.lua"/>
</Ui>
</Ui>
@@ -8,10 +8,10 @@
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName".
-- @class file
-- @name AceConfigRegistry-3.0
-- @release $Id: AceConfigRegistry-3.0.lua 1207 2019-06-23 12:08:33Z nevcairiel $
-- @release $Id: AceConfigRegistry-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $
local CallbackHandler = LibStub("CallbackHandler-1.0")
local MAJOR, MINOR = "AceConfigRegistry-3.0", 20
local MAJOR, MINOR = "AceConfigRegistry-3.0", 21
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigRegistry then return end
@@ -83,6 +83,7 @@ local basekeys={
dialogHidden=optmethodbool,
dropdownHidden=optmethodbool,
cmdHidden=optmethodbool,
tooltipHyperlink=optstringfunc,
icon=optstringnumberfunc,
iconCoords=optmethodtable,
handler=opttable,
@@ -1,4 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AceConfigRegistry-3.0.lua"/>
</Ui>
</Ui>
+76 -86
View File
@@ -24,33 +24,28 @@
-- f:AddChild(btn)
-- @class file
-- @name AceGUI-3.0
-- @release $Id$
-- @release $Id: AceGUI-3.0.lua 1288 2022-09-25 14:19:00Z funkehdude $
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 41
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
if not AceGUI then return end -- No upgrade needed
-- Lua APIs
local tconcat, tinsert = table.concat, table.insert
local tinsert, wipe = table.insert, table.wipe
local select, pairs, next, type = select, pairs, next, type
local error, assert, loadstring = error, assert, loadstring
local setmetatable, rawget, rawset = setmetatable, rawget, rawset
local math_max = math.max
local error, assert = error, assert
local setmetatable, rawget = setmetatable, rawget
local math_max, math_min, math_ceil = math.max, math.min, math.ceil
-- WoW APIs
local UIParent = 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: geterrorhandler, LibStub
--local con = LibStub("AceConsole-3.0",true)
AceGUI.WidgetRegistry = AceGUI.WidgetRegistry or {}
AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
AceGUI.WidgetBase = AceGUI.WidgetBase or {}
AceGUI.WidgetContainerBase = AceGUI.WidgetContainerBase or {}
AceGUI.WidgetVersions = AceGUI.WidgetVersions or {}
AceGUI.tooltip = AceGUI.tooltip or CreateFrame("GameTooltip", "AceGUITooltip", UIParent, "GameTooltipTemplate")
-- local upvalues
local WidgetRegistry = AceGUI.WidgetRegistry
@@ -58,47 +53,22 @@ local LayoutRegistry = AceGUI.LayoutRegistry
local WidgetVersions = AceGUI.WidgetVersions
--[[
xpcall safecall implementation
pcall safecall implementation
]]
local xpcall = xpcall
local pcall = pcall
local function errorhandler(err)
return geterrorhandler()(err)
end
local function CreateDispatcher(argCount)
local code = [[
local xpcall, eh = ...
local method, ARGS
local function call() return method(ARGS) end
local function dispatch(func, ...)
method = func
if not method then return end
ARGS = ...
return xpcall(call, eh)
end
return dispatch
]]
local ARGS = {}
for i = 1, argCount do ARGS[i] = "arg"..i end
code = code:gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
end
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
Dispatchers[0] = function(func)
return xpcall(func, errorhandler)
end
local function safecall(func, ...)
return Dispatchers[select("#", ...)](func, ...)
if func then
local ret = {pcall(func, ...)}
if not ret[1] then
errorhandler(ret[2])
end
return unpack(ret)
end
end
-- Recycling functions
@@ -122,38 +92,38 @@ do
AceGUI.objPools = AceGUI.objPools or {}
local objPools = AceGUI.objPools
--Returns a new instance, if none are available either returns a new table or calls the given contructor
function newWidget(type)
if not WidgetRegistry[type] then
function newWidget(widgetType)
if not WidgetRegistry[widgetType] then
error("Attempt to instantiate unknown widget type", 2)
end
if not objPools[type] then
objPools[type] = {}
if not objPools[widgetType] then
objPools[widgetType] = {}
end
local newObj = next(objPools[type])
local newObj = next(objPools[widgetType])
if not newObj then
newObj = WidgetRegistry[type]()
newObj.AceGUIWidgetVersion = WidgetVersions[type]
newObj = WidgetRegistry[widgetType]()
newObj.AceGUIWidgetVersion = WidgetVersions[widgetType]
else
objPools[type][newObj] = nil
objPools[widgetType][newObj] = nil
-- if the widget is older then the latest, don't even try to reuse it
-- just forget about it, and grab a new one.
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[type] then
return newWidget(type)
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[widgetType] then
return newWidget(widgetType)
end
end
return newObj
end
-- Releases an instance to the Pool
function delWidget(obj,type)
if not objPools[type] then
objPools[type] = {}
function delWidget(obj,widgetType)
if not objPools[widgetType] then
objPools[widgetType] = {}
end
if objPools[type][obj] then
if objPools[widgetType][obj] then
error("Attempt to Release Widget that is already released", 2)
end
objPools[type][obj] = true
objPools[widgetType][obj] = true
end
end
@@ -169,9 +139,9 @@ end
-- OnAcquire function on it, before returning.
-- @param type The type of the widget.
-- @return The newly created widget.
function AceGUI:Create(type)
if WidgetRegistry[type] then
local widget = newWidget(type)
function AceGUI:Create(widgetType)
if WidgetRegistry[widgetType] then
local widget = newWidget(widgetType)
if rawget(widget, "Acquire") then
widget.OnAcquire = widget.Acquire
@@ -189,7 +159,7 @@ function AceGUI:Create(type)
if widget.OnAcquire then
widget:OnAcquire()
else
error(("Widget type %s doesn't supply an OnAcquire Function"):format(type))
error(("Widget type %s doesn't supply an OnAcquire Function"):format(widgetType))
end
-- Set the default Layout ("List")
safecall(widget.SetLayout, widget, "List")
@@ -240,6 +210,22 @@ function AceGUI:Release(widget)
delWidget(widget, widget.type)
end
--- Check if a widget is currently in the process of being released
-- This function check if this widget, or any of its parents (in which case it'll be released shortly as well)
-- are currently being released. This allows addon to handle any callbacks accordingly.
-- @param widget The widget to check
function AceGUI:IsReleasing(widget)
if widget.isQueuedForRelease then
return true
end
if widget.parent and widget.parent.AceGUIWidgetVersion then
return AceGUI:IsReleasing(widget.parent)
end
return false
end
-----------
-- Focus --
-----------
@@ -366,6 +352,10 @@ do
AceGUI:Release(self)
end
WidgetBase.IsReleasing = function(self)
return AceGUI:IsReleasing(self)
end
WidgetBase.SetPoint = function(self, ...)
return self.frame:SetPoint(...)
end
@@ -597,25 +587,25 @@ AceGUI.counts = AceGUI.counts or {}
-- This is used by widgets that require a named frame, e.g. when a Blizzard
-- Template requires it.
-- @param type The widget type
function AceGUI:GetNextWidgetNum(type)
if not self.counts[type] then
self.counts[type] = 0
function AceGUI:GetNextWidgetNum(widgetType)
if not self.counts[widgetType] then
self.counts[widgetType] = 0
end
self.counts[type] = self.counts[type] + 1
return self.counts[type]
self.counts[widgetType] = self.counts[widgetType] + 1
return self.counts[widgetType]
end
--- Return the number of created widgets for this type.
-- In contrast to GetNextWidgetNum, the number is not incremented.
-- @param type The widget type
function AceGUI:GetWidgetCount(type)
return self.counts[type] or 0
-- @param widgetType The widget type
function AceGUI:GetWidgetCount(widgetType)
return self.counts[widgetType] or 0
end
--- Return the version of the currently registered widget type.
-- @param type The widget type
function AceGUI:GetWidgetVersion(type)
return WidgetVersions[type]
-- @param widgetType The widget type
function AceGUI:GetWidgetVersion(widgetType)
return WidgetVersions[widgetType]
end
-------------
@@ -778,7 +768,6 @@ AceGUI:RegisterLayout("Flow",
usedwidth = 0
rowstart = frame
rowstartoffset = frameoffset
if child.DoLayout then
child:DoLayout()
@@ -821,7 +810,8 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
or colObj and (colObj["align" .. dir] or colObj.align)
or tableObj["align" .. dir] or tableObj.align
or "CENTERLEFT"
local child, cell, val = child or 0, cell or 0, nil
local val
child, cell = child or 0, cell or 0
if type(fn) == "string" then
fn = fn:lower()
@@ -835,7 +825,7 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
val = fn
end
return fn, max(0, min(val, cell))
return fn, math_max(0, math_min(val, cell))
end
-- Get width or height for multiple cells combined
@@ -844,7 +834,7 @@ local GetCellDimension = function (dir, laneDim, from, to, space)
for cell=from,to do
dim = dim + (laneDim[cell] or 0)
end
return dim + max(0, to - from) * (space or 0)
return dim + math_max(0, to - from) * (space or 0)
end
--[[ Options
@@ -890,7 +880,7 @@ AceGUI:RegisterLayout("Table",
repeat
n = n + 1
local col = (n - 1) % #cols + 1
local row = ceil(n / #cols)
local row = math_ceil(n / #cols)
local rowspan = rowspans[col]
local cell = rowspan and rowspan.child or child
local cellObj = cell:GetUserData("cell")
@@ -906,7 +896,7 @@ AceGUI:RegisterLayout("Table",
end
-- Colspan
local colspan = max(0, min((cellObj and cellObj.colspan or 1) - 1, #cols - col))
local colspan = math_max(0, math_min((cellObj and cellObj.colspan or 1) - 1, #cols - col))
n = n + colspan
-- Place the cell
@@ -923,7 +913,7 @@ AceGUI:RegisterLayout("Table",
end
end
local rows = ceil(n / #cols)
local rows = math_ceil(n / #cols)
-- Determine fixed size cols and collect weights
local extantH, totalWeight = totalH, 0
@@ -948,16 +938,16 @@ AceGUI:RegisterLayout("Table",
f:ClearAllPoints()
local childH = f:GetWidth() or 0
laneH[col] = max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH))
laneH[col] = math_max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH))
end
end
laneH[col] = max(colObj.min or colObj[1] or 0, min(laneH[col], colObj.max or colObj[2] or laneH[col]))
laneH[col] = math_max(colObj.min or colObj[1] or 0, math_min(laneH[col], colObj.max or colObj[2] or laneH[col]))
else
-- Rel./Abs. width
laneH[col] = colObj.width < 1 and colObj.width * totalH or colObj.width
end
extantH = max(0, extantH - laneH[col])
extantH = math_max(0, extantH - laneH[col])
end
end
@@ -996,7 +986,7 @@ AceGUI:RegisterLayout("Table",
child:DoLayout()
end
rowV = max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV))
rowV = math_max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV))
end
end
@@ -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", 27
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", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), 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)
@@ -2,7 +2,7 @@
DropdownGroup Container
Container controlled by a dropdown on the top.
-------------------------------------------------------------------------------]]
local Type, Version = "DropdownGroup", 21
local Type, Version = "DropdownGroup", 23
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -106,7 +106,7 @@ local PaneBackdrop = {
}
local function Constructor()
local frame = CreateFrame("Frame")
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)))
frame:SetHeight(100)
frame:SetWidth(100)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
Frame Container
-------------------------------------------------------------------------------]]
local Type, Version = "Frame", 25
local Type, Version = "Frame", 31
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)
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
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)
@@ -269,7 +271,7 @@ local function Constructor()
line2:SetHeight(8)
line2:SetPoint("BOTTOMRIGHT", -8, 8)
line2:SetTexture("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)
@@ -2,7 +2,7 @@
InlineGroup Container
Simple container widget that creates a visible "box" with an optional title.
-------------------------------------------------------------------------------]]
local Type, Version = "InlineGroup", 21
local Type, Version = "InlineGroup", 23
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -66,7 +66,7 @@ local PaneBackdrop = {
}
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
@@ -2,7 +2,7 @@
ScrollFrame Container
Plain container that scrolls its content and doesn't grow in height.
-------------------------------------------------------------------------------]]
local Type, Version = "ScrollFrame", 26
local Type, Version = "ScrollFrame", 27
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -94,7 +94,7 @@ local methods = {
local status = self.status or self.localstatus
local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
local offset = status.offset or 0
-- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracies
-- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys
-- No-one is going to miss 2 pixels at the bottom of the frame, anyhow!
if viewheight < height + 2 then
if self.scrollBarShown then
@@ -164,8 +164,8 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", string.format("%s%d", Type, num), UIParent)
local scrollframe = CreateFrame("ScrollFrame", nil, frame)
scrollframe:SetPoint("TOPLEFT")
@@ -2,7 +2,7 @@
SimpleGroup Container
Simple container widget that just groups widgets.
-------------------------------------------------------------------------------]]
local Type, Version = "SimpleGroup", 20
local Type, Version = "SimpleGroup", 21
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -46,7 +46,7 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
--Container Support
@@ -2,22 +2,18 @@
TabGroup Container
Container that uses tabs on top to switch between groups.
-------------------------------------------------------------------------------]]
local Type, Version = "TabGroup", 31
local Type, Version = "TabGroup", 39
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)
@@ -39,7 +172,7 @@ end
local function Tab_SetText(frame, text)
frame:_SetText(text)
local width = frame.obj.frame.width or frame.obj.frame:GetWidth() or 0
PanelTemplates_TabResize(frame, 0, nil, width)
PanelTemplates_TabResize(frame, 0, nil, nil, width, frame:GetFontString():GetStringWidth())
end
local function Tab_SetSelected(frame, selected)
@@ -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)
@@ -255,7 +441,7 @@ local methods = {
end
for i = starttab, endtab do
PanelTemplates_TabResize(tabs[i], padding + 4, nil, width)
PanelTemplates_TabResize(tabs[i], padding + 4, nil, nil, width, tabs[i]:GetFontString():GetStringWidth())
end
starttab = endtab + 1
end
@@ -304,7 +490,7 @@ local PaneBackdrop = {
local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame",nil,UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, num), UIParent)
frame:SetHeight(100)
frame:SetWidth(100)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
@@ -2,22 +2,18 @@
TreeGroup Container
Container that uses a tree control to switch between groups.
-------------------------------------------------------------------------------]]
local Type, Version = "TreeGroup", 43
local Type, Version = "TreeGroup", 50
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: GameTooltip, FONT_COLOR_CODE_CLOSE
-- Recycling functions
local new, del
do
@@ -159,7 +155,7 @@ end
local function FirstFrameUpdate(frame)
local self = frame.obj
frame:SetScript("OnUpdate", nil)
self:RefreshTree()
self:RefreshTree(nil, true)
end
local function BuildUniqueValue(...)
@@ -206,11 +202,13 @@ local function Button_OnEnter(frame)
self:Fire("OnButtonEnter", frame.uniquevalue, frame)
if self.enabletooltips then
GameTooltip:SetOwner(frame, "ANCHOR_NONE")
GameTooltip:SetPoint("LEFT",frame,"RIGHT")
GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, 1)
local tooltip = AceGUI.tooltip
tooltip:SetOwner(frame, "ANCHOR_NONE")
tooltip:ClearAllPoints()
tooltip:SetPoint("LEFT",frame,"RIGHT")
tooltip:SetText(frame.text:GetText() or "", 1, .82, 0, true)
GameTooltip:Show()
tooltip:Show()
end
end
@@ -219,7 +217,7 @@ local function Button_OnLeave(frame)
self:Fire("OnButtonLeave", frame.uniquevalue, frame)
if self.enabletooltips then
GameTooltip:Hide()
AceGUI.tooltip:Hide()
end
end
@@ -227,7 +225,7 @@ local function OnScrollValueChanged(frame, value)
if frame.obj.noupdate then return end
local self = frame.obj
local status = self.status or self.localstatus
status.scrollvalue = value
status.scrollvalue = floor(value + 0.5)
self:RefreshTree()
AceGUI:ClearFocus()
end
@@ -292,10 +290,13 @@ local methods = {
["OnAcquire"] = function(self)
self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE)
self:EnableButtonTooltips(true)
self.frame:SetScript("OnUpdate", FirstFrameUpdate)
end,
["OnRelease"] = function(self)
self.status = nil
self.tree = nil
self.frame:SetScript("OnUpdate", nil)
for k, v in pairs(self.localstatus) do
if k == "groups" then
for k2 in pairs(v) do
@@ -383,13 +384,9 @@ local methods = {
end
end,
["RefreshTree"] = function(self,scrollToSelection)
["RefreshTree"] = function(self,scrollToSelection,fromOnUpdate)
local buttons = self.buttons
local lines = self.lines
for i, v in ipairs(buttons) do
v:Hide()
end
while lines[1] do
local t = tremove(lines)
for k in pairs(t) do
@@ -415,6 +412,11 @@ local methods = {
local maxlines = (floor(((self.treeframe:GetHeight()or 0) - 20 ) / 18))
if maxlines <= 0 then return end
if self.frame:GetParent() == UIParent and not fromOnUpdate then
self.frame:SetScript("OnUpdate", FirstFrameUpdate)
return
end
local first, last
scrollToSelection = status.scrollToSelection
@@ -493,6 +495,10 @@ local methods = {
buttonnum = buttonnum + 1
end
-- We hide the remaining buttons after updating others to avoid a blizzard bug that keeps them interactable even if hidden when hidden before updating the buttons.
for i = buttonnum, #buttons do
buttons[i]:Hide()
end
end,
["SetSelected"] = function(self, value)
@@ -557,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)
@@ -619,13 +629,13 @@ local PaneBackdrop = {
local DraggerBackdrop = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = nil,
tile = true, tileSize = 16, edgeSize = 0,
tile = true, tileSize = 16, edgeSize = 1,
insets = { left = 3, right = 3, top = 7, bottom = 7 }
}
local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, num), UIParent)
local treeframe = CreateFrame("Frame", nil, frame)
treeframe:SetPoint("TOPLEFT")
@@ -636,8 +646,12 @@ 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)
@@ -667,7 +681,7 @@ local function Constructor()
scrollbg:SetAllPoints(scrollbar)
scrollbg:SetTexture(0,0,0,0.4)
local border = CreateFrame("Frame",nil,frame)
local border = CreateFrame("Frame", nil, frame)
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 = 5
local Version = 9
local function frameOnShow(this)
this.obj:Fire("OnShow")
@@ -155,7 +151,7 @@ do
end
local function Constructor()
local frame = CreateFrame("Frame",nil,UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
local self = {}
self.type = "Window"
@@ -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("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)
@@ -2,7 +2,7 @@
Button Widget
Graphical Button.
-------------------------------------------------------------------------------]]
local Type, Version = "Button", 23
local Type, Version = "Button", 25
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -74,7 +74,7 @@ Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate2")
local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate")
frame:Hide()
frame:EnableMouse(true)
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
Checkbox Widget
-------------------------------------------------------------------------------]]
local Type, Version = "CheckBox", 26
local Type, Version = "CheckBox", 27
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 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)
@@ -242,7 +238,7 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Button", nil, UIParent)
local frame = CreateFrame("Button", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:Hide()
frame:EnableMouse(true)
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
ColorPicker Widget
-------------------------------------------------------------------------------]]
local Type, Version = "ColorPicker", 25
local Type, Version = "ColorPicker", 29
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -11,17 +11,24 @@ 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
-- Unfortunately we have no way to realistically detect if a client uses inverted alpha
-- as no API will tell you. Wrath uses the old colorpicker, era uses the new one, both are inverted
local INVERTED_ALPHA = true
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
local function ColorCallback(self, r, g, b, a, isAlpha)
if INVERTED_ALPHA and a then
a = 1 - a
end
if not self.HasAlpha then
a = 1
end
-- no change, skip update
if r == self.r and g == self.g and b == self.b and a == self.a then
return
end
self:SetColor(r, g, b, a)
if ColorPickerFrame:IsVisible() then
--colorpicker is still open
@@ -54,30 +61,63 @@ local function ColorSwatch_OnClick(frame)
ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10)
ColorPickerFrame:SetClampedToScreen(true)
ColorPickerFrame.func = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = 1 - OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a)
end
if ColorPickerFrame.SetupColorPickerAndShow then -- 10.2.5 color picker overhaul
local r2, g2, b2, a2 = self.r, self.g, self.b, (self.a or 1)
if INVERTED_ALPHA then
a2 = 1 - a2
end
ColorPickerFrame.hasOpacity = self.HasAlpha
ColorPickerFrame.opacityFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = 1 - OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a, true)
end
local info = {
swatchFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = ColorPickerFrame:GetColorAlpha()
ColorCallback(self, r, g, b, a)
end,
local r, g, b, a = self.r, self.g, self.b, self.a
if self.HasAlpha then
ColorPickerFrame.opacity = 1 - (a or 0)
end
ColorPickerFrame:SetColorRGB(r, g, b)
hasOpacity = self.HasAlpha,
opacityFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = ColorPickerFrame:GetColorAlpha()
ColorCallback(self, r, g, b, a, true)
end,
opacity = a2,
ColorPickerFrame.cancelFunc = function()
ColorCallback(self, r, g, b, a, true)
end
cancelFunc = function()
ColorCallback(self, r2, g2, b2, a2, true)
end,
ColorPickerFrame:Show()
r = r2,
g = g2,
b = b2,
}
ColorPickerFrame:SetupColorPickerAndShow(info)
else
ColorPickerFrame.func = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a)
end
ColorPickerFrame.hasOpacity = self.HasAlpha
ColorPickerFrame.opacityFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a, true)
end
local r, g, b, a = self.r, self.g, self.b, 1 - (self.a or 1)
if self.HasAlpha then
ColorPickerFrame.opacity = a
end
ColorPickerFrame:SetColorRGB(r, g, b)
ColorPickerFrame.cancelFunc = function()
ColorCallback(self, r, g, b, a, true)
end
ColorPickerFrame:Show()
end
end
AceGUI:ClearFocus()
end
@@ -129,7 +169,7 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Button", nil, UIParent)
local frame = CreateFrame("Button", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:Hide()
frame:EnableMouse(true)
@@ -1,4 +1,4 @@
--[[ $Id$ ]]--
--[[ $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)
@@ -246,7 +246,7 @@ end
-- Special: Different text color and no highlight
do
local widgetType = "Dropdown-Item-Header"
local widgetVersion = 1
local widgetVersion = 2
local function OnEnter(this)
local self = this.obj
@@ -295,7 +295,7 @@ end
-- A simple button
do
local widgetType = "Dropdown-Item-Execute"
local widgetVersion = 1
local widgetVersion = 2
local function Frame_OnClick(this, button)
local self = this.obj
@@ -323,7 +323,7 @@ end
-- Does not close the pullout on click.
do
local widgetType = "Dropdown-Item-Toggle"
local widgetVersion = 3
local widgetVersion = 5
local function UpdateToggle(self)
if self.value then
@@ -383,7 +383,7 @@ end
-- Does not close the pullout on click
do
local widgetType = "Dropdown-Item-Menu"
local widgetVersion = 2
local widgetVersion = 3
local function OnEnter(this)
local self = this.obj
@@ -440,7 +440,7 @@ end
-- A single line to separate items
do
local widgetType = "Dropdown-Item-Separator"
local widgetVersion = 1
local widgetVersion = 3
-- exported, override
local function SetDisabled(self, disabled)
@@ -455,7 +455,7 @@ do
local line = self.frame:CreateTexture(nil, "OVERLAY")
line:SetHeight(1)
line:SetTexture(.5, .5, .5)
line:SetTexture(0.5, 0.5, 0.5)
line:SetPoint("LEFT", self.frame, "LEFT", 10, 0)
line:SetPoint("RIGHT", self.frame, "RIGHT", -10, 0)
@@ -1,4 +1,4 @@
--[[ $Id: AceGUIWidget-DropDown.lua 1209 2019-06-24 21:01:01Z 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, ...)
@@ -39,7 +35,7 @@ end
do
local widgetType = "Dropdown-Pullout"
local widgetVersion = 3
local widgetVersion = 6
--[[ Static data ]]--
@@ -193,12 +189,7 @@ do
local height = 8
for i, item in pairs(items) do
if i == 1 then
item:SetPoint("TOP", itemFrame, "TOP", 0, -2)
else
item:SetPoint("TOP", items[i-1].frame, "BOTTOM", 0, 1)
end
item:SetPoint("TOP", itemFrame, "TOP", 0, -2 + (i - 1) * -16)
item:Show()
height = height + 16
@@ -356,7 +347,7 @@ end
do
local widgetType = "Dropdown"
local widgetVersion = 34
local widgetVersion = 37
--[[ Static data ]]--
@@ -381,7 +372,6 @@ do
local function Dropdown_TogglePullout(this)
local self = this.obj
PlaySound("igMainMenuOptionCheckBoxOn") -- missleading name, but the Blizzard code uses this sound
if self.open then
self.open = nil
self.pullout:Close()
@@ -465,6 +455,7 @@ do
self:SetWidth(200)
self:SetLabel()
self:SetPulloutWidth(nil)
self.list = {}
end
-- exported, AceGUI callback
@@ -535,9 +526,7 @@ do
-- exported
local function SetValue(self, value)
if self.list then
self:SetText(self.list[value] or "")
end
self:SetText(self.list[value] or "")
self.value = value
end
@@ -601,7 +590,7 @@ do
end
end
local function SetList(self, list, order, itemType)
self.list = list
self.list = list or {}
self.pullout:Clear()
self.hasClose = nil
if not list then return end
@@ -629,10 +618,8 @@ do
-- exported
local function AddItem(self, value, text, itemType)
if self.list then
self.list[value] = text
AddListItem(self, value, text, itemType)
end
self.list[value] = text
AddListItem(self, value, text, itemType)
end
-- exported
@@ -657,7 +644,7 @@ do
local function Constructor()
local count = AceGUI:GetNextWidgetNum(widgetType)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", widgetType .. count, UIParent)
local dropdown = CreateFrame("Frame", "AceGUI30DropDown"..count, frame, "UIDropDownMenuTemplate")
local self = {}
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
EditBox Widget
-------------------------------------------------------------------------------]]
local Type, Version = "EditBox", 28
local Type, Version = "EditBox", 30
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -10,14 +10,11 @@ local tostring, pairs = tostring, pairs
-- WoW APIs
local PlaySound = PlaySound
local GetMacroInfo = GetMacroInfo
local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, GetSpellInfo
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
-------------------------------------------------------------------------------]]
@@ -210,10 +207,10 @@ Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, num), UIParent)
frame:Hide()
local editbox = CreateFrame("EditBox", "AceGUI-3.0EditBox"..num, frame, "WA_InputBoxTemplate")
local editbox = CreateFrame("EditBox", "AceGUI-3.0EditBox"..num, frame, "InputBoxTemplate")
editbox:SetAutoFocus(false)
editbox:SetFontObject(ChatFontNormal)
editbox:SetScript("OnEnter", Control_OnEnter)
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
Heading Widget
-------------------------------------------------------------------------------]]
local Type, Version = "Heading", 20
local Type, Version = "Heading", 21
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -39,7 +39,7 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:Hide()
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
Icon Widget
-------------------------------------------------------------------------------]]
local Type, Version = "Icon", 21
local Type, Version = "Icon", 22
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -96,7 +96,7 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Button", nil, UIParent)
local frame = CreateFrame("Button", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:Hide()
frame:EnableMouse(true)
@@ -132,7 +132,7 @@ local function Constructor()
widget[method] = func
end
widget.SetText = widget.SetLabel
widget.SetText = widget.SetLabel -- deprecated soon!
return AceGUI:RegisterAsWidget(widget)
end
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
InteractiveLabel Widget
-------------------------------------------------------------------------------]]
local Type, Version = "InteractiveLabel", 21
local Type, Version = "InteractiveLabel", 22
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -2,7 +2,7 @@
Keybinding Widget
Set Keybindings in the Config UI.
-------------------------------------------------------------------------------]]
local Type, Version = "Keybinding", 25
local Type, Version = "Keybinding", 27
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 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
-------------------------------------------------------------------------------]]
@@ -185,10 +181,9 @@ local function keybindingMsgFixWidth(frame)
end
local function Constructor()
local name = "AceGUI30KeybindingButton" .. AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate2")
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", string.format("%s%d", Type, num), UIParent)
local button = CreateFrame("Button", "AceGUI30KeybindingButton" .. num, frame, "UIPanelButtonTemplate")
button:EnableMouse(true)
button:EnableMouseWheel(false)
@@ -2,7 +2,7 @@
Label Widget
Displays text and optionally an icon.
-------------------------------------------------------------------------------]]
local Type, Version = "Label", 26
local Type, Version = "Label", 29
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,11 +125,16 @@ local methods = {
end,
["SetFont"] = function(self, font, height, flags)
self.label:SetFont(font, height, flags)
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)
@@ -155,7 +156,7 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:Hide()
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall")
@@ -1,4 +1,4 @@
local Type, Version = "MultiLineEditBox", 33
local Type, Version = "MultiLineEditBox", 34
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -273,11 +273,11 @@ local backdrop = {
}
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
frame:Hide()
local widgetNum = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", string.format("%s%d", Type, widgetNum), UIParent)
frame:Hide()
local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
label:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, -4)
label:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, -4)
@@ -2,7 +2,7 @@
Slider Widget
Graphical Slider, like, for Range values.
-------------------------------------------------------------------------------]]
local Type, Version = "Slider", 20
local Type, Version = "Slider", 24
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -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
@@ -60,6 +56,10 @@ end
local function Slider_OnValueChanged(frame, newvalue)
local self = frame.obj
if not frame.setup then
if self.step and self.step > 0 then
local min_value = self.min or 0
newvalue = floor((newvalue - min_value) / self.step + 0.5) * self.step + min_value
end
if newvalue ~= self.value and not self.disabled then
self.value = newvalue
self:Fire("OnValueChanged", newvalue)
@@ -171,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
@@ -210,7 +210,7 @@ local ManualBackdrop = {
}
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", string.format("%s%d", Type, AceGUI:GetNextWidgetNum(Type)), UIParent)
frame:EnableMouse(true)
frame:SetScript("OnMouseDown", Frame_OnMouseDown)
@@ -27,7 +27,6 @@ local function ConstructIconPicker(frame)
local scroll = AceGUI:Create("ScrollFrame");
scroll:SetLayout("flow");
--scroll.frame:SetClipsChildren(true);
group:AddChild(scroll);
local function iconPickerFill(subname, doSort)
@@ -100,8 +99,12 @@ local function ConstructIconPicker(frame)
end
end
local input = CreateFrame("Editbox", "WeakAurasIconFilterInput", group.frame, "WA_InputBoxTemplate");
input:SetScript("OnTextChanged", function(...) iconPickerFill(input:GetText(), false); end);
local input = CreateFrame("EditBox", "WeakAurasFilterInput", group.frame)
WeakAuras.XMLTemplates["SearchBoxTemplate"](input)
input:SetScript("OnTextChanged", function(self)
WA_SearchBoxTemplate_OnTextChanged(self)
iconPickerFill(input:GetText(), false)
end);
input:SetScript("OnEnterPressed", function(...) iconPickerFill(input:GetText(), true); end);
input:SetScript("OnEscapePressed", function(...) input:SetText(""); iconPickerFill(input:GetText(), true); end);
input:SetWidth(200);
+5 -60
View File
@@ -57,66 +57,11 @@ local function ConstructModelPicker(frame)
group.frame:Hide();
group:SetLayout("flow");
local filterInput = CreateFrame("EditBox", "WeakAurasModelFilterInput", group.frame, "WA_InputBoxTemplate")
filterInput:SetAutoFocus(false)
filterInput:SetTextInsets(16, 20, 0, 0)
filterInput.Instructions = filterInput:CreateFontString(nil, "ARTWORK", "GameFontDisableSmall")
filterInput.Instructions:SetText(SEARCH)
filterInput.Instructions:SetPoint("TOPLEFT", filterInput, "TOPLEFT", 16, 0)
filterInput.Instructions:SetPoint("BOTTOMRIGHT", filterInput, "BOTTOMRIGHT", -20, 0)
filterInput.Instructions:SetTextColor(0.35, 0.35, 0.35)
filterInput.Instructions:SetJustifyH("LEFT")
filterInput.Instructions:SetJustifyV("MIDDLE")
filterInput.searchIcon = filterInput:CreateTexture(nil, "OVERLAY")
filterInput.searchIcon:SetTexture("Interface\\Common\\UI-Searchbox-Icon")
filterInput.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
filterInput.searchIcon:SetSize(14, 14)
filterInput.searchIcon:SetPoint("LEFT", 0, -2)
filterInput.clearButton = CreateFrame("Button", nil, filterInput)
filterInput.clearButton:SetSize(14, 14)
filterInput.clearButton:SetPoint("RIGHT", -3, 0)
filterInput.clearButton.texture = filterInput.clearButton:CreateTexture()
filterInput.clearButton.texture:SetTexture("Interface\\FriendsFrame\\ClearBroadcastIcon")
filterInput.clearButton.texture:SetAlpha(0.5)
filterInput.clearButton.texture:SetSize(17, 17)
filterInput.clearButton.texture:SetPoint("CENTER", 0, 0)
filterInput.clearButton:SetScript("OnEnter", function(self) self.texture:SetAlpha(1.0) end)
filterInput.clearButton:SetScript("OnLeave", function(self) self.texture:SetAlpha(0.5) end)
filterInput.clearButton:SetScript("OnMouseDown", function(self) if self:IsEnabled() then self.texture:SetPoint("CENTER", 1, -1) end end)
filterInput.clearButton:SetScript("OnMouseUp", function(self) self.texture:SetPoint("CENTER") end)
filterInput.clearButton:SetScript("OnClick", function(self)
local editBox = self:GetParent()
editBox:SetText("")
editBox:ClearFocus()
end)
filterInput:SetScript("OnEditFocusLost", function(self)
if self:GetText() == "" then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
self.clearButton:Hide()
end
end)
filterInput:SetScript("OnEditFocusGained", function(self)
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0)
self.clearButton:Show()
end)
filterInput:HookScript("OnTextChanged", function(self)
if not self:HasFocus() and self:GetText() == "" then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
self.clearButton:Hide()
else
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0)
self.clearButton:Show()
end
if self:GetText() == "" then
self.Instructions:Show()
else
self.Instructions:Hide()
end
local filterInput = CreateFrame("EditBox", "WeakAurasFilterInput", nil)
WeakAuras.XMLTemplates["SearchBoxTemplate"](filterInput)
filterInput:SetParent(group.frame)
filterInput:SetScript("OnTextChanged", function(self)
WA_SearchBoxTemplate_OnTextChanged(self)
local filterText = filterInput:GetText()
RecurseSetFilter(group.modelTree.tree, filterText)
group.modelTree.filter = filterText ~= nil and filterText ~= ""
+13 -65
View File
@@ -96,7 +96,8 @@ function OptionsPrivate.CreateFrame()
local db = OptionsPrivate.savedVars.db
local odb = OptionsPrivate.savedVars.odb
frame = CreateFrame("Frame", "WeakAurasOptions", UIParent, "WA_PortraitFrameTemplate")
frame = CreateFrame("Frame", "WeakAurasOptions", UIParent)
WeakAuras.XMLTemplates["PortraitFrameTemplate"](frame)
function OptionsPrivate.SetTitle(title)
local text = "WeakAuras " .. WeakAuras.versionString
@@ -312,7 +313,8 @@ function OptionsPrivate.CreateFrame()
end
end
local minimizebutton = CreateFrame("Button", nil, frame, "WA_MaximizeMinimizeButtonFrameTemplate")
local minimizebutton = CreateFrame("Button", nil, frame)
WeakAuras.XMLTemplates["MaximizeMinimizeButtonFrameTemplate"](minimizebutton)
minimizebutton:SetPoint("RIGHT", frame.CloseButton, "LEFT", 0, 0)
minimizebutton:SetOnMaximizedCallback(function()
frame.minimized = false
@@ -386,7 +388,8 @@ function OptionsPrivate.CreateFrame()
tipPopupLabelK:SetJustifyH("LEFT")
tipPopupLabelK:SetJustifyV("TOP")
local urlWidget = CreateFrame("EditBox", nil, tipPopup, "WA_InputBoxTemplate")
local urlWidget = CreateFrame("EditBox", nil, tipPopup)
WeakAuras.XMLTemplates["InputBoxTemplate"](urlWidget)
urlWidget:SetFont(STANDARD_TEXT_FONT, 12)
urlWidget:SetPoint("TOPLEFT", tipPopupLabelK, "BOTTOMLEFT", 6, 0)
urlWidget:SetPoint("TOPRIGHT", tipPopupLabelK, "BOTTOMRIGHT", 0, 0)
@@ -570,66 +573,10 @@ function OptionsPrivate.CreateFrame()
frame.moversizer, frame.mover = OptionsPrivate.MoverSizer(frame)
-- filter line
local filterInput = CreateFrame("EditBox", "WeakAurasFilterInput", frame, "WA_InputBoxTemplate")
filterInput:SetAutoFocus(false)
filterInput:SetTextInsets(16, 20, 0, 0)
filterInput.Instructions = filterInput:CreateFontString(nil, "ARTWORK", "GameFontDisableSmall")
filterInput.Instructions:SetText(SEARCH)
filterInput.Instructions:SetPoint("TOPLEFT", filterInput, "TOPLEFT", 16, 0)
filterInput.Instructions:SetPoint("BOTTOMRIGHT", filterInput, "BOTTOMRIGHT", -20, 0)
filterInput.Instructions:SetTextColor(0.35, 0.35, 0.35)
filterInput.Instructions:SetJustifyH("LEFT")
filterInput.Instructions:SetJustifyV("MIDDLE")
filterInput.searchIcon = filterInput:CreateTexture(nil, "OVERLAY")
filterInput.searchIcon:SetTexture("Interface\\Common\\UI-Searchbox-Icon")
filterInput.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
filterInput.searchIcon:SetSize(14, 14)
filterInput.searchIcon:SetPoint("LEFT", 0, -2)
filterInput.clearButton = CreateFrame("Button", nil, filterInput)
filterInput.clearButton:SetSize(14, 14)
filterInput.clearButton:SetPoint("RIGHT", -3, 0)
filterInput.clearButton.texture = filterInput.clearButton:CreateTexture()
filterInput.clearButton.texture:SetTexture("Interface\\FriendsFrame\\ClearBroadcastIcon")
filterInput.clearButton.texture:SetAlpha(0.5)
filterInput.clearButton.texture:SetSize(17, 17)
filterInput.clearButton.texture:SetPoint("CENTER", 0, 0)
filterInput.clearButton:SetScript("OnEnter", function(self) self.texture:SetAlpha(1.0) end)
filterInput.clearButton:SetScript("OnLeave", function(self) self.texture:SetAlpha(0.5) end)
filterInput.clearButton:SetScript("OnMouseDown", function(self) if self:IsEnabled() then self.texture:SetPoint("CENTER", 1, -1) end end)
filterInput.clearButton:SetScript("OnMouseUp", function(self) self.texture:SetPoint("CENTER") end)
filterInput.clearButton:SetScript("OnClick", function(self)
local editBox = self:GetParent()
editBox:SetText("")
editBox:ClearFocus()
end)
filterInput:SetScript("OnEditFocusLost", function(self)
if self:GetText() == "" then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
self.clearButton:Hide()
end
end)
filterInput:SetScript("OnEditFocusGained", function(self)
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0)
self.clearButton:Show()
end)
filterInput:HookScript("OnTextChanged", function(self)
if not self:HasFocus() and self:GetText() == "" then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
self.clearButton:Hide()
else
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0)
self.clearButton:Show()
end
if self:GetText() == "" then
self.Instructions:Show()
else
self.Instructions:Hide()
end
local filterInput = CreateFrame("EditBox", "WeakAurasFilterInput", frame)
WeakAuras.XMLTemplates["SearchBoxTemplate"](filterInput)
filterInput:SetScript("OnTextChanged", function(self)
WA_SearchBoxTemplate_OnTextChanged(self)
OptionsPrivate.SortDisplayButtons(filterInput:GetText())
end)
filterInput:SetHeight(15)
@@ -1032,7 +979,8 @@ function OptionsPrivate.CreateFrame()
sidegroup.frame:Show()
sidegroup:SetLayout("flow")
local dynamicTextCodesFrame = CreateFrame("Frame", "WeakAurasTextReplacements", sidegroup.frame, "WA_PortraitFrameTemplate")
local dynamicTextCodesFrame = CreateFrame("Frame", "WeakAurasTextReplacements", sidegroup.frame)
WeakAuras.XMLTemplates["PortraitFrameTemplate"](dynamicTextCodesFrame)
dynamicTextCodesFrame:HidePortrait()
dynamicTextCodesFrame:SetPoint("TOPLEFT", sidegroup.frame, "TOPRIGHT", 20, 0)
dynamicTextCodesFrame:SetPoint("BOTTOMLEFT", sidegroup.frame, "BOTTOMRIGHT", 20, 0)
@@ -1408,7 +1356,7 @@ function OptionsPrivate.CreateFrame()
containerScroll:SetLayout("flow")
border:AddChild(containerScroll)
local _, _, _, enabled = GetAddOnInfo("WeakAurasTemplates")
local enabled = select(4, GetAddOnInfo("WeakAurasTemplates"))
if enabled then
local simpleLabel = AceGUI:Create("Label")
simpleLabel:SetFont(STANDARD_TEXT_FONT, 24, "OUTLINE")
+10 -64
View File
@@ -420,7 +420,8 @@ local function ConstructTextEditor(frame)
local apiSearchFrame
-- Make sidebar for snippets
local snippetsFrame = CreateFrame("Frame", "WeakAurasSnippets", group.frame, "WA_PortraitFrameTemplate")
local snippetsFrame = CreateFrame("Frame", "WeakAurasSnippets", group.frame)
WeakAuras.XMLTemplates["PortraitFrameTemplate"](snippetsFrame)
snippetsFrame:HidePortrait()
snippetsFrame:SetPoint("TOPLEFT", group.frame, "TOPRIGHT", 20, 0)
snippetsFrame:SetPoint("BOTTOMLEFT", group.frame, "BOTTOMRIGHT", 20, 0)
@@ -505,7 +506,8 @@ local function ConstructTextEditor(frame)
apiSearchButton:RegisterForClicks("LeftButtonUp")
-- Make sidebar for apiSearch
apiSearchFrame = CreateFrame("Frame", "WeakAurasAPISearchFrame", group.frame, "WA_PortraitFrameTemplate")
apiSearchFrame = CreateFrame("Frame", "WeakAurasAPISearchFrame", group.frame)
WeakAuras.XMLTemplates["PortraitFrameTemplate"](apiSearchFrame)
apiSearchFrame:HidePortrait()
apiSearchFrame:SetWidth(350)
@@ -514,54 +516,11 @@ local function ConstructTextEditor(frame)
local APISearchCTimer
-- filter line
local filterInput = CreateFrame("EditBox", "WeakAurasAPISearchFilterInput", apiSearchFrame, "WA_InputBoxTemplate")
filterInput:SetAutoFocus(false)
filterInput:SetTextInsets(16, 20, 0, 0)
filterInput.Instructions = filterInput:CreateFontString(nil, "ARTWORK", "GameFontDisableSmall")
filterInput.Instructions:SetText(SEARCH)
filterInput.Instructions:SetPoint("TOPLEFT", filterInput, "TOPLEFT", 16, 0)
filterInput.Instructions:SetPoint("BOTTOMRIGHT", filterInput, "BOTTOMRIGHT", -20, 0)
filterInput.Instructions:SetTextColor(0.35, 0.35, 0.35)
filterInput.Instructions:SetJustifyH("LEFT")
filterInput.Instructions:SetJustifyV("MIDDLE")
filterInput.searchIcon = filterInput:CreateTexture(nil, "OVERLAY")
filterInput.searchIcon:SetTexture("Interface\\Common\\UI-Searchbox-Icon")
filterInput.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
filterInput.searchIcon:SetSize(14, 14)
filterInput.searchIcon:SetPoint("LEFT", 0, -2)
filterInput.clearButton = CreateFrame("Button", nil, filterInput)
filterInput.clearButton:SetSize(14, 14)
filterInput.clearButton:SetPoint("RIGHT", -3, 0)
filterInput.clearButton.texture = filterInput.clearButton:CreateTexture()
filterInput.clearButton.texture:SetTexture("Interface\\FriendsFrame\\ClearBroadcastIcon")
filterInput.clearButton.texture:SetAlpha(0.5)
filterInput.clearButton.texture:SetSize(17, 17)
filterInput.clearButton.texture:SetPoint("CENTER", 0, 0)
filterInput.clearButton:SetScript("OnEnter", function(self) self.texture:SetAlpha(1.0) end)
filterInput.clearButton:SetScript("OnLeave", function(self) self.texture:SetAlpha(0.5) end)
filterInput.clearButton:SetScript("OnMouseDown", function(self) if self:IsEnabled() then self.texture:SetPoint("CENTER", 1, -1) end end)
filterInput.clearButton:SetScript("OnMouseUp", function(self) self.texture:SetPoint("CENTER") end)
filterInput.clearButton:SetScript("OnClick", function(self)
local editBox = self:GetParent()
editBox:SetText("")
editBox:ClearFocus()
end)
filterInput:SetScript("OnEditFocusLost", function(self)
if self:GetText() == "" then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
self.clearButton:Hide()
end
end)
filterInput:SetScript("OnEditFocusGained", function(self)
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0)
self.clearButton:Show()
end)
local filterInput = CreateFrame("EditBox", "WeakAurasAPISearchFilterInput", apiSearchFrame)
WeakAuras.XMLTemplates["SearchBoxTemplate"](filterInput)
filterInput:SetFrameLevel(5)
filterInput:SetScript("OnTextChanged", function(self)
WA_SearchBoxTemplate_OnTextChanged(self)
if APISearchCTimer and WeakAuras.timer:TimeLeft(APISearchCTimer) then
WeakAuras.timer:CancelTimer(APISearchCTimer)
end
@@ -572,20 +531,6 @@ local function ConstructTextEditor(frame)
APISearchTextChangeDelay
)
end)
filterInput:HookScript("OnTextChanged", function(self)
if not self:HasFocus() and self:GetText() == "" then
self.searchIcon:SetVertexColor(0.6, 0.6, 0.6)
self.clearButton:Hide()
else
self.searchIcon:SetVertexColor(1.0, 1.0, 1.0)
self.clearButton:Show()
end
if self:GetText() == "" then
self.Instructions:Show()
else
self.Instructions:Hide()
end
end)
filterInput:SetHeight(15)
filterInput:SetPoint("TOPLEFT", apiSearchFrame, "TOPLEFT", 17, -30)
filterInput:SetPoint("TOPRIGHT", apiSearchFrame, "TOPRIGHT", -10, -30)
@@ -890,7 +835,8 @@ local function ConstructTextEditor(frame)
editorError:SetPoint("RIGHT", settings_frame, "LEFT")
group.editorError = editorError
local editorLine = CreateFrame("EditBox", nil, group.frame, "WA_InputBoxTemplate")
local editorLine = CreateFrame("EditBox", nil, group.frame)
WeakAuras.XMLTemplates["InputBoxTemplate"](editorLine)
-- Set script on enter pressed..
editorLine:SetPoint("RIGHT", snippetsButton, "LEFT", -10, 0)
editorLine:SetFont(STANDARD_TEXT_FONT, 10)