Ace3 backport

This commit is contained in:
Pinya
2018-07-21 13:29:50 +03:00
parent 332d53e7f6
commit f0eac39bcd
43 changed files with 1071 additions and 846 deletions
@@ -6,7 +6,8 @@ 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 select, pairs, print = select, pairs, print
local pairs, print, unpack = pairs, print, unpack
local getn = table.getn
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
@@ -14,16 +15,16 @@ local CreateFrame, UIParent = CreateFrame, UIParent
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
local function Control_OnEnter(frame)
frame.obj:Fire("OnEnter")
local function Control_OnEnter()
this.obj:Fire("OnEnter")
end
local function Control_OnLeave(frame)
frame.obj:Fire("OnLeave")
local function Control_OnLeave()
this.obj:Fire("OnLeave")
end
local function Button_OnClick(frame, button)
frame.obj:Fire("OnClick", button)
local function Button_OnClick()
this.obj:Fire("OnClick", arg1)
AceGUI:ClearFocus()
end
@@ -58,9 +59,9 @@ local methods = {
image:SetTexture(path)
if image:GetTexture() then
local n = select("#", ...)
local n = getn(arg)
if n == 4 or n == 8 then
image:SetTexCoord(...)
image:SetTexCoord(unpack(arg))
else
image:SetTexCoord(0, 1, 0, 1)
end