Compare commits

..

17 Commits

Author SHA1 Message Date
Sumsebrum
ff619e7228 Merge branch 'hotfix/v2.27-readme' into main 2023-10-03 19:19:07 +02:00
Sumsebrum
8bd027c614 v2.27-Release readme 2023-10-03 19:18:46 +02:00
Sumsebrum
393af7875d Merge branch 'hotfix/v2.27' into main 2023-10-03 19:14:44 +02:00
Sumsebrum
468cbf24f3 #81 NeatPlates fix & version v2.27-Release 2023-10-03 19:14:16 +02:00
Sumsebrum
50987addb5 Merge branch 'hotfix/v2.26' into main 2023-09-30 20:46:27 +02:00
Sumsebrum
7930335294 v2.26 2023-09-30 20:45:57 +02:00
Sumsebrum
535fedab1a plater fix 2023-09-30 20:44:22 +02:00
Sumsebrum
6be69bc51c Merge branch 'hotfix/v2.25' into main 2023-09-29 20:42:55 +02:00
Sumsebrum
5f8807a879 bump version v2.25-Release 2023-09-29 20:42:19 +02:00
Sumsebrum
c122e24054 #81 elvui totemplates fix 2023-09-29 20:37:54 +02:00
Sumsebrum
47bc4d46f4 Merge branch 'hotfix/v2.24-Release' into main 2023-07-15 14:35:32 +02:00
Sumsebrum
cacd83479c bump version 2.24-Release 2023-07-15 14:34:59 +02:00
Sumsebrum
117888cdb0 wow 30402 update libs + fix taint issue 2023-07-15 14:31:46 +02:00
Sumsebrum
8f4f153011 Merge branch 'hotfix/2.23-Release' into main 2023-01-18 16:50:34 +01:00
Sumsebrum
b72b2a3c3a update version + readme 2023-01-18 16:50:12 +01:00
Sumsebrum
387f12a97e fix layers and masks 2023-01-18 16:45:28 +01:00
Sumsebrum
892b5e8a59 lib update 2023-01-18 16:44:35 +01:00
57 changed files with 678 additions and 1255 deletions

1
.gitignore vendored
View File

@ -6,5 +6,6 @@ BuffLib
Ace-Libs
Images_Raw
Gladdy_old
DoNotCommit
untracked
Gladdy_TW

View File

@ -13,7 +13,6 @@ local CreateFrame = CreateFrame
local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME
local IsAddOnLoaded = IsAddOnLoaded
local GetBattlefieldStatus = GetBattlefieldStatus
local IsActiveBattlefieldArena = IsActiveBattlefieldArena
local IsInInstance = IsInInstance
local GetNumArenaOpponents = GetNumArenaOpponents
local RELEASE_TYPES = { alpha = "Alpha", beta = "Beta", release = "Release"}
@ -27,11 +26,11 @@ local LibStub = LibStub
---------------------------
local MAJOR, MINOR = "Gladdy", 11
local MAJOR, MINOR = "Gladdy", 15
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
local L
Gladdy.version_major_num = 2
Gladdy.version_minor_num = 0.22
Gladdy.version_minor_num = 0.27
Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num
Gladdy.version_releaseType = RELEASE_TYPES.release
Gladdy.version = PREFIX .. string.format("%.2f", Gladdy.version_num) .. "-" .. Gladdy.version_releaseType
@ -433,23 +432,22 @@ end
function Gladdy:UPDATE_BATTLEFIELD_STATUS(_, index)
local status, mapName, instanceID, levelRangeMin, levelRangeMax, teamSize, isRankedArena, suspendedQueue, bool, queueType = GetBattlefieldStatus(index)
local instanceType = select(2, IsInInstance())
Gladdy:Debug("INFO", "UPDATE_BATTLEFIELD_STATUS", instanceType, status, teamSize)
self:Debug("INFO", "UPDATE_BATTLEFIELD_STATUS", instanceType, status, teamSize)
if ((instanceType == "arena" or GetNumArenaOpponents() > 0) and status == "active" and teamSize > 0) then
self.curBracket = teamSize
self:JoinedArena()
elseif status == "active" then
if self.db.hideBlizzard == "always" then
self:BlizzArenaSetAlpha(0)
else
self:BlizzArenaSetAlpha(1)
end
end
end
function Gladdy:PLAYER_REGEN_ENABLED()
if self.showFrame then
self:UpdateFrame()
if self.startTest then
self:Test()
self.startTest = nil
end
self.frame:Show()
self:SendMessage("JOINED_ARENA")
self.showFrame = nil
self:InitFrames()
end
if self.hideFrame then
self:Reset()
@ -481,8 +479,8 @@ function Gladdy:Reset()
for unit in pairs(self.buttons) do
self:ResetUnit(unit)
end
if Gladdy.db.hideBlizzard == "never" or Gladdy.db.hideBlizzard == "arena" then
Gladdy:BlizzArenaSetAlpha(1)
if self.db.hideBlizzard == "never" or self.db.hideBlizzard == "arena" then
self:BlizzArenaSetAlpha(1)
end
end
@ -525,6 +523,16 @@ end
---------------------------
function Gladdy:JoinedArena()
if InCombatLockdown() then
self:Print("Gladdy frames show as soon as you leave combat")
self.showFrame = true
else
self:InitFrames()
end
end
function Gladdy:InitFrames()
self.showFrame = nil
if not self.curBracket then
self.curBracket = 2
end
@ -535,19 +543,21 @@ function Gladdy:JoinedArena()
end
end
if InCombatLockdown() then
Gladdy:Print("Gladdy frames show as soon as you leave combat")
self.showFrame = true
else
self:UpdateFrame()
self.frame:Show()
self:SendMessage("JOINED_ARENA")
self:UpdateFrame()
if self.startTest then
self:Test()
self.startTest = nil
end
self.frame:Show()
self:SendMessage("JOINED_ARENA")
for i=1, self.curBracket do
self.buttons["arena" .. i]:SetAlpha(1)
end
if Gladdy.db.hideBlizzard == "arena" or Gladdy.db.hideBlizzard == "always" then
Gladdy:BlizzArenaSetAlpha(0)
if self.db.hideBlizzard == "arena" or self.db.hideBlizzard == "always" then
self:BlizzArenaSetAlpha(0)
else
self:BlizzArenaSetAlpha(1)
end
end

View File

@ -1,7 +1,7 @@
## Title: Gladdy |cFFFF0000 game client not supported|r
## Version: 2.23-Release
## Version: 2.27-Release
## Notes: The most powerful arena AddOn for WoW Classic TBC/WotLK
## Author: XiconQoo, DnB_Junkee, Knall, Binkcn
## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751
## X-Curse-Project-ID: 482332
## X-WoWI-ID: 26350

View File

@ -1,6 +1,6 @@
## Interface: 20504
## Title: Gladdy - TBC
## Version: 2.22-Release
## Version: 2.27-Release
## Notes: The most powerful arena AddOn for WoW 2.5.4
## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751
@ -39,7 +39,6 @@ Modules\BuffsDebuffs.lua
Modules\VersionCheck.lua
Modules\XiconProfiles.lua
Modules\Pets.lua
Modules\Targets.lua
Modules\ExportImport.lua
Modules\CombatIndicator.lua
Modules\RangeCheck.lua

View File

@ -1,7 +1,7 @@
## Interface: 30400
## Interface: 30402
## Title: Gladdy - WotLK
## Version: 2.22-Release
## Notes: The most powerful arena AddOn for WoW 3.4.0
## Version: 2.27-Release
## Notes: The most powerful arena AddOn for WoW 3.4.2
## Author: XiconQoo, DnB_Junkee, Knall
## X-Email: contact me on discord Knall#1751
## X-Curse-Project-ID: 482332
@ -39,7 +39,6 @@ Modules\BuffsDebuffs.lua
Modules\VersionCheck.lua
Modules\XiconProfiles.lua
Modules\Pets.lua
Modules\Targets.lua
Modules\ExportImport.lua
Modules\CombatIndicator.lua
Modules\RangeCheck.lua

View File

@ -1298,10 +1298,6 @@ elseif GetLocale() == "zhCN" then
L["Portrait"] = "头像"
L["Health Values"] = "生命值"
-- Targets.lua
L["Targets"] = "敌方目标"
L["Enables Targets module"] = "启用敌方目标显示模块"
-- Powerbar.lua
L["Power Bar"] = "法力/能量条"
L["Power Bar Text"] = "法力/能量条文字"

View File

@ -9,7 +9,7 @@
-- make into AceComm.
-- @class file
-- @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
@ -35,10 +35,6 @@ local error, assert = error, assert
-- WoW APIs
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 {}
-- for my sanity and yours, let's give the message type bytes some names

View File

@ -75,7 +75,7 @@ local next = next
local strlen = string.len
local GetFramerate = GetFramerate
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

View File

@ -1,7 +1,7 @@
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames.
-- @class file
-- @name AceConfigCmd-3.0
-- @release $Id: AceConfigCmd-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceConfigCmd-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
--[[
AceConfigCmd-3.0
@ -37,17 +37,10 @@ local error, assert = error, assert
-- WoW APIs
local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, SELECTED_CHAT_FRAME, DEFAULT_CHAT_FRAME
local L = setmetatable({}, { -- TODO: replace with proper locale
__index = function(self,k) return k end
})
local function print(msg)
(SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg)
end
@ -401,7 +394,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
return
end
local str = strsub(info.input,inputpos);
local strInput = strsub(info.input,inputpos);
if tab.type=="execute" then
------------ execute --------------------------------------------
@ -414,21 +407,21 @@ local function handle(info, inputpos, tab, depth, retfalse)
local res = true
if tab.pattern then
if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end
if not strmatch(str, tab.pattern) then
usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
if type(tab.pattern)~="string" then err(info, inputpos, "'pattern' - expected a string") end
if not strmatch(strInput, tab.pattern) then
usererr(info, inputpos, "'"..strInput.."' - " .. L["invalid input"])
return
end
end
do_final(info, inputpos, tab, "set", str)
do_final(info, inputpos, tab, "set", strInput)
elseif tab.type=="toggle" then
------------ toggle --------------------------------------------
local b
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str=="" then
b = callmethod(info, inputpos, tab, "get")
@ -465,9 +458,9 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="range" then
------------ range --------------------------------------------
local val = tonumber(str)
local val = tonumber(strInput)
if not val then
usererr(info, inputpos, "'"..str.."' - "..L["expected number"])
usererr(info, inputpos, "'"..strInput.."' - "..L["expected number"])
return
end
if type(info.step)=="number" then
@ -487,7 +480,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="select" then
------------ select ------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
local values = tab.values
if type(values) == "function" or type(values) == "string" then
@ -528,7 +521,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="multiselect" then
------------ multiselect -------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
local values = tab.values
if type(values) == "function" or type(values) == "string" then
@ -565,7 +558,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
--check that the opt is valid
local ok
for k,v in pairs(values) do
for k in pairs(values) do
if strlower(k)==opt then
opt = k -- overwrite with key (in case of case mismatches)
ok = true
@ -634,7 +627,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="color" then
------------ color --------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str == "" then
--TODO: Show current value
return
@ -706,7 +699,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
elseif tab.type=="keybinding" then
------------ keybinding --------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str == "" then
--TODO: Show current value
return

View File

@ -1,13 +1,13 @@
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
-- @class file
-- @name AceConfigDialog-3.0
-- @release $Id: AceConfigDialog-3.0.lua 1232 2020-04-14 22:21:22Z nevcairiel $
-- @release $Id: AceConfigDialog-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $
local LibStub = LibStub
local gui = LibStub("AceGUI-3.0")
local reg = LibStub("AceConfigRegistry-3.0")
local MAJOR, MINOR = "AceConfigDialog-3.0", 79
local MAJOR, MINOR = "AceConfigDialog-3.0", 86
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigDialog then return end
@ -22,19 +22,13 @@ AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {}
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {}
-- 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 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 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 = {}
--[[
@ -153,6 +147,7 @@ local stringIsLiteral = {
width = true,
image = true,
fontSize = true,
tooltipHyperlink = true
}
--Is Never a function or method
@ -194,9 +189,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
--We have a function to call
local info = new()
--traverse the options table, picking up the handler and filling the info with the path
local handler
local group = options
handler = group.handler or handler
local handler = group.handler
for i = 1, #path do
group = GetSubOption(group, path[i])
@ -508,6 +502,14 @@ local function OptionOnMouseOver(widget, event)
local tooltip = AceConfigDialog.tooltip
tooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT")
local tooltipHyperlink = GetOptionsMemberValue("tooltipHyperlink", opt, options, path, appName)
if tooltipHyperlink then
tooltip:SetHyperlink(tooltipHyperlink)
tooltip:Show()
return
end
local name = GetOptionsMemberValue("name", opt, options, path, appName)
local desc = GetOptionsMemberValue("desc", opt, options, path, appName)
local usage = GetOptionsMemberValue("usage", opt, options, path, appName)
@ -535,8 +537,7 @@ local function OptionOnMouseLeave(widget, event)
end
local function GetFuncName(option)
local type = option.type
if type == "execute" then
if option.type == "execute" then
return "func"
else
return "set"
@ -544,13 +545,15 @@ local function GetFuncName(option)
end
do
local frame = AceConfigDialog.popup
if not frame then
if not frame or oldminor < 81 then
frame = CreateFrame("Frame", nil, UIParent)
AceConfigDialog.popup = frame
frame:Hide()
frame:SetPoint("CENTER", UIParent, "CENTER")
frame:SetSize(320, 72)
frame:EnableMouse(true) -- Do not allow click-through on the frame
frame:SetFrameStrata("TOOLTIP")
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetScript("OnKeyDown", function(self, key)
if key == "ESCAPE" then
self:SetPropagateKeyboardInput(false)
@ -564,26 +567,17 @@ do
end
end)
if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then
frame:SetBackdrop({
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
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 border = CreateFrame("Frame", nil, frame, "DialogBorderOpaqueTemplate")
border:SetAllPoints(frame)
frame:SetFixedFrameStrata(true)
frame:SetFixedFrameLevel(true)
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
text:SetSize(290, 0)
text:SetPoint("TOP", 0, -16)
frame.text = text
local function newButton(text)
local function newButton(newText)
local button = CreateFrame("Button", nil, frame)
button:SetSize(128, 21)
button:SetNormalFontObject(GameFontNormal)
@ -594,7 +588,7 @@ do
button:GetPushedTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
button:SetHighlightTexture(130762) -- "Interface\\Buttons\\UI-DialogBox-Button-Highlight"
button:GetHighlightTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
button:SetText(text)
button:SetText(newText)
return button
end
@ -681,7 +675,7 @@ local function ActivateControl(widget, event, ...)
if group[funcname] ~= nil then
func = group[funcname]
end
handler = group.handler or handler
handler = group.handler
confirm = group.confirm
validate = group.validate
for i = 1, #path do
@ -745,7 +739,6 @@ local function ActivateControl(widget, event, ...)
end
end
local rootframe = user.rootframe
if not validated or type(validated) == "string" then
if not validated then
if usage then
@ -760,8 +753,8 @@ local function ActivateControl(widget, event, ...)
end
-- show validate message
if rootframe.SetStatusText then
rootframe:SetStatusText(validated)
if user.rootframe.SetStatusText then
user.rootframe:SetStatusText(validated)
else
validationErrorPopup(validated)
end
@ -798,14 +791,14 @@ local function ActivateControl(widget, event, ...)
if type(confirm) == "boolean" then
if confirm then
if not confirmText then
local name, desc = option.name, option.desc
if type(name) == "function" then
name = name(info)
local option_name, desc = option.name, option.desc
if type(option_name) == "function" then
option_name = option_name(info)
end
if type(desc) == "function" then
desc = desc(info)
end
confirmText = name
confirmText = option_name
if desc then
confirmText = confirmText.." - "..desc
end
@ -1147,8 +1140,6 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
--Control to feed
local control
local name = GetOptionsMemberValue("name", v, options, path, appName)
if v.type == "execute" then
local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
@ -1251,7 +1242,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
end
tsort(sorting, sortTblAsStrings)
end
for k, value in ipairs(sorting) do
for _, value in ipairs(sorting) do
local text = values[value]
local radio = gui:Create("CheckBox")
radio:SetLabel(text)
@ -1333,8 +1324,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
control:SetWidth(width_multiplier)
end
--check:SetTriState(v.tristate)
for i = 1, #valuesort do
local key = valuesort[i]
for s = 1, #valuesort do
local key = valuesort[s]
local value = GetOptionsMemberValue("get",v, options, path, appName, key)
control:SetItemValue(key,value)
end
@ -1346,8 +1337,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
control:PauseLayout()
local width = GetOptionsMemberValue("width",v,options,path,appName)
for i = 1, #valuesort do
local value = valuesort[i]
for s = 1, #valuesort do
local value = valuesort[s]
local text = values[value]
local check = gui:Create("CheckBox")
check:SetLabel(text)
@ -1364,7 +1355,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
elseif width == "half" then
check:SetWidth(width_multiplier / 2)
elseif (type(width) == "number") then
control:SetWidth(width_multiplier * width)
check:SetWidth(width_multiplier * width)
elseif width == "full" then
check.width = "fill"
else
@ -1434,8 +1425,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
end
control:SetImageSize(width, height)
end
local width = GetOptionsMemberValue("width",v,options,path,appName)
control.width = not width and "fill"
local controlWidth = GetOptionsMemberValue("width",v,options,path,appName)
control.width = not controlWidth and "fill"
end
--Common Init
@ -1690,29 +1681,29 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
elseif grouptype == "select" then
local select = gui:Create("DropdownGroup")
select:SetTitle(name)
InjectInfo(select, options, group, path, rootframe, appName)
select:SetCallback("OnGroupSelected", GroupSelected)
local selectGroup = gui:Create("DropdownGroup")
selectGroup:SetTitle(name)
InjectInfo(selectGroup, options, group, path, rootframe, appName)
selectGroup:SetCallback("OnGroupSelected", GroupSelected)
local status = AceConfigDialog:GetStatusTable(appName, path)
if not status.groups then
status.groups = {}
end
select:SetStatusTable(status.groups)
selectGroup:SetStatusTable(status.groups)
local grouplist, orderlist = BuildSelect(group, options, path, appName)
select:SetGroupList(grouplist, orderlist)
select:SetUserData("grouplist", grouplist)
select:SetUserData("orderlist", orderlist)
selectGroup:SetGroupList(grouplist, orderlist)
selectGroup:SetUserData("grouplist", grouplist)
selectGroup:SetUserData("orderlist", orderlist)
local firstgroup = orderlist[1]
if firstgroup then
select:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
selectGroup:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
end
select.width = "fill"
select.height = "fill"
selectGroup.width = "fill"
selectGroup.height = "fill"
container:AddChild(select)
container:AddChild(selectGroup)
--assume tree group by default
--if parenttype is tree then this group is already a node on that tree
@ -1940,13 +1931,13 @@ end
-- convert pre-39 BlizOptions structure to the new format
if oldminor and oldminor < 39 and AceConfigDialog.BlizOptions then
local old = AceConfigDialog.BlizOptions
local new = {}
local newOpt = {}
for key, widget in pairs(old) do
local appName = widget:GetUserData("appName")
if not new[appName] then new[appName] = {} end
new[appName][key] = widget
if not newOpt[appName] then newOpt[appName] = {} end
newOpt[appName][key] = widget
end
AceConfigDialog.BlizOptions = new
AceConfigDialog.BlizOptions = newOpt
else
AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {}
end
@ -1979,6 +1970,7 @@ end
-- @param parent The parent to use in the interface options tree.
-- @param ... The path in the options table to feed into the interface options panel.
-- @return The reference to the frame registered into the Interface Options.
-- @return The category ID to pass to Settings.OpenToCategory (or InterfaceOptionsFrame_OpenToCategory)
function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
local BlizOptions = AceConfigDialog.BlizOptions
@ -1994,7 +1986,6 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
if not BlizOptions[appName][key] then
local group = gui:Create("BlizOptionsGroup")
BlizOptions[appName][key] = group
group:SetName(name or appName, parent)
group:SetTitle(name or appName)
group:SetUserData("appName", appName)
@ -2007,8 +1998,30 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
end
group:SetCallback("OnShow", FeedToBlizPanel)
group:SetCallback("OnHide", ClearBlizPanel)
InterfaceOptions_AddCategory(group.frame)
return group.frame
if Settings and Settings.RegisterCanvasLayoutCategory then
local categoryName = name or appName
if parent then
local category = Settings.GetCategory(parent)
if not category then
error(("The parent category '%s' was not found"):format(parent), 2)
end
local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName)
-- force the generated ID to be used for subcategories, as these can have very simple names like "Profiles"
group:SetName(subcategory.ID, parent)
else
local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName)
-- using appName here would be cleaner, but would not be 100% compatible
-- but for top-level categories it should be fine, as these are typically addon names
category.ID = categoryName
group:SetName(categoryName, parent)
Settings.RegisterAddOnCategory(category)
end
else
group:SetName(name or appName, parent)
InterfaceOptions_AddCategory(group.frame)
end
return group.frame, group.frame.name
else
error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2)
end

View File

@ -8,10 +8,10 @@
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName".
-- @class file
-- @name AceConfigRegistry-3.0
-- @release $Id: AceConfigRegistry-3.0.lua 1207 2019-06-23 12:08:33Z nevcairiel $
-- @release $Id: AceConfigRegistry-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $
local CallbackHandler = LibStub("CallbackHandler-1.0")
local MAJOR, MINOR = "AceConfigRegistry-3.0", 20
local MAJOR, MINOR = "AceConfigRegistry-3.0", 21
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigRegistry then return end
@ -83,6 +83,7 @@ local basekeys={
dialogHidden=optmethodbool,
dropdownHidden=optmethodbool,
cmdHidden=optmethodbool,
tooltipHyperlink=optstringfunc,
icon=optstringnumberfunc,
iconCoords=optmethodtable,
handler=opttable,

View File

@ -40,8 +40,8 @@
-- end
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 1217 2019-07-11 03:06:18Z funkydude $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 27
-- @release $Id: AceDB-3.0.lua 1306 2023-06-23 14:55:09Z nevcairiel $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 28
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
if not AceDB then return end -- No upgrade needed
@ -53,10 +53,6 @@ local setmetatable, rawset, rawget = setmetatable, rawset, rawget
-- WoW APIs
local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub
AceDB.db_registry = AceDB.db_registry or {}
AceDB.frame = AceDB.frame or CreateFrame("Frame")
@ -98,11 +94,11 @@ local function copyDefaults(dest, src)
-- This is a metatable used for table defaults
local mt = {
-- This handles the lookup and creation of new subtables
__index = function(t,k)
if k == nil then return nil end
__index = function(t,k2)
if k2 == nil then return nil end
local tbl = {}
copyDefaults(tbl, v)
rawset(t, k, tbl)
rawset(t, k2, tbl)
return tbl
end,
}
@ -115,7 +111,7 @@ local function copyDefaults(dest, src)
end
else
-- 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)
end
elseif type(v) == "table" then
@ -264,7 +260,7 @@ local factionrealmKey = factionKey .. " - " .. realmKey
local localeKey = GetLocale():lower()
local regionTable = { "US", "KR", "EU", "TW", "CN" }
local regionKey = regionTable[GetCurrentRegion()]
local regionKey = regionTable[GetCurrentRegion()] or GetCurrentRegionName() or "TR"
local factionrealmregionKey = factionrealmKey .. " - " .. regionKey
-- Actual database initialization function

View File

@ -1,7 +1,7 @@
--- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles.
-- @class file
-- @name AceDBOptions-3.0
-- @release $Id: AceDBOptions-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id: AceDBOptions-3.0.lua 1304 2023-05-19 19:50:10Z nevcairiel $
local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15
local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)
@ -13,10 +13,6 @@ local pairs, next = pairs, next
-- WoW APIs
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.handlers = AceDBOptions.handlers or {}
@ -88,25 +84,25 @@ elseif LOCALE == "frFR" then
L["reset_desc"] = "Réinitialise le profil actuel au cas où votre configuration est corrompue ou si vous voulez tout simplement faire table rase."
L["reset_sub"] = "Réinitialise le profil actuel avec les paramètres par défaut."
elseif LOCALE == "koKR" then
L["choose"] = "저장 중인 프로필"
L["choose_desc"] = "입력창에 새로운 이름을 입력하거나 저장 중인 프로필 중 하나를 선택하여 새로운 프로필을 만들 수 있습니다."
L["choose"] = "기존 프로필"
L["choose_desc"] = "편집 상자에 이름을 입력하여 새로운 프로필을 만들거나 이미 존재하는 프로필 중 하나를 선택할 수 있습니다."
L["choose_sub"] = "현재 이용할 수 있는 프로필 중 하나를 선택합니다."
L["copy"] = "복사해오기"
L["copy_desc"] = "현재 사용 중인 프로필에 선택한 프로필의 설정을 복사합니다."
L["copy"] = "복사해 올 프로필"
L["copy_desc"] = "기존 프로필의 설정을 현재 활성화된 프로필로 복사합니다."
L["current"] = "현재 프로필:"
L["default"] = "기본값"
L["delete"] = "프로필 삭제"
L["delete_confirm"] = "정말로 선택한 프로필을 삭제할까요?"
L["delete_desc"] = "저장 공간 절약과 SavedVariables 파일의 정리를 위해 데이터베이스에서 사용하지 않는 프로필을 삭제하세요."
L["delete_sub"] = "데이터베이스 프로필을 삭제합니다."
L["intro"] = "활성 데이터베이스 프로필을 변경할 수 있고, 각 캐릭터 별로 다른 설정을 할 수 있습니다."
L["delete_confirm"] = "선택한 프로필을 삭제하시겠습니까?"
L["delete_desc"] = "데이터베이스에서 기존 프로필과 사용하지 않는 프로필을 삭제하여 공간을 절약하고 SavedVariables 파일을 정리합니다."
L["delete_sub"] = "데이터베이스에서 프로필을 삭제합니다."
L["intro"] = "활성 데이터베이스 프로필을 변경할 수 있으며, 모든 캐릭터마다 서로 다른 설정을 지정할 수 있습니다."
L["new"] = "새로운 프로필"
L["new_sub"] = "새로운 프로필을 만듭니다."
L["new_sub"] = "비어 있는 프로필을 새로 만듭니다."
L["profiles"] = "프로필"
L["profiles_sub"] = "프로필 관리"
L["reset"] = "프로필 초기화"
L["reset_desc"] = "설정이 깨졌거나 처음부터 다시 설정을 원하는 경우, 현재 프로필을 기본값으로 초기화하세요."
L["reset_sub"] = "현재 프로필을 기본값으로 초기화합니다"
L["reset"] = "프로필 재설정"
L["reset_desc"] = "구성이 손상되었거나 처음부터 다시 시작하고 싶은 경우 현재 프로필을 기본값으로 재설정하세요."
L["reset_sub"] = "현재 프로필을 기본값으로 재설정합니다"
elseif LOCALE == "esES" or LOCALE == "esMX" then
L["choose"] = "Perfiles existentes"
L["choose_desc"] = "Puedes crear un nuevo perfil introduciendo un nombre en el recuadro o puedes seleccionar un perfil de los ya existentes."
@ -170,31 +166,31 @@ elseif LOCALE == "zhCN" then
elseif LOCALE == "ruRU" then
L["choose"] = "Существующие профили"
L["choose_desc"] = "Вы можете создать новый профиль, введя название в поле ввода, или выбрать один из уже существующих профилей."
L["choose_sub"] = "Выбор одиного из уже доступных профилей"
L["choose_sub"] = "Выбор одного из уже доступных профилей."
L["copy"] = "Скопировать из"
L["copy_desc"] = "Скопировать настройки из выбранного профиля в активный."
L["copy_desc"] = "Копирование настроек из выбранного профиля в активный."
L["current"] = "Текущий профиль:"
L["default"] = "По умолчанию"
L["delete"] = "Удалить профиль"
L["delete_confirm"] = "Вы уверены, что вы хотите удалить выбранный профиль?"
L["delete_desc"] = "Удалить существующий и неиспользуемый профиль из БД для сохранения места, и очистить SavedVariables файл."
L["delete_sub"] = "Удаление профиля из БД"
L["intro"] = "Изменяя активный профиль, вы можете задать различные настройки модификаций для каждого персонажа."
L["delete_confirm"] = "Вы уверены, что хотите удалить выбранный профиль?"
L["delete_desc"] = "Удаление существующего и неиспользуемого профиля из базы данных для сохранения места, и очистка файла SavedVariables."
L["delete_sub"] = "Удаление профиля из базы данных."
L["intro"] = "Изменяя активный профиль, Вы можете задать разные настройки для каждого персонажа."
L["new"] = "Новый"
L["new_sub"] = "Создать новый чистый профиль"
L["new_sub"] = "Создание нового чистого профиля."
L["profiles"] = "Профили"
L["profiles_sub"] = "Управление профилями"
L["reset"] = "Сброс профиля"
L["reset_desc"] = "Сбросить текущий профиль к стандартным настройкам, если ваша конфигурация испорчена или вы хотите настроить всё заново."
L["reset"] = "Сбросить профиль"
L["reset_desc"] = "Сброс текущего профиля к стандартным настройкам, если Ваша конфигурация испорчена или Вы хотите настроить все заново."
L["reset_sub"] = "Сброс текущего профиля на стандартный"
elseif LOCALE == "itIT" then
L["choose"] = "Profili Esistenti"
L["choose_desc"] = "Puoi creare un nuovo profilo digitando il nome della casella di testo, oppure scegliendone uno tra i profili già esistenti."
L["choose_sub"] = "Seleziona uno dei profili attualmente disponibili."
L["copy"] = "Copia Da"
L["copy_desc"] = "Copia le impostazioni da un profilo esistente, nel profilo attivo in questo momento."
L["copy_desc"] = "Copia le impostazioni da un profilo esistente nel profilo attivo in questo momento."
L["current"] = "Profilo Attivo:"
L["default"] = "Standard"
L["default"] = "Predefinito"
L["delete"] = "Cancella un Profilo"
L["delete_confirm"] = "Sei sicuro di voler cancellare il profilo selezionato?"
L["delete_desc"] = "Cancella i profili non utilizzati dal database per risparmiare spazio e mantenere puliti i file di configurazione SavedVariables."

View File

@ -24,28 +24,22 @@
-- f:AddChild(btn)
-- @class file
-- @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, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
if not AceGUI then return end -- No upgrade needed
-- Lua APIs
local tinsert = table.insert
local tinsert, wipe = table.insert, table.wipe
local select, pairs, next, type = select, pairs, next, type
local error, assert = error, assert
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
local UIParent = UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: geterrorhandler, LibStub
--local con = LibStub("AceConsole-3.0",true)
AceGUI.WidgetRegistry = AceGUI.WidgetRegistry or {}
AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
AceGUI.WidgetBase = AceGUI.WidgetBase or {}
@ -94,38 +88,38 @@ do
AceGUI.objPools = AceGUI.objPools or {}
local objPools = AceGUI.objPools
--Returns a new instance, if none are available either returns a new table or calls the given contructor
function newWidget(type)
if not WidgetRegistry[type] then
function newWidget(widgetType)
if not WidgetRegistry[widgetType] then
error("Attempt to instantiate unknown widget type", 2)
end
if not objPools[type] then
objPools[type] = {}
if not objPools[widgetType] then
objPools[widgetType] = {}
end
local newObj = next(objPools[type])
local newObj = next(objPools[widgetType])
if not newObj then
newObj = WidgetRegistry[type]()
newObj.AceGUIWidgetVersion = WidgetVersions[type]
newObj = WidgetRegistry[widgetType]()
newObj.AceGUIWidgetVersion = WidgetVersions[widgetType]
else
objPools[type][newObj] = nil
objPools[widgetType][newObj] = nil
-- if the widget is older then the latest, don't even try to reuse it
-- just forget about it, and grab a new one.
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[type] then
return newWidget(type)
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[widgetType] then
return newWidget(widgetType)
end
end
return newObj
end
-- Releases an instance to the Pool
function delWidget(obj,type)
if not objPools[type] then
objPools[type] = {}
function delWidget(obj,widgetType)
if not objPools[widgetType] then
objPools[widgetType] = {}
end
if objPools[type][obj] then
if objPools[widgetType][obj] then
error("Attempt to Release Widget that is already released", 2)
end
objPools[type][obj] = true
objPools[widgetType][obj] = true
end
end
@ -141,9 +135,9 @@ end
-- OnAcquire function on it, before returning.
-- @param type The type of the widget.
-- @return The newly created widget.
function AceGUI:Create(type)
if WidgetRegistry[type] then
local widget = newWidget(type)
function AceGUI:Create(widgetType)
if WidgetRegistry[widgetType] then
local widget = newWidget(widgetType)
if rawget(widget, "Acquire") then
widget.OnAcquire = widget.Acquire
@ -161,7 +155,7 @@ function AceGUI:Create(type)
if widget.OnAcquire then
widget:OnAcquire()
else
error(("Widget type %s doesn't supply an OnAcquire Function"):format(type))
error(("Widget type %s doesn't supply an OnAcquire Function"):format(widgetType))
end
-- Set the default Layout ("List")
safecall(widget.SetLayout, widget, "List")
@ -589,25 +583,25 @@ AceGUI.counts = AceGUI.counts or {}
-- This is used by widgets that require a named frame, e.g. when a Blizzard
-- Template requires it.
-- @param type The widget type
function AceGUI:GetNextWidgetNum(type)
if not self.counts[type] then
self.counts[type] = 0
function AceGUI:GetNextWidgetNum(widgetType)
if not self.counts[widgetType] then
self.counts[widgetType] = 0
end
self.counts[type] = self.counts[type] + 1
return self.counts[type]
self.counts[widgetType] = self.counts[widgetType] + 1
return self.counts[widgetType]
end
--- Return the number of created widgets for this type.
-- In contrast to GetNextWidgetNum, the number is not incremented.
-- @param type The widget type
function AceGUI:GetWidgetCount(type)
return self.counts[type] or 0
-- @param widgetType The widget type
function AceGUI:GetWidgetCount(widgetType)
return self.counts[widgetType] or 0
end
--- Return the version of the currently registered widget type.
-- @param type The widget type
function AceGUI:GetWidgetVersion(type)
return WidgetVersions[type]
-- @param widgetType The widget type
function AceGUI:GetWidgetVersion(widgetType)
return WidgetVersions[widgetType]
end
-------------
@ -770,7 +764,6 @@ AceGUI:RegisterLayout("Flow",
usedwidth = 0
rowstart = frame
rowstartoffset = frameoffset
if child.DoLayout then
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 tableObj["align" .. dir] or tableObj.align
or "CENTERLEFT"
local child, cell, val = child or 0, cell or 0, nil
local val
child, cell = child or 0, cell or 0
if type(fn) == "string" then
fn = fn:lower()
@ -827,7 +821,7 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
val = fn
end
return fn, max(0, min(val, cell))
return fn, math_max(0, math_min(val, cell))
end
-- Get width or height for multiple cells combined
@ -836,7 +830,7 @@ local GetCellDimension = function (dir, laneDim, from, to, space)
for cell=from,to do
dim = dim + (laneDim[cell] or 0)
end
return dim + max(0, to - from) * (space or 0)
return dim + math_max(0, to - from) * (space or 0)
end
--[[ Options
@ -882,7 +876,7 @@ AceGUI:RegisterLayout("Table",
repeat
n = n + 1
local col = (n - 1) % #cols + 1
local row = ceil(n / #cols)
local row = math_ceil(n / #cols)
local rowspan = rowspans[col]
local cell = rowspan and rowspan.child or child
local cellObj = cell:GetUserData("cell")
@ -898,7 +892,7 @@ AceGUI:RegisterLayout("Table",
end
-- Colspan
local colspan = max(0, min((cellObj and cellObj.colspan or 1) - 1, #cols - col))
local colspan = math_max(0, math_min((cellObj and cellObj.colspan or 1) - 1, #cols - col))
n = n + colspan
-- Place the cell
@ -915,7 +909,7 @@ AceGUI:RegisterLayout("Table",
end
end
local rows = ceil(n / #cols)
local rows = math_ceil(n / #cols)
-- Determine fixed size cols and collect weights
local extantH, totalWeight = totalH, 0
@ -940,16 +934,16 @@ AceGUI:RegisterLayout("Table",
f:ClearAllPoints()
local childH = f:GetWidth() or 0
laneH[col] = max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH))
laneH[col] = math_max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH))
end
end
laneH[col] = max(colObj.min or colObj[1] or 0, min(laneH[col], colObj.max or colObj[2] or laneH[col]))
laneH[col] = math_max(colObj.min or colObj[1] or 0, math_min(laneH[col], colObj.max or colObj[2] or laneH[col]))
else
-- Rel./Abs. width
laneH[col] = colObj.width < 1 and colObj.width * totalH or colObj.width
end
extantH = max(0, extantH - laneH[col])
extantH = math_max(0, extantH - laneH[col])
end
end
@ -988,7 +982,7 @@ AceGUI:RegisterLayout("Table",
child:DoLayout()
end
rowV = max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV))
rowV = math_max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV))
end
end

View File

@ -2,7 +2,7 @@
BlizOptionsGroup Container
Simple container widget for the integration of AceGUI into the Blizzard Interface Options
-------------------------------------------------------------------------------]]
local Type, Version = "BlizOptionsGroup", 21
local Type, Version = "BlizOptionsGroup", 26
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -99,7 +99,7 @@ local methods = {
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local frame = CreateFrame("Frame")
local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
frame:Hide()
-- support functions for the Blizzard Interface Options
@ -108,6 +108,11 @@ local function Constructor()
frame.default = default
frame.refresh = refresh
-- 10.0 support function aliases (cancel has been removed)
frame.OnCommit = okay
frame.OnDefault = default
frame.OnRefresh = refresh
frame:SetScript("OnHide", OnHide)
frame:SetScript("OnShow", OnShow)

View File

@ -125,7 +125,7 @@ local function Constructor()
dropdown.frame:Show()
dropdown:SetLabel("")
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
border:SetPoint("TOPLEFT", 0, -26)
border:SetPoint("BOTTOMRIGHT", 0, 3)
border:SetBackdrop(PaneBackdrop)

View File

@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
Frame Container
-------------------------------------------------------------------------------]]
local Type, Version = "Frame", 27
local Type, Version = "Frame", 30
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -13,10 +13,6 @@ local wipe = table.wipe
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: CLOSE
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
@ -83,6 +79,7 @@ local methods = {
["OnAcquire"] = function(self)
self.frame:SetParent(UIParent)
self.frame:SetFrameStrata("FULLSCREEN_DIALOG")
self.frame:SetFrameLevel(100) -- Lots of room to draw under it
self:SetTitle()
self:SetStatusText()
self:ApplyStatus()
@ -179,16 +176,21 @@ local PaneBackdrop = {
}
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
frame:Hide()
frame:EnableMouse(true)
frame:SetMovable(true)
frame:SetResizable(true)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
frame:SetFrameLevel(100) -- Lots of room to draw under it
frame:SetBackdrop(FrameBackdrop)
frame:SetBackdropColor(0, 0, 0, 1)
frame:SetMinResize(400, 200)
if frame.SetResizeBounds then -- WoW 10.0
frame:SetResizeBounds(400, 200)
else
frame:SetMinResize(400, 200)
end
frame:SetToplevel(true)
frame:SetScript("OnShow", Frame_OnShow)
frame:SetScript("OnHide", Frame_OnClose)
@ -201,7 +203,7 @@ local function Constructor()
closebutton:SetWidth(100)
closebutton:SetText(CLOSE)
local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local statusbg = CreateFrame("Button", nil, frame, "BackdropTemplate")
statusbg:SetPoint("BOTTOMLEFT", 15, 15)
statusbg:SetPoint("BOTTOMRIGHT", -132, 15)
statusbg:SetHeight(24)
@ -269,7 +271,7 @@ local function Constructor()
line2:SetHeight(8)
line2:SetPoint("BOTTOMRIGHT", -8, 8)
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
local x = 0.1 * 8/17
x = 0.1 * 8/17
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
local sizer_s = CreateFrame("Frame", nil, frame)

View File

@ -75,7 +75,7 @@ local function Constructor()
titletext:SetJustifyH("LEFT")
titletext:SetHeight(18)
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
border:SetPoint("TOPLEFT", 0, -17)
border:SetPoint("BOTTOMRIGHT", -1, 3)
border:SetBackdrop(PaneBackdrop)

View File

@ -2,22 +2,18 @@
TabGroup Container
Container that uses tabs on top to switch between groups.
-------------------------------------------------------------------------------]]
local Type, Version = "TabGroup", 37
local Type, Version = "TabGroup", 38
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, wipe
local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, table.wipe
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: PanelTemplates_TabResize, PanelTemplates_SetDisabledTabState, PanelTemplates_SelectTab, PanelTemplates_DeselectTab
-- local upvalue storage used by BuildTabs
local widths = {}
local rowwidths = {}
@ -26,6 +22,143 @@ local rowends = {}
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
local function PanelTemplates_TabResize(tab, padding, absoluteSize, minWidth, maxWidth, absoluteTextSize)
local tabName = tab:GetName();
local buttonMiddle = tab.Middle or tab.middleTexture or _G[tabName.."Middle"];
local buttonMiddleDisabled = tab.MiddleDisabled or (tabName and _G[tabName.."MiddleDisabled"]);
local left = tab.Left or tab.leftTexture or _G[tabName.."Left"];
local sideWidths = 2 * left:GetWidth();
local tabText = tab.Text or _G[tab:GetName().."Text"];
local highlightTexture = tab.HighlightTexture or (tabName and _G[tabName.."HighlightTexture"]);
local width, tabWidth;
local textWidth;
if ( absoluteTextSize ) then
textWidth = absoluteTextSize;
else
tabText:SetWidth(0);
textWidth = tabText:GetWidth();
end
-- If there's an absolute size specified then use it
if ( absoluteSize ) then
if ( absoluteSize < sideWidths) then
width = 1;
tabWidth = sideWidths
else
width = absoluteSize - sideWidths;
tabWidth = absoluteSize
end
tabText:SetWidth(width);
else
-- Otherwise try to use padding
if ( padding ) then
width = textWidth + padding;
else
width = textWidth + 24;
end
-- If greater than the maxWidth then cap it
if ( maxWidth and width > maxWidth ) then
if ( padding ) then
width = maxWidth + padding;
else
width = maxWidth + 24;
end
tabText:SetWidth(width);
else
tabText:SetWidth(0);
end
if (minWidth and width < minWidth) then
width = minWidth;
end
tabWidth = width + sideWidths;
end
if ( buttonMiddle ) then
buttonMiddle:SetWidth(width);
end
if ( buttonMiddleDisabled ) then
buttonMiddleDisabled:SetWidth(width);
end
tab:SetWidth(tabWidth);
if ( highlightTexture ) then
highlightTexture:SetWidth(tabWidth);
end
end
local function PanelTemplates_DeselectTab(tab)
local name = tab:GetName();
local left = tab.Left or _G[name.."Left"];
local middle = tab.Middle or _G[name.."Middle"];
local right = tab.Right or _G[name.."Right"];
left:Show();
middle:Show();
right:Show();
--tab:UnlockHighlight();
tab:Enable();
local text = tab.Text or _G[name.."Text"];
text:SetPoint("CENTER", tab, "CENTER", (tab.deselectedTextX or 0), (tab.deselectedTextY or 2));
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
leftDisabled:Hide();
middleDisabled:Hide();
rightDisabled:Hide();
end
local function PanelTemplates_SelectTab(tab)
local name = tab:GetName();
local left = tab.Left or _G[name.."Left"];
local middle = tab.Middle or _G[name.."Middle"];
local right = tab.Right or _G[name.."Right"];
left:Hide();
middle:Hide();
right:Hide();
--tab:LockHighlight();
tab:Disable();
tab:SetDisabledFontObject(GameFontHighlightSmall);
local text = tab.Text or _G[name.."Text"];
text:SetPoint("CENTER", tab, "CENTER", (tab.selectedTextX or 0), (tab.selectedTextY or -3));
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
leftDisabled:Show();
middleDisabled:Show();
rightDisabled:Show();
if GameTooltip:IsOwned(tab) then
GameTooltip:Hide();
end
end
local function PanelTemplates_SetDisabledTabState(tab)
local name = tab:GetName();
local left = tab.Left or _G[name.."Left"];
local middle = tab.Middle or _G[name.."Middle"];
local right = tab.Right or _G[name.."Right"];
left:Show();
middle:Show();
right:Show();
--tab:UnlockHighlight();
tab:Disable();
tab.text = tab:GetText();
-- Gray out text
tab:SetDisabledFontObject(GameFontDisableSmall);
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
leftDisabled:Hide();
middleDisabled:Hide();
rightDisabled:Hide();
end
local function UpdateTabLook(frame)
if frame.disabled then
PanelTemplates_SetDisabledTabState(frame)
@ -103,11 +236,64 @@ local methods = {
["CreateTab"] = function(self, id)
local tabname = ("AceGUITabGroup%dTab%d"):format(self.num, id)
local tab = CreateFrame("Button", tabname, self.border, "OptionsFrameTabButtonTemplate")
local tab = CreateFrame("Button", tabname, self.border)
tab:SetSize(115, 24)
tab.deselectedTextY = -3
tab.selectedTextY = -2
tab.LeftDisabled = tab:CreateTexture(tabname .. "LeftDisabled", "BORDER")
tab.LeftDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
tab.LeftDisabled:SetSize(20, 24)
tab.LeftDisabled:SetPoint("BOTTOMLEFT", 0, -3)
tab.LeftDisabled:SetTexCoord(0, 0.15625, 0, 1.0)
tab.MiddleDisabled = tab:CreateTexture(tabname .. "MiddleDisabled", "BORDER")
tab.MiddleDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
tab.MiddleDisabled:SetSize(88, 24)
tab.MiddleDisabled:SetPoint("LEFT", tab.LeftDisabled, "RIGHT")
tab.MiddleDisabled:SetTexCoord(0.15625, 0.84375, 0, 1.0)
tab.RightDisabled = tab:CreateTexture(tabname .. "RightDisabled", "BORDER")
tab.RightDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
tab.RightDisabled:SetSize(20, 24)
tab.RightDisabled:SetPoint("LEFT", tab.MiddleDisabled, "RIGHT")
tab.RightDisabled:SetTexCoord(0.84375, 1.0, 0, 1.0)
tab.Left = tab:CreateTexture(tabname .. "Left", "BORDER")
tab.Left:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
tab.Left:SetSize(20, 24)
tab.Left:SetPoint("TOPLEFT")
tab.Left:SetTexCoord(0, 0.15625, 0, 1.0)
tab.Middle = tab:CreateTexture(tabname .. "Middle", "BORDER")
tab.Middle:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
tab.Middle:SetSize(88, 24)
tab.Middle:SetPoint("LEFT", tab.Left, "RIGHT")
tab.Middle:SetTexCoord(0.15625, 0.84375, 0, 1.0)
tab.Right = tab:CreateTexture(tabname .. "Right", "BORDER")
tab.Right:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
tab.Right:SetSize(20, 24)
tab.Right:SetPoint("LEFT", tab.Middle, "RIGHT")
tab.Right:SetTexCoord(0.84375, 1.0, 0, 1.0)
tab.Text = tab:CreateFontString(tabname .. "Text")
tab:SetFontString(tab.Text)
tab:SetNormalFontObject(GameFontNormalSmall)
tab:SetHighlightFontObject(GameFontHighlightSmall)
tab:SetDisabledFontObject(GameFontHighlightSmall)
tab:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight", "ADD")
tab.HighlightTexture = tab:GetHighlightTexture()
tab.HighlightTexture:ClearAllPoints()
tab.HighlightTexture:SetPoint("LEFT", tab, "LEFT", 10, -4)
tab.HighlightTexture:SetPoint("RIGHT", tab, "RIGHT", -10, -4)
_G[tabname .. "HighlightTexture"] = tab.HighlightTexture
tab.obj = self
tab.id = id
tab.text = _G[tabname .. "Text"]
tab.text = tab.Text -- compat
tab.text:ClearAllPoints()
tab.text:SetPoint("LEFT", 14, -3)
tab.text:SetPoint("RIGHT", -12, -3)
@ -316,7 +502,7 @@ local function Constructor()
titletext:SetHeight(18)
titletext:SetText("")
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
border:SetPoint("TOPLEFT", 1, -27)
border:SetPoint("BOTTOMRIGHT", -1, 3)
border:SetBackdrop(PaneBackdrop)

View File

@ -2,22 +2,18 @@
TreeGroup Container
Container that uses a tree control to switch between groups.
-------------------------------------------------------------------------------]]
local Type, Version = "TreeGroup", 45
local Type, Version = "TreeGroup", 47
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
local math_min, math_max, floor = math.min, math.max, floor
local math_min, math_max, floor = math.min, math.max, math.floor
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: FONT_COLOR_CODE_CLOSE
-- Recycling functions
local new, del
do
@ -567,7 +563,11 @@ local methods = {
if maxtreewidth > 100 and status.treewidth > maxtreewidth then
self:SetTreeWidth(maxtreewidth, status.treesizable)
end
treeframe:SetMaxResize(maxtreewidth, 1600)
if treeframe.SetResizeBounds then
treeframe:SetResizeBounds(100, 1, maxtreewidth, 1600)
else
treeframe:SetMaxResize(maxtreewidth, 1600)
end
end,
["OnHeightSet"] = function(self, height)
@ -637,7 +637,7 @@ local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
local treeframe = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local treeframe = CreateFrame("Frame", nil, frame, "BackdropTemplate")
treeframe:SetPoint("TOPLEFT")
treeframe:SetPoint("BOTTOMLEFT")
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
@ -646,13 +646,17 @@ local function Constructor()
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
treeframe:SetResizable(true)
treeframe:SetMinResize(100, 1)
treeframe:SetMaxResize(400, 1600)
if treeframe.SetResizeBounds then -- WoW 10.0
treeframe:SetResizeBounds(100, 1, 400, 1600)
else
treeframe:SetMinResize(100, 1)
treeframe:SetMaxResize(400, 1600)
end
treeframe:SetScript("OnUpdate", FirstFrameUpdate)
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
local dragger = CreateFrame("Frame", nil, treeframe, BackdropTemplateMixin and "BackdropTemplate" or nil)
local dragger = CreateFrame("Frame", nil, treeframe, "BackdropTemplate")
dragger:SetWidth(8)
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT")
@ -677,7 +681,7 @@ local function Constructor()
scrollbg:SetAllPoints(scrollbar)
scrollbg:SetColorTexture(0,0,0,0.4)
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
border:SetPoint("BOTTOMRIGHT")
border:SetBackdrop(PaneBackdrop)

View File

@ -7,10 +7,6 @@ local pairs, assert, type = pairs, assert, type
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GameFontNormal
----------------
-- Main Frame --
----------------
@ -21,7 +17,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
]]
do
local Type = "Window"
local Version = 6
local Version = 8
local function frameOnShow(this)
this.obj:Fire("OnShow")
@ -186,7 +182,11 @@ do
frame:SetScript("OnShow",frameOnShow)
frame:SetScript("OnHide",frameOnClose)
frame:SetMinResize(240,240)
if frame.SetResizeBounds then -- WoW 10.0
frame:SetResizeBounds(240,240)
else
frame:SetMinResize(240,240)
end
frame:SetToplevel(true)
local titlebg = frame:CreateTexture(nil, "BACKGROUND")
@ -300,7 +300,7 @@ do
line2:SetHeight(8)
line2:SetPoint("BOTTOMRIGHT", -8, 8)
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
local x = 0.1 * 8/17
x = 0.1 * 8/17
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
local sizer_s = CreateFrame("Frame",nil,frame)

View File

@ -12,10 +12,6 @@ local select, pairs = select, pairs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: SetDesaturation, GameFontHighlight
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
@ -199,14 +195,14 @@ local methods = {
["SetDescription"] = function(self, desc)
if desc then
if not self.desc then
local desc = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
desc:ClearAllPoints()
desc:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
desc:SetWidth(self.frame.width - 30)
desc:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
desc:SetJustifyH("LEFT")
desc:SetJustifyV("TOP")
self.desc = desc
local f = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
f:ClearAllPoints()
f:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
f:SetWidth(self.frame.width - 30)
f:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
f:SetJustifyH("LEFT")
f:SetJustifyV("TOP")
self.desc = f
end
self.desc:Show()
--self.text:SetFontObject(GameFontNormal)

View File

@ -11,10 +11,6 @@ local pairs = pairs
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: ColorPickerFrame, OpacitySliderFrame
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]

View File

@ -1,4 +1,4 @@
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1202 2019-05-15 23:11:22Z nevcairiel $ ]]--
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1272 2022-08-29 15:56:35Z nevcairiel $ ]]--
local AceGUI = LibStub("AceGUI-3.0")
@ -41,7 +41,7 @@ local ItemBase = {
-- NOTE: The ItemBase version is added to each item's version number
-- to ensure proper updates on ItemBase changes.
-- Use at least 1000er steps.
version = 1000,
version = 2000,
counter = 0,
}
@ -178,7 +178,7 @@ function ItemBase.Create(type)
highlight:Hide()
self.highlight = highlight
local check = frame:CreateTexture("OVERLAY")
local check = frame:CreateTexture(nil, "OVERLAY")
check:SetWidth(16)
check:SetHeight(16)
check:SetPoint("LEFT",frame,"LEFT",3,-1)
@ -186,7 +186,7 @@ function ItemBase.Create(type)
check:Hide()
self.check = check
local sub = frame:CreateTexture("OVERLAY")
local sub = frame:CreateTexture(nil, "OVERLAY")
sub:SetWidth(16)
sub:SetHeight(16)
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)

View File

@ -1,4 +1,4 @@
--[[ $Id: AceGUIWidget-DropDown.lua 1239 2020-09-20 10:22:02Z nevcairiel $ ]]--
--[[ $Id: AceGUIWidget-DropDown.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]--
local AceGUI = LibStub("AceGUI-3.0")
-- Lua APIs
@ -11,10 +11,6 @@ local PlaySound = PlaySound
local UIParent, CreateFrame = UIParent, CreateFrame
local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: CLOSE
local function fixlevels(parent,...)
local i = 1
local child = select(i, ...)
@ -253,7 +249,7 @@ do
local function Constructor()
local count = AceGUI:GetNextWidgetNum(widgetType)
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, "BackdropTemplate")
local self = {}
self.count = count
self.type = widgetType
@ -304,7 +300,7 @@ do
scrollFrame.obj = self
itemFrame.obj = self
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, "BackdropTemplate")
slider:SetOrientation("VERTICAL")
slider:SetHitRectInsets(0, 0, -10, 0)
slider:SetBackdrop(sliderBackdrop)
@ -351,7 +347,7 @@ end
do
local widgetType = "Dropdown"
local widgetVersion = 35
local widgetVersion = 36
--[[ Static data ]]--
@ -376,7 +372,6 @@ do
local function Dropdown_TogglePullout(this)
local self = this.obj
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
if self.open then
self.open = nil
self.pullout:Close()

View File

@ -14,10 +14,6 @@ local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, Get
local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: AceGUIEditBoxInsertLink, ChatFontNormal, OKAY
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]

View File

@ -13,10 +13,6 @@ local pairs = pairs
local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: NOT_BOUND
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
@ -214,7 +210,7 @@ local function Constructor()
label:SetJustifyH("CENTER")
label:SetHeight(18)
local msgframe = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
local msgframe = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
msgframe:SetHeight(30)
msgframe:SetBackdrop(ControlBackdrop)
msgframe:SetBackdropColor(0,0,0)

View File

@ -2,7 +2,7 @@
Label Widget
Displays text and optionally an icon.
-------------------------------------------------------------------------------]]
local Type, Version = "Label", 27
local Type, Version = "Label", 28
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -12,10 +12,6 @@ local max, select, pairs = math.max, select, pairs
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GameFontHighlightSmall
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
@ -129,12 +125,16 @@ local methods = {
end,
["SetFont"] = function(self, font, height, flags)
self.label:SetFont(font, height, flags)
UpdateImageAnchor(self)
if not self.fontObject then
self.fontObject = CreateFont("AceGUI30LabelFont" .. AceGUI:GetNextWidgetNum(Type))
end
self.fontObject:SetFont(font, height, flags)
self:SetFontObject(self.fontObject)
end,
["SetFontObject"] = function(self, font)
self:SetFont((font or GameFontHighlightSmall):GetFont())
self.label:SetFontObject(font or GameFontHighlightSmall)
UpdateImageAnchor(self)
end,
["SetImageSize"] = function(self, width, height)

View File

@ -1,4 +1,4 @@
local Type, Version = "MultiLineEditBox", 29
local Type, Version = "MultiLineEditBox", 32
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@ -10,10 +10,6 @@ local GetCursorInfo, GetSpellInfo, ClearCursor = GetCursorInfo, GetSpellInfo, Cl
local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: ACCEPT, ChatFontNormal
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
@ -145,6 +141,14 @@ local function OnVerticalScroll(self, offset)
editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight())
end
local function OnScrollRangeChanged(self, xrange, yrange)
if yrange == 0 then
self.obj.editBox:SetHitRectInsets(0, 0, 0, 0)
else
OnVerticalScroll(self, self:GetVerticalScroll())
end
end
local function OnShowFocus(frame)
frame.obj.editBox:SetFocus()
frame:SetScript("OnShow", nil)
@ -257,8 +261,6 @@ local methods = {
["SetCursorPosition"] = function(self, ...)
return self.editBox:SetCursorPosition(...)
end,
}
--[[-----------------------------------------------------------------------------
@ -297,7 +299,7 @@ local function Constructor()
text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -5, 1)
text:SetJustifyV("MIDDLE")
local scrollBG = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local scrollBG = CreateFrame("Frame", nil, frame, "BackdropTemplate")
scrollBG:SetBackdrop(backdrop)
scrollBG:SetBackdropColor(0, 0, 0)
scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
@ -321,6 +323,7 @@ local function Constructor()
scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag)
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll)
scrollFrame:HookScript("OnScrollRangeChanged", OnScrollRangeChanged)
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame)
editBox:SetAllPoints()

View File

@ -14,10 +14,6 @@ local tonumber, pairs = tonumber, pairs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: GameFontHighlightSmall
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
@ -31,13 +27,13 @@ local function UpdateText(self)
end
local function UpdateLabels(self)
local min, max = (self.min or 0), (self.max or 100)
local min_value, max_value = (self.min or 0), (self.max or 100)
if self.ispercent then
self.lowtext:SetFormattedText("%s%%", (min * 100))
self.hightext:SetFormattedText("%s%%", (max * 100))
self.lowtext:SetFormattedText("%s%%", (min_value * 100))
self.hightext:SetFormattedText("%s%%", (max_value * 100))
else
self.lowtext:SetText(min)
self.hightext:SetText(max)
self.lowtext:SetText(min_value)
self.hightext:SetText(max_value)
end
end
@ -175,13 +171,13 @@ local methods = {
self.label:SetText(text)
end,
["SetSliderValues"] = function(self, min, max, step)
["SetSliderValues"] = function(self, min_value, max_value, step)
local frame = self.slider
frame.setup = true
self.min = min
self.max = max
self.min = min_value
self.max = max_value
self.step = step
frame:SetMinMaxValues(min or 0,max or 100)
frame:SetMinMaxValues(min_value or 0,max_value or 100)
UpdateLabels(self)
frame:SetValueStep(step or 1)
if self.value then
@ -225,7 +221,7 @@ local function Constructor()
label:SetJustifyH("CENTER")
label:SetHeight(15)
local slider = CreateFrame("Slider", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local slider = CreateFrame("Slider", nil, frame, "BackdropTemplate")
slider:SetOrientation("HORIZONTAL")
slider:SetHeight(15)
slider:SetHitRectInsets(0, 0, -10, 0)
@ -247,7 +243,7 @@ local function Constructor()
local hightext = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
hightext:SetPoint("TOPRIGHT", slider, "BOTTOMRIGHT", -2, 3)
local editbox = CreateFrame("EditBox", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
local editbox = CreateFrame("EditBox", nil, frame, "BackdropTemplate")
editbox:SetAutoFocus(false)
editbox:SetFontObject(GameFontHighlightSmall)
editbox:SetPoint("TOP", slider, "BOTTOM")

View File

@ -9,8 +9,8 @@
-- make into AceHook.
-- @class file
-- @name AceHook-3.0
-- @release $Id: AceHook-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 8
-- @release $Id: AceHook-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 9
local AceHook, oldminor = LibStub:NewLibrary(ACEHOOK_MAJOR, ACEHOOK_MINOR)
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
end
handlers[uid], actives[uid], scripts[uid] = nil, nil, nil
uid = nil
end
local orig
@ -478,10 +477,10 @@ function AceHook:UnhookAll()
for key, value in pairs(registry[self]) do
if type(key) == "table" then
for method in pairs(value) do
self:Unhook(key, method)
AceHook.Unhook(self, key, method)
end
else
self:Unhook(key)
AceHook.Unhook(self, key)
end
end
end

View File

@ -10,7 +10,7 @@
-- make into AceSerializer.
-- @class file
-- @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 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)
nres=nres+1
res[nres] = "^T"
for k,v in pairs(v) do
nres = SerializeValue(k, res, nres)
nres = SerializeValue(v, res, nres)
for key,value in pairs(v) do
nres = SerializeValue(key, res, nres)
nres = SerializeValue(value, res, nres)
end
nres=nres+1
res[nres] = "^t"

View File

@ -15,7 +15,7 @@
-- make into AceTimer.
-- @class file
-- @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 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
-- due to fps differences
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
if delay < 0.01 then delay = 0.01 end
C_TimerAfter(delay, timer.callback)
timer.ends = time + delay
if ndelay < 0.01 then ndelay = 0.01 end
C_TimerAfter(ndelay, timer.callback)
timer.ends = time + ndelay
else
activeTimers[timer.handle or timer] = nil
end

View File

@ -1,61 +1,26 @@
--[[ $Id: CallbackHandler-1.0.lua 3 2008-09-29 16:54:20Z nevcairiel $ ]]
local MAJOR, MINOR = "CallbackHandler-1.0", 3
--[[ $Id: CallbackHandler-1.0.lua 1298 2022-12-12 15:10:10Z nevcairiel $ ]]
local MAJOR, MINOR = "CallbackHandler-1.0", 8
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
if not CallbackHandler then return end -- No upgrade needed
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
local type = type
local pcall = pcall
local pairs = pairs
local assert = assert
local concat = table.concat
local loadstring = loadstring
local next = next
local select = select
local type = type
local xpcall = xpcall
-- Lua APIs
local securecallfunction, error = securecallfunction, error
local setmetatable, rawget = setmetatable, rawget
local next, select, pairs, type, tostring = next, select, pairs, type, tostring
local function errorhandler(err)
return geterrorhandler()(err)
local function Dispatch(handlers, ...)
local index, method = next(handlers)
if not method then return end
repeat
securecallfunction(method, ...)
index, method = next(handlers, index)
until not method
end
local function CreateDispatcher(argCount)
local code = [[
local next, xpcall, eh = ...
local method, ARGS
local function call() method(ARGS) end
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
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
--------------------------------------------------------------------------
-- CallbackHandler:New
--
@ -64,9 +29,7 @@ end})
-- 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.
function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused)
-- 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")
function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName)
RegisterName = RegisterName or "RegisterCallback"
UnregisterName = UnregisterName or "UnregisterCallback"
@ -88,19 +51,19 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll
local oldrecurse = registry.recurse
registry.recurse = oldrecurse + 1
Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...)
Dispatch(events[eventname], eventname, ...)
registry.recurse = oldrecurse
if registry.insertQueue and oldrecurse==0 then
-- Something in one of our callbacks wanted to register more callbacks; they got queued
for eventname,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.
for self,func in pairs(callbacks) do
events[eventname][self] = func
for event,callbacks in pairs(registry.insertQueue) do
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 object,func in pairs(callbacks) do
events[event][object] = func
-- fire OnUsed callback?
if first and registry.OnUsed then
registry.OnUsed(registry, target, eventname)
registry.OnUsed(registry, target, event)
first = nil
end
end
@ -146,9 +109,9 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll
regfunc = function(...) self[method](self,...) end
end
else
-- function ref with self=object or self="addonId"
if type(self)~="table" and type(self)~="string" then
error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string expected.", 2)
-- function ref with self=object or self="addonId" or self=thread
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 or thread expected.", 2)
end
if select("#",...)>=1 then -- this is not the same as testing for arg==nil!

View File

@ -9,7 +9,7 @@ License: MIT
--- 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", 54 -- Don't forget to change this in Spells.lua aswell!
local Lib = assert(LibStub, MAJOR .. " requires LibStub."):NewLibrary(MAJOR, MINOR)
if not Lib then return end -- already loaded
@ -30,7 +30,7 @@ L["TAUNTS"] = "Taunts"
L["FEARS"] = "Fears"
L["RANDOM_ROOTS"] = "Random roots"
L["RANDOM_STUNS"] = "Random stuns"
L["OPENER_STUN"] = "Opener Stuns"
L["OPENER_STUN"] = "Opener stuns"
L["HORROR"] = "Horrors"
L["SCATTERS"] = "Scatters"
L["SLEEPS"] = GetSpellInfo(1090) or "Sleep"
@ -129,34 +129,30 @@ Lib.gameExpansion = ({
[WOW_PROJECT_MAINLINE] = "retail",
[WOW_PROJECT_CLASSIC] = "classic",
[WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc",
[WOW_PROJECT_WRATH_CLASSIC or 11] = "wotlk",
})[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.
Lib.resetTimes = {
retail = {
["default"] = 18.5, -- 18 sec + 0.5 latency
["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
["default"] = 18.5, -- static 18 sec + 0.5 latency
["npc"] = 21, -- Against mobs it seems to last slightly longer, depending on server load
["knockback"] = 10.5, -- Knockbacks are immediately immune and only DRs for 10s
},
classic = {
["default"] = 19, -- dynamic between 15 and 20s
["npc"] = 23,
["default"] = 20, -- dynamic between 15 and 20s
["npc"] = 21,
},
tbc = {
["default"] = 19, -- dynamic between 15 and 20s
["npc"] = 23,
["default"] = 20, -- dynamic between 15 and 20s
["npc"] = 21,
},
wotlk = {
["default"] = 19, -- dynamic between 15 and 20s
["npc"] = 23,
["default"] = 20, -- dynamic between 15 and 20s
["npc"] = 21,
},
}
@ -203,7 +199,7 @@ Lib.categoryNames = {
["counterattack"] = L.COUNTERATTACK,
},
wotlk = { -- WORK IN PROGRESS
wotlk = {
["incapacitate"] = L.INCAPACITATES,
["stun"] = L.STUNS,
["random_stun"] = L.RANDOM_STUNS,
@ -223,13 +219,12 @@ Lib.categoryNames = {
}
-- Categories that have DR against normal mobs.
-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
-- Note that for retail some special mobs have DR on all categories,
-- see UnitClassification() and UnitIsQuestBoss().
Lib.categoriesPvE = {
retail = {
["taunt"] = L.TAUNTS, -- Lib.categoryNames.retail.taunt
["taunt"] = L.TAUNTS,
["stun"] = L.STUNS,
["root"] = L.ROOTS,
},
classic = {
@ -296,9 +291,9 @@ function Lib:GetCategories()
return Lib.categoryNames[Lib.gameExpansion]
end
--- Get table of all categories that DRs in PvE only.
--- Get table of all categories that DRs in PvE.
-- Key is unlocalized name used for API functions, value is localized name used for UI.
-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
-- Note that for retail some special mobs have DR on all categories,
-- see UnitClassification() and UnitIsQuestBoss().
-- Tip: you can combine :GetPvECategories() and :IterateSpellsByCategory() to get spellIDs only for PvE aswell.
-- @treturn table {string=string}
@ -341,7 +336,7 @@ function Lib:GetCategoryLocalization(category)
end
--- Check if a category has DR against mobs.
-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
-- Note that for retail some special mobs have DR on all categories, you need to check for this yourself;
-- see UnitClassification() and UnitIsQuestBoss().
-- @tparam string category Unlocalized category name
-- @treturn bool
@ -382,7 +377,6 @@ do
--- Iterate through the spells of a given category.
-- @tparam string category Unlocalized category name
-- @usage for spellID in DRList:IterateSpellsByCategory("root") do print(spellID) end
-- @warning Slow function, do not use for frequent combat related stuff unless you cache results.
-- @return Iterator function
function Lib:IterateSpellsByCategory(category)
assert(Lib.categoryNames[Lib.gameExpansion][category], "invalid category")
@ -395,6 +389,6 @@ Lib.GetCategoryName = Lib.GetCategoryLocalization
Lib.IsPVE = Lib.IsPvECategory
Lib.NextDR = Lib.GetNextDR
Lib.GetSpellCategory = Lib.GetCategoryBySpellID
Lib.IterateSpells = Lib.IterateSpellsByCategory
Lib.RESET_TIME = Lib.resetTimes[Lib.gameExpansion].default
Lib.pveDR = Lib.categoriesPvE
Lib.IterateSpells = function(cat) if cat then return Lib.IterateSpellsByCategory(cat) else return next, Lib.spellList end end

View File

@ -1,7 +1,8 @@
## Interface: 90205
## Interface-Classic: 11402
## Interface: 100105
## Interface-Classic: 11403
## Interface-BCC: 20504
## Interface-Wrath: 30400
## Interface-Wrath: 30402
## IconTexture: Interface\Icons\Spell_nature_heavypolymorph1
## Title: Lib: DRList-1.0
## Version: @project-version@
## X-Category: Library
@ -14,6 +15,7 @@ libs\LibStub\LibStub.lua
#@end-no-lib-strip@
DRList-1.0.xml
#@do-not-package@
tests\engine.lua
tests\test-retail.lua

View File

@ -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", 54 -- Don't forget to change this in DRList-1.0.lua aswell!
local Lib = LibStub(MAJOR)
if Lib.spellListVersion and Lib.spellListVersion >= MINOR then
return
@ -13,17 +13,20 @@ if Lib.gameExpansion == "retail" then
[207167] = "disorient", -- Blinding Sleet
[207685] = "disorient", -- Sigil of Misery
[33786] = "disorient", -- Cyclone
[360806] = "disorient", -- Sleep Walk
[1513] = "disorient", -- Scare Beast
[31661] = "disorient", -- Dragon's Breath
[198909] = "disorient", -- Song of Chi-ji
[202274] = "disorient", -- Incendiary Brew
[202274] = "disorient", -- Hot Trub
[105421] = "disorient", -- Blinding Light
[10326] = "disorient", -- Turn Evil
[205364] = "disorient", -- Dominate Mind
[605] = "disorient", -- Mind Control
[8122] = "disorient", -- Psychic Scream
[226943] = "disorient", -- Mind Bomb
[2094] = "disorient", -- Blind
[118699] = "disorient", -- Fear
[130616] = "disorient", -- Fear (Horrify)
[5484] = "disorient", -- Howl of Terror
[261589] = "disorient", -- Seduction (Grimoire of Sacrifice)
[6358] = "disorient", -- Seduction (Succubus)
@ -36,9 +39,11 @@ if Lib.gameExpansion == "retail" then
[221527] = "incapacitate", -- Imprison (Honor talent)
[2637] = "incapacitate", -- Hibernate
[99] = "incapacitate", -- Incapacitating Roar
[378441] = "incapacitate", -- Time Stop
[3355] = "incapacitate", -- Freezing Trap
[203337] = "incapacitate", -- Freezing Trap (Honor talent)
[213691] = "incapacitate", -- Scatter Shot
[383121] = "incapacitate", -- Mass Polymorph
[118] = "incapacitate", -- Polymorph
[28271] = "incapacitate", -- Polymorph (Turtle)
[28272] = "incapacitate", -- Polymorph (Pig)
@ -53,8 +58,11 @@ if Lib.gameExpansion == "retail" then
[161372] = "incapacitate", -- Polymorph (Peacock)
[277787] = "incapacitate", -- Polymorph (Baby Direhorn)
[277792] = "incapacitate", -- Polymorph (Bumblebee)
[321395] = "incapacitate", -- Polymorph (Mawrat)
[391622] = "incapacitate", -- Polymorph (Duck)
[82691] = "incapacitate", -- Ring of Frost
[115078] = "incapacitate", -- Paralysis
[357768] = "incapacitate", -- Paralysis 2 (Perpetual Paralysis?)
[20066] = "incapacitate", -- Repentance
[9484] = "incapacitate", -- Shackle Undead
[200196] = "incapacitate", -- Holy Word: Chastise
@ -78,8 +86,11 @@ if Lib.gameExpansion == "retail" then
[47476] = "silence", -- Strangulate
[204490] = "silence", -- Sigil of Silence
-- [78675] = "silence", -- Solar Beam (has no DR)
[410065] = "silence", -- Reactive Resin
[202933] = "silence", -- Spider Sting
[356727] = "silence", -- Spider Venom
[354831] = "silence", -- Wailing Arrow 1
[355596] = "silence", -- Wailing Arrow 2
[217824] = "silence", -- Shield of Virtue
[15487] = "silence", -- Silence
[1330] = "silence", -- Garrote
@ -102,10 +113,14 @@ if Lib.gameExpansion == "retail" then
[5211] = "stun", -- Mighty Bash
[202244] = "stun", -- Overrun
[325321] = "stun", -- Wild Hunt's Charge
[372245] = "stun", -- Terror of the Skies
[117526] = "stun", -- Binding Shot
[357021] = "stun", -- Consecutive Concussion
[24394] = "stun", -- Intimidation
[389831] = "stun", -- Snowdrift
[119381] = "stun", -- Leg Sweep
[202346] = "stun", -- Double Barrel
[385149] = "stun", -- Exorcism
[853] = "stun", -- Hammer of Justice
[255941] = "stun", -- Wake of Ashes
[64044] = "stun", -- Psychic Horror
@ -119,6 +134,7 @@ if Lib.gameExpansion == "retail" then
[171017] = "stun", -- Meteor Strike (Infernal)
[171018] = "stun", -- Meteor Strike (Abyssal)
[30283] = "stun", -- Shadowfury
[385954] = "stun", -- Shield Charge
[46968] = "stun", -- Shockwave
[132168] = "stun", -- Shockwave (Protection)
[145047] = "stun", -- Shockwave (Proving Grounds PvE)
@ -128,13 +144,16 @@ if Lib.gameExpansion == "retail" then
[255723] = "stun", -- Bull Rush (Highmountain Tauren)
[287712] = "stun", -- Haymaker (Kul Tiran)
[332423] = "stun", -- Sparkling Driftglobe Core (Kyrian Covenant)
-- TODO: Inferal Awakening?
[204085] = "root", -- Deathchill (Chains of Ice)
[233395] = "root", -- Deathchill (Remorseless Winter)
[339] = "root", -- Entangling Roots
[235963] = "root", -- Entangling Roots (Earthen Grasp)
[170855] = "root", -- Entangling Roots (Nature's Grasp)
[102359] = "root", -- Mass Entanglement
[117526] = "root", -- Binding Shot
[355689] = "root", -- Landslide
[393456] = "root", -- Entrapment (Tar Trap)
[162480] = "root", -- Steel Trap
[273909] = "root", -- Steelclaw Trap
-- [190927] = "root_harpoon", -- Harpoon (TODO: confirm)
@ -142,19 +161,26 @@ if Lib.gameExpansion == "retail" then
[201158] = "root", -- Super Sticky Tar
[122] = "root", -- Frost Nova
[33395] = "root", -- Freeze
[386770] = "root", -- Freezing Cold
[198121] = "root", -- Frostbite
[114404] = "root", -- Void Tendril's Grasp
[342375] = "root", -- Tormenting Backlash (Torghast PvE)
[233582] = "root", -- Entrenched in Flame
[116706] = "root", -- Disable
[324382] = "root", -- Clash
[64695] = "root", -- Earthgrab (Totem effect)
-- [356738] = "root", -- Earth Unleashed (doesn't seem to DR)
[285515] = "root", -- Surge of Power
[199042] = "root", -- Thunderstruck (Protection PvP Talent)
--[356356] = "root", -- Warbringer TODO: has DR?
[39965] = "root", -- Frost Grenade (Item)
[75148] = "root", -- Embersilk Net (Item)
[55536] = "root", -- Frostweave Net (Item)
[268966] = "root", -- Hooked Deep Sea Net (Item)
[209749] = "disarm", -- Faerie Swarm (Balance Honor Talent)
[407032] = "disarm", -- Sticky Tar Bomb 1
[407031] = "disarm", -- Sticky Tar Bomb 2
[207777] = "disarm", -- Dismantle
[233759] = "disarm", -- Grapple Weapon
[236077] = "disarm", -- Disarm
@ -360,7 +386,7 @@ elseif Lib.gameExpansion == "tbc" then
[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 for every rank is used over spell name to avoid name collisions, and faster lookups
@ -415,6 +441,9 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
[30216] = "incapacitate", -- Fel Iron Bomb
[30461] = "incapacitate", -- The Bigger One
[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)
[5211] = "stun", -- Bash (Rank 1)
@ -504,6 +533,7 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
[9853] = "root", -- Entangling Roots (Rank 6)
[26989] = "root", -- Entangling Roots (Rank 7)
[53308] = "root", -- Entangling Roots (Rank 8)
[65857] = "root", -- Entangling Roots (Rank 8) (TODO: Not sure which ID is correct)
[19975] = "root", -- Nature's Grasp (Rank 1)
[19974] = "root", -- Nature's Grasp (Rank 2)
[19973] = "root", -- Nature's Grasp (Rank 3)
@ -511,7 +541,8 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
[19971] = "root", -- Nature's Grasp (Rank 5)
[19970] = "root", -- Nature's Grasp (Rank 6)
[27010] = "root", -- Nature's Grasp (Rank 7)
[53312] = "root", -- Nature's Grasp (Rank 8)
[53313] = "root", -- Nature's Grasp (Rank 8)
[66070] = "root", -- Nature's Grasp (Rank 8) (TODO: Not sure which ID is correct)
[50245] = "root", -- Pin (Rank 1)
[53544] = "root", -- Pin (Rank 2)
[53545] = "root", -- Pin (Rank 3)
@ -525,8 +556,10 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
[10230] = "root", -- Frost Nova (Rank 4)
[27088] = "root", -- Frost Nova (Rank 5)
[42917] = "root", -- Frost Nova (Rank 6)
[64695] = "root", -- Earthgrab
[39965] = "root", -- Frost Grenade (Item)
[63685] = "root", -- Freeze (Frost Shock)
[55536] = "root", -- Frostweave Net (Item)
[12494] = "random_root", -- Frostbite
[55080] = "random_root", -- Shattered Barrier
@ -542,6 +575,7 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
[53540] = "disarm", -- Snatch (Rank 4)
[53542] = "disarm", -- Snatch (Rank 5)
[53543] = "disarm", -- Snatch (Rank 6)
[64346] = "disarm", -- Fiery Payback
[64058] = "disarm", -- Psychic Horror Disarm Effect
[51722] = "disarm", -- Dismantle
[676] = "disarm", -- Disarm
@ -592,6 +626,7 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
[33786] = "cyclone", -- Cyclone
[605] = "mind_control", -- Mind Control
[13181] = "mind_control", -- Gnomish Mind Control Cap
[67799] = "mind_control", -- Mind Amplification Dish
[7922] = "charge", -- Charge Stun
[19306] = "counterattack", -- Counterattack 1
[20909] = "counterattack", -- Counterattack 2
@ -599,9 +634,6 @@ elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE
[27067] = "counterattack", -- Counterattack 4
[48998] = "counterattack", -- Counterattack 5
[48999] = "counterattack", -- Counterattack 6
--Storm, Earth and Fire has no DR
-- TODO: profession stuff
}
elseif Lib.gameExpansion == "classic" then

View File

@ -51,7 +51,7 @@ GlowMaskPool.parent = GlowParent
local TexPoolResetter = function(pool,tex)
local maskNum = tex:GetNumMaskTextures()
for i = maskNum,1 do
for i = maskNum , 1, -1 do
tex:RemoveMaskTexture(tex:GetMaskTexture(i))
end
tex:Hide()
@ -93,14 +93,14 @@ lib.GlowFramePool = GlowFramePool
local function addFrameAndTex(r,color,name,key,N,xOffset,yOffset,texture,texCoord,desaturated,frameLevel)
key = key or ""
frameLevel = frameLevel or 8
frameLevel = frameLevel or 8
if not r[name..key] then
r[name..key] = GlowFramePool:Acquire()
r[name..key]:SetParent(r)
r[name..key].name = name..key
end
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("BOTTOMRIGHT",r,"BOTTOMRIGHT",xOffset,-yOffset+0.05)
f:Show()
@ -613,7 +613,7 @@ function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
if not r then
return
end
frameLevel = frameLevel or 8;
frameLevel = frameLevel or 8;
local throttle
if frequency and frequency > 0 then
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("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
f.ants:SetSize(width*1.4*0.85, height*1.4*0.85)
AnimIn_OnFinished(f.animIn)
if f.animOut:IsPlaying() then
AnimIn_OnFinished(f.animIn)
if f.animOut:IsPlaying() then
f.animOut:Stop()
f.animIn:Play()
end

View File

@ -1,6 +1,7 @@
--@curseforge-project-slug: libsharedmedia-3-0@
--[[
Name: LibSharedMedia-3.0
Revision: $Revision: 114 $
Revision: $Revision: 128 $
Author: Elkano (elkano@gmx.de)
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com)
Website: http://www.wowace.com/projects/libsharedmedia-3-0/

View File

@ -10,7 +10,7 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
function LibStub:NewLibrary(major, minor)
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]
if oldminor and oldminor >= minor then return nil end

View File

@ -27,19 +27,19 @@ function ACDFrame:Initialize()
self.ACDNumFrame:SetPoint("CENTER", 0, 128)
self.ACDNumFrame:Hide()
local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "HIGH")
local ACDNumTens = ACDNumFrame:CreateTexture("ACDNumTens", "OVERLAY")
self.ACDNumTens = ACDNumTens
self.ACDNumTens:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumTens:SetHeight(Gladdy.db.arenaCountdownSize)
self.ACDNumTens:SetPoint("CENTER", self.ACDNumFrame, "CENTER", -(Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "HIGH")
local ACDNumOnes = ACDNumFrame:CreateTexture("ACDNumOnes", "OVERLAY")
self.ACDNumOnes = ACDNumOnes
self.ACDNumOnes:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumOnes:SetHeight(Gladdy.db.arenaCountdownSize)
self.ACDNumOnes:SetPoint("CENTER", self.ACDNumFrame, "CENTER", (Gladdy.db.arenaCountdownSize/8 + Gladdy.db.arenaCountdownSize/8/2), 0)
local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "HIGH")
local ACDNumOne = ACDNumFrame:CreateTexture("ACDNumOne", "OVERLAY")
self.ACDNumOne = ACDNumOne
self.ACDNumOne:SetWidth(Gladdy.db.arenaCountdownSize)
self.ACDNumOne:SetHeight(Gladdy.db.arenaCountdownSize)

View File

@ -331,13 +331,13 @@ function Auras:UpdateFrame(unit)
if Gladdy.db.auraIconZoomed then
if auraFrame.icon.masked then
auraFrame.icon:SetMask(nil)
auraFrame.icon:SetMask("")
auraFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9)
auraFrame.icon.masked = nil
end
else
if not auraFrame.icon.masked then
auraFrame.icon:SetMask(nil)
auraFrame.icon:SetMask("")
auraFrame.icon:SetTexCoord(0,1,0,1)
auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
auraFrame.icon.masked = true
@ -479,13 +479,13 @@ function Auras:UpdateInterruptFrame(unit)
if Gladdy.db.auraInterruptIconZoomed then
if interruptFrame.icon.masked then
interruptFrame.icon:SetMask(nil)
interruptFrame.icon:SetMask("")
interruptFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9)
interruptFrame.icon.masked = nil
end
else
if not interruptFrame.icon.masked then
interruptFrame.icon:SetMask(nil)
interruptFrame.icon:SetMask("")
interruptFrame.icon:SetTexCoord(0,1,0,1)
interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
interruptFrame.icon.masked = true

View File

@ -300,13 +300,13 @@ local function styleIcon(aura, auraType)
if zoomedOption then
if aura.texture.masked then
aura.texture:SetMask(nil)
aura.texture:SetMask("")
aura.texture:SetTexCoord(0.1,0.9,0.1,0.9)
aura.texture.masked = nil
end
else
if not aura.texture.masked then
aura.texture:SetMask(nil)
aura.texture:SetMask("")
aura.texture:SetTexCoord(0,1,0,1)
aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
aura.texture.masked = true

View File

@ -123,7 +123,7 @@ function Castbar:CreateFrame(unit)
castBar.icon:SetPoint("LEFT", castBar, "RIGHT", 3, 0) -- Icon of castbar
end
castBar.spellText = castBar:CreateFontString(nil, "LOW")
castBar.spellText = castBar:CreateFontString(nil, "OVERLAY")
castBar.spellText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
castBar.spellText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
castBar.spellText:SetShadowOffset(1, -1)
@ -131,7 +131,7 @@ function Castbar:CreateFrame(unit)
castBar.spellText:SetJustifyH("CENTER")
castBar.spellText:SetPoint("LEFT", 10, 0) -- Text of the spell
castBar.timeText = castBar:CreateFontString(nil, "LOW")
castBar.timeText = castBar:CreateFontString(nil, "OVERLAY")
castBar.timeText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
castBar.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.castBarFontColor))
castBar.timeText:SetShadowOffset(1, -1)
@ -197,13 +197,13 @@ function Castbar:UpdateFrame(unit)
castBar.icon.texture:SetAllPoints(castBar.icon)
if Gladdy.db.castBarIconZoomed then
if castBar.icon.texture.masked then
castBar.icon.texture:SetMask(nil)
castBar.icon.texture:SetMask("")
castBar.icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
castBar.icon.texture.masked = nil
end
else
if not castBar.icon.texture.masked then
castBar.icon.texture:SetMask(nil)
castBar.icon.texture:SetMask("")
castBar.icon.texture:SetTexCoord(0,1,0,1)
castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
castBar.icon.texture.masked = true

View File

@ -145,13 +145,13 @@ function Classicon:UpdateFrame(unit)
if Gladdy.db.classIconZoomed then
if classIcon.texture.masked then
classIcon.texture:SetMask(nil)
classIcon.texture:SetMask("")
classIcon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
classIcon.texture.masked = nil
end
else
if not classIcon.texture.masked then
classIcon.texture:SetMask(nil)
classIcon.texture:SetMask("")
classIcon.texture:SetTexCoord(0,1,0,1)
classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
classIcon.texture.masked = true

View File

@ -196,13 +196,13 @@ function Cooldowns:UpdateIcon(icon)
if Gladdy.db.cooldownIconZoomed then
if icon.texture.masked then
icon.texture:SetMask(nil)
icon.texture:SetMask("")
icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
icon.texture.masked = nil
end
else
if not icon.texture.masked then
icon.texture:SetMask(nil)
icon.texture:SetMask("")
icon.texture:SetTexCoord(0,1,0,1)
icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
icon.texture.masked = true

View File

@ -294,13 +294,13 @@ function Diminishings:UpdateFrame(unit)
if Gladdy.db.drIconZoomed then
if icon.texture.masked then
icon.texture:SetMask(nil)
icon.texture:SetMask("")
icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
icon.texture.masked = nil
end
else
if not icon.texture.masked then
icon.texture:SetMask(nil)
icon.texture:SetMask("")
icon.texture:SetTexCoord(0,1,0,1)
icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
icon.texture.masked = true

View File

@ -79,7 +79,7 @@ function Healthbar:CreateFrame(unit)
healthBar.bg:SetAlpha(1)
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.healthBarBgColor))
healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
healthBar.nameText = healthBar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
if (Gladdy.db.healthBarNameFontSize < 1) then
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "healthBarNameFont"), 1)
healthBar.nameText:Hide()
@ -93,7 +93,7 @@ function Healthbar:CreateFrame(unit)
healthBar.nameText:SetJustifyH("CENTER")
healthBar.nameText:SetPoint("LEFT", Gladdy.db.healthTextLeftHOffset, Gladdy.db.healthTextLeftVOffset)
healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
healthBar.healthText = healthBar:CreateFontString(nil, "OVERLAY")
if (Gladdy.db.healthBarHealthFontSize < 1) then
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "healthBarFont"), 1)
healthBar.healthText:Hide()

View File

@ -215,7 +215,7 @@ function Pets:CreateFrame(unitId)
healthBar.bg:SetAlpha(1)
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.petHealthBarBgColor))
healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
healthBar.nameText = healthBar:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
if (Gladdy.db.petHealthBarFontSize < 1) then
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.nameText:Hide()
@ -229,7 +229,7 @@ function Pets:CreateFrame(unitId)
healthBar.nameText:SetJustifyH("CENTER")
healthBar.nameText:SetPoint("LEFT", 5, 0)
healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
healthBar.healthText = healthBar:CreateFontString(nil, "OVERLAY")
if (Gladdy.db.petHealthBarFontSize < 1) then
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "petHealthBarFont"), 1)
healthBar.healthText:Hide()

View File

@ -81,7 +81,7 @@ function Powerbar:CreateFrame(unit)
powerBar.bg:SetAllPoints(powerBar.energy)
powerBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.powerBarBgColor))
powerBar.raceText = powerBar:CreateFontString(nil, "LOW")
powerBar.raceText = powerBar:CreateFontString(nil, "OVERLAY")
powerBar.raceText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarRaceFontSize, Gladdy.db.powerTextLeftOutline and "OUTLINE")
powerBar.raceText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
powerBar.raceText:SetShadowOffset(1, -1)
@ -89,7 +89,7 @@ function Powerbar:CreateFrame(unit)
powerBar.raceText:SetJustifyH("CENTER")
powerBar.raceText:SetPoint("LEFT", Gladdy.db.powerTextLeftHOffset, Gladdy.db.powerTextLeftVOffset)
powerBar.powerText = powerBar:CreateFontString(nil, "LOW")
powerBar.powerText = powerBar:CreateFontString(nil, "OVERLAY")
powerBar.powerText:SetFont(Gladdy:SMFetch("font", "powerBarFont"), Gladdy.db.powerBarPowerFontSize, Gladdy.db.powerTextRightOutline and "OUTLINE")
powerBar.powerText:SetTextColor(Gladdy:SetColor(Gladdy.db.powerBarFontColor))
powerBar.powerText:SetShadowOffset(1, -1)

View File

@ -169,13 +169,13 @@ function Racial:UpdateFrame(unit)
if Gladdy.db.racialIconZoomed then
if racial.texture.masked then
racial.texture:SetMask(nil)
racial.texture:SetMask("")
racial.texture:SetTexCoord(0.1,0.9,0.1,0.9)
racial.texture.masked = nil
end
else
if not racial.texture.masked then
racial.texture:SetMask(nil)
racial.texture:SetMask("")
racial.texture:SetTexCoord(0,1,0,1)
racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
racial.texture.masked = true

View File

@ -1,756 +0,0 @@
local string_gsub, floor, pairs = string.gsub, math.floor, pairs
local CreateFrame, SetPortraitTexture = CreateFrame, SetPortraitTexture
local UnitHealthMax, UnitHealth, UnitName, UnitClass, UnitGUID, UnitExists = UnitHealthMax, UnitHealth, UnitName, UnitClass, UnitGUID, UnitExists
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local Gladdy = LibStub("Gladdy")
local L = Gladdy.L
local Targets = Gladdy:NewModule("Targets", nil, {
targetEnabled = true,
targetWidth = 128,
targetHeight = 40,
targetPortraitEnabled = true,
targetPortraitBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
targetHealthBarFont = "DorisPP",
targetHealthBarHeight = 60,
targetHealthBarTexture = "Smooth",
targetHealthBarBorderStyle = "Gladdy Tooltip round",
targetHealthBarBorderSize = 9,
targetHealthBarBorderColor = { r = 0, g = 0, b = 0, a = 1 },
targetHealthBarColor = { r = 0, g = 1, b = 0, a = 1 },
targetHealthBarBgColor = { r = 0, g = 0, b = 0, a = 0.4 },
targetHealthBarFontColor = { r = 1, g = 1, b = 1, a = 1 },
targetHealthBarFontSize = 12,
targetHealthUnitName = true,
targetHealthPercentage = true,
targetHealthBarClassColored = true,
targetXOffset = 286,
targetYOffset = 0,
targetGroup = false,
targetMargin = 1,
targetFrameStrata = "MEDIUM",
targetFrameLevel = 5,
})
function Targets:Initialize()
self.frames = {}
if Gladdy.db.targetEnabled then
self:RegisterMessage("JOINED_ARENA")
self:RegisterMessage("ENEMY_SPOTTED")
self:RegisterMessage("UNIT_DESTROYED")
self:RegisterMessage("UNIT_DEATH")
-- self:RegisterMessage("ENEMY_STEALTH")
-- self:RegisterMessage("UNIT_SPEC")
end
end
function Targets:UpdateFrameOnce()
if Gladdy.db.targetEnabled then
self:RegisterMessage("JOINED_ARENA")
self:RegisterMessage("ENEMY_SPOTTED")
self:RegisterMessage("UNIT_DESTROYED")
self:RegisterMessage("UNIT_DEATH")
else
self:UnregisterAllMessages()
end
end
function Targets:JOINED_ARENA()
for _,v in pairs(self.frames) do
v.healthBar:SetAlpha(0)
end
if Gladdy.db.targetEnabled then
self:RegisterEvent("UNIT_TARGET")
self:SetScript("OnEvent", function(_, event, unitId)
if event == "UNIT_TARGET" then
Targets:CheckUnitTarget(unitId)
end
end)
end
end
function Targets:UNIT_DEATH(unitId)
local unit = string_gsub(unitId, "%d$", "%1target")
local healthBar = self.frames[unit].healthBar
if (not healthBar) then
return
end
healthBar:SetAlpha(0)
healthBar:SetScript("OnUpdate", nil)
healthBar.portrait:SetTexture(nil)
end
function Targets:UNIT_DESTROYED(unitId)
local unit = string_gsub(unitId, "%d$", "%1target")
local healthBar = self.frames[unit].healthBar
if (not healthBar) then
return
end
healthBar:SetAlpha(0)
healthBar:SetScript("OnUpdate", nil)
healthBar.portrait:SetTexture(nil)
end
function Targets:ENEMY_SPOTTED(unit)
if Gladdy.db.targetEnabled then
self:CheckUnitTarget(unit)
end
end
local targetsHealth = {}
function Targets:CheckUnitTarget(unitId)
if (not unitId) then
return
end
local unitPrefix = string_gsub(unitId, "%d$", "")
local unit = string_gsub(unitId, "%d$", "%1target")
if unitPrefix ~= "arena" then
return
end
local targetsFrame = self.frames[unit]
if (not targetsFrame) then
return
end
if ( UnitGUID(unit)) then
-- print(unit .. "'s name:" .. UnitName(unit))
-- print(unit .. "'s HP:" .. UnitHealth(unit) .."/"..UnitHealthMax(unit))
targetsFrame.healthBar:SetAlpha(1)
targetsFrame.healthBar.hp:SetMinMaxValues(0, UnitHealthMax(unit))
targetsFrame.healthBar.hp:SetValue(UnitHealth(unit))
Targets:SetHealthText(targetsFrame.healthBar, UnitHealth(unit), UnitHealthMax(unit))
SetPortraitTexture(targetsFrame.healthBar.portrait, unit)
targetsFrame.healthBar:SetScript("OnUpdate", function(self)
if targetsHealth[self.unit] ~= UnitHealth(self.unit) then
-- print("OnUpdate Unit HP:" .. self.unit .. " -> " .. UnitHealth(self.unit) .. "/" .. UnitHealthMax(self.unit))
self.hp:SetValue(UnitHealth(self.unit))
Targets:SetHealthText(self, UnitHealth(self.unit), UnitHealthMax(self.unit))
targetsHealth[self.unit] = UnitHealth(self.unit)
end
end)
Targets:SetText(unit)
Targets:SetHealthStatusBarColor(unit)
else
targetsHealth[unit] = nil
targetsFrame.healthBar:SetAlpha(0)
targetsFrame.healthBar:SetScript("OnUpdate", nil)
targetsFrame.healthBar.portrait:SetTexture(nil)
end
end
function Targets:Test(unitId)
if Gladdy.db.targetEnabled then
local unit = string_gsub(unitId, "%d$", "%1target")
local targetsFrame = self.frames[unit]
if (not targetsFrame) then
return
end
targetsFrame.healthBar:SetAlpha(1)
targetsFrame.healthBar.hp:SetMinMaxValues(0, 12000)
targetsFrame.healthBar.hp:SetValue(7000)
Targets:SetHealthText(targetsFrame.healthBar, 7000, 12000)
SetPortraitTexture(targetsFrame.healthBar.portrait, "player")
Targets:SetText(unit)
Targets:SetHealthStatusBarColor(unit)
self:RegisterEvent("UNIT_TARGET")
self:SetScript("OnEvent", function(_, event, unitId)
if event == "UNIT_TARGET" then
Targets:CheckUnitTarget(unitId)
end
end)
end
end
function Targets:CreateFrame(unitId)
local unit = string_gsub(unitId, "%d$", "%1target")
if self.frames[unit] then
return
end
local button = CreateFrame("Frame", "GladdyButtonFrameTarget" .. unit, Gladdy.frame)
button:SetMovable(true)
--button:SetAlpha(0)
button:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.targetXOffset, Gladdy.db.targetYOffset)
local secure = CreateFrame("Button", "GladdyButton" .. unit, button, "SecureActionButtonTemplate, SecureHandlerEnterLeaveTemplate")
secure:RegisterForClicks("AnyUp")
secure:RegisterForClicks("AnyDown")
secure:SetAttribute("*type1", "target")
secure:SetAttribute("*type2", "focus")
secure:SetAttribute("unit", unit)
secure:SetAllPoints(button)
button.unit = unit
button.secure = secure
local healthBar = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "targetHealthBarBorderStyle"),
edgeSize = Gladdy.db.targetHealthBarBorderSize })
healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.targetHealthBarBorderColor))
healthBar:SetFrameStrata(Gladdy.db.targetFrameStrata)
healthBar:SetFrameLevel(Gladdy.db.targetFrameLevel)
healthBar:SetAllPoints(button)
healthBar:SetAlpha(0)
healthBar.portrait = healthBar:CreateTexture(nil, "BACKGROUND")
healthBar.portrait:SetPoint("LEFT", healthBar, "RIGHT")
healthBar.portrait:SetTexCoord(0.1, 0.9, 0.1, 0.9)
-- SetPortraitTexture(healthBar.portrait, "player")
healthBar.portrait.border = healthBar:CreateTexture(nil, "OVERLAY")
healthBar.portrait.border:SetAllPoints(healthBar.portrait)
healthBar.portrait.border:SetTexture(Gladdy.db.classIconBorderStyle)
healthBar.portrait.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.targetHealthBarBorderColor))
healthBar.hp = CreateFrame("StatusBar", nil, healthBar)
healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "targetHealthBarTexture"))
healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.targetHealthBarColor))
healthBar.hp:SetMinMaxValues(0, 100)
healthBar.hp:SetFrameStrata(Gladdy.db.targetFrameStrata)
healthBar.hp:SetFrameLevel(Gladdy.db.targetFrameLevel - 1)
healthBar.hp:SetAllPoints(healthBar)
healthBar.bg = healthBar.hp:CreateTexture(nil, "BACKGROUND")
healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "targetHealthBarTexture"))
healthBar.bg:ClearAllPoints()
healthBar.bg:SetAllPoints(healthBar.hp)
healthBar.bg:SetAlpha(1)
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.targetHealthBarBgColor))
healthBar.nameText = healthBar:CreateFontString(nil, "LOW", "GameFontNormalSmall")
if (Gladdy.db.targetHealthBarFontSize < 1) then
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), 1)
healthBar.nameText:Hide()
else
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), Gladdy.db.targetHealthBarFontSize)
healthBar.nameText:Show()
end
healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.targetHealthBarFontColor))
healthBar.nameText:SetShadowOffset(1, -1)
healthBar.nameText:SetShadowColor(0, 0, 0, 1)
healthBar.nameText:SetJustifyH("CENTER")
healthBar.nameText:SetPoint("LEFT", 5, 0)
healthBar.healthText = healthBar:CreateFontString(nil, "LOW")
if (Gladdy.db.targetHealthBarFontSize < 1) then
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), 1)
healthBar.healthText:Hide()
else
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), Gladdy.db.targetHealthBarFontSize)
healthBar.healthText:Hide()
end
healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.targetHealthBarFontColor))
healthBar.healthText:SetShadowOffset(1, -1)
healthBar.healthText:SetShadowColor(0, 0, 0, 1)
healthBar.healthText:SetJustifyH("CENTER")
healthBar.healthText:SetPoint("RIGHT", -5, 0)
healthBar.unit = unit
button.healthBar = healthBar
healthBar:RegisterUnitEvent("UNIT_HEALTH_FREQUENT", unit)
healthBar:RegisterUnitEvent("UNIT_MAXHEALTH", unit)
healthBar:RegisterUnitEvent("UNIT_PORTRAIT_UPDATE", unit)
healthBar:RegisterUnitEvent("UNIT_NAME_UPDATE", unit)
-- healthBar:SetScript("OnEvent", Targets.OnEvent)
button:SetWidth(Gladdy.db.targetWidth)
button:SetHeight(Gladdy.db.targetHeight)
self.frames[unit] = button
end
function Targets.OnEvent(self, event, unit)
-- if event == "UNIT_PORTRAIT_UPDATE" then
-- SetPortraitTexture(self.portrait, unit)
-- end
-- local health = UnitHealth(unit)
-- local healthMax = UnitHealthMax(unit)
-- self.hp:SetMinMaxValues(0, healthMax)
-- self.hp:SetValue(health)
-- Targets:SetHealthText(self, health, healthMax)
end
function Targets:UpdateFrame(unitId)
local unit = string_gsub(unitId, "%d$", "%1target")
local healthBar = self.frames[unit].healthBar
if (not healthBar) then
return
end
healthBar:SetFrameStrata(Gladdy.db.targetFrameStrata)
healthBar:SetFrameLevel(Gladdy.db.targetFrameLevel)
healthBar.hp:SetFrameStrata(Gladdy.db.targetFrameStrata)
healthBar.hp:SetFrameLevel(Gladdy.db.targetFrameLevel - 1)
if not Gladdy.db.targetEnabled then
self.frames[unit]:Hide()
else
self.frames[unit]:Show()
end
self.frames[unit]:SetWidth(Gladdy.db.targetWidth)
self.frames[unit]:SetHeight(Gladdy.db.targetHeight)
Gladdy:SetPosition(self.frames[unit], unitId, "targetXOffset", "targetYOffset", Targets:LegacySetPosition(unit, unitId), Targets)
if (Gladdy.db.targetGroup) then
if (unit == "arena1target") then
self.frames[unit]:ClearAllPoints()
self.frames[unit]:SetPoint("TOPLEFT", Gladdy.buttons[unitId].healthBar, "TOPLEFT", Gladdy.db.targetXOffset, Gladdy.db.targetYOffset)
else
local previousTarget = "arena" .. string_gsub(string_gsub(unit, "arena", ""), "target", "") - 1 .. "target"
self.frames[unit]:ClearAllPoints()
self.frames[unit]:SetPoint("TOPLEFT", self.frames[previousTarget], "BOTTOMLEFT", 0, - Gladdy.db.targetMargin)
end
else
self.frames[unit]:ClearAllPoints()
self.frames[unit]:SetPoint("TOPLEFT", Gladdy.buttons[unitId].healthBar, "TOPLEFT", Gladdy.db.targetXOffset, Gladdy.db.targetYOffset)
end
healthBar.portrait:SetHeight(Gladdy.db.targetHeight)
healthBar.portrait:SetWidth(Gladdy.db.targetHeight)
if not Gladdy.db.targetPortraitEnabled then
healthBar.portrait:Hide()
healthBar.portrait.border:Hide()
else
healthBar.portrait:Show()
healthBar.portrait.border:Show()
end
healthBar.portrait.border:SetTexture(Gladdy.db.targetPortraitBorderStyle)
healthBar.portrait.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.targetHealthBarBorderColor))
healthBar.bg:SetTexture(Gladdy:SMFetch("statusbar", "targetHealthBarTexture"))
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.targetHealthBarBgColor))
healthBar:SetBackdrop({ edgeFile = Gladdy:SMFetch("border", "targetHealthBarBorderStyle"),
edgeSize = Gladdy.db.targetHealthBarBorderSize })
healthBar:SetBackdropBorderColor(Gladdy:SetColor(Gladdy.db.targetHealthBarBorderColor))
healthBar.hp:SetStatusBarTexture(Gladdy:SMFetch("statusbar", "targetHealthBarTexture"))
healthBar.hp:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.targetHealthBarColor))
healthBar.hp:ClearAllPoints()
healthBar.hp:SetPoint("TOPLEFT", healthBar, "TOPLEFT", (Gladdy.db.targetHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), -(Gladdy.db.targetHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
healthBar.hp:SetPoint("BOTTOMRIGHT", healthBar, "BOTTOMRIGHT", -(Gladdy.db.targetHealthBarBorderSize/Gladdy.db.statusbarBorderOffset), (Gladdy.db.targetHealthBarBorderSize/Gladdy.db.statusbarBorderOffset))
if (Gladdy.db.targetHealthBarFontSize < 1) then
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), 1)
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), 1)
healthBar.nameText:Hide()
healthBar.healthText:Hide()
else
healthBar.nameText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), Gladdy.db.targetHealthBarFontSize)
healthBar.nameText:Show()
healthBar.healthText:SetFont(Gladdy:SMFetch("font", "targetHealthBarFont"), Gladdy.db.targetHealthBarFontSize)
healthBar.healthText:Show()
end
healthBar.nameText:SetTextColor(Gladdy:SetColor(Gladdy.db.targetHealthBarFontColor))
healthBar.healthText:SetTextColor(Gladdy:SetColor(Gladdy.db.targetHealthBarFontColor))
if (unit == "arena1target") then
Gladdy:CreateMover(self.frames[unit], "targetXOffset", "targetYOffset", L["Targets"], {"TOPLEFT", "TOPLEFT"})
end
end
function Targets:SetHealthStatusBarColor(unit)
local targetsFrame = self.frames[unit]
if not targetsFrame then
return
end
local class = select(2, UnitClass(unit))
if not class then
return
end
local healthBar = targetsFrame.healthBar
if not healthBar.hp.oorFactor then
healthBar.hp.oorFactor = 1
end
healthBar.bg:SetVertexColor(Gladdy:SetColor(Gladdy.db.targetHealthBarBgColor))
if Gladdy.db.targetHealthBarClassColored then
healthBar.hp:SetStatusBarColor(
RAID_CLASS_COLORS[class].r / healthBar.hp.oorFactor,
RAID_CLASS_COLORS[class].g / healthBar.hp.oorFactor,
RAID_CLASS_COLORS[class].b / healthBar.hp.oorFactor, 1)
end
end
function Targets:SetHealthText(healthBar, health, healthMax)
local healthText = ""
if healthMax ~= 0 then
local healthPercentage = floor(health * 100 / healthMax)
if (Gladdy.db.targetHealthPercentage) then
healthText = ("%d%%"):format(healthPercentage)
end
else
healthText = ""
end
healthBar.healthText:SetText(healthText)
end
function Targets:SetText(unit)
local targetsFrame = self.frames[unit]
if not targetsFrame then
return
end
local nameText = ""
local unitName = UnitName(unit)
if unitName and Gladdy.db.targetHealthUnitName then
nameText = unitName
else
nameText = ""
end
targetsFrame.healthBar.nameText:SetText(nameText)
end
local function option(params)
local defaults = {
get = function(info)
local key = info.arg or info[#info]
return Gladdy.dbi.profile[key]
end,
set = function(info, value)
local key = info.arg or info[#info]
Gladdy.dbi.profile[key] = value
Gladdy.options.args.Targets.args.group.args.border.args.targetHealthBarBorderSize.max = Gladdy.db.targetHeight/2
if Gladdy.db.targetHealthBarBorderSize > Gladdy.db.targetHeight/2 then
Gladdy.db.targetHealthBarBorderSize = Gladdy.db.targetHeight/2
end
Gladdy:UpdateFrame()
end,
}
for k, v in pairs(params) do
defaults[k] = v
end
return defaults
end
function Targets:GetOptions()
return {
header = {
type = "header",
name = L["Targets"],
order = 2,
},
targetEnabled = Gladdy:option({
type = "toggle",
name = L["Enabled"],
desc = L["Enables Targets module"],
order = 3,
}),
targetGroup = option({
type = "toggle",
name = L["Group Targets"],
order = 4,
}),
group = {
type = "group",
childGroups = "tree",
name = L["Frame"],
order = 3,
disabled = function() return not Gladdy.db.targetEnabled end,
args = {
general = {
type = "group",
name = L["General"],
order = 1,
args = {
headerAuras = {
type = "header",
name = L["General"],
order = 1,
},
targetHeight = option({
type = "range",
name = L["Bar height"],
desc = L["Height of the bar"],
order = 3,
min = 10,
max = 100,
step = 1,
width = "full",
}),
targetWidth = option({
type = "range",
name = L["Bar width"],
desc = L["Width of the bar"],
order = 4,
min = 10,
max = 300,
step = 1,
width = "full",
}),
targetMargin = option({
type = "range",
name = L["Margin"],
desc = L["Height of the bar"],
order = 6,
disabled = function()
return not Gladdy.db.targetGroup
end,
min = 0,
max = 50,
step = .1,
}),
targetHealthBarTexture = option({
type = "select",
name = L["Bar texture"],
desc = L["Texture of the bar"],
order = 7,
dialogControl = "LSM30_Statusbar",
values = AceGUIWidgetLSMlists.statusbar,
}),
targetHealthBarColor = Gladdy:colorOption({
type = "color",
name = L["Health color"],
desc = L["Color of the status bar"],
order = 8,
hasAlpha = true,
}),
targetHealthBarBgColor = Gladdy:colorOption({
type = "color",
name = L["Background color"],
desc = L["Color of the status bar background"],
order = 9,
hasAlpha = true,
}),
},
},
portrait = {
type = "group",
name = L["Portrait"],
order = 2,
args = {
headerAuras = {
type = "header",
name = L["Portrait"],
order = 1,
},
targetPortraitEnabled = Gladdy:option({
type = "toggle",
name = L["Enabled"],
order = 2,
}),
targetPortraitBorderStyle = Gladdy:option({
type = "select",
name = L["Border style"],
order = 3,
values = Gladdy:GetIconStyles()
}),
},
},
font = {
type = "group",
name = L["Font"],
order = 3,
args = {
header = {
type = "header",
name = L["Font"],
order = 1,
},
targetHealthBarFont = option({
type = "select",
name = L["Font"],
desc = L["Font of the bar"],
order = 11,
dialogControl = "LSM30_Font",
values = AceGUIWidgetLSMlists.font,
}),
targetHealthBarFontColor = Gladdy:colorOption({
type = "color",
name = L["Font color"],
desc = L["Color of the text"],
order = 12,
hasAlpha = true,
}),
targetHealthBarFontSize = option({
type = "range",
name = L["Font size"],
desc = L["Size of the text"],
order = 13,
min = 0,
max = 20,
width = "full",
}),
},
},
border = {
type = "group",
name = L["Border"],
order = 4,
args = {
header = {
type = "header",
name = L["Border"],
order = 1,
},
targetHealthBarBorderStyle = option({
type = "select",
name = L["Border style"],
order = 21,
dialogControl = "LSM30_Border",
values = AceGUIWidgetLSMlists.border,
}),
targetHealthBarBorderSize = option({
type = "range",
name = L["Border size"],
desc = L["Size of the border"],
order = 22,
min = 0.5,
max = Gladdy.db.targetHeight/2,
step = 0.5,
width = "full",
}),
targetHealthBarBorderColor = Gladdy:colorOption({
type = "color",
name = L["Border color"],
desc = L["Color of the border"],
order = 23,
hasAlpha = true,
}),
},
},
position = {
type = "group",
name = L["Position"],
order = 5,
args = {
header = {
type = "header",
name = L["Position"],
order = 1,
},
targetXOffset = Gladdy:option({
type = "range",
name = L["Horizontal offset"],
order = 22,
min = -600,
max = 600,
step = 0.1,
width = "full",
}),
targetYOffset = Gladdy:option({
type = "range",
name = L["Vertical offset"],
order = 23,
min = -600,
max = 600,
step = 0.1,
width = "full",
}),
}
},
frameStrata = {
type = "group",
name = L["Frame Strata and Level"],
order = 6,
args = {
headerAuraLevel = {
type = "header",
name = L["Frame Strata and Level"],
order = 1,
},
targetFrameStrata = Gladdy:option({
type = "select",
name = L["Frame Strata"],
order = 2,
values = Gladdy.frameStrata,
sorting = Gladdy.frameStrataSorting,
width = "full",
}),
targetFrameLevel = Gladdy:option({
type = "range",
name = L["Frame Level"],
min = 1,
max = 500,
step = 1,
order = 3,
width = "full",
}),
},
},
healthValues = {
type = "group",
name = L["Health Bar Text"],
order = 7,
args = {
header = {
type = "header",
name = L["Health Bar Text"],
order = 1,
},
targetHealthUnitName = option({
type = "toggle",
name = L["Show name text"],
desc = L["Show the units name"],
order = 2,
width = "full",
}),
targetHealthPercentage = option({
type = "toggle",
name = L["Show health percentage"],
desc = L["Show health percentage on the health bar"],
order = 33,
}),
},
},
},
},
}
end
---------------------------
-- LAGACY HANDLER
---------------------------
function Targets:LegacySetPosition(unit, unitId)
if Gladdy.db.newLayout then
return Gladdy.db.newLayout
end
self.frames[unit]:ClearAllPoints()
self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.targetXOffset, Gladdy.db.targetYOffset)
if (Gladdy.db.tagetsGroup) then
if (unit == "arena1target") then
self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.targetXOffset, Gladdy.db.targetYOffset)
else
local previousTarget = "arena" .. string_gsub(string_gsub(unit, "arena", ""), "target", "") - 1 .. "target"
self.frames[unit]:ClearAllPoints()
self.frames[unit]:SetPoint("TOPLEFT", self.frames[previousTarget], "BOTTOMLEFT", 0, - Gladdy.db.targetMargin)
end
else
self.frames[unit]:ClearAllPoints()
self.frames[unit]:SetPoint("LEFT", Gladdy.buttons[unitId].healthBar, "RIGHT", Gladdy.db.targetXOffset, Gladdy.db.targetYOffset)
end
return Gladdy.db.newLayout
end

View File

@ -203,13 +203,15 @@ end
function TotemPlates:NAME_PLATE_UNIT_REMOVED(unitID)
local nameplate = C_NamePlate.GetNamePlateForUnit(unitID)
self.activeTotemNameplates[unitID] = nil
--self:ToggleAddon(nameplate, true)
if nameplate.gladdyTotemFrame then
nameplate.gladdyTotemFrame:Hide()
nameplate.gladdyTotemFrame:SetParent(nil)
tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame)
nameplate.gladdyTotemFrame = nil
end
if (self.addon == "ElvUI") then
self:ToggleAddon(nameplate, true)
end
end
---------------------------------------------------
@ -373,23 +375,25 @@ function TotemPlates:ToggleAddon(nameplate, show)
local addonFrames = { self:GetAddonFrame(nameplate) }
if addonFrames and #addonFrames > 0 then
if show then
for _,v in ipairs(addonFrames) do
if nameplate.unitFrame and nameplate.unitFrame.UpdateAllElements then
for _, frame in ipairs(addonFrames) do
if frame.UpdateAllElements then
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_ADDED - nameplate.unitFrame:UpdateAllElements")
nameplate.unitFrame:UpdateAllElements("NAME_PLATE_UNIT_ADDED")
frame:Show()
frame:UpdateAllElements("NAME_PLATE_UNIT_ADDED")
else
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_ADDED - Show")
v:Show()
frame:Show()
end
end
else
for _,v in ipairs(addonFrames) do
if nameplate.unitFrame and nameplate.unitFrame.UpdateAllElements then
for _, frame in ipairs(addonFrames) do
if frame.UpdateAllElements then
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_REMOVED - nameplate.unitFrame:UpdateAllElements")
nameplate.unitFrame:UpdateAllElements("NAME_PLATE_UNIT_REMOVED")
frame:UpdateAllElements("NAME_PLATE_UNIT_REMOVED")
frame:Hide()
else
Gladdy:Debug("INFO", "TotemPlates:ToggleAddon - NAME_PLATE_UNIT_REMOVED - Hide")
v:Hide()
frame:Hide()
end
end
end
@ -402,7 +406,7 @@ function TotemPlates.OnUpdate(self)
else
self.selectionHighlight:SetAlpha(0)
end
if (TotemPlates.addon == "Plater" or TotemPlates.addon == "Tukui" or TotemPlates.addon == "ElvUI") and self.parent and self.parent.unitFrame then
if (TotemPlates.addon == "Plater" or TotemPlates.addon == "Tukui") and self.parent and self.parent.unitFrame then
self.parent.unitFrame:Hide()
end
end
@ -454,7 +458,7 @@ function TotemPlates:OnUnitEvent(unitID)
nameplate.gladdyTotemFrame.parent = nameplate
nameplate.gladdyTotemFrame:Show()
TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID)
self:ToggleAddon(nameplate)
self:ToggleAddon(nameplate, false)
self.activeTotemNameplates[unitID] = nameplate
elseif totemDataEntry and not Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].enabled and Gladdy.db.npTotemsHideDisabledTotems then
if nameplate.gladdyTotemFrame then
@ -463,7 +467,7 @@ function TotemPlates:OnUnitEvent(unitID)
tinsert(self.totemPlateCache, nameplate.gladdyTotemFrame)
nameplate.gladdyTotemFrame = nil
end
self:ToggleAddon(nameplate)
self:ToggleAddon(nameplate, false)
else
self:ToggleAddon(nameplate, true)
end

View File

@ -182,13 +182,13 @@ function Trinket:UpdateFrame(unit)
if Gladdy.db.trinketIconZoomed then
if trinket.texture.masked then
trinket.texture:SetMask(nil)
trinket.texture:SetMask("")
trinket.texture:SetTexCoord(0.1,0.9,0.1,0.9)
trinket.texture.masked = nil
end
else
if not trinket.texture.masked then
trinket.texture:SetMask(nil)
trinket.texture:SetMask("")
trinket.texture:SetTexCoord(0,1,0,1)
trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
trinket.texture.masked = true

View File

@ -4,7 +4,7 @@
---
## [v2.23-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.23-Release/Gladdy_Classic_v2.23-Release.zip)
## [v2.27-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.27-Release/Gladdy_Classic_v2.27-Release.zip)
###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work
@ -55,11 +55,13 @@ The goal is to make Gladdy highly configurable in it's appearance. Everything ca
## Contributors
- [XyzKangUI](https://github.com/XyzKangUI)
- [ManneN1](https://github.com/ManneN1)
- [AlexFolland](https://github.com/AlexFolland)
- [dfherr](https://github.com/dfherr)
- [miraage](https://github.com/miraage)
- [veiz](https://github.com/veiz)
- [Flamanis](https://github.com/Flamanis)
Thank you!
@ -79,9 +81,22 @@ Thank you!
### Changes
### v2.27-Release
- fix TotemPlates interfering with NeatPlates
### v2.26-Release
- fix TotemPlates interfering with Plater (thanks again [Flamanis](https://github.com/Flamanis))
### v2.25-Release
- fix TotemPlates interfering with ElvUI (thanks [Flamanis](https://github.com/Flamanis))
### v2.24-Release
- fix for WotLK v30402 (update libs)
- update DRList
- fix taint issue on first load up
### v2.23-Release
- **Targets**
- show targets
- fix for WotLK v30401 (update libs + layers + masks)
### v2.22-Release
- fixed unwanted committed changes to LibCustomGlow