Partially remove the select function

This commit is contained in:
Bunny67
2017-12-27 00:47:12 +03:00
parent c8c0e191c9
commit cad6a274a2
18 changed files with 39 additions and 61 deletions
+3 -8
View File
@@ -929,15 +929,10 @@ function E:Contruct_StaticPopups()
E.StaticPopupFrames[index].text = _G[name.."Text"] E.StaticPopupFrames[index].text = _G[name.."Text"]
E.StaticPopupFrames[index].editBox = _G[name.."EditBox"] E.StaticPopupFrames[index].editBox = _G[name.."EditBox"]
_G[name.."EditBox"]:DisableDrawLayer("BACKGROUND")
S:HandleEditBox(_G[name.."EditBox"]) S:HandleEditBox(_G[name.."EditBox"])
--[[for k = 1, _G[name.."EditBox"]:GetNumRegions() do
local region = select(k, _G[name.."EditBox"]:GetRegions())
if(region and region:IsObjectType("Texture")) then
if(region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right") then
E:kill(region)
end
end
end]]
S:HandleEditBox(_G[name.."MoneyInputFrameGold"]) S:HandleEditBox(_G[name.."MoneyInputFrameGold"])
S:HandleEditBox(_G[name.."MoneyInputFrameSilver"]) S:HandleEditBox(_G[name.."MoneyInputFrameSilver"])
S:HandleEditBox(_G[name.."MoneyInputFrameCopper"]) S:HandleEditBox(_G[name.."MoneyInputFrameCopper"])
+1 -1
View File
@@ -4,7 +4,7 @@ local LSM = LibStub("LibSharedMedia-3.0");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack, type, select, getmetatable = unpack, type, select, getmetatable local unpack, type, getmetatable = unpack, type, getmetatable
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local RAID_CLASS_COLORS = RAID_CLASS_COLORS local RAID_CLASS_COLORS = RAID_CLASS_COLORS
+1 -1
View File
@@ -1,7 +1,7 @@
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = getfenv() local _G = getfenv()
local print, tostring, select = print, tostring, select local print, tostring = print, tostring
local format = string.format local format = string.format
--WoW API / Variables --WoW API / Variables
local GetMouseFocus = GetMouseFocus local GetMouseFocus = GetMouseFocus
@@ -3,7 +3,7 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local type, pairs, select = type, pairs, select local type, pairs = type, pairs
local sort, wipe = table.sort, wipe local sort, wipe = table.sort, wipe
local format, find, join, gsub = string.format, string.find, string.join, string.gsub local format, find, join, gsub = string.format, string.find, string.join, string.gsub
--WoW API / Variables --WoW API / Variables
@@ -3,7 +3,7 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local select, unpack = select, unpack local unpack = unpack
local format, join = string.format, string.join local format, join = string.format, string.join
local sort, wipe = table.sort, wipe local sort, wipe = table.sort, wipe
--WoW API / Variables --WoW API / Variables
@@ -3,7 +3,7 @@ local DT = E:GetModule("DataTexts");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local select, collectgarbage = select, collectgarbage local collectgarbage = collectgarbage
local sort, wipe = table.sort, wipe local sort, wipe = table.sort, wipe
local floor = math.floor local floor = math.floor
local format = string.format local format = string.format
@@ -5,7 +5,6 @@ local S = E:GetModule("Skins");
--Lua functions --Lua functions
local _G = getfenv() local _G = getfenv()
local unpack = unpack local unpack = unpack
local select = select
local pairs = pairs local pairs = pairs
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
@@ -328,14 +327,23 @@ function S:SkinAce3()
if(not E.GUIFrame) then if(not E.GUIFrame) then
E.GUIFrame = frame E.GUIFrame = frame
end end
for i=1, frame:GetNumChildren() do
local child = select(i, frame:GetChildren()) for _, child in ipairs({frame:GetChildren()}) do
if child:GetObjectType() == "Button" and child:GetText() then if child:GetObjectType() == "Button" and child:GetText() then
SkinButton(child) SkinButton(child)
else else
E:StripTextures(child) E:StripTextures(child)
end end
end end
--[[for i=1, frame:GetNumChildren() do
local child = select(i, frame:GetChildren())
if child:GetObjectType() == "Button" and child:GetText() then
SkinButton(child)
else
E:StripTextures(child)
end
end]]
elseif TYPE == "Window" then elseif TYPE == "Window" then
E:StripTextures(frame) E:StripTextures(frame)
S:HandleCloseButton(frame.obj.closebutton) S:HandleCloseButton(frame.obj.closebutton)
@@ -5,7 +5,6 @@ local S = E:GetModule("Skins");
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
local select = select
local find, match, split = string.find, string.match, string.split local find, match, split = string.find, string.match, string.split
--WoW API / Variables --WoW API / Variables
local GetItemInfo = GetItemInfo local GetItemInfo = GetItemInfo
@@ -4,7 +4,6 @@ local S = E:GetModule("Skins");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local select = select
--WoW API / Variables --WoW API / Variables
local hooksecurefunc = hooksecurefunc local hooksecurefunc = hooksecurefunc
@@ -32,10 +31,10 @@ local function LoadSkin()
S:HandleButton(GossipFrameGreetingGoodbyeButton) S:HandleButton(GossipFrameGreetingGoodbyeButton)
GossipFrameGreetingGoodbyeButton:SetPoint("BOTTOMRIGHT", GossipFrame, -34, 71) GossipFrameGreetingGoodbyeButton:SetPoint("BOTTOMRIGHT", GossipFrame, -34, 71)
for i = 1, NUMGOSSIPBUTTONS do --[[for i = 1, NUMGOSSIPBUTTONS do
local obj = select(3,_G["GossipTitleButton"..i]:GetRegions()) local obj = select(3,_G["GossipTitleButton"..i]:GetRegions())
obj:SetTextColor(1, 1, 1) obj:SetTextColor(1, 1, 1)
end end]]
GossipGreetingText:SetTextColor(1,1,1) GossipGreetingText:SetTextColor(1,1,1)
E:CreateBackdrop(GossipFrame, "Transparent") E:CreateBackdrop(GossipFrame, "Transparent")
@@ -4,7 +4,6 @@ local S = E:GetModule("Skins");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local select = select
--WoW API / Variables --WoW API / Variables
local function LoadSkin() local function LoadSkin()
@@ -21,14 +20,7 @@ local function LoadSkin()
S:HandleCloseButton(GuildRegistrarFrameCloseButton) S:HandleCloseButton(GuildRegistrarFrameCloseButton)
S:HandleEditBox(GuildRegistrarFrameEditBox) S:HandleEditBox(GuildRegistrarFrameEditBox)
for i = 1, GuildRegistrarFrameEditBox:GetNumRegions() do GuildRegistrarFrameEditBox:DisableDrawLayer("BACKGROUND")
local region = select(i, GuildRegistrarFrameEditBox:GetRegions())
if region and region:GetObjectType() == "Texture" then
if region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right" then
E:Kill(region)
end
end
end
GuildRegistrarFrameEditBox:SetHeight(20) GuildRegistrarFrameEditBox:SetHeight(20)
@@ -5,7 +5,6 @@ local S = E:GetModule("Skins");
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
local select = select
local match = string.match local match = string.match
--WoW API / Variables --WoW API / Variables
local UnitName = UnitName local UnitName = UnitName
@@ -30,18 +29,18 @@ local function LoadSkin()
S:HandleCloseButton(LootCloseButton) S:HandleCloseButton(LootCloseButton)
for i = 1, LootFrame:GetNumRegions() do --[[for i = 1, LootFrame:GetNumRegions() do
local region = select(i, LootFrame:GetRegions()) local region = select(i, LootFrame:GetRegions())
if region:GetObjectType() == "FontString" then if region:GetObjectType() == "FontString" then
if region:GetText() == ITEMS then if region:GetText() == ITEMS then
LootFrame.Title = region LootFrame.Title = region
end end
end end
end end]]
LootFrame.Title:ClearAllPoints() --[[LootFrame.Title:ClearAllPoints()
LootFrame.Title:SetPoint("TOPLEFT", LootFrame.backdrop, "TOPLEFT", 4, -4) LootFrame.Title:SetPoint("TOPLEFT", LootFrame.backdrop, "TOPLEFT", 4, -4)
LootFrame.Title:SetJustifyH("LEFT") LootFrame.Title:SetJustifyH("LEFT")]]
S:HandleNextPrevButton(LootFrameDownButton) S:HandleNextPrevButton(LootFrameDownButton)
S:HandleNextPrevButton(LootFrameUpButton) S:HandleNextPrevButton(LootFrameUpButton)
@@ -5,7 +5,6 @@ local S = E:GetModule("Skins");
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
local select = select
--WoW API / Variables --WoW API / Variables
local GetInboxItem = GetInboxItem local GetInboxItem = GetInboxItem
local GetItemInfo = GetItemInfo local GetItemInfo = GetItemInfo
@@ -142,13 +141,13 @@ local function LoadSkin()
E:StyleButton(OpenMailPackageButton) E:StyleButton(OpenMailPackageButton)
E:SetTemplate(OpenMailPackageButton, "Default", true) E:SetTemplate(OpenMailPackageButton, "Default", true)
for i = 1, OpenMailPackageButton:GetNumRegions() do --[[for i = 1, OpenMailPackageButton:GetNumRegions() do
local region = select(i, OpenMailPackageButton:GetRegions()) local region = select(i, OpenMailPackageButton:GetRegions())
if region:GetObjectType() == "Texture" then if region:GetObjectType() == "Texture" then
region:SetTexCoord(unpack(E.TexCoords)) region:SetTexCoord(unpack(E.TexCoords))
E:SetInside(region) E:SetInside(region)
end end
end end]]
hooksecurefunc("OpenMail_Update", function() hooksecurefunc("OpenMail_Update", function()
local index = InboxFrame.openMailID local index = InboxFrame.openMailID
@@ -4,7 +4,6 @@ local S = E:GetModule("Skins");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local select = select
local unpack = unpack local unpack = unpack
local match, split = string.match, string.split local match, split = string.match, string.split
--WoW API / Variables --WoW API / Variables
@@ -52,13 +51,14 @@ local function LoadSkin()
E:StyleButton(MerchantRepairItemButton) E:StyleButton(MerchantRepairItemButton)
E:SetTemplate(MerchantRepairItemButton, "Default", true) E:SetTemplate(MerchantRepairItemButton, "Default", true)
for i = 1, MerchantRepairItemButton:GetNumRegions() do
--[[for i = 1, MerchantRepairItemButton:GetNumRegions() do
local region = select(i, MerchantRepairItemButton:GetRegions()) local region = select(i, MerchantRepairItemButton:GetRegions())
if region:GetObjectType() == "Texture" then if region:GetObjectType() == "Texture" then
region:SetTexCoord(0.04, 0.24, 0.06, 0.5) region:SetTexCoord(0.04, 0.24, 0.06, 0.5)
E:SetInside(region) E:SetInside(region)
end end
end end]]
E:StyleButton(MerchantRepairAllButton) E:StyleButton(MerchantRepairAllButton)
E:SetTemplate(MerchantRepairAllButton, "Default", true) E:SetTemplate(MerchantRepairAllButton, "Default", true)
@@ -142,13 +142,10 @@ local function LoadSkin()
end end
end) end)
for i = 1, OptionsFrame:GetNumRegions() do -- Kill the nVidia logo
local region = select(i, OptionsFrame:GetRegions()) local _, _, nVidiaLogo = OptionsFrame:GetRegions()
if region:GetObjectType() == "Texture" then if nVidiaLogo:GetObjectType() == "Texture" then
if i == 3 then E:Kill(nVidiaLogo)
E:Kill(region) -- Kill the nVidia logo
end
end
end end
-- Static Popups -- Static Popups
@@ -160,23 +157,16 @@ local function LoadSkin()
E:SetTemplate(staticPopup, "Transparent") E:SetTemplate(staticPopup, "Transparent")
itemFrameBox:DisableDrawLayer("BACKGROUND")
S:HandleEditBox(itemFrameBox) S:HandleEditBox(itemFrameBox)
itemFrameBox.backdrop:SetPoint("TOPLEFT", -2, -4) itemFrameBox.backdrop:SetPoint("TOPLEFT", -2, -4)
itemFrameBox.backdrop:SetPoint("BOTTOMRIGHT", 2, 4) itemFrameBox.backdrop:SetPoint("BOTTOMRIGHT", 2, 4)
for k = 1, itemFrameBox:GetNumRegions() do
local region = select(k, itemFrameBox:GetRegions())
if(region and region:GetObjectType() == "Texture") then
if region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or region:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right" then
E:Kill(region)
end
end
end
E:StripTextures(closeButton) E:StripTextures(closeButton)
S:HandleCloseButton(closeButton) S:HandleCloseButton(closeButton)
select(8, wideBox:GetRegions()):Hide() --select(8, wideBox:GetRegions()):Hide()
S:HandleEditBox(wideBox) S:HandleEditBox(wideBox)
wideBox:SetHeight(22) wideBox:SetHeight(22)
@@ -5,7 +5,6 @@ local S = E:GetModule("Skins");
--Lua functions --Lua functions
local _G = _G local _G = _G
local pairs = pairs local pairs = pairs
local select = select
local unpack = unpack local unpack = unpack
local find, format, match, split = string.find, string.format, string.match, string.split local find, format, match, split = string.find, string.format, string.match, string.split
--WoW API / Variables --WoW API / Variables
@@ -5,7 +5,6 @@ local S = E:GetModule("Skins");
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
local select = select
local getn = table.getn local getn = table.getn
--WoW API / Variables --WoW API / Variables
@@ -5,7 +5,6 @@ local S = E:GetModule("Skins");
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
local select = select
local find, match, split = string.find, string.match, string.split local find, match, split = string.find, string.match, string.split
--WoW API / Variables --WoW API / Variables
local GetItemInfo = GetItemInfo local GetItemInfo = GetItemInfo
+1 -1
View File
@@ -4,7 +4,7 @@ local S = E:NewModule("Skins", "AceHook-3.0", "AceEvent-3.0");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall local unpack, assert, pairs, ipairs, type, pcall = unpack, assert, pairs, ipairs, type, pcall
local tinsert, wipe = table.insert, table.wipe local tinsert, wipe = table.insert, table.wipe
local lower = string.lower local lower = string.lower
--WoW API / Variables --WoW API / Variables