From cad6a274a214cc5af7d2a3299ca0b5b57b5e7d9c Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Wed, 27 Dec 2017 00:47:12 +0300 Subject: [PATCH] Partially remove the select function --- 2/3/4/5/6/7/ElvUI/Core/StaticPopups.lua | 11 +++------ 2/3/4/5/6/7/ElvUI/Core/toolkit.lua | 2 +- 2/3/4/5/6/7/ElvUI/Developer/Frame.lua | 2 +- .../5/6/7/ElvUI/Modules/DataTexts/Friends.lua | 2 +- 2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua | 2 +- .../5/6/7/ElvUI/Modules/DataTexts/System.lua | 2 +- .../5/6/7/ElvUI/Modules/Skins/Addons/Ace3.lua | 14 ++++++++--- .../7/ElvUI/Modules/Skins/Blizzard/Craft.lua | 1 - .../7/ElvUI/Modules/Skins/Blizzard/Gossip.lua | 5 ++-- .../Modules/Skins/Blizzard/GuildRegistrar.lua | 10 +------- .../6/7/ElvUI/Modules/Skins/Blizzard/Loot.lua | 9 ++++--- .../6/7/ElvUI/Modules/Skins/Blizzard/Mail.lua | 5 ++-- .../ElvUI/Modules/Skins/Blizzard/Merchant.lua | 6 ++--- .../6/7/ElvUI/Modules/Skins/Blizzard/Misc.lua | 24 ++++++------------- .../7/ElvUI/Modules/Skins/Blizzard/Quest.lua | 1 - .../Modules/Skins/Blizzard/SpellBook.lua | 1 - .../Modules/Skins/Blizzard/TradeSkill.lua | 1 - 2/3/4/5/6/7/ElvUI/Modules/Skins/Skins.lua | 2 +- 18 files changed, 39 insertions(+), 61 deletions(-) diff --git a/2/3/4/5/6/7/ElvUI/Core/StaticPopups.lua b/2/3/4/5/6/7/ElvUI/Core/StaticPopups.lua index 2b8247b..107c8de 100644 --- a/2/3/4/5/6/7/ElvUI/Core/StaticPopups.lua +++ b/2/3/4/5/6/7/ElvUI/Core/StaticPopups.lua @@ -929,15 +929,10 @@ function E:Contruct_StaticPopups() E.StaticPopupFrames[index].text = _G[name.."Text"] E.StaticPopupFrames[index].editBox = _G[name.."EditBox"] + _G[name.."EditBox"]:DisableDrawLayer("BACKGROUND") + 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.."MoneyInputFrameSilver"]) S:HandleEditBox(_G[name.."MoneyInputFrameCopper"]) diff --git a/2/3/4/5/6/7/ElvUI/Core/toolkit.lua b/2/3/4/5/6/7/ElvUI/Core/toolkit.lua index ebe9037..2b87c68 100644 --- a/2/3/4/5/6/7/ElvUI/Core/toolkit.lua +++ b/2/3/4/5/6/7/ElvUI/Core/toolkit.lua @@ -4,7 +4,7 @@ local LSM = LibStub("LibSharedMedia-3.0"); --Cache global variables --Lua functions local _G = _G -local unpack, type, select, getmetatable = unpack, type, select, getmetatable +local unpack, type, getmetatable = unpack, type, getmetatable --WoW API / Variables local CreateFrame = CreateFrame local RAID_CLASS_COLORS = RAID_CLASS_COLORS diff --git a/2/3/4/5/6/7/ElvUI/Developer/Frame.lua b/2/3/4/5/6/7/ElvUI/Developer/Frame.lua index f56a195..c601ee5 100644 --- a/2/3/4/5/6/7/ElvUI/Developer/Frame.lua +++ b/2/3/4/5/6/7/ElvUI/Developer/Frame.lua @@ -1,7 +1,7 @@ --Cache global variables --Lua functions local _G = getfenv() -local print, tostring, select = print, tostring, select +local print, tostring = print, tostring local format = string.format --WoW API / Variables local GetMouseFocus = GetMouseFocus diff --git a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua index c3a47a9..7a091d6 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Friends.lua @@ -3,7 +3,7 @@ local DT = E:GetModule("DataTexts"); --Cache global variables --Lua functions -local type, pairs, select = type, pairs, select +local type, pairs = type, pairs local sort, wipe = table.sort, wipe local format, find, join, gsub = string.format, string.find, string.join, string.gsub --WoW API / Variables diff --git a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua index 6ed392c..3f54b11 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/Guild.lua @@ -3,7 +3,7 @@ local DT = E:GetModule("DataTexts"); --Cache global variables --Lua functions -local select, unpack = select, unpack +local unpack = unpack local format, join = string.format, string.join local sort, wipe = table.sort, wipe --WoW API / Variables diff --git a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/System.lua b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/System.lua index bc2fb04..f2ae76f 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/System.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/System.lua @@ -3,7 +3,7 @@ local DT = E:GetModule("DataTexts"); --Cache global variables --Lua functions -local select, collectgarbage = select, collectgarbage +local collectgarbage = collectgarbage local sort, wipe = table.sort, wipe local floor = math.floor local format = string.format diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Addons/Ace3.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Addons/Ace3.lua index 8340ee9..71721d0 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Addons/Ace3.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Addons/Ace3.lua @@ -5,7 +5,6 @@ local S = E:GetModule("Skins"); --Lua functions local _G = getfenv() local unpack = unpack -local select = select local pairs = pairs --WoW API / Variables local CreateFrame = CreateFrame @@ -328,14 +327,23 @@ function S:SkinAce3() if(not E.GUIFrame) then E.GUIFrame = frame 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 SkinButton(child) else E:StripTextures(child) 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 E:StripTextures(frame) S:HandleCloseButton(frame.obj.closebutton) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Craft.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Craft.lua index 6cada28..4b0d2e2 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Craft.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Craft.lua @@ -5,7 +5,6 @@ local S = E:GetModule("Skins"); --Lua functions local _G = _G local unpack = unpack -local select = select local find, match, split = string.find, string.match, string.split --WoW API / Variables local GetItemInfo = GetItemInfo diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Gossip.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Gossip.lua index 4cddf41..63bb018 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Gossip.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Gossip.lua @@ -4,7 +4,6 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions local _G = _G -local select = select --WoW API / Variables local hooksecurefunc = hooksecurefunc @@ -32,10 +31,10 @@ local function LoadSkin() S:HandleButton(GossipFrameGreetingGoodbyeButton) GossipFrameGreetingGoodbyeButton:SetPoint("BOTTOMRIGHT", GossipFrame, -34, 71) - for i = 1, NUMGOSSIPBUTTONS do + --[[for i = 1, NUMGOSSIPBUTTONS do local obj = select(3,_G["GossipTitleButton"..i]:GetRegions()) obj:SetTextColor(1, 1, 1) - end + end]] GossipGreetingText:SetTextColor(1,1,1) E:CreateBackdrop(GossipFrame, "Transparent") diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/GuildRegistrar.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/GuildRegistrar.lua index ba19157..333f63d 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/GuildRegistrar.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/GuildRegistrar.lua @@ -4,7 +4,6 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions local _G = _G -local select = select --WoW API / Variables local function LoadSkin() @@ -21,14 +20,7 @@ local function LoadSkin() S:HandleCloseButton(GuildRegistrarFrameCloseButton) S:HandleEditBox(GuildRegistrarFrameEditBox) - for i = 1, GuildRegistrarFrameEditBox:GetNumRegions() do - 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:DisableDrawLayer("BACKGROUND") GuildRegistrarFrameEditBox:SetHeight(20) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Loot.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Loot.lua index 4c947f4..7515363 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Loot.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Loot.lua @@ -5,7 +5,6 @@ local S = E:GetModule("Skins"); --Lua functions local _G = _G local unpack = unpack -local select = select local match = string.match --WoW API / Variables local UnitName = UnitName @@ -30,18 +29,18 @@ local function LoadSkin() S:HandleCloseButton(LootCloseButton) - for i = 1, LootFrame:GetNumRegions() do + --[[for i = 1, LootFrame:GetNumRegions() do local region = select(i, LootFrame:GetRegions()) if region:GetObjectType() == "FontString" then if region:GetText() == ITEMS then LootFrame.Title = region end end - end + end]] - LootFrame.Title:ClearAllPoints() + --[[LootFrame.Title:ClearAllPoints() LootFrame.Title:SetPoint("TOPLEFT", LootFrame.backdrop, "TOPLEFT", 4, -4) - LootFrame.Title:SetJustifyH("LEFT") + LootFrame.Title:SetJustifyH("LEFT")]] S:HandleNextPrevButton(LootFrameDownButton) S:HandleNextPrevButton(LootFrameUpButton) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Mail.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Mail.lua index 7c27d52..0a91755 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Mail.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Mail.lua @@ -5,7 +5,6 @@ local S = E:GetModule("Skins"); --Lua functions local _G = _G local unpack = unpack -local select = select --WoW API / Variables local GetInboxItem = GetInboxItem local GetItemInfo = GetItemInfo @@ -142,13 +141,13 @@ local function LoadSkin() E:StyleButton(OpenMailPackageButton) E:SetTemplate(OpenMailPackageButton, "Default", true) - for i = 1, OpenMailPackageButton:GetNumRegions() do + --[[for i = 1, OpenMailPackageButton:GetNumRegions() do local region = select(i, OpenMailPackageButton:GetRegions()) if region:GetObjectType() == "Texture" then region:SetTexCoord(unpack(E.TexCoords)) E:SetInside(region) end - end + end]] hooksecurefunc("OpenMail_Update", function() local index = InboxFrame.openMailID diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Merchant.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Merchant.lua index 362ae56..d249c5c 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Merchant.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Merchant.lua @@ -4,7 +4,6 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions local _G = _G -local select = select local unpack = unpack local match, split = string.match, string.split --WoW API / Variables @@ -52,13 +51,14 @@ local function LoadSkin() E:StyleButton(MerchantRepairItemButton) E:SetTemplate(MerchantRepairItemButton, "Default", true) - for i = 1, MerchantRepairItemButton:GetNumRegions() do + + --[[for i = 1, MerchantRepairItemButton:GetNumRegions() do local region = select(i, MerchantRepairItemButton:GetRegions()) if region:GetObjectType() == "Texture" then region:SetTexCoord(0.04, 0.24, 0.06, 0.5) E:SetInside(region) end - end + end]] E:StyleButton(MerchantRepairAllButton) E:SetTemplate(MerchantRepairAllButton, "Default", true) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Misc.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Misc.lua index e5e6598..a1fb7a7 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Misc.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Misc.lua @@ -142,13 +142,10 @@ local function LoadSkin() end end) - for i = 1, OptionsFrame:GetNumRegions() do - local region = select(i, OptionsFrame:GetRegions()) - if region:GetObjectType() == "Texture" then - if i == 3 then - E:Kill(region) -- Kill the nVidia logo - end - end + -- Kill the nVidia logo + local _, _, nVidiaLogo = OptionsFrame:GetRegions() + if nVidiaLogo:GetObjectType() == "Texture" then + E:Kill(nVidiaLogo) end -- Static Popups @@ -160,23 +157,16 @@ local function LoadSkin() E:SetTemplate(staticPopup, "Transparent") + itemFrameBox:DisableDrawLayer("BACKGROUND") + S:HandleEditBox(itemFrameBox) itemFrameBox.backdrop:SetPoint("TOPLEFT", -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) S:HandleCloseButton(closeButton) - select(8, wideBox:GetRegions()):Hide() + --select(8, wideBox:GetRegions()):Hide() S:HandleEditBox(wideBox) wideBox:SetHeight(22) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Quest.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Quest.lua index 6e049e1..8af0c0f 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Quest.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Quest.lua @@ -5,7 +5,6 @@ local S = E:GetModule("Skins"); --Lua functions local _G = _G local pairs = pairs -local select = select local unpack = unpack local find, format, match, split = string.find, string.format, string.match, string.split --WoW API / Variables diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/SpellBook.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/SpellBook.lua index 2a44c3f..1d1c816 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/SpellBook.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/SpellBook.lua @@ -5,7 +5,6 @@ local S = E:GetModule("Skins"); --Lua functions local _G = _G local unpack = unpack -local select = select local getn = table.getn --WoW API / Variables diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua index 7b8724c..9f0ea8a 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua @@ -5,7 +5,6 @@ local S = E:GetModule("Skins"); --Lua functions local _G = _G local unpack = unpack -local select = select local find, match, split = string.find, string.match, string.split --WoW API / Variables local GetItemInfo = GetItemInfo diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Skins.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Skins.lua index 9409241..df98bc7 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Skins.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Skins.lua @@ -4,7 +4,7 @@ local S = E:NewModule("Skins", "AceHook-3.0", "AceEvent-3.0"); --Cache global variables --Lua functions 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 lower = string.lower --WoW API / Variables