Skip to content

Commit

Permalink
6.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Resike committed Mar 1, 2019
1 parent 9743103 commit b78db47
Show file tree
Hide file tree
Showing 21 changed files with 114 additions and 202 deletions.
3 changes: 3 additions & 0 deletions Gladius/!Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**6.0.3**
* Updated for 8.1.0.

**6.0.2**
* Update for Gladius v3 users.

Expand Down
4 changes: 2 additions & 2 deletions Gladius/Gladius.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 80000
## Interface: 80100
## Title: Gladius
## Version: 6.0.2
## Version: 6.0.3
## Notes: Arena enemy unit frames.
## Author: Resike and Firebunny. Original author: Proditor
## SavedVariables: Gladius2DB
Expand Down
Original file line number Diff line number Diff line change
@@ -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 1169 2018-02-27 16:18:28Z nevcairiel $
-- @release $Id: AceConfigDialog-3.0.lua 1194 2018-08-25 07:59:05Z nevcairiel $

local LibStub = LibStub
local gui = LibStub("AceGUI-3.0")
local reg = LibStub("AceConfigRegistry-3.0")

local MAJOR, MINOR = "AceConfigDialog-3.0", 66
local MAJOR, MINOR = "AceConfigDialog-3.0", 67
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)

if not AceConfigDialog then return end
Expand All @@ -21,11 +21,11 @@ AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {}
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {}

-- Lua APIs
local tconcat, tinsert, tsort, tremove, tsort = table.concat, table.insert, table.sort, table.remove, table.sort
local tinsert, tsort, tremove = table.insert, table.sort, table.remove
local strmatch, format = string.match, string.format
local assert, loadstring, error = assert, loadstring, error
local error = error
local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs
local rawset, tostring, tonumber = rawset, tostring, tonumber
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
Expand All @@ -45,39 +45,10 @@ local function errorhandler(err)
return geterrorhandler()(err)
end

local function CreateDispatcher(argCount)
local code = [[
local xpcall, eh = ...
local method, ARGS
local function call() return method(ARGS) end
local function dispatch(func, ...)
method = func
if not method then return end
ARGS = ...
return xpcall(call, eh)
end
return dispatch
]]

local ARGS = {}
for i = 1, argCount do ARGS[i] = "arg"..i end
code = code:gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
end

local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
Dispatchers[0] = function(func)
return xpcall(func, errorhandler)
end

local function safecall(func, ...)
return Dispatchers[select("#", ...)](func, ...)
if func then
return xpcall(func, errorhandler, ...)
end
end

local width_multiplier = 170
Expand Down Expand Up @@ -1533,10 +1504,6 @@ local function GroupSelected(widget, event, uniquevalue)
end

BuildPath(feedpath, ("\001"):split(uniquevalue))
local group = options
for i = 1, #feedpath do
group = GetSubOption(group, feedpath[i])
end
widget:ReleaseChildren()
AceConfigDialog:FeedGroup(user.appName,options,widget,rootframe,feedpath)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- :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 1169 2018-02-27 16:18:28Z nevcairiel $
-- @release $Id: AceConfigRegistry-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $
local CallbackHandler = LibStub("CallbackHandler-1.0")

local MAJOR, MINOR = "AceConfigRegistry-3.0", 18
Expand Down Expand Up @@ -59,7 +59,6 @@ local optstring={["nil"]=true,["string"]=true, _="string"}
local optstringfunc={["nil"]=true,["string"]=true,["function"]=true, _="string or funcref"}
local optstringnumberfunc={["nil"]=true,["string"]=true,["number"]=true,["function"]=true, _="string, number or funcref"}
local optnumber={["nil"]=true,["number"]=true, _="number"}
local optmethod={["nil"]=true,["string"]=true,["function"]=true, _="methodname or funcref"}
local optmethodfalse={["nil"]=true,["string"]=true,["function"]=true,["boolean"]={[false]=true}, _="methodname, funcref or false"}
local optmethodnumber={["nil"]=true,["string"]=true,["function"]=true,["number"]=true, _="methodname, funcref or number"}
local optmethodtable={["nil"]=true,["string"]=true,["function"]=true,["table"]=true, _="methodname, funcref or table"}
Expand Down
8 changes: 3 additions & 5 deletions Gladius/Libs/AceDB-3.0/AceDB-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
-- end
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id: AceDB-3.0.lua 1142 2016-07-11 08:36:19Z nevcairiel $
-- @release $Id: AceDB-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 26
local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)

if not AceDB then return end -- No upgrade needed

-- Lua APIs
local type, pairs, next, error = type, pairs, next, error
local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget
local setmetatable, rawset, rawget = setmetatable, rawset, rawget

-- WoW APIs
local _G = _G
Expand Down Expand Up @@ -619,8 +619,6 @@ function DBObjectLib:ResetDB(defaultProfile)
sv[k] = nil
end

local parent = self.parent

initdb(sv, self.defaults, defaultProfile, self)

-- fix the child namespaces
Expand Down
4 changes: 2 additions & 2 deletions Gladius/Libs/AceDBOptions-3.0/AceDBOptions-3.0.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--- 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 1140 2016-07-03 07:53:29Z nevcairiel $
-- @release $Id: AceDBOptions-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $
local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15
local AceDBOptions, oldminor = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)
local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)

if not AceDBOptions then return end -- No upgrade needed

Expand Down
45 changes: 7 additions & 38 deletions Gladius/Libs/AceGUI-3.0/AceGUI-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
-- f:AddChild(btn)
-- @class file
-- @name AceGUI-3.0
-- @release $Id: AceGUI-3.0.lua 1177 2018-06-25 12:12:48Z nevcairiel $
-- @release $Id: AceGUI-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 36
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)

if not AceGUI then return end -- No upgrade needed

-- Lua APIs
local tconcat, tremove, tinsert = table.concat, table.remove, table.insert
local tinsert = table.insert
local select, pairs, next, type = select, pairs, next, type
local error, assert, loadstring = error, assert, loadstring
local setmetatable, rawget, rawset = setmetatable, rawget, rawset
local error, assert = error, assert
local setmetatable, rawget = setmetatable, rawget
local math_max = math.max

-- WoW APIs
Expand Down Expand Up @@ -66,39 +66,10 @@ local function errorhandler(err)
return geterrorhandler()(err)
end

local function CreateDispatcher(argCount)
local code = [[
local xpcall, eh = ...
local method, ARGS
local function call() return method(ARGS) end
local function dispatch(func, ...)
method = func
if not method then return end
ARGS = ...
return xpcall(call, eh)
end
return dispatch
]]

local ARGS = {}
for i = 1, argCount do ARGS[i] = "arg"..i end
code = code:gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
end

local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
Dispatchers[0] = function(func)
return xpcall(func, errorhandler)
end

local function safecall(func, ...)
return Dispatchers[select("#", ...)](func, ...)
if func then
return xpcall(func, errorhandler, ...)
end
end

-- Recycling functions
Expand Down Expand Up @@ -690,14 +661,12 @@ AceGUI:RegisterLayout("Flow",
--height of the current row
local rowheight = 0
local rowoffset = 0
local lastrowoffset

local width = content.width or content:GetWidth() or 0

--control at the start of the row
local rowstart
local rowstartoffset
local lastrowstart
local isfullheight

local frameoffset
Expand Down
10 changes: 5 additions & 5 deletions Gladius/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ local function Constructor()
statustext:SetText("")

local titlebg = frame:CreateTexture(nil, "OVERLAY")
titlebg:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header")
titlebg:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header
titlebg:SetTexCoord(0.31, 0.67, 0, 0.63)
titlebg:SetPoint("TOP", 0, 12)
titlebg:SetWidth(100)
Expand All @@ -235,14 +235,14 @@ local function Constructor()
titletext:SetPoint("TOP", titlebg, "TOP", 0, -14)

local titlebg_l = frame:CreateTexture(nil, "OVERLAY")
titlebg_l:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header")
titlebg_l:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header
titlebg_l:SetTexCoord(0.21, 0.31, 0, 0.63)
titlebg_l:SetPoint("RIGHT", titlebg, "LEFT")
titlebg_l:SetWidth(30)
titlebg_l:SetHeight(40)

local titlebg_r = frame:CreateTexture(nil, "OVERLAY")
titlebg_r:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header")
titlebg_r:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header
titlebg_r:SetTexCoord(0.67, 0.77, 0, 0.63)
titlebg_r:SetPoint("LEFT", titlebg, "RIGHT")
titlebg_r:SetWidth(30)
Expand All @@ -260,15 +260,15 @@ local function Constructor()
line1:SetWidth(14)
line1:SetHeight(14)
line1:SetPoint("BOTTOMRIGHT", -8, 8)
line1:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
line1:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
local x = 0.1 * 14/17
line1:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)

local line2 = sizer_se:CreateTexture(nil, "BACKGROUND")
line2:SetWidth(8)
line2:SetHeight(8)
line2:SetPoint("BOTTOMRIGHT", -8, 8)
line2:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
local 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)

Expand Down
21 changes: 16 additions & 5 deletions Gladius/Libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
ScrollFrame Container
Plain container that scrolls its content and doesn't grow in height.
-------------------------------------------------------------------------------]]
local Type, Version = "ScrollFrame", 24
local Type, Version = "ScrollFrame", 26
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, assert, type = pairs, assert, type
local min, max, floor, abs = math.min, math.max, math.floor, math.abs
local min, max, floor = math.min, math.max, math.floor

-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
Expand Down Expand Up @@ -53,7 +53,7 @@ local methods = {
self.scrollframe:SetPoint("BOTTOMRIGHT")
self.scrollbar:Hide()
self.scrollBarShown = nil
self.content.height, self.content.width = nil, nil
self.content.height, self.content.width, self.content.original_width = nil, nil, nil
end,

["SetScroll"] = function(self, value)
Expand Down Expand Up @@ -94,7 +94,6 @@ local methods = {
local status = self.status or self.localstatus
local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
local offset = status.offset or 0
local curvalue = self.scrollbar:GetValue()
-- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys
-- No-one is going to miss 2 pixels at the bottom of the frame, anyhow!
if viewheight < height + 2 then
Expand All @@ -103,13 +102,19 @@ local methods = {
self.scrollbar:Hide()
self.scrollbar:SetValue(0)
self.scrollframe:SetPoint("BOTTOMRIGHT")
if self.content.original_width then
self.content.width = self.content.original_width
end
self:DoLayout()
end
else
if not self.scrollBarShown then
self.scrollBarShown = true
self.scrollbar:Show()
self.scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
if self.content.original_width then
self.content.width = self.content.original_width - 20
end
self:DoLayout()
end
local value = (offset / (viewheight - height) * 1000)
Expand All @@ -128,6 +133,11 @@ local methods = {

["LayoutFinished"] = function(self, width, height)
self.content:SetHeight(height or 0 + 20)

-- update the scrollframe
self:FixScroll()

-- schedule another update when everything has "settled"
self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate)
end,

Expand All @@ -141,7 +151,8 @@ local methods = {

["OnWidthSet"] = function(self, width)
local content = self.content
content.width = width
content.width = width - (self.scrollBarShown and 20 or 0)
content.original_width = width
end,

["OnHeightSet"] = function(self, height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ local methods = {

["BuildTabs"] = function(self)
local hastitle = (self.titletext:GetText() and self.titletext:GetText() ~= "")
local status = self.status or self.localstatus
local tablist = self.tablist
local tabs = self.tabs

Expand Down
Loading

0 comments on commit b78db47

Please sign in to comment.