lib update
This commit is contained in:
parent
ab51106301
commit
892b5e8a59
@ -9,7 +9,7 @@
|
|||||||
-- make into AceComm.
|
-- make into AceComm.
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceComm-3.0
|
-- @name AceComm-3.0
|
||||||
-- @release $Id: AceComm-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
|
-- @release $Id: AceComm-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||||
|
|
||||||
--[[ AceComm-3.0
|
--[[ AceComm-3.0
|
||||||
|
|
||||||
@ -35,10 +35,6 @@ local error, assert = error, assert
|
|||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local Ambiguate = Ambiguate
|
local Ambiguate = Ambiguate
|
||||||
|
|
||||||
-- 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, DEFAULT_CHAT_FRAME, geterrorhandler, RegisterAddonMessagePrefix
|
|
||||||
|
|
||||||
AceComm.embeds = AceComm.embeds or {}
|
AceComm.embeds = AceComm.embeds or {}
|
||||||
|
|
||||||
-- for my sanity and yours, let's give the message type bytes some names
|
-- for my sanity and yours, let's give the message type bytes some names
|
||||||
|
@ -75,7 +75,7 @@ local next = next
|
|||||||
local strlen = string.len
|
local strlen = string.len
|
||||||
local GetFramerate = GetFramerate
|
local GetFramerate = GetFramerate
|
||||||
local strlower = string.lower
|
local strlower = string.lower
|
||||||
local unpack,type,pairs,wipe = unpack,type,pairs,wipe
|
local unpack,type,pairs,wipe = unpack,type,pairs,table.wipe
|
||||||
local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty
|
local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames.
|
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames.
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceConfigCmd-3.0
|
-- @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
|
AceConfigCmd-3.0
|
||||||
@ -37,17 +37,10 @@ local error, assert = error, assert
|
|||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local _G = _G
|
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
|
local L = setmetatable({}, { -- TODO: replace with proper locale
|
||||||
__index = function(self,k) return k end
|
__index = function(self,k) return k end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local function print(msg)
|
local function print(msg)
|
||||||
(SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg)
|
(SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg)
|
||||||
end
|
end
|
||||||
@ -401,7 +394,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local str = strsub(info.input,inputpos);
|
local strInput = strsub(info.input,inputpos);
|
||||||
|
|
||||||
if tab.type=="execute" then
|
if tab.type=="execute" then
|
||||||
------------ execute --------------------------------------------
|
------------ execute --------------------------------------------
|
||||||
@ -414,21 +407,21 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||||||
|
|
||||||
local res = true
|
local res = true
|
||||||
if tab.pattern then
|
if tab.pattern then
|
||||||
if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end
|
if type(tab.pattern)~="string" then err(info, inputpos, "'pattern' - expected a string") end
|
||||||
if not strmatch(str, tab.pattern) then
|
if not strmatch(strInput, tab.pattern) then
|
||||||
usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
|
usererr(info, inputpos, "'"..strInput.."' - " .. L["invalid input"])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
do_final(info, inputpos, tab, "set", str)
|
do_final(info, inputpos, tab, "set", strInput)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
elseif tab.type=="toggle" then
|
elseif tab.type=="toggle" then
|
||||||
------------ toggle --------------------------------------------
|
------------ toggle --------------------------------------------
|
||||||
local b
|
local b
|
||||||
local str = strtrim(strlower(str))
|
local str = strtrim(strlower(strInput))
|
||||||
if str=="" then
|
if str=="" then
|
||||||
b = callmethod(info, inputpos, tab, "get")
|
b = callmethod(info, inputpos, tab, "get")
|
||||||
|
|
||||||
@ -465,9 +458,9 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||||||
|
|
||||||
elseif tab.type=="range" then
|
elseif tab.type=="range" then
|
||||||
------------ range --------------------------------------------
|
------------ range --------------------------------------------
|
||||||
local val = tonumber(str)
|
local val = tonumber(strInput)
|
||||||
if not val then
|
if not val then
|
||||||
usererr(info, inputpos, "'"..str.."' - "..L["expected number"])
|
usererr(info, inputpos, "'"..strInput.."' - "..L["expected number"])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if type(info.step)=="number" then
|
if type(info.step)=="number" then
|
||||||
@ -487,7 +480,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||||||
|
|
||||||
elseif tab.type=="select" then
|
elseif tab.type=="select" then
|
||||||
------------ select ------------------------------------
|
------------ select ------------------------------------
|
||||||
local str = strtrim(strlower(str))
|
local str = strtrim(strlower(strInput))
|
||||||
|
|
||||||
local values = tab.values
|
local values = tab.values
|
||||||
if type(values) == "function" or type(values) == "string" then
|
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
|
elseif tab.type=="multiselect" then
|
||||||
------------ multiselect -------------------------------------------
|
------------ multiselect -------------------------------------------
|
||||||
local str = strtrim(strlower(str))
|
local str = strtrim(strlower(strInput))
|
||||||
|
|
||||||
local values = tab.values
|
local values = tab.values
|
||||||
if type(values) == "function" or type(values) == "string" then
|
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
|
--check that the opt is valid
|
||||||
local ok
|
local ok
|
||||||
for k,v in pairs(values) do
|
for k in pairs(values) do
|
||||||
if strlower(k)==opt then
|
if strlower(k)==opt then
|
||||||
opt = k -- overwrite with key (in case of case mismatches)
|
opt = k -- overwrite with key (in case of case mismatches)
|
||||||
ok = true
|
ok = true
|
||||||
@ -634,7 +627,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||||||
|
|
||||||
elseif tab.type=="color" then
|
elseif tab.type=="color" then
|
||||||
------------ color --------------------------------------------
|
------------ color --------------------------------------------
|
||||||
local str = strtrim(strlower(str))
|
local str = strtrim(strlower(strInput))
|
||||||
if str == "" then
|
if str == "" then
|
||||||
--TODO: Show current value
|
--TODO: Show current value
|
||||||
return
|
return
|
||||||
@ -706,7 +699,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||||||
|
|
||||||
elseif tab.type=="keybinding" then
|
elseif tab.type=="keybinding" then
|
||||||
------------ keybinding --------------------------------------------
|
------------ keybinding --------------------------------------------
|
||||||
local str = strtrim(strlower(str))
|
local str = strtrim(strlower(strInput))
|
||||||
if str == "" then
|
if str == "" then
|
||||||
--TODO: Show current value
|
--TODO: Show current value
|
||||||
return
|
return
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
|
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceConfigDialog-3.0
|
-- @name AceConfigDialog-3.0
|
||||||
-- @release $Id: AceConfigDialog-3.0.lua 1232 2020-04-14 22:21:22Z nevcairiel $
|
-- @release $Id: AceConfigDialog-3.0.lua 1292 2022-09-29 08:00:11Z nevcairiel $
|
||||||
|
|
||||||
local LibStub = LibStub
|
local LibStub = LibStub
|
||||||
local gui = LibStub("AceGUI-3.0")
|
local gui = LibStub("AceGUI-3.0")
|
||||||
local reg = LibStub("AceConfigRegistry-3.0")
|
local reg = LibStub("AceConfigRegistry-3.0")
|
||||||
|
|
||||||
local MAJOR, MINOR = "AceConfigDialog-3.0", 79
|
local MAJOR, MINOR = "AceConfigDialog-3.0", 85
|
||||||
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||||
|
|
||||||
if not AceConfigDialog then return end
|
if not AceConfigDialog then return end
|
||||||
@ -22,19 +22,13 @@ AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {}
|
|||||||
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {}
|
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {}
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local tinsert, tsort, tremove = 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 strmatch, format = string.match, string.format
|
||||||
local error = error
|
local error = error
|
||||||
local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs
|
local pairs, next, select, type, unpack, ipairs = pairs, next, select, type, unpack, ipairs
|
||||||
local tostring, tonumber = tostring, tonumber
|
local tostring, tonumber = tostring, tonumber
|
||||||
local math_min, math_max, math_floor = math.min, math.max, math.floor
|
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, ACCEPT, CANCEL
|
|
||||||
-- GLOBALS: PlaySound, GameFontHighlight, GameFontHighlightSmall, GameFontHighlightLarge
|
|
||||||
-- GLOBALS: CloseSpecialWindows, InterfaceOptions_AddCategory, geterrorhandler
|
|
||||||
|
|
||||||
local emptyTbl = {}
|
local emptyTbl = {}
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
@ -194,9 +188,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
|
|||||||
--We have a function to call
|
--We have a function to call
|
||||||
local info = new()
|
local info = new()
|
||||||
--traverse the options table, picking up the handler and filling the info with the path
|
--traverse the options table, picking up the handler and filling the info with the path
|
||||||
local handler
|
|
||||||
local group = options
|
local group = options
|
||||||
handler = group.handler or handler
|
local handler = group.handler
|
||||||
|
|
||||||
for i = 1, #path do
|
for i = 1, #path do
|
||||||
group = GetSubOption(group, path[i])
|
group = GetSubOption(group, path[i])
|
||||||
@ -535,8 +528,7 @@ local function OptionOnMouseLeave(widget, event)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function GetFuncName(option)
|
local function GetFuncName(option)
|
||||||
local type = option.type
|
if option.type == "execute" then
|
||||||
if type == "execute" then
|
|
||||||
return "func"
|
return "func"
|
||||||
else
|
else
|
||||||
return "set"
|
return "set"
|
||||||
@ -544,13 +536,15 @@ local function GetFuncName(option)
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local frame = AceConfigDialog.popup
|
local frame = AceConfigDialog.popup
|
||||||
if not frame then
|
if not frame or oldminor < 81 then
|
||||||
frame = CreateFrame("Frame", nil, UIParent)
|
frame = CreateFrame("Frame", nil, UIParent)
|
||||||
AceConfigDialog.popup = frame
|
AceConfigDialog.popup = frame
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
frame:SetPoint("CENTER", UIParent, "CENTER")
|
frame:SetPoint("CENTER", UIParent, "CENTER")
|
||||||
frame:SetSize(320, 72)
|
frame:SetSize(320, 72)
|
||||||
|
frame:EnableMouse(true) -- Do not allow click-through on the frame
|
||||||
frame:SetFrameStrata("TOOLTIP")
|
frame:SetFrameStrata("TOOLTIP")
|
||||||
|
frame:SetFrameLevel(100) -- Lots of room to draw under it
|
||||||
frame:SetScript("OnKeyDown", function(self, key)
|
frame:SetScript("OnKeyDown", function(self, key)
|
||||||
if key == "ESCAPE" then
|
if key == "ESCAPE" then
|
||||||
self:SetPropagateKeyboardInput(false)
|
self:SetPropagateKeyboardInput(false)
|
||||||
@ -564,26 +558,17 @@ do
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
|
local border = CreateFrame("Frame", nil, frame, "DialogBorderOpaqueTemplate")
|
||||||
frame:SetBackdrop({
|
border:SetAllPoints(frame)
|
||||||
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
|
frame:SetFixedFrameStrata(true)
|
||||||
edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
|
frame:SetFixedFrameLevel(true)
|
||||||
tile = true,
|
|
||||||
tileSize = 32,
|
|
||||||
edgeSize = 32,
|
|
||||||
insets = { left = 11, right = 11, top = 11, bottom = 11 },
|
|
||||||
})
|
|
||||||
else
|
|
||||||
local border = CreateFrame("Frame", nil, frame, "DialogBorderDarkTemplate")
|
|
||||||
border:SetAllPoints(frame)
|
|
||||||
end
|
|
||||||
|
|
||||||
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
|
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
|
||||||
text:SetSize(290, 0)
|
text:SetSize(290, 0)
|
||||||
text:SetPoint("TOP", 0, -16)
|
text:SetPoint("TOP", 0, -16)
|
||||||
frame.text = text
|
frame.text = text
|
||||||
|
|
||||||
local function newButton(text)
|
local function newButton(newText)
|
||||||
local button = CreateFrame("Button", nil, frame)
|
local button = CreateFrame("Button", nil, frame)
|
||||||
button:SetSize(128, 21)
|
button:SetSize(128, 21)
|
||||||
button:SetNormalFontObject(GameFontNormal)
|
button:SetNormalFontObject(GameFontNormal)
|
||||||
@ -594,7 +579,7 @@ do
|
|||||||
button:GetPushedTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
|
button:GetPushedTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
|
||||||
button:SetHighlightTexture(130762) -- "Interface\\Buttons\\UI-DialogBox-Button-Highlight"
|
button:SetHighlightTexture(130762) -- "Interface\\Buttons\\UI-DialogBox-Button-Highlight"
|
||||||
button:GetHighlightTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
|
button:GetHighlightTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
|
||||||
button:SetText(text)
|
button:SetText(newText)
|
||||||
return button
|
return button
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -681,7 +666,7 @@ local function ActivateControl(widget, event, ...)
|
|||||||
if group[funcname] ~= nil then
|
if group[funcname] ~= nil then
|
||||||
func = group[funcname]
|
func = group[funcname]
|
||||||
end
|
end
|
||||||
handler = group.handler or handler
|
handler = group.handler
|
||||||
confirm = group.confirm
|
confirm = group.confirm
|
||||||
validate = group.validate
|
validate = group.validate
|
||||||
for i = 1, #path do
|
for i = 1, #path do
|
||||||
@ -745,7 +730,6 @@ local function ActivateControl(widget, event, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local rootframe = user.rootframe
|
|
||||||
if not validated or type(validated) == "string" then
|
if not validated or type(validated) == "string" then
|
||||||
if not validated then
|
if not validated then
|
||||||
if usage then
|
if usage then
|
||||||
@ -760,8 +744,8 @@ local function ActivateControl(widget, event, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- show validate message
|
-- show validate message
|
||||||
if rootframe.SetStatusText then
|
if user.rootframe.SetStatusText then
|
||||||
rootframe:SetStatusText(validated)
|
user.rootframe:SetStatusText(validated)
|
||||||
else
|
else
|
||||||
validationErrorPopup(validated)
|
validationErrorPopup(validated)
|
||||||
end
|
end
|
||||||
@ -798,14 +782,14 @@ local function ActivateControl(widget, event, ...)
|
|||||||
if type(confirm) == "boolean" then
|
if type(confirm) == "boolean" then
|
||||||
if confirm then
|
if confirm then
|
||||||
if not confirmText then
|
if not confirmText then
|
||||||
local name, desc = option.name, option.desc
|
local option_name, desc = option.name, option.desc
|
||||||
if type(name) == "function" then
|
if type(option_name) == "function" then
|
||||||
name = name(info)
|
option_name = option_name(info)
|
||||||
end
|
end
|
||||||
if type(desc) == "function" then
|
if type(desc) == "function" then
|
||||||
desc = desc(info)
|
desc = desc(info)
|
||||||
end
|
end
|
||||||
confirmText = name
|
confirmText = option_name
|
||||||
if desc then
|
if desc then
|
||||||
confirmText = confirmText.." - "..desc
|
confirmText = confirmText.." - "..desc
|
||||||
end
|
end
|
||||||
@ -1147,8 +1131,6 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||||||
--Control to feed
|
--Control to feed
|
||||||
local control
|
local control
|
||||||
|
|
||||||
local name = GetOptionsMemberValue("name", v, options, path, appName)
|
|
||||||
|
|
||||||
if v.type == "execute" then
|
if v.type == "execute" then
|
||||||
|
|
||||||
local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
|
local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
|
||||||
@ -1251,7 +1233,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||||||
end
|
end
|
||||||
tsort(sorting, sortTblAsStrings)
|
tsort(sorting, sortTblAsStrings)
|
||||||
end
|
end
|
||||||
for k, value in ipairs(sorting) do
|
for _, value in ipairs(sorting) do
|
||||||
local text = values[value]
|
local text = values[value]
|
||||||
local radio = gui:Create("CheckBox")
|
local radio = gui:Create("CheckBox")
|
||||||
radio:SetLabel(text)
|
radio:SetLabel(text)
|
||||||
@ -1333,8 +1315,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||||||
control:SetWidth(width_multiplier)
|
control:SetWidth(width_multiplier)
|
||||||
end
|
end
|
||||||
--check:SetTriState(v.tristate)
|
--check:SetTriState(v.tristate)
|
||||||
for i = 1, #valuesort do
|
for s = 1, #valuesort do
|
||||||
local key = valuesort[i]
|
local key = valuesort[s]
|
||||||
local value = GetOptionsMemberValue("get",v, options, path, appName, key)
|
local value = GetOptionsMemberValue("get",v, options, path, appName, key)
|
||||||
control:SetItemValue(key,value)
|
control:SetItemValue(key,value)
|
||||||
end
|
end
|
||||||
@ -1346,8 +1328,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||||||
|
|
||||||
control:PauseLayout()
|
control:PauseLayout()
|
||||||
local width = GetOptionsMemberValue("width",v,options,path,appName)
|
local width = GetOptionsMemberValue("width",v,options,path,appName)
|
||||||
for i = 1, #valuesort do
|
for s = 1, #valuesort do
|
||||||
local value = valuesort[i]
|
local value = valuesort[s]
|
||||||
local text = values[value]
|
local text = values[value]
|
||||||
local check = gui:Create("CheckBox")
|
local check = gui:Create("CheckBox")
|
||||||
check:SetLabel(text)
|
check:SetLabel(text)
|
||||||
@ -1364,7 +1346,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||||||
elseif width == "half" then
|
elseif width == "half" then
|
||||||
check:SetWidth(width_multiplier / 2)
|
check:SetWidth(width_multiplier / 2)
|
||||||
elseif (type(width) == "number") then
|
elseif (type(width) == "number") then
|
||||||
control:SetWidth(width_multiplier * width)
|
check:SetWidth(width_multiplier * width)
|
||||||
elseif width == "full" then
|
elseif width == "full" then
|
||||||
check.width = "fill"
|
check.width = "fill"
|
||||||
else
|
else
|
||||||
@ -1434,8 +1416,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||||||
end
|
end
|
||||||
control:SetImageSize(width, height)
|
control:SetImageSize(width, height)
|
||||||
end
|
end
|
||||||
local width = GetOptionsMemberValue("width",v,options,path,appName)
|
local controlWidth = GetOptionsMemberValue("width",v,options,path,appName)
|
||||||
control.width = not width and "fill"
|
control.width = not controlWidth and "fill"
|
||||||
end
|
end
|
||||||
|
|
||||||
--Common Init
|
--Common Init
|
||||||
@ -1690,29 +1672,29 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
|
|||||||
|
|
||||||
elseif grouptype == "select" then
|
elseif grouptype == "select" then
|
||||||
|
|
||||||
local select = gui:Create("DropdownGroup")
|
local selectGroup = gui:Create("DropdownGroup")
|
||||||
select:SetTitle(name)
|
selectGroup:SetTitle(name)
|
||||||
InjectInfo(select, options, group, path, rootframe, appName)
|
InjectInfo(selectGroup, options, group, path, rootframe, appName)
|
||||||
select:SetCallback("OnGroupSelected", GroupSelected)
|
selectGroup:SetCallback("OnGroupSelected", GroupSelected)
|
||||||
local status = AceConfigDialog:GetStatusTable(appName, path)
|
local status = AceConfigDialog:GetStatusTable(appName, path)
|
||||||
if not status.groups then
|
if not status.groups then
|
||||||
status.groups = {}
|
status.groups = {}
|
||||||
end
|
end
|
||||||
select:SetStatusTable(status.groups)
|
selectGroup:SetStatusTable(status.groups)
|
||||||
local grouplist, orderlist = BuildSelect(group, options, path, appName)
|
local grouplist, orderlist = BuildSelect(group, options, path, appName)
|
||||||
select:SetGroupList(grouplist, orderlist)
|
selectGroup:SetGroupList(grouplist, orderlist)
|
||||||
select:SetUserData("grouplist", grouplist)
|
selectGroup:SetUserData("grouplist", grouplist)
|
||||||
select:SetUserData("orderlist", orderlist)
|
selectGroup:SetUserData("orderlist", orderlist)
|
||||||
|
|
||||||
local firstgroup = orderlist[1]
|
local firstgroup = orderlist[1]
|
||||||
if firstgroup then
|
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
|
end
|
||||||
|
|
||||||
select.width = "fill"
|
selectGroup.width = "fill"
|
||||||
select.height = "fill"
|
selectGroup.height = "fill"
|
||||||
|
|
||||||
container:AddChild(select)
|
container:AddChild(selectGroup)
|
||||||
|
|
||||||
--assume tree group by default
|
--assume tree group by default
|
||||||
--if parenttype is tree then this group is already a node on that tree
|
--if parenttype is tree then this group is already a node on that tree
|
||||||
@ -1940,13 +1922,13 @@ end
|
|||||||
-- convert pre-39 BlizOptions structure to the new format
|
-- convert pre-39 BlizOptions structure to the new format
|
||||||
if oldminor and oldminor < 39 and AceConfigDialog.BlizOptions then
|
if oldminor and oldminor < 39 and AceConfigDialog.BlizOptions then
|
||||||
local old = AceConfigDialog.BlizOptions
|
local old = AceConfigDialog.BlizOptions
|
||||||
local new = {}
|
local newOpt = {}
|
||||||
for key, widget in pairs(old) do
|
for key, widget in pairs(old) do
|
||||||
local appName = widget:GetUserData("appName")
|
local appName = widget:GetUserData("appName")
|
||||||
if not new[appName] then new[appName] = {} end
|
if not newOpt[appName] then newOpt[appName] = {} end
|
||||||
new[appName][key] = widget
|
newOpt[appName][key] = widget
|
||||||
end
|
end
|
||||||
AceConfigDialog.BlizOptions = new
|
AceConfigDialog.BlizOptions = newOpt
|
||||||
else
|
else
|
||||||
AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {}
|
AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {}
|
||||||
end
|
end
|
||||||
@ -1979,6 +1961,7 @@ end
|
|||||||
-- @param parent The parent to use in the interface options tree.
|
-- @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.
|
-- @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 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, ...)
|
function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
||||||
local BlizOptions = AceConfigDialog.BlizOptions
|
local BlizOptions = AceConfigDialog.BlizOptions
|
||||||
|
|
||||||
@ -1994,7 +1977,6 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
|||||||
if not BlizOptions[appName][key] then
|
if not BlizOptions[appName][key] then
|
||||||
local group = gui:Create("BlizOptionsGroup")
|
local group = gui:Create("BlizOptionsGroup")
|
||||||
BlizOptions[appName][key] = group
|
BlizOptions[appName][key] = group
|
||||||
group:SetName(name or appName, parent)
|
|
||||||
|
|
||||||
group:SetTitle(name or appName)
|
group:SetTitle(name or appName)
|
||||||
group:SetUserData("appName", appName)
|
group:SetUserData("appName", appName)
|
||||||
@ -2007,8 +1989,30 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
|||||||
end
|
end
|
||||||
group:SetCallback("OnShow", FeedToBlizPanel)
|
group:SetCallback("OnShow", FeedToBlizPanel)
|
||||||
group:SetCallback("OnHide", ClearBlizPanel)
|
group:SetCallback("OnHide", ClearBlizPanel)
|
||||||
InterfaceOptions_AddCategory(group.frame)
|
if Settings and Settings.RegisterCanvasLayoutCategory then
|
||||||
return group.frame
|
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
|
else
|
||||||
error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2)
|
error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2)
|
||||||
end
|
end
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
-- end
|
-- end
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceDB-3.0.lua
|
-- @name AceDB-3.0.lua
|
||||||
-- @release $Id: AceDB-3.0.lua 1217 2019-07-11 03:06:18Z funkydude $
|
-- @release $Id: AceDB-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||||
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 27
|
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 27
|
||||||
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
|
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
|
||||||
|
|
||||||
@ -53,10 +53,6 @@ local setmetatable, rawset, rawget = setmetatable, rawset, rawget
|
|||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local _G = _G
|
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
|
|
||||||
|
|
||||||
AceDB.db_registry = AceDB.db_registry or {}
|
AceDB.db_registry = AceDB.db_registry or {}
|
||||||
AceDB.frame = AceDB.frame or CreateFrame("Frame")
|
AceDB.frame = AceDB.frame or CreateFrame("Frame")
|
||||||
|
|
||||||
@ -98,11 +94,11 @@ local function copyDefaults(dest, src)
|
|||||||
-- This is a metatable used for table defaults
|
-- This is a metatable used for table defaults
|
||||||
local mt = {
|
local mt = {
|
||||||
-- This handles the lookup and creation of new subtables
|
-- This handles the lookup and creation of new subtables
|
||||||
__index = function(t,k)
|
__index = function(t,k2)
|
||||||
if k == nil then return nil end
|
if k2 == nil then return nil end
|
||||||
local tbl = {}
|
local tbl = {}
|
||||||
copyDefaults(tbl, v)
|
copyDefaults(tbl, v)
|
||||||
rawset(t, k, tbl)
|
rawset(t, k2, tbl)
|
||||||
return tbl
|
return tbl
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
@ -115,7 +111,7 @@ local function copyDefaults(dest, src)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Values are not tables, so this is just a simple return
|
-- Values are not tables, so this is just a simple return
|
||||||
local mt = {__index = function(t,k) return k~=nil and v or nil end}
|
local mt = {__index = function(t,k2) return k2~=nil and v or nil end}
|
||||||
setmetatable(dest, mt)
|
setmetatable(dest, mt)
|
||||||
end
|
end
|
||||||
elseif type(v) == "table" then
|
elseif type(v) == "table" then
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
--- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles.
|
--- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles.
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceDBOptions-3.0
|
-- @name AceDBOptions-3.0
|
||||||
-- @release $Id: AceDBOptions-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
|
-- @release $Id: AceDBOptions-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||||
local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15
|
local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15
|
||||||
local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)
|
local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)
|
||||||
|
|
||||||
@ -13,10 +13,6 @@ local pairs, next = pairs, next
|
|||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local UnitClass = UnitClass
|
local UnitClass = UnitClass
|
||||||
|
|
||||||
-- 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_CODE, FONT_COLOR_CODE_CLOSE
|
|
||||||
|
|
||||||
AceDBOptions.optionTables = AceDBOptions.optionTables or {}
|
AceDBOptions.optionTables = AceDBOptions.optionTables or {}
|
||||||
AceDBOptions.handlers = AceDBOptions.handlers or {}
|
AceDBOptions.handlers = AceDBOptions.handlers or {}
|
||||||
|
|
||||||
|
@ -24,28 +24,22 @@
|
|||||||
-- f:AddChild(btn)
|
-- f:AddChild(btn)
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceGUI-3.0
|
-- @name AceGUI-3.0
|
||||||
-- @release $Id: AceGUI-3.0.lua 1231 2020-04-14 22:20:36Z nevcairiel $
|
-- @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_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 41
|
||||||
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
|
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
|
||||||
|
|
||||||
if not AceGUI then return end -- No upgrade needed
|
if not AceGUI then return end -- No upgrade needed
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local tinsert = table.insert
|
local tinsert, wipe = table.insert, table.wipe
|
||||||
local select, pairs, next, type = select, pairs, next, type
|
local select, pairs, next, type = select, pairs, next, type
|
||||||
local error, assert = error, assert
|
local error, assert = error, assert
|
||||||
local setmetatable, rawget = setmetatable, rawget
|
local setmetatable, rawget = setmetatable, rawget
|
||||||
local math_max = math.max
|
local math_max, math_min, math_ceil = math.max, math.min, math.ceil
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local UIParent = UIParent
|
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.WidgetRegistry = AceGUI.WidgetRegistry or {}
|
||||||
AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
|
AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
|
||||||
AceGUI.WidgetBase = AceGUI.WidgetBase or {}
|
AceGUI.WidgetBase = AceGUI.WidgetBase or {}
|
||||||
@ -94,38 +88,38 @@ do
|
|||||||
AceGUI.objPools = AceGUI.objPools or {}
|
AceGUI.objPools = AceGUI.objPools or {}
|
||||||
local objPools = AceGUI.objPools
|
local objPools = AceGUI.objPools
|
||||||
--Returns a new instance, if none are available either returns a new table or calls the given contructor
|
--Returns a new instance, if none are available either returns a new table or calls the given contructor
|
||||||
function newWidget(type)
|
function newWidget(widgetType)
|
||||||
if not WidgetRegistry[type] then
|
if not WidgetRegistry[widgetType] then
|
||||||
error("Attempt to instantiate unknown widget type", 2)
|
error("Attempt to instantiate unknown widget type", 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not objPools[type] then
|
if not objPools[widgetType] then
|
||||||
objPools[type] = {}
|
objPools[widgetType] = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
local newObj = next(objPools[type])
|
local newObj = next(objPools[widgetType])
|
||||||
if not newObj then
|
if not newObj then
|
||||||
newObj = WidgetRegistry[type]()
|
newObj = WidgetRegistry[widgetType]()
|
||||||
newObj.AceGUIWidgetVersion = WidgetVersions[type]
|
newObj.AceGUIWidgetVersion = WidgetVersions[widgetType]
|
||||||
else
|
else
|
||||||
objPools[type][newObj] = nil
|
objPools[widgetType][newObj] = nil
|
||||||
-- if the widget is older then the latest, don't even try to reuse it
|
-- if the widget is older then the latest, don't even try to reuse it
|
||||||
-- just forget about it, and grab a new one.
|
-- just forget about it, and grab a new one.
|
||||||
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[type] then
|
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[widgetType] then
|
||||||
return newWidget(type)
|
return newWidget(widgetType)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return newObj
|
return newObj
|
||||||
end
|
end
|
||||||
-- Releases an instance to the Pool
|
-- Releases an instance to the Pool
|
||||||
function delWidget(obj,type)
|
function delWidget(obj,widgetType)
|
||||||
if not objPools[type] then
|
if not objPools[widgetType] then
|
||||||
objPools[type] = {}
|
objPools[widgetType] = {}
|
||||||
end
|
end
|
||||||
if objPools[type][obj] then
|
if objPools[widgetType][obj] then
|
||||||
error("Attempt to Release Widget that is already released", 2)
|
error("Attempt to Release Widget that is already released", 2)
|
||||||
end
|
end
|
||||||
objPools[type][obj] = true
|
objPools[widgetType][obj] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -141,9 +135,9 @@ end
|
|||||||
-- OnAcquire function on it, before returning.
|
-- OnAcquire function on it, before returning.
|
||||||
-- @param type The type of the widget.
|
-- @param type The type of the widget.
|
||||||
-- @return The newly created widget.
|
-- @return The newly created widget.
|
||||||
function AceGUI:Create(type)
|
function AceGUI:Create(widgetType)
|
||||||
if WidgetRegistry[type] then
|
if WidgetRegistry[widgetType] then
|
||||||
local widget = newWidget(type)
|
local widget = newWidget(widgetType)
|
||||||
|
|
||||||
if rawget(widget, "Acquire") then
|
if rawget(widget, "Acquire") then
|
||||||
widget.OnAcquire = widget.Acquire
|
widget.OnAcquire = widget.Acquire
|
||||||
@ -161,7 +155,7 @@ function AceGUI:Create(type)
|
|||||||
if widget.OnAcquire then
|
if widget.OnAcquire then
|
||||||
widget:OnAcquire()
|
widget:OnAcquire()
|
||||||
else
|
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
|
end
|
||||||
-- Set the default Layout ("List")
|
-- Set the default Layout ("List")
|
||||||
safecall(widget.SetLayout, widget, "List")
|
safecall(widget.SetLayout, widget, "List")
|
||||||
@ -589,25 +583,25 @@ AceGUI.counts = AceGUI.counts or {}
|
|||||||
-- This is used by widgets that require a named frame, e.g. when a Blizzard
|
-- This is used by widgets that require a named frame, e.g. when a Blizzard
|
||||||
-- Template requires it.
|
-- Template requires it.
|
||||||
-- @param type The widget type
|
-- @param type The widget type
|
||||||
function AceGUI:GetNextWidgetNum(type)
|
function AceGUI:GetNextWidgetNum(widgetType)
|
||||||
if not self.counts[type] then
|
if not self.counts[widgetType] then
|
||||||
self.counts[type] = 0
|
self.counts[widgetType] = 0
|
||||||
end
|
end
|
||||||
self.counts[type] = self.counts[type] + 1
|
self.counts[widgetType] = self.counts[widgetType] + 1
|
||||||
return self.counts[type]
|
return self.counts[widgetType]
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Return the number of created widgets for this type.
|
--- Return the number of created widgets for this type.
|
||||||
-- In contrast to GetNextWidgetNum, the number is not incremented.
|
-- In contrast to GetNextWidgetNum, the number is not incremented.
|
||||||
-- @param type The widget type
|
-- @param widgetType The widget type
|
||||||
function AceGUI:GetWidgetCount(type)
|
function AceGUI:GetWidgetCount(widgetType)
|
||||||
return self.counts[type] or 0
|
return self.counts[widgetType] or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Return the version of the currently registered widget type.
|
--- Return the version of the currently registered widget type.
|
||||||
-- @param type The widget type
|
-- @param widgetType The widget type
|
||||||
function AceGUI:GetWidgetVersion(type)
|
function AceGUI:GetWidgetVersion(widgetType)
|
||||||
return WidgetVersions[type]
|
return WidgetVersions[widgetType]
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
@ -770,7 +764,6 @@ AceGUI:RegisterLayout("Flow",
|
|||||||
|
|
||||||
usedwidth = 0
|
usedwidth = 0
|
||||||
rowstart = frame
|
rowstart = frame
|
||||||
rowstartoffset = frameoffset
|
|
||||||
|
|
||||||
if child.DoLayout then
|
if child.DoLayout then
|
||||||
child:DoLayout()
|
child:DoLayout()
|
||||||
@ -813,7 +806,8 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
|
|||||||
or colObj and (colObj["align" .. dir] or colObj.align)
|
or colObj and (colObj["align" .. dir] or colObj.align)
|
||||||
or tableObj["align" .. dir] or tableObj.align
|
or tableObj["align" .. dir] or tableObj.align
|
||||||
or "CENTERLEFT"
|
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
|
if type(fn) == "string" then
|
||||||
fn = fn:lower()
|
fn = fn:lower()
|
||||||
@ -827,7 +821,7 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
|
|||||||
val = fn
|
val = fn
|
||||||
end
|
end
|
||||||
|
|
||||||
return fn, max(0, min(val, cell))
|
return fn, math_max(0, math_min(val, cell))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Get width or height for multiple cells combined
|
-- Get width or height for multiple cells combined
|
||||||
@ -836,7 +830,7 @@ local GetCellDimension = function (dir, laneDim, from, to, space)
|
|||||||
for cell=from,to do
|
for cell=from,to do
|
||||||
dim = dim + (laneDim[cell] or 0)
|
dim = dim + (laneDim[cell] or 0)
|
||||||
end
|
end
|
||||||
return dim + max(0, to - from) * (space or 0)
|
return dim + math_max(0, to - from) * (space or 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Options
|
--[[ Options
|
||||||
@ -882,7 +876,7 @@ AceGUI:RegisterLayout("Table",
|
|||||||
repeat
|
repeat
|
||||||
n = n + 1
|
n = n + 1
|
||||||
local col = (n - 1) % #cols + 1
|
local col = (n - 1) % #cols + 1
|
||||||
local row = ceil(n / #cols)
|
local row = math_ceil(n / #cols)
|
||||||
local rowspan = rowspans[col]
|
local rowspan = rowspans[col]
|
||||||
local cell = rowspan and rowspan.child or child
|
local cell = rowspan and rowspan.child or child
|
||||||
local cellObj = cell:GetUserData("cell")
|
local cellObj = cell:GetUserData("cell")
|
||||||
@ -898,7 +892,7 @@ AceGUI:RegisterLayout("Table",
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Colspan
|
-- 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
|
n = n + colspan
|
||||||
|
|
||||||
-- Place the cell
|
-- Place the cell
|
||||||
@ -915,7 +909,7 @@ AceGUI:RegisterLayout("Table",
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local rows = ceil(n / #cols)
|
local rows = math_ceil(n / #cols)
|
||||||
|
|
||||||
-- Determine fixed size cols and collect weights
|
-- Determine fixed size cols and collect weights
|
||||||
local extantH, totalWeight = totalH, 0
|
local extantH, totalWeight = totalH, 0
|
||||||
@ -940,16 +934,16 @@ AceGUI:RegisterLayout("Table",
|
|||||||
f:ClearAllPoints()
|
f:ClearAllPoints()
|
||||||
local childH = f:GetWidth() or 0
|
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
|
||||||
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
|
else
|
||||||
-- Rel./Abs. width
|
-- Rel./Abs. width
|
||||||
laneH[col] = colObj.width < 1 and colObj.width * totalH or colObj.width
|
laneH[col] = colObj.width < 1 and colObj.width * totalH or colObj.width
|
||||||
end
|
end
|
||||||
extantH = max(0, extantH - laneH[col])
|
extantH = math_max(0, extantH - laneH[col])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -988,7 +982,7 @@ AceGUI:RegisterLayout("Table",
|
|||||||
child:DoLayout()
|
child:DoLayout()
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
BlizOptionsGroup Container
|
BlizOptionsGroup Container
|
||||||
Simple container widget for the integration of AceGUI into the Blizzard Interface Options
|
Simple container widget for the integration of AceGUI into the Blizzard Interface Options
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
local Type, Version = "BlizOptionsGroup", 21
|
local Type, Version = "BlizOptionsGroup", 26
|
||||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ local methods = {
|
|||||||
Constructor
|
Constructor
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
local function Constructor()
|
local function Constructor()
|
||||||
local frame = CreateFrame("Frame")
|
local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
|
|
||||||
-- support functions for the Blizzard Interface Options
|
-- support functions for the Blizzard Interface Options
|
||||||
@ -108,6 +108,11 @@ local function Constructor()
|
|||||||
frame.default = default
|
frame.default = default
|
||||||
frame.refresh = refresh
|
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("OnHide", OnHide)
|
||||||
frame:SetScript("OnShow", OnShow)
|
frame:SetScript("OnShow", OnShow)
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ local function Constructor()
|
|||||||
dropdown.frame:Show()
|
dropdown.frame:Show()
|
||||||
dropdown:SetLabel("")
|
dropdown:SetLabel("")
|
||||||
|
|
||||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||||
border:SetPoint("TOPLEFT", 0, -26)
|
border:SetPoint("TOPLEFT", 0, -26)
|
||||||
border:SetPoint("BOTTOMRIGHT", 0, 3)
|
border:SetPoint("BOTTOMRIGHT", 0, 3)
|
||||||
border:SetBackdrop(PaneBackdrop)
|
border:SetBackdrop(PaneBackdrop)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
--[[-----------------------------------------------------------------------------
|
--[[-----------------------------------------------------------------------------
|
||||||
Frame Container
|
Frame Container
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
local Type, Version = "Frame", 27
|
local Type, Version = "Frame", 30
|
||||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
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 PlaySound = PlaySound
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
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
|
Scripts
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
@ -83,6 +79,7 @@ local methods = {
|
|||||||
["OnAcquire"] = function(self)
|
["OnAcquire"] = function(self)
|
||||||
self.frame:SetParent(UIParent)
|
self.frame:SetParent(UIParent)
|
||||||
self.frame:SetFrameStrata("FULLSCREEN_DIALOG")
|
self.frame:SetFrameStrata("FULLSCREEN_DIALOG")
|
||||||
|
self.frame:SetFrameLevel(100) -- Lots of room to draw under it
|
||||||
self:SetTitle()
|
self:SetTitle()
|
||||||
self:SetStatusText()
|
self:SetStatusText()
|
||||||
self:ApplyStatus()
|
self:ApplyStatus()
|
||||||
@ -179,16 +176,21 @@ local PaneBackdrop = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local function Constructor()
|
local function Constructor()
|
||||||
local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
|
|
||||||
frame:EnableMouse(true)
|
frame:EnableMouse(true)
|
||||||
frame:SetMovable(true)
|
frame:SetMovable(true)
|
||||||
frame:SetResizable(true)
|
frame:SetResizable(true)
|
||||||
frame:SetFrameStrata("FULLSCREEN_DIALOG")
|
frame:SetFrameStrata("FULLSCREEN_DIALOG")
|
||||||
|
frame:SetFrameLevel(100) -- Lots of room to draw under it
|
||||||
frame:SetBackdrop(FrameBackdrop)
|
frame:SetBackdrop(FrameBackdrop)
|
||||||
frame:SetBackdropColor(0, 0, 0, 1)
|
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:SetToplevel(true)
|
||||||
frame:SetScript("OnShow", Frame_OnShow)
|
frame:SetScript("OnShow", Frame_OnShow)
|
||||||
frame:SetScript("OnHide", Frame_OnClose)
|
frame:SetScript("OnHide", Frame_OnClose)
|
||||||
@ -201,7 +203,7 @@ local function Constructor()
|
|||||||
closebutton:SetWidth(100)
|
closebutton:SetWidth(100)
|
||||||
closebutton:SetText(CLOSE)
|
closebutton:SetText(CLOSE)
|
||||||
|
|
||||||
local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local statusbg = CreateFrame("Button", nil, frame, "BackdropTemplate")
|
||||||
statusbg:SetPoint("BOTTOMLEFT", 15, 15)
|
statusbg:SetPoint("BOTTOMLEFT", 15, 15)
|
||||||
statusbg:SetPoint("BOTTOMRIGHT", -132, 15)
|
statusbg:SetPoint("BOTTOMRIGHT", -132, 15)
|
||||||
statusbg:SetHeight(24)
|
statusbg:SetHeight(24)
|
||||||
@ -269,7 +271,7 @@ local function Constructor()
|
|||||||
line2:SetHeight(8)
|
line2:SetHeight(8)
|
||||||
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
||||||
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
||||||
local x = 0.1 * 8/17
|
x = 0.1 * 8/17
|
||||||
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
|
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)
|
local sizer_s = CreateFrame("Frame", nil, frame)
|
||||||
|
@ -75,7 +75,7 @@ local function Constructor()
|
|||||||
titletext:SetJustifyH("LEFT")
|
titletext:SetJustifyH("LEFT")
|
||||||
titletext:SetHeight(18)
|
titletext:SetHeight(18)
|
||||||
|
|
||||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||||
border:SetPoint("TOPLEFT", 0, -17)
|
border:SetPoint("TOPLEFT", 0, -17)
|
||||||
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
||||||
border:SetBackdrop(PaneBackdrop)
|
border:SetBackdrop(PaneBackdrop)
|
||||||
|
@ -2,22 +2,18 @@
|
|||||||
TabGroup Container
|
TabGroup Container
|
||||||
Container that uses tabs on top to switch between groups.
|
Container that uses tabs on top to switch between groups.
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
local Type, Version = "TabGroup", 37
|
local Type, Version = "TabGroup", 38
|
||||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||||
|
|
||||||
-- Lua APIs
|
-- 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
|
-- WoW APIs
|
||||||
local PlaySound = PlaySound
|
local PlaySound = PlaySound
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
local _G = _G
|
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 upvalue storage used by BuildTabs
|
||||||
local widths = {}
|
local widths = {}
|
||||||
local rowwidths = {}
|
local rowwidths = {}
|
||||||
@ -26,6 +22,143 @@ local rowends = {}
|
|||||||
--[[-----------------------------------------------------------------------------
|
--[[-----------------------------------------------------------------------------
|
||||||
Support functions
|
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)
|
local function UpdateTabLook(frame)
|
||||||
if frame.disabled then
|
if frame.disabled then
|
||||||
PanelTemplates_SetDisabledTabState(frame)
|
PanelTemplates_SetDisabledTabState(frame)
|
||||||
@ -103,11 +236,64 @@ local methods = {
|
|||||||
|
|
||||||
["CreateTab"] = function(self, id)
|
["CreateTab"] = function(self, id)
|
||||||
local tabname = ("AceGUITabGroup%dTab%d"):format(self.num, 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.obj = self
|
||||||
tab.id = id
|
tab.id = id
|
||||||
|
|
||||||
tab.text = _G[tabname .. "Text"]
|
tab.text = tab.Text -- compat
|
||||||
tab.text:ClearAllPoints()
|
tab.text:ClearAllPoints()
|
||||||
tab.text:SetPoint("LEFT", 14, -3)
|
tab.text:SetPoint("LEFT", 14, -3)
|
||||||
tab.text:SetPoint("RIGHT", -12, -3)
|
tab.text:SetPoint("RIGHT", -12, -3)
|
||||||
@ -316,7 +502,7 @@ local function Constructor()
|
|||||||
titletext:SetHeight(18)
|
titletext:SetHeight(18)
|
||||||
titletext:SetText("")
|
titletext:SetText("")
|
||||||
|
|
||||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||||
border:SetPoint("TOPLEFT", 1, -27)
|
border:SetPoint("TOPLEFT", 1, -27)
|
||||||
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
||||||
border:SetBackdrop(PaneBackdrop)
|
border:SetBackdrop(PaneBackdrop)
|
||||||
|
@ -2,22 +2,18 @@
|
|||||||
TreeGroup Container
|
TreeGroup Container
|
||||||
Container that uses a tree control to switch between groups.
|
Container that uses a tree control to switch between groups.
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
local Type, Version = "TreeGroup", 45
|
local Type, Version = "TreeGroup", 47
|
||||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
|
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
|
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
|
|
||||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
|
||||||
-- List them here for Mikk's FindGlobals script
|
|
||||||
-- GLOBALS: FONT_COLOR_CODE_CLOSE
|
|
||||||
|
|
||||||
-- Recycling functions
|
-- Recycling functions
|
||||||
local new, del
|
local new, del
|
||||||
do
|
do
|
||||||
@ -567,7 +563,11 @@ local methods = {
|
|||||||
if maxtreewidth > 100 and status.treewidth > maxtreewidth then
|
if maxtreewidth > 100 and status.treewidth > maxtreewidth then
|
||||||
self:SetTreeWidth(maxtreewidth, status.treesizable)
|
self:SetTreeWidth(maxtreewidth, status.treesizable)
|
||||||
end
|
end
|
||||||
treeframe:SetMaxResize(maxtreewidth, 1600)
|
if treeframe.SetResizeBounds then
|
||||||
|
treeframe:SetResizeBounds(100, 1, maxtreewidth, 1600)
|
||||||
|
else
|
||||||
|
treeframe:SetMaxResize(maxtreewidth, 1600)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["OnHeightSet"] = function(self, height)
|
["OnHeightSet"] = function(self, height)
|
||||||
@ -637,7 +637,7 @@ local function Constructor()
|
|||||||
local num = AceGUI:GetNextWidgetNum(Type)
|
local num = AceGUI:GetNextWidgetNum(Type)
|
||||||
local frame = CreateFrame("Frame", nil, UIParent)
|
local frame = CreateFrame("Frame", nil, UIParent)
|
||||||
|
|
||||||
local treeframe = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local treeframe = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||||
treeframe:SetPoint("TOPLEFT")
|
treeframe:SetPoint("TOPLEFT")
|
||||||
treeframe:SetPoint("BOTTOMLEFT")
|
treeframe:SetPoint("BOTTOMLEFT")
|
||||||
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
|
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
|
||||||
@ -646,13 +646,17 @@ local function Constructor()
|
|||||||
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
|
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
|
||||||
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||||
treeframe:SetResizable(true)
|
treeframe:SetResizable(true)
|
||||||
treeframe:SetMinResize(100, 1)
|
if treeframe.SetResizeBounds then -- WoW 10.0
|
||||||
treeframe:SetMaxResize(400, 1600)
|
treeframe:SetResizeBounds(100, 1, 400, 1600)
|
||||||
|
else
|
||||||
|
treeframe:SetMinResize(100, 1)
|
||||||
|
treeframe:SetMaxResize(400, 1600)
|
||||||
|
end
|
||||||
treeframe:SetScript("OnUpdate", FirstFrameUpdate)
|
treeframe:SetScript("OnUpdate", FirstFrameUpdate)
|
||||||
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
|
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
|
||||||
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
|
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
|
||||||
|
|
||||||
local dragger = CreateFrame("Frame", nil, treeframe, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local dragger = CreateFrame("Frame", nil, treeframe, "BackdropTemplate")
|
||||||
dragger:SetWidth(8)
|
dragger:SetWidth(8)
|
||||||
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
|
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
|
||||||
dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT")
|
dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT")
|
||||||
@ -677,7 +681,7 @@ local function Constructor()
|
|||||||
scrollbg:SetAllPoints(scrollbar)
|
scrollbg:SetAllPoints(scrollbar)
|
||||||
scrollbg:SetColorTexture(0,0,0,0.4)
|
scrollbg:SetColorTexture(0,0,0,0.4)
|
||||||
|
|
||||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||||
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
|
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
|
||||||
border:SetPoint("BOTTOMRIGHT")
|
border:SetPoint("BOTTOMRIGHT")
|
||||||
border:SetBackdrop(PaneBackdrop)
|
border:SetBackdrop(PaneBackdrop)
|
||||||
|
@ -7,10 +7,6 @@ local pairs, assert, type = pairs, assert, type
|
|||||||
local PlaySound = PlaySound
|
local PlaySound = PlaySound
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
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 --
|
-- Main Frame --
|
||||||
----------------
|
----------------
|
||||||
@ -21,7 +17,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
|
|||||||
]]
|
]]
|
||||||
do
|
do
|
||||||
local Type = "Window"
|
local Type = "Window"
|
||||||
local Version = 6
|
local Version = 8
|
||||||
|
|
||||||
local function frameOnShow(this)
|
local function frameOnShow(this)
|
||||||
this.obj:Fire("OnShow")
|
this.obj:Fire("OnShow")
|
||||||
@ -186,7 +182,11 @@ do
|
|||||||
|
|
||||||
frame:SetScript("OnShow",frameOnShow)
|
frame:SetScript("OnShow",frameOnShow)
|
||||||
frame:SetScript("OnHide",frameOnClose)
|
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)
|
frame:SetToplevel(true)
|
||||||
|
|
||||||
local titlebg = frame:CreateTexture(nil, "BACKGROUND")
|
local titlebg = frame:CreateTexture(nil, "BACKGROUND")
|
||||||
@ -300,7 +300,7 @@ do
|
|||||||
line2:SetHeight(8)
|
line2:SetHeight(8)
|
||||||
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
||||||
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
||||||
local x = 0.1 * 8/17
|
x = 0.1 * 8/17
|
||||||
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
|
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)
|
local sizer_s = CreateFrame("Frame",nil,frame)
|
||||||
|
@ -12,10 +12,6 @@ local select, pairs = select, pairs
|
|||||||
local PlaySound = PlaySound
|
local PlaySound = PlaySound
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
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
|
Support functions
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
@ -199,14 +195,14 @@ local methods = {
|
|||||||
["SetDescription"] = function(self, desc)
|
["SetDescription"] = function(self, desc)
|
||||||
if desc then
|
if desc then
|
||||||
if not self.desc then
|
if not self.desc then
|
||||||
local desc = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
local f = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
||||||
desc:ClearAllPoints()
|
f:ClearAllPoints()
|
||||||
desc:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
|
f:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
|
||||||
desc:SetWidth(self.frame.width - 30)
|
f:SetWidth(self.frame.width - 30)
|
||||||
desc:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
|
f:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
|
||||||
desc:SetJustifyH("LEFT")
|
f:SetJustifyH("LEFT")
|
||||||
desc:SetJustifyV("TOP")
|
f:SetJustifyV("TOP")
|
||||||
self.desc = desc
|
self.desc = f
|
||||||
end
|
end
|
||||||
self.desc:Show()
|
self.desc:Show()
|
||||||
--self.text:SetFontObject(GameFontNormal)
|
--self.text:SetFontObject(GameFontNormal)
|
||||||
|
@ -11,10 +11,6 @@ local pairs = pairs
|
|||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
|
|
||||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
|
||||||
-- List them here for Mikk's FindGlobals script
|
|
||||||
-- GLOBALS: ColorPickerFrame, OpacitySliderFrame
|
|
||||||
|
|
||||||
--[[-----------------------------------------------------------------------------
|
--[[-----------------------------------------------------------------------------
|
||||||
Support functions
|
Support functions
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1202 2019-05-15 23:11:22Z nevcairiel $ ]]--
|
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1272 2022-08-29 15:56:35Z nevcairiel $ ]]--
|
||||||
|
|
||||||
local AceGUI = LibStub("AceGUI-3.0")
|
local AceGUI = LibStub("AceGUI-3.0")
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ local ItemBase = {
|
|||||||
-- NOTE: The ItemBase version is added to each item's version number
|
-- NOTE: The ItemBase version is added to each item's version number
|
||||||
-- to ensure proper updates on ItemBase changes.
|
-- to ensure proper updates on ItemBase changes.
|
||||||
-- Use at least 1000er steps.
|
-- Use at least 1000er steps.
|
||||||
version = 1000,
|
version = 2000,
|
||||||
counter = 0,
|
counter = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ function ItemBase.Create(type)
|
|||||||
highlight:Hide()
|
highlight:Hide()
|
||||||
self.highlight = highlight
|
self.highlight = highlight
|
||||||
|
|
||||||
local check = frame:CreateTexture("OVERLAY")
|
local check = frame:CreateTexture(nil, "OVERLAY")
|
||||||
check:SetWidth(16)
|
check:SetWidth(16)
|
||||||
check:SetHeight(16)
|
check:SetHeight(16)
|
||||||
check:SetPoint("LEFT",frame,"LEFT",3,-1)
|
check:SetPoint("LEFT",frame,"LEFT",3,-1)
|
||||||
@ -186,7 +186,7 @@ function ItemBase.Create(type)
|
|||||||
check:Hide()
|
check:Hide()
|
||||||
self.check = check
|
self.check = check
|
||||||
|
|
||||||
local sub = frame:CreateTexture("OVERLAY")
|
local sub = frame:CreateTexture(nil, "OVERLAY")
|
||||||
sub:SetWidth(16)
|
sub:SetWidth(16)
|
||||||
sub:SetHeight(16)
|
sub:SetHeight(16)
|
||||||
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)
|
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
--[[ $Id: AceGUIWidget-DropDown.lua 1239 2020-09-20 10:22:02Z nevcairiel $ ]]--
|
--[[ $Id: AceGUIWidget-DropDown.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]--
|
||||||
local AceGUI = LibStub("AceGUI-3.0")
|
local AceGUI = LibStub("AceGUI-3.0")
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
@ -11,10 +11,6 @@ local PlaySound = PlaySound
|
|||||||
local UIParent, CreateFrame = UIParent, CreateFrame
|
local UIParent, CreateFrame = UIParent, CreateFrame
|
||||||
local _G = _G
|
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 function fixlevels(parent,...)
|
||||||
local i = 1
|
local i = 1
|
||||||
local child = select(i, ...)
|
local child = select(i, ...)
|
||||||
@ -253,7 +249,7 @@ do
|
|||||||
|
|
||||||
local function Constructor()
|
local function Constructor()
|
||||||
local count = AceGUI:GetNextWidgetNum(widgetType)
|
local count = AceGUI:GetNextWidgetNum(widgetType)
|
||||||
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, "BackdropTemplate")
|
||||||
local self = {}
|
local self = {}
|
||||||
self.count = count
|
self.count = count
|
||||||
self.type = widgetType
|
self.type = widgetType
|
||||||
@ -304,7 +300,7 @@ do
|
|||||||
scrollFrame.obj = self
|
scrollFrame.obj = self
|
||||||
itemFrame.obj = self
|
itemFrame.obj = self
|
||||||
|
|
||||||
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, "BackdropTemplate")
|
||||||
slider:SetOrientation("VERTICAL")
|
slider:SetOrientation("VERTICAL")
|
||||||
slider:SetHitRectInsets(0, 0, -10, 0)
|
slider:SetHitRectInsets(0, 0, -10, 0)
|
||||||
slider:SetBackdrop(sliderBackdrop)
|
slider:SetBackdrop(sliderBackdrop)
|
||||||
@ -351,7 +347,7 @@ end
|
|||||||
|
|
||||||
do
|
do
|
||||||
local widgetType = "Dropdown"
|
local widgetType = "Dropdown"
|
||||||
local widgetVersion = 35
|
local widgetVersion = 36
|
||||||
|
|
||||||
--[[ Static data ]]--
|
--[[ Static data ]]--
|
||||||
|
|
||||||
@ -376,7 +372,6 @@ do
|
|||||||
|
|
||||||
local function Dropdown_TogglePullout(this)
|
local function Dropdown_TogglePullout(this)
|
||||||
local self = this.obj
|
local self = this.obj
|
||||||
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
|
|
||||||
if self.open then
|
if self.open then
|
||||||
self.open = nil
|
self.open = nil
|
||||||
self.pullout:Close()
|
self.pullout:Close()
|
||||||
|
@ -14,10 +14,6 @@ local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, Get
|
|||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
local _G = _G
|
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
|
Support functions
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
|
@ -13,10 +13,6 @@ local pairs = pairs
|
|||||||
local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
|
local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
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
|
Scripts
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
@ -214,7 +210,7 @@ local function Constructor()
|
|||||||
label:SetJustifyH("CENTER")
|
label:SetJustifyH("CENTER")
|
||||||
label:SetHeight(18)
|
label:SetHeight(18)
|
||||||
|
|
||||||
local msgframe = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local msgframe = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
|
||||||
msgframe:SetHeight(30)
|
msgframe:SetHeight(30)
|
||||||
msgframe:SetBackdrop(ControlBackdrop)
|
msgframe:SetBackdrop(ControlBackdrop)
|
||||||
msgframe:SetBackdropColor(0,0,0)
|
msgframe:SetBackdropColor(0,0,0)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Label Widget
|
Label Widget
|
||||||
Displays text and optionally an icon.
|
Displays text and optionally an icon.
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
local Type, Version = "Label", 27
|
local Type, Version = "Label", 28
|
||||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
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
|
-- WoW APIs
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
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
|
Support functions
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
@ -129,12 +125,16 @@ local methods = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
["SetFont"] = function(self, font, height, flags)
|
["SetFont"] = function(self, font, height, flags)
|
||||||
self.label:SetFont(font, height, flags)
|
if not self.fontObject then
|
||||||
UpdateImageAnchor(self)
|
self.fontObject = CreateFont("AceGUI30LabelFont" .. AceGUI:GetNextWidgetNum(Type))
|
||||||
|
end
|
||||||
|
self.fontObject:SetFont(font, height, flags)
|
||||||
|
self:SetFontObject(self.fontObject)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["SetFontObject"] = function(self, font)
|
["SetFontObject"] = function(self, font)
|
||||||
self:SetFont((font or GameFontHighlightSmall):GetFont())
|
self.label:SetFontObject(font or GameFontHighlightSmall)
|
||||||
|
UpdateImageAnchor(self)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["SetImageSize"] = function(self, width, height)
|
["SetImageSize"] = function(self, width, height)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local Type, Version = "MultiLineEditBox", 29
|
local Type, Version = "MultiLineEditBox", 32
|
||||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||||
|
|
||||||
@ -10,10 +10,6 @@ local GetCursorInfo, GetSpellInfo, ClearCursor = GetCursorInfo, GetSpellInfo, Cl
|
|||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
local _G = _G
|
local _G = _G
|
||||||
|
|
||||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
|
||||||
-- List them here for Mikk's FindGlobals script
|
|
||||||
-- GLOBALS: ACCEPT, ChatFontNormal
|
|
||||||
|
|
||||||
--[[-----------------------------------------------------------------------------
|
--[[-----------------------------------------------------------------------------
|
||||||
Support functions
|
Support functions
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
@ -145,6 +141,14 @@ local function OnVerticalScroll(self, offset)
|
|||||||
editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight())
|
editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight())
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function OnScrollRangeChanged(self, xrange, yrange)
|
||||||
|
if yrange == 0 then
|
||||||
|
self.obj.editBox:SetHitRectInsets(0, 0, 0, 0)
|
||||||
|
else
|
||||||
|
OnVerticalScroll(self, self:GetVerticalScroll())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function OnShowFocus(frame)
|
local function OnShowFocus(frame)
|
||||||
frame.obj.editBox:SetFocus()
|
frame.obj.editBox:SetFocus()
|
||||||
frame:SetScript("OnShow", nil)
|
frame:SetScript("OnShow", nil)
|
||||||
@ -257,8 +261,6 @@ local methods = {
|
|||||||
["SetCursorPosition"] = function(self, ...)
|
["SetCursorPosition"] = function(self, ...)
|
||||||
return self.editBox:SetCursorPosition(...)
|
return self.editBox:SetCursorPosition(...)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
--[[-----------------------------------------------------------------------------
|
--[[-----------------------------------------------------------------------------
|
||||||
@ -297,7 +299,7 @@ local function Constructor()
|
|||||||
text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -5, 1)
|
text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -5, 1)
|
||||||
text:SetJustifyV("MIDDLE")
|
text:SetJustifyV("MIDDLE")
|
||||||
|
|
||||||
local scrollBG = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local scrollBG = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||||
scrollBG:SetBackdrop(backdrop)
|
scrollBG:SetBackdrop(backdrop)
|
||||||
scrollBG:SetBackdropColor(0, 0, 0)
|
scrollBG:SetBackdropColor(0, 0, 0)
|
||||||
scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||||
@ -321,6 +323,7 @@ local function Constructor()
|
|||||||
scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag)
|
scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag)
|
||||||
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
|
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
|
||||||
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll)
|
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll)
|
||||||
|
scrollFrame:HookScript("OnScrollRangeChanged", OnScrollRangeChanged)
|
||||||
|
|
||||||
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame)
|
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame)
|
||||||
editBox:SetAllPoints()
|
editBox:SetAllPoints()
|
||||||
|
@ -14,10 +14,6 @@ local tonumber, pairs = tonumber, pairs
|
|||||||
local PlaySound = PlaySound
|
local PlaySound = PlaySound
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
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
|
Support functions
|
||||||
-------------------------------------------------------------------------------]]
|
-------------------------------------------------------------------------------]]
|
||||||
@ -31,13 +27,13 @@ local function UpdateText(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateLabels(self)
|
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
|
if self.ispercent then
|
||||||
self.lowtext:SetFormattedText("%s%%", (min * 100))
|
self.lowtext:SetFormattedText("%s%%", (min_value * 100))
|
||||||
self.hightext:SetFormattedText("%s%%", (max * 100))
|
self.hightext:SetFormattedText("%s%%", (max_value * 100))
|
||||||
else
|
else
|
||||||
self.lowtext:SetText(min)
|
self.lowtext:SetText(min_value)
|
||||||
self.hightext:SetText(max)
|
self.hightext:SetText(max_value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -175,13 +171,13 @@ local methods = {
|
|||||||
self.label:SetText(text)
|
self.label:SetText(text)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["SetSliderValues"] = function(self, min, max, step)
|
["SetSliderValues"] = function(self, min_value, max_value, step)
|
||||||
local frame = self.slider
|
local frame = self.slider
|
||||||
frame.setup = true
|
frame.setup = true
|
||||||
self.min = min
|
self.min = min_value
|
||||||
self.max = max
|
self.max = max_value
|
||||||
self.step = step
|
self.step = step
|
||||||
frame:SetMinMaxValues(min or 0,max or 100)
|
frame:SetMinMaxValues(min_value or 0,max_value or 100)
|
||||||
UpdateLabels(self)
|
UpdateLabels(self)
|
||||||
frame:SetValueStep(step or 1)
|
frame:SetValueStep(step or 1)
|
||||||
if self.value then
|
if self.value then
|
||||||
@ -225,7 +221,7 @@ local function Constructor()
|
|||||||
label:SetJustifyH("CENTER")
|
label:SetJustifyH("CENTER")
|
||||||
label:SetHeight(15)
|
label:SetHeight(15)
|
||||||
|
|
||||||
local slider = CreateFrame("Slider", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local slider = CreateFrame("Slider", nil, frame, "BackdropTemplate")
|
||||||
slider:SetOrientation("HORIZONTAL")
|
slider:SetOrientation("HORIZONTAL")
|
||||||
slider:SetHeight(15)
|
slider:SetHeight(15)
|
||||||
slider:SetHitRectInsets(0, 0, -10, 0)
|
slider:SetHitRectInsets(0, 0, -10, 0)
|
||||||
@ -247,7 +243,7 @@ local function Constructor()
|
|||||||
local hightext = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
local hightext = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
||||||
hightext:SetPoint("TOPRIGHT", slider, "BOTTOMRIGHT", -2, 3)
|
hightext:SetPoint("TOPRIGHT", slider, "BOTTOMRIGHT", -2, 3)
|
||||||
|
|
||||||
local editbox = CreateFrame("EditBox", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
local editbox = CreateFrame("EditBox", nil, frame, "BackdropTemplate")
|
||||||
editbox:SetAutoFocus(false)
|
editbox:SetAutoFocus(false)
|
||||||
editbox:SetFontObject(GameFontHighlightSmall)
|
editbox:SetFontObject(GameFontHighlightSmall)
|
||||||
editbox:SetPoint("TOP", slider, "BOTTOM")
|
editbox:SetPoint("TOP", slider, "BOTTOM")
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
-- make into AceHook.
|
-- make into AceHook.
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceHook-3.0
|
-- @name AceHook-3.0
|
||||||
-- @release $Id: AceHook-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
|
-- @release $Id: AceHook-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||||
local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 8
|
local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 9
|
||||||
local AceHook, oldminor = LibStub:NewLibrary(ACEHOOK_MAJOR, ACEHOOK_MINOR)
|
local AceHook, oldminor = LibStub:NewLibrary(ACEHOOK_MAJOR, ACEHOOK_MINOR)
|
||||||
|
|
||||||
if not AceHook then return end -- No upgrade needed
|
if not AceHook then return end -- No upgrade needed
|
||||||
@ -195,7 +195,6 @@ function hook(self, obj, method, handler, script, secure, raw, forceSecure, usag
|
|||||||
registry[self][method] = nil
|
registry[self][method] = nil
|
||||||
end
|
end
|
||||||
handlers[uid], actives[uid], scripts[uid] = nil, nil, nil
|
handlers[uid], actives[uid], scripts[uid] = nil, nil, nil
|
||||||
uid = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local orig
|
local orig
|
||||||
@ -478,10 +477,10 @@ function AceHook:UnhookAll()
|
|||||||
for key, value in pairs(registry[self]) do
|
for key, value in pairs(registry[self]) do
|
||||||
if type(key) == "table" then
|
if type(key) == "table" then
|
||||||
for method in pairs(value) do
|
for method in pairs(value) do
|
||||||
self:Unhook(key, method)
|
AceHook.Unhook(self, key, method)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:Unhook(key)
|
AceHook.Unhook(self, key)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
-- make into AceSerializer.
|
-- make into AceSerializer.
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceSerializer-3.0
|
-- @name AceSerializer-3.0
|
||||||
-- @release $Id: AceSerializer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
|
-- @release $Id: AceSerializer-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||||
local MAJOR,MINOR = "AceSerializer-3.0", 5
|
local MAJOR,MINOR = "AceSerializer-3.0", 5
|
||||||
local AceSerializer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
local AceSerializer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||||
|
|
||||||
@ -83,9 +83,9 @@ local function SerializeValue(v, res, nres)
|
|||||||
elseif t=="table" then -- ^T...^t = table (list of key,value pairs)
|
elseif t=="table" then -- ^T...^t = table (list of key,value pairs)
|
||||||
nres=nres+1
|
nres=nres+1
|
||||||
res[nres] = "^T"
|
res[nres] = "^T"
|
||||||
for k,v in pairs(v) do
|
for key,value in pairs(v) do
|
||||||
nres = SerializeValue(k, res, nres)
|
nres = SerializeValue(key, res, nres)
|
||||||
nres = SerializeValue(v, res, nres)
|
nres = SerializeValue(value, res, nres)
|
||||||
end
|
end
|
||||||
nres=nres+1
|
nres=nres+1
|
||||||
res[nres] = "^t"
|
res[nres] = "^t"
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
-- make into AceTimer.
|
-- make into AceTimer.
|
||||||
-- @class file
|
-- @class file
|
||||||
-- @name AceTimer-3.0
|
-- @name AceTimer-3.0
|
||||||
-- @release $Id: AceTimer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
|
-- @release $Id: AceTimer-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||||
|
|
||||||
local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes
|
local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes
|
||||||
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||||
@ -61,11 +61,11 @@ local function new(self, loop, func, delay, ...)
|
|||||||
-- Compensate delay to get a perfect average delay, even if individual times don't match up perfectly
|
-- Compensate delay to get a perfect average delay, even if individual times don't match up perfectly
|
||||||
-- due to fps differences
|
-- due to fps differences
|
||||||
local time = GetTime()
|
local time = GetTime()
|
||||||
local delay = timer.delay - (time - timer.ends)
|
local ndelay = timer.delay - (time - timer.ends)
|
||||||
-- Ensure the delay doesn't go below the threshold
|
-- Ensure the delay doesn't go below the threshold
|
||||||
if delay < 0.01 then delay = 0.01 end
|
if ndelay < 0.01 then ndelay = 0.01 end
|
||||||
C_TimerAfter(delay, timer.callback)
|
C_TimerAfter(ndelay, timer.callback)
|
||||||
timer.ends = time + delay
|
timer.ends = time + ndelay
|
||||||
else
|
else
|
||||||
activeTimers[timer.handle or timer] = nil
|
activeTimers[timer.handle or timer] = nil
|
||||||
end
|
end
|
||||||
|
@ -1,61 +1,31 @@
|
|||||||
--[[ $Id: CallbackHandler-1.0.lua 3 2008-09-29 16:54:20Z nevcairiel $ ]]
|
--[[ $Id: CallbackHandler-1.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]
|
||||||
local MAJOR, MINOR = "CallbackHandler-1.0", 3
|
local MAJOR, MINOR = "CallbackHandler-1.0", 7
|
||||||
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
|
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
|
||||||
|
|
||||||
if not CallbackHandler then return end -- No upgrade needed
|
if not CallbackHandler then return end -- No upgrade needed
|
||||||
|
|
||||||
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
|
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
|
||||||
|
|
||||||
local type = type
|
-- Lua APIs
|
||||||
local pcall = pcall
|
local error = error
|
||||||
local pairs = pairs
|
local setmetatable, rawget = setmetatable, rawget
|
||||||
local assert = assert
|
local next, select, pairs, type, tostring = next, select, pairs, type, tostring
|
||||||
local concat = table.concat
|
|
||||||
local loadstring = loadstring
|
|
||||||
local next = next
|
|
||||||
local select = select
|
|
||||||
local type = type
|
|
||||||
local xpcall = xpcall
|
local xpcall = xpcall
|
||||||
|
|
||||||
local function errorhandler(err)
|
local function errorhandler(err)
|
||||||
return geterrorhandler()(err)
|
return geterrorhandler()(err)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function CreateDispatcher(argCount)
|
local function Dispatch(handlers, ...)
|
||||||
local code = [[
|
local index, method = next(handlers)
|
||||||
local next, xpcall, eh = ...
|
if not method then return end
|
||||||
|
repeat
|
||||||
local method, ARGS
|
xpcall(method, errorhandler, ...)
|
||||||
local function call() method(ARGS) end
|
index, method = next(handlers, index)
|
||||||
|
until not method
|
||||||
local function dispatch(handlers, ...)
|
|
||||||
local index
|
|
||||||
index, method = next(handlers)
|
|
||||||
if not method then return end
|
|
||||||
local OLD_ARGS = ARGS
|
|
||||||
ARGS = ...
|
|
||||||
repeat
|
|
||||||
xpcall(call, eh)
|
|
||||||
index, method = next(handlers, index)
|
|
||||||
until not method
|
|
||||||
ARGS = OLD_ARGS
|
|
||||||
end
|
|
||||||
|
|
||||||
return dispatch
|
|
||||||
]]
|
|
||||||
|
|
||||||
local ARGS, OLD_ARGS = {}, {}
|
|
||||||
for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end
|
|
||||||
code = code:gsub("OLD_ARGS", concat(OLD_ARGS, ", ")):gsub("ARGS", concat(ARGS, ", "))
|
|
||||||
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
|
|
||||||
local dispatcher = CreateDispatcher(argCount)
|
|
||||||
rawset(self, argCount, dispatcher)
|
|
||||||
return dispatcher
|
|
||||||
end})
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
-- CallbackHandler:New
|
-- CallbackHandler:New
|
||||||
--
|
--
|
||||||
@ -64,9 +34,7 @@ end})
|
|||||||
-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
|
-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
|
||||||
-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.
|
-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.
|
||||||
|
|
||||||
function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused)
|
function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName)
|
||||||
-- TODO: Remove this after beta has gone out
|
|
||||||
assert(not OnUsed and not OnUnused, "ACE-80: OnUsed/OnUnused are deprecated. Callbacks are now done to registry.OnUsed and registry.OnUnused")
|
|
||||||
|
|
||||||
RegisterName = RegisterName or "RegisterCallback"
|
RegisterName = RegisterName or "RegisterCallback"
|
||||||
UnregisterName = UnregisterName or "UnregisterCallback"
|
UnregisterName = UnregisterName or "UnregisterCallback"
|
||||||
@ -88,19 +56,19 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll
|
|||||||
local oldrecurse = registry.recurse
|
local oldrecurse = registry.recurse
|
||||||
registry.recurse = oldrecurse + 1
|
registry.recurse = oldrecurse + 1
|
||||||
|
|
||||||
Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...)
|
Dispatch(events[eventname], eventname, ...)
|
||||||
|
|
||||||
registry.recurse = oldrecurse
|
registry.recurse = oldrecurse
|
||||||
|
|
||||||
if registry.insertQueue and oldrecurse==0 then
|
if registry.insertQueue and oldrecurse==0 then
|
||||||
-- Something in one of our callbacks wanted to register more callbacks; they got queued
|
-- Something in one of our callbacks wanted to register more callbacks; they got queued
|
||||||
for eventname,callbacks in pairs(registry.insertQueue) do
|
for event,callbacks in pairs(registry.insertQueue) do
|
||||||
local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
|
local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten.
|
||||||
for self,func in pairs(callbacks) do
|
for object,func in pairs(callbacks) do
|
||||||
events[eventname][self] = func
|
events[event][object] = func
|
||||||
-- fire OnUsed callback?
|
-- fire OnUsed callback?
|
||||||
if first and registry.OnUsed then
|
if first and registry.OnUsed then
|
||||||
registry.OnUsed(registry, target, eventname)
|
registry.OnUsed(registry, target, event)
|
||||||
first = nil
|
first = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -146,9 +114,9 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll
|
|||||||
regfunc = function(...) self[method](self,...) end
|
regfunc = function(...) self[method](self,...) end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- function ref with self=object or self="addonId"
|
-- function ref with self=object or self="addonId" or self=thread
|
||||||
if type(self)~="table" and type(self)~="string" then
|
if type(self)~="table" and type(self)~="string" and type(self)~="thread" then
|
||||||
error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string expected.", 2)
|
error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string or thread expected.", 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
if select("#",...)>=1 then -- this is not the same as testing for arg==nil!
|
if select("#",...)>=1 then -- this is not the same as testing for arg==nil!
|
||||||
|
@ -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/
|
<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">
|
..\FrameXML\UI.xsd">
|
||||||
<Script file="CallbackHandler-1.0.lua"/>
|
<Script file="CallbackHandler-1.0.lua"/>
|
||||||
</Ui>
|
</Ui>
|
||||||
|
@ -9,7 +9,7 @@ License: MIT
|
|||||||
|
|
||||||
--- DRList-1.0
|
--- DRList-1.0
|
||||||
-- @module DRList-1.0
|
-- @module DRList-1.0
|
||||||
local MAJOR, MINOR = "DRList-1.0", 42 -- Don't forget to change this in Spells.lua aswell!
|
local MAJOR, MINOR = "DRList-1.0", 49 -- Don't forget to change this in Spells.lua aswell!
|
||||||
local Lib = assert(LibStub, MAJOR .. " requires LibStub."):NewLibrary(MAJOR, MINOR)
|
local Lib = assert(LibStub, MAJOR .. " requires LibStub."):NewLibrary(MAJOR, MINOR)
|
||||||
if not Lib then return end -- already loaded
|
if not Lib then return end -- already loaded
|
||||||
|
|
||||||
@ -62,7 +62,8 @@ elseif locale == "frFR" then
|
|||||||
L["STUNS"] = "Etourdissements"
|
L["STUNS"] = "Etourdissements"
|
||||||
L["TAUNTS"] = "Provocations"
|
L["TAUNTS"] = "Provocations"
|
||||||
elseif locale == "itIT" then
|
elseif locale == "itIT" then
|
||||||
--@localization(locale="itIT", namespace="Categories", format="lua_additive_table", handle-unlocalized="ignore")@
|
-- Categories
|
||||||
|
|
||||||
elseif locale == "koKR" then
|
elseif locale == "koKR" then
|
||||||
L["DISORIENTS"] = "방향 감각 상실"
|
L["DISORIENTS"] = "방향 감각 상실"
|
||||||
L["INCAPACITATES"] = "행동 불가"
|
L["INCAPACITATES"] = "행동 불가"
|
||||||
@ -71,7 +72,8 @@ elseif locale == "koKR" then
|
|||||||
L["SILENCES"] = "침묵"
|
L["SILENCES"] = "침묵"
|
||||||
L["STUNS"] = "기절"
|
L["STUNS"] = "기절"
|
||||||
elseif locale == "ptBR" then
|
elseif locale == "ptBR" then
|
||||||
--@localization(locale="ptBR", namespace="Categories", format="lua_additive_table", handle-unlocalized="ignore")@
|
-- Categories
|
||||||
|
|
||||||
elseif locale == "ruRU" then
|
elseif locale == "ruRU" then
|
||||||
L["DISARMS"] = "Разоружение"
|
L["DISARMS"] = "Разоружение"
|
||||||
L["DISORIENTS"] = "Дезориентация"
|
L["DISORIENTS"] = "Дезориентация"
|
||||||
@ -129,33 +131,29 @@ Lib.gameExpansion = ({
|
|||||||
[WOW_PROJECT_MAINLINE] = "retail",
|
[WOW_PROJECT_MAINLINE] = "retail",
|
||||||
[WOW_PROJECT_CLASSIC] = "classic",
|
[WOW_PROJECT_CLASSIC] = "classic",
|
||||||
[WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc",
|
[WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc",
|
||||||
|
[WOW_PROJECT_WRATH_CLASSIC or 11] = "wotlk",
|
||||||
})[WOW_PROJECT_ID]
|
})[WOW_PROJECT_ID]
|
||||||
|
|
||||||
local tocVersion = select(4, GetBuildInfo())
|
|
||||||
if tocVersion >= 30400 and tocVersion < 40000 then
|
|
||||||
Lib.gameExpansion = "wotlk" -- temporary check for wotlk build until new constant is added
|
|
||||||
end
|
|
||||||
|
|
||||||
-- How long it takes for a DR to expire, in seconds.
|
-- How long it takes for a DR to expire, in seconds.
|
||||||
Lib.resetTimes = {
|
Lib.resetTimes = {
|
||||||
retail = {
|
retail = {
|
||||||
["default"] = 18.5, -- 18 sec + 0.5 latency
|
["default"] = 18.5, -- 18 sec + 0.5 latency
|
||||||
["npc"] = 23, -- Against mobs it seems to last slightly longer, depending on server load
|
["npc"] = 23, -- Against mobs it seems to last slightly longer, depending on server load
|
||||||
["knockback"] = 10, -- Knockbacks are immediately immune and only DRs for 10s
|
["knockback"] = 10.5, -- Knockbacks are immediately immune and only DRs for 10s
|
||||||
},
|
},
|
||||||
|
|
||||||
classic = {
|
classic = {
|
||||||
["default"] = 19, -- dynamic between 15 and 20s
|
["default"] = 20, -- dynamic between 15 and 20s
|
||||||
["npc"] = 23,
|
["npc"] = 23,
|
||||||
},
|
},
|
||||||
|
|
||||||
tbc = {
|
tbc = {
|
||||||
["default"] = 19, -- dynamic between 15 and 20s
|
["default"] = 20, -- dynamic between 15 and 20s
|
||||||
["npc"] = 23,
|
["npc"] = 23,
|
||||||
},
|
},
|
||||||
|
|
||||||
wotlk = {
|
wotlk = {
|
||||||
["default"] = 19, -- dynamic between 15 and 20s
|
["default"] = 20, -- dynamic between 15 and 20s
|
||||||
["npc"] = 23,
|
["npc"] = 23,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -203,7 +201,7 @@ Lib.categoryNames = {
|
|||||||
["counterattack"] = L.COUNTERATTACK,
|
["counterattack"] = L.COUNTERATTACK,
|
||||||
},
|
},
|
||||||
|
|
||||||
wotlk = { -- WORK IN PROGRESS
|
wotlk = {
|
||||||
["incapacitate"] = L.INCAPACITATES,
|
["incapacitate"] = L.INCAPACITATES,
|
||||||
["stun"] = L.STUNS,
|
["stun"] = L.STUNS,
|
||||||
["random_stun"] = L.RANDOM_STUNS,
|
["random_stun"] = L.RANDOM_STUNS,
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
## Interface: 90205
|
## Interface: 100002
|
||||||
## Interface-Classic: 11402
|
|
||||||
## Interface-BCC: 20504
|
|
||||||
## Interface-Wrath: 30400
|
|
||||||
## Title: Lib: DRList-1.0
|
## Title: Lib: DRList-1.0
|
||||||
## Version: @project-version@
|
## Version: v1.3.8
|
||||||
## X-Category: Library
|
## X-Category: Library
|
||||||
## X-License: MIT
|
## X-License: MIT
|
||||||
## X-Curse-Project-ID: 315757
|
## X-Curse-Project-ID: 315757
|
||||||
@ -14,10 +11,3 @@ libs\LibStub\LibStub.lua
|
|||||||
#@end-no-lib-strip@
|
#@end-no-lib-strip@
|
||||||
|
|
||||||
DRList-1.0.xml
|
DRList-1.0.xml
|
||||||
#@do-not-package@
|
|
||||||
tests\engine.lua
|
|
||||||
tests\test-retail.lua
|
|
||||||
tests\test-classic.lua
|
|
||||||
tests\test-tbc.lua
|
|
||||||
tests\test-wotlk.lua
|
|
||||||
#@end-do-not-package@
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local MAJOR, MINOR = "DRList-1.0", 42 -- Don't forget to change this in DRList-1.0.lua aswell!
|
local MAJOR, MINOR = "DRList-1.0", 49 -- Don't forget to change this in DRList-1.0.lua aswell!
|
||||||
local Lib = LibStub(MAJOR)
|
local Lib = LibStub(MAJOR)
|
||||||
if Lib.spellListVersion and Lib.spellListVersion >= MINOR then
|
if Lib.spellListVersion and Lib.spellListVersion >= MINOR then
|
||||||
return
|
return
|
||||||
@ -13,12 +13,14 @@ if Lib.gameExpansion == "retail" then
|
|||||||
[207167] = "disorient", -- Blinding Sleet
|
[207167] = "disorient", -- Blinding Sleet
|
||||||
[207685] = "disorient", -- Sigil of Misery
|
[207685] = "disorient", -- Sigil of Misery
|
||||||
[33786] = "disorient", -- Cyclone
|
[33786] = "disorient", -- Cyclone
|
||||||
|
[360806] = "disorient", -- Sleep Walk
|
||||||
[1513] = "disorient", -- Scare Beast
|
[1513] = "disorient", -- Scare Beast
|
||||||
[31661] = "disorient", -- Dragon's Breath
|
[31661] = "disorient", -- Dragon's Breath
|
||||||
[198909] = "disorient", -- Song of Chi-ji
|
[198909] = "disorient", -- Song of Chi-ji
|
||||||
[202274] = "disorient", -- Incendiary Brew
|
[202274] = "disorient", -- Incendiary Brew
|
||||||
[105421] = "disorient", -- Blinding Light
|
[105421] = "disorient", -- Blinding Light
|
||||||
[10326] = "disorient", -- Turn Evil
|
[10326] = "disorient", -- Turn Evil
|
||||||
|
[205364] = "disorient", -- Dominate Mind
|
||||||
[605] = "disorient", -- Mind Control
|
[605] = "disorient", -- Mind Control
|
||||||
[8122] = "disorient", -- Psychic Scream
|
[8122] = "disorient", -- Psychic Scream
|
||||||
[226943] = "disorient", -- Mind Bomb
|
[226943] = "disorient", -- Mind Bomb
|
||||||
@ -36,9 +38,11 @@ if Lib.gameExpansion == "retail" then
|
|||||||
[221527] = "incapacitate", -- Imprison (Honor talent)
|
[221527] = "incapacitate", -- Imprison (Honor talent)
|
||||||
[2637] = "incapacitate", -- Hibernate
|
[2637] = "incapacitate", -- Hibernate
|
||||||
[99] = "incapacitate", -- Incapacitating Roar
|
[99] = "incapacitate", -- Incapacitating Roar
|
||||||
|
[378441] = "incapacitate", -- Time Stop
|
||||||
[3355] = "incapacitate", -- Freezing Trap
|
[3355] = "incapacitate", -- Freezing Trap
|
||||||
[203337] = "incapacitate", -- Freezing Trap (Honor talent)
|
[203337] = "incapacitate", -- Freezing Trap (Honor talent)
|
||||||
[213691] = "incapacitate", -- Scatter Shot
|
[213691] = "incapacitate", -- Scatter Shot
|
||||||
|
[383121] = "incapacitate", -- Mass Polymorph
|
||||||
[118] = "incapacitate", -- Polymorph
|
[118] = "incapacitate", -- Polymorph
|
||||||
[28271] = "incapacitate", -- Polymorph (Turtle)
|
[28271] = "incapacitate", -- Polymorph (Turtle)
|
||||||
[28272] = "incapacitate", -- Polymorph (Pig)
|
[28272] = "incapacitate", -- Polymorph (Pig)
|
||||||
@ -53,8 +57,11 @@ if Lib.gameExpansion == "retail" then
|
|||||||
[161372] = "incapacitate", -- Polymorph (Peacock)
|
[161372] = "incapacitate", -- Polymorph (Peacock)
|
||||||
[277787] = "incapacitate", -- Polymorph (Baby Direhorn)
|
[277787] = "incapacitate", -- Polymorph (Baby Direhorn)
|
||||||
[277792] = "incapacitate", -- Polymorph (Bumblebee)
|
[277792] = "incapacitate", -- Polymorph (Bumblebee)
|
||||||
|
[321395] = "incapacitate", -- Polymorph (Mawrat)
|
||||||
|
[391622] = "incapacitate", -- Polymorph (Duck)
|
||||||
[82691] = "incapacitate", -- Ring of Frost
|
[82691] = "incapacitate", -- Ring of Frost
|
||||||
[115078] = "incapacitate", -- Paralysis
|
[115078] = "incapacitate", -- Paralysis
|
||||||
|
[357768] = "incapacitate", -- Paralysis 2 (Perpetual Paralysis?)
|
||||||
[20066] = "incapacitate", -- Repentance
|
[20066] = "incapacitate", -- Repentance
|
||||||
[9484] = "incapacitate", -- Shackle Undead
|
[9484] = "incapacitate", -- Shackle Undead
|
||||||
[200196] = "incapacitate", -- Holy Word: Chastise
|
[200196] = "incapacitate", -- Holy Word: Chastise
|
||||||
@ -80,6 +87,8 @@ if Lib.gameExpansion == "retail" then
|
|||||||
-- [78675] = "silence", -- Solar Beam (has no DR)
|
-- [78675] = "silence", -- Solar Beam (has no DR)
|
||||||
[202933] = "silence", -- Spider Sting
|
[202933] = "silence", -- Spider Sting
|
||||||
[356727] = "silence", -- Spider Venom
|
[356727] = "silence", -- Spider Venom
|
||||||
|
[354831] = "silence", -- Wailing Arrow 1
|
||||||
|
[355596] = "silence", -- Wailing Arrow 2
|
||||||
[217824] = "silence", -- Shield of Virtue
|
[217824] = "silence", -- Shield of Virtue
|
||||||
[15487] = "silence", -- Silence
|
[15487] = "silence", -- Silence
|
||||||
[1330] = "silence", -- Garrote
|
[1330] = "silence", -- Garrote
|
||||||
@ -102,10 +111,14 @@ if Lib.gameExpansion == "retail" then
|
|||||||
[5211] = "stun", -- Mighty Bash
|
[5211] = "stun", -- Mighty Bash
|
||||||
[202244] = "stun", -- Overrun
|
[202244] = "stun", -- Overrun
|
||||||
[325321] = "stun", -- Wild Hunt's Charge
|
[325321] = "stun", -- Wild Hunt's Charge
|
||||||
|
[372245] = "stun", -- Terror of the Skies
|
||||||
|
[117526] = "stun", -- Binding Shot
|
||||||
[357021] = "stun", -- Consecutive Concussion
|
[357021] = "stun", -- Consecutive Concussion
|
||||||
[24394] = "stun", -- Intimidation
|
[24394] = "stun", -- Intimidation
|
||||||
|
[389831] = "stun", -- Snowdrift
|
||||||
[119381] = "stun", -- Leg Sweep
|
[119381] = "stun", -- Leg Sweep
|
||||||
[202346] = "stun", -- Double Barrel
|
[202346] = "stun", -- Double Barrel
|
||||||
|
[385149] = "stun", -- Exorcism
|
||||||
[853] = "stun", -- Hammer of Justice
|
[853] = "stun", -- Hammer of Justice
|
||||||
[255941] = "stun", -- Wake of Ashes
|
[255941] = "stun", -- Wake of Ashes
|
||||||
[64044] = "stun", -- Psychic Horror
|
[64044] = "stun", -- Psychic Horror
|
||||||
@ -119,6 +132,7 @@ if Lib.gameExpansion == "retail" then
|
|||||||
[171017] = "stun", -- Meteor Strike (Infernal)
|
[171017] = "stun", -- Meteor Strike (Infernal)
|
||||||
[171018] = "stun", -- Meteor Strike (Abyssal)
|
[171018] = "stun", -- Meteor Strike (Abyssal)
|
||||||
[30283] = "stun", -- Shadowfury
|
[30283] = "stun", -- Shadowfury
|
||||||
|
[385954] = "stun", -- Shield Charge
|
||||||
[46968] = "stun", -- Shockwave
|
[46968] = "stun", -- Shockwave
|
||||||
[132168] = "stun", -- Shockwave (Protection)
|
[132168] = "stun", -- Shockwave (Protection)
|
||||||
[145047] = "stun", -- Shockwave (Proving Grounds PvE)
|
[145047] = "stun", -- Shockwave (Proving Grounds PvE)
|
||||||
@ -128,13 +142,16 @@ if Lib.gameExpansion == "retail" then
|
|||||||
[255723] = "stun", -- Bull Rush (Highmountain Tauren)
|
[255723] = "stun", -- Bull Rush (Highmountain Tauren)
|
||||||
[287712] = "stun", -- Haymaker (Kul Tiran)
|
[287712] = "stun", -- Haymaker (Kul Tiran)
|
||||||
[332423] = "stun", -- Sparkling Driftglobe Core (Kyrian Covenant)
|
[332423] = "stun", -- Sparkling Driftglobe Core (Kyrian Covenant)
|
||||||
|
-- TODO: Inferal Awakening?
|
||||||
|
|
||||||
[204085] = "root", -- Deathchill (Chains of Ice)
|
[204085] = "root", -- Deathchill (Chains of Ice)
|
||||||
[233395] = "root", -- Deathchill (Remorseless Winter)
|
[233395] = "root", -- Deathchill (Remorseless Winter)
|
||||||
[339] = "root", -- Entangling Roots
|
[339] = "root", -- Entangling Roots
|
||||||
|
[235963] = "root", -- Entangling Roots (Earthen Grasp)
|
||||||
[170855] = "root", -- Entangling Roots (Nature's Grasp)
|
[170855] = "root", -- Entangling Roots (Nature's Grasp)
|
||||||
[102359] = "root", -- Mass Entanglement
|
[102359] = "root", -- Mass Entanglement
|
||||||
[117526] = "root", -- Binding Shot
|
[355689] = "root", -- Landslide
|
||||||
|
[393456] = "root", -- Entrapment (Tar Trap)
|
||||||
[162480] = "root", -- Steel Trap
|
[162480] = "root", -- Steel Trap
|
||||||
[273909] = "root", -- Steelclaw Trap
|
[273909] = "root", -- Steelclaw Trap
|
||||||
-- [190927] = "root_harpoon", -- Harpoon (TODO: confirm)
|
-- [190927] = "root_harpoon", -- Harpoon (TODO: confirm)
|
||||||
@ -142,13 +159,17 @@ if Lib.gameExpansion == "retail" then
|
|||||||
[201158] = "root", -- Super Sticky Tar
|
[201158] = "root", -- Super Sticky Tar
|
||||||
[122] = "root", -- Frost Nova
|
[122] = "root", -- Frost Nova
|
||||||
[33395] = "root", -- Freeze
|
[33395] = "root", -- Freeze
|
||||||
|
[386770] = "root", -- Freezing Cold
|
||||||
[198121] = "root", -- Frostbite
|
[198121] = "root", -- Frostbite
|
||||||
|
[114404] = "root", -- Void Tendril's Grasp
|
||||||
[342375] = "root", -- Tormenting Backlash (Torghast PvE)
|
[342375] = "root", -- Tormenting Backlash (Torghast PvE)
|
||||||
[233582] = "root", -- Entrenched in Flame
|
[233582] = "root", -- Entrenched in Flame
|
||||||
[116706] = "root", -- Disable
|
[116706] = "root", -- Disable
|
||||||
[324382] = "root", -- Clash
|
[324382] = "root", -- Clash
|
||||||
[64695] = "root", -- Earthgrab (Totem effect)
|
[64695] = "root", -- Earthgrab (Totem effect)
|
||||||
|
-- [356738] = "root", -- Earth Unleashed (doesn't seem to DR)
|
||||||
[285515] = "root", -- Surge of Power
|
[285515] = "root", -- Surge of Power
|
||||||
|
--[356356] = "root", -- Warbringer TODO: has DR?
|
||||||
[39965] = "root", -- Frost Grenade (Item)
|
[39965] = "root", -- Frost Grenade (Item)
|
||||||
[75148] = "root", -- Embersilk Net (Item)
|
[75148] = "root", -- Embersilk Net (Item)
|
||||||
[55536] = "root", -- Frostweave Net (Item)
|
[55536] = "root", -- Frostweave Net (Item)
|
||||||
@ -360,7 +381,7 @@ elseif Lib.gameExpansion == "tbc" then
|
|||||||
[27067] = "counterattack", -- Counterattack (Rank 4)
|
[27067] = "counterattack", -- Counterattack (Rank 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE BETA ACCESS
|
elseif Lib.gameExpansion == "wotlk" then
|
||||||
|
|
||||||
-- SpellID list for Wrath of the Lich King.
|
-- SpellID list for Wrath of the Lich King.
|
||||||
-- spellID for every rank is used over spell name to avoid name collisions, and faster lookups
|
-- spellID for every rank is used over spell name to avoid name collisions, and faster lookups
|
||||||
@ -415,6 +436,9 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
|
|||||||
[30216] = "incapacitate", -- Fel Iron Bomb
|
[30216] = "incapacitate", -- Fel Iron Bomb
|
||||||
[30461] = "incapacitate", -- The Bigger One
|
[30461] = "incapacitate", -- The Bigger One
|
||||||
[30217] = "incapacitate", -- Adamantite Grenade
|
[30217] = "incapacitate", -- Adamantite Grenade
|
||||||
|
[67769] = "incapacitate", -- Cobalt Frag Bomb
|
||||||
|
[67890] = "incapacitate", -- Cobalt Frag Bomb (Frag Belt)
|
||||||
|
[54466] = "incapacitate", -- Saronite Grenade
|
||||||
|
|
||||||
[47481] = "stun", -- Gnaw (Ghoul Pet)
|
[47481] = "stun", -- Gnaw (Ghoul Pet)
|
||||||
[5211] = "stun", -- Bash (Rank 1)
|
[5211] = "stun", -- Bash (Rank 1)
|
||||||
@ -527,6 +551,7 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
|
|||||||
[42917] = "root", -- Frost Nova (Rank 6)
|
[42917] = "root", -- Frost Nova (Rank 6)
|
||||||
[39965] = "root", -- Frost Grenade (Item)
|
[39965] = "root", -- Frost Grenade (Item)
|
||||||
[63685] = "root", -- Freeze (Frost Shock)
|
[63685] = "root", -- Freeze (Frost Shock)
|
||||||
|
[55536] = "root", -- Frostweave Net (Item)
|
||||||
|
|
||||||
[12494] = "random_root", -- Frostbite
|
[12494] = "random_root", -- Frostbite
|
||||||
[55080] = "random_root", -- Shattered Barrier
|
[55080] = "random_root", -- Shattered Barrier
|
||||||
@ -542,6 +567,7 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
|
|||||||
[53540] = "disarm", -- Snatch (Rank 4)
|
[53540] = "disarm", -- Snatch (Rank 4)
|
||||||
[53542] = "disarm", -- Snatch (Rank 5)
|
[53542] = "disarm", -- Snatch (Rank 5)
|
||||||
[53543] = "disarm", -- Snatch (Rank 6)
|
[53543] = "disarm", -- Snatch (Rank 6)
|
||||||
|
[64346] = "disarm", -- Fiery Payback
|
||||||
[64058] = "disarm", -- Psychic Horror Disarm Effect
|
[64058] = "disarm", -- Psychic Horror Disarm Effect
|
||||||
[51722] = "disarm", -- Dismantle
|
[51722] = "disarm", -- Dismantle
|
||||||
[676] = "disarm", -- Disarm
|
[676] = "disarm", -- Disarm
|
||||||
@ -592,6 +618,7 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
|
|||||||
[33786] = "cyclone", -- Cyclone
|
[33786] = "cyclone", -- Cyclone
|
||||||
[605] = "mind_control", -- Mind Control
|
[605] = "mind_control", -- Mind Control
|
||||||
[13181] = "mind_control", -- Gnomish Mind Control Cap
|
[13181] = "mind_control", -- Gnomish Mind Control Cap
|
||||||
|
[67799] = "mind_control", -- Mind Amplification Dish
|
||||||
[7922] = "charge", -- Charge Stun
|
[7922] = "charge", -- Charge Stun
|
||||||
[19306] = "counterattack", -- Counterattack 1
|
[19306] = "counterattack", -- Counterattack 1
|
||||||
[20909] = "counterattack", -- Counterattack 2
|
[20909] = "counterattack", -- Counterattack 2
|
||||||
@ -600,8 +627,6 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
|
|||||||
[48998] = "counterattack", -- Counterattack 5
|
[48998] = "counterattack", -- Counterattack 5
|
||||||
[48999] = "counterattack", -- Counterattack 6
|
[48999] = "counterattack", -- Counterattack 6
|
||||||
--Storm, Earth and Fire has no DR
|
--Storm, Earth and Fire has no DR
|
||||||
|
|
||||||
-- TODO: profession stuff
|
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif Lib.gameExpansion == "classic" then
|
elseif Lib.gameExpansion == "classic" then
|
||||||
|
@ -51,7 +51,7 @@ GlowMaskPool.parent = GlowParent
|
|||||||
|
|
||||||
local TexPoolResetter = function(pool,tex)
|
local TexPoolResetter = function(pool,tex)
|
||||||
local maskNum = tex:GetNumMaskTextures()
|
local maskNum = tex:GetNumMaskTextures()
|
||||||
for i = maskNum,1 do
|
for i = maskNum , 1, -1 do
|
||||||
tex:RemoveMaskTexture(tex:GetMaskTexture(i))
|
tex:RemoveMaskTexture(tex:GetMaskTexture(i))
|
||||||
end
|
end
|
||||||
tex:Hide()
|
tex:Hide()
|
||||||
@ -93,14 +93,14 @@ lib.GlowFramePool = GlowFramePool
|
|||||||
|
|
||||||
local function addFrameAndTex(r,color,name,key,N,xOffset,yOffset,texture,texCoord,desaturated,frameLevel)
|
local function addFrameAndTex(r,color,name,key,N,xOffset,yOffset,texture,texCoord,desaturated,frameLevel)
|
||||||
key = key or ""
|
key = key or ""
|
||||||
frameLevel = frameLevel or 8
|
frameLevel = frameLevel or 8
|
||||||
if not r[name..key] then
|
if not r[name..key] then
|
||||||
r[name..key] = GlowFramePool:Acquire()
|
r[name..key] = GlowFramePool:Acquire()
|
||||||
r[name..key]:SetParent(r)
|
r[name..key]:SetParent(r)
|
||||||
r[name..key].name = name..key
|
r[name..key].name = name..key
|
||||||
end
|
end
|
||||||
local f = r[name..key]
|
local f = r[name..key]
|
||||||
f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
|
f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
|
||||||
f:SetPoint("TOPLEFT",r,"TOPLEFT",-xOffset+0.05,yOffset+0.05)
|
f:SetPoint("TOPLEFT",r,"TOPLEFT",-xOffset+0.05,yOffset+0.05)
|
||||||
f:SetPoint("BOTTOMRIGHT",r,"BOTTOMRIGHT",xOffset,-yOffset+0.05)
|
f:SetPoint("BOTTOMRIGHT",r,"BOTTOMRIGHT",xOffset,-yOffset+0.05)
|
||||||
f:Show()
|
f:Show()
|
||||||
@ -613,7 +613,7 @@ function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
|
|||||||
if not r then
|
if not r then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
frameLevel = frameLevel or 8;
|
frameLevel = frameLevel or 8;
|
||||||
local throttle
|
local throttle
|
||||||
if frequency and frequency > 0 then
|
if frequency and frequency > 0 then
|
||||||
throttle = 0.25/frequency*0.01
|
throttle = 0.25/frequency*0.01
|
||||||
@ -628,8 +628,8 @@ function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
|
|||||||
f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
|
f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
|
||||||
f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
|
f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
|
||||||
f.ants:SetSize(width*1.4*0.85, height*1.4*0.85)
|
f.ants:SetSize(width*1.4*0.85, height*1.4*0.85)
|
||||||
AnimIn_OnFinished(f.animIn)
|
AnimIn_OnFinished(f.animIn)
|
||||||
if f.animOut:IsPlaying() then
|
if f.animOut:IsPlaying() then
|
||||||
f.animOut:Stop()
|
f.animOut:Stop()
|
||||||
f.animIn:Play()
|
f.animIn:Play()
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
--@curseforge-project-slug: libsharedmedia-3-0@
|
||||||
--[[
|
--[[
|
||||||
Name: LibSharedMedia-3.0
|
Name: LibSharedMedia-3.0
|
||||||
Revision: $Revision: 114 $
|
Revision: $Revision: 128 $
|
||||||
Author: Elkano (elkano@gmx.de)
|
Author: Elkano (elkano@gmx.de)
|
||||||
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com)
|
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com)
|
||||||
Website: http://www.wowace.com/projects/libsharedmedia-3-0/
|
Website: http://www.wowace.com/projects/libsharedmedia-3-0/
|
||||||
|
@ -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/
|
<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">
|
..\FrameXML\UI.xsd">
|
||||||
<Script file="LibSharedMedia-3.0.lua" />
|
<Script file="LibSharedMedia-3.0.lua" />
|
||||||
</Ui>
|
</Ui>
|
||||||
|
@ -7,24 +7,24 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
|||||||
LibStub = LibStub or {libs = {}, minors = {} }
|
LibStub = LibStub or {libs = {}, minors = {} }
|
||||||
_G[LIBSTUB_MAJOR] = LibStub
|
_G[LIBSTUB_MAJOR] = LibStub
|
||||||
LibStub.minor = LIBSTUB_MINOR
|
LibStub.minor = LIBSTUB_MINOR
|
||||||
|
|
||||||
function LibStub:NewLibrary(major, minor)
|
function LibStub:NewLibrary(major, minor)
|
||||||
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
||||||
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
minor = assert(tonumber(string.match(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
||||||
|
|
||||||
local oldminor = self.minors[major]
|
local oldminor = self.minors[major]
|
||||||
if oldminor and oldminor >= minor then return nil end
|
if oldminor and oldminor >= minor then return nil end
|
||||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||||
return self.libs[major], oldminor
|
return self.libs[major], oldminor
|
||||||
end
|
end
|
||||||
|
|
||||||
function LibStub:GetLibrary(major, silent)
|
function LibStub:GetLibrary(major, silent)
|
||||||
if not self.libs[major] and not silent then
|
if not self.libs[major] and not silent then
|
||||||
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
|
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
|
||||||
end
|
end
|
||||||
return self.libs[major], self.minors[major]
|
return self.libs[major], self.minors[major]
|
||||||
end
|
end
|
||||||
|
|
||||||
function LibStub:IterateLibraries() return pairs(self.libs) end
|
function LibStub:IterateLibraries() return pairs(self.libs) end
|
||||||
setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user