From 29acfd85a375b21daa13d76319ce3749dae89cde Mon Sep 17 00:00:00 2001 From: Crum Date: Sun, 17 Dec 2017 01:25:18 -0600 Subject: [PATCH] skins update --- .../Modules/Skins/Blizzard/AuctionHouse.lua | 4 +- .../ElvUI/Modules/Skins/Blizzard/BGScore.lua | 2 +- .../6/7/ElvUI/Modules/Skins/Blizzard/Bags.lua | 3 +- .../Modules/Skins/Blizzard/Battlefield.lua | 5 - .../ElvUI/Modules/Skins/Blizzard/Binding.lua | 5 + .../Modules/Skins/Blizzard/Character.lua | 6 +- .../7/ElvUI/Modules/Skins/Blizzard/Craft.lua | 46 +++++---- .../7/ElvUI/Modules/Skins/Blizzard/Debug.lua | 9 +- .../ElvUI/Modules/Skins/Blizzard/Friends.lua | 34 +++---- .../7/ElvUI/Modules/Skins/Blizzard/Gossip.lua | 4 +- .../Modules/Skins/Blizzard/GuildRegistrar.lua | 3 +- .../6/7/ElvUI/Modules/Skins/Blizzard/Help.lua | 4 +- .../ElvUI/Modules/Skins/Blizzard/Inspect.lua | 8 +- .../6/7/ElvUI/Modules/Skins/Blizzard/Loot.lua | 60 ++++++++---- .../7/ElvUI/Modules/Skins/Blizzard/Macro.lua | 4 +- .../6/7/ElvUI/Modules/Skins/Blizzard/Mail.lua | 91 +++++++++--------- .../ElvUI/Modules/Skins/Blizzard/Merchant.lua | 24 ++--- .../Modules/Skins/Blizzard/MirrorTimers.lua | 8 +- .../6/7/ElvUI/Modules/Skins/Blizzard/Misc.lua | 2 +- .../ElvUI/Modules/Skins/Blizzard/Petition.lua | 4 +- .../7/ElvUI/Modules/Skins/Blizzard/Quest.lua | 48 +++++----- .../Modules/Skins/Blizzard/QuestTimers.lua | 1 - .../6/7/ElvUI/Modules/Skins/Blizzard/Raid.lua | 28 +++--- .../Modules/Skins/Blizzard/SpellBook.lua | 3 +- .../7/ElvUI/Modules/Skins/Blizzard/Stable.lua | 15 ++- .../7/ElvUI/Modules/Skins/Blizzard/Tabard.lua | 10 +- .../7/ElvUI/Modules/Skins/Blizzard/Talent.lua | 2 +- .../ElvUI/Modules/Skins/Blizzard/Tooltip.lua | 2 +- .../7/ElvUI/Modules/Skins/Blizzard/Trade.lua | 33 ++++--- .../Modules/Skins/Blizzard/TradeSkill.lua | 10 +- .../ElvUI/Modules/Skins/Blizzard/Trainer.lua | 14 +-- .../ElvUI/Modules/Skins/Blizzard/Tutorial.lua | 3 +- 2/3/4/5/6/7/ElvUI/Modules/Skins/Skins.lua | 96 +++++++++---------- 33 files changed, 301 insertions(+), 290 deletions(-) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua index 5938ae3..aa56625 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local pairs = pairs --WoW API / Variables @@ -96,7 +96,7 @@ local function LoadSkin() E:SetInside(this:GetNormalTexture()) end local _, _, _, quality = GetAuctionSellItemInfo() - if quality and quality > 1 then + if quality then AuctionsItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) AuctionsItemButtonName:SetTextColor(quality) else diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/BGScore.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/BGScore.lua index d19d90b..728cfb1 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/BGScore.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/BGScore.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local split = string.split --WoW API / Variables local hooksecurefunc = hooksecurefunc diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Bags.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Bags.lua index 9e2fd9a..a185b05 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Bags.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Bags.lua @@ -66,6 +66,8 @@ local function LoadSkin() S:HandleCloseButton(containerFrameClose) + S:SecureHookScript(containerFrame, "OnShow", "ContainerFrame_Update") + local itemButton, itemButtonIcon for k = 1, MAX_CONTAINER_ITEMS, 1 do itemButton = _G["ContainerFrame"..i.."Item"..k] @@ -87,7 +89,6 @@ local function LoadSkin() end S:SecureHook("ContainerFrame_Update") - S:SecureHookScript(ContainerFrame1, "OnShow", "ContainerFrame_Update") -- BankFrame E:CreateBackdrop(BankFrame, "Transparent") diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Battlefield.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Battlefield.lua index 7309883..f1c243f 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Battlefield.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Battlefield.lua @@ -1,11 +1,6 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local S = E:GetModule("Skins"); ---Cache global variables ---Lua functions - ---WoW API / Variables - local function LoadSkin() E:StripTextures(BattlefieldFrame) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Binding.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Binding.lua index 1ac762e..d25754c 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Binding.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Binding.lua @@ -1,6 +1,11 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local S = E:GetModule("Skins"); +--Cache global variables +--Lua functions +local _G = _G +--WoW API / Variables + local function LoadSkin() -- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.binding ~= true then return end diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Character.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Character.lua index e0c39eb..e495580 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Character.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Character.lua @@ -6,7 +6,7 @@ local S = E:GetModule("Skins"); local _G = _G local unpack = unpack local pairs = pairs -local getn = table.getn +local find, getn = string.find, table.getn --WoW API / Variables local GetInventoryItemTexture = GetInventoryItemTexture local GetInventoryItemQuality = GetInventoryItemQuality @@ -259,7 +259,7 @@ local function LoadSkin() SkillFrameCollapseAllButton.Text:SetText("+") hooksecurefunc(SkillFrameCollapseAllButton, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") else self.Text:SetText("+") @@ -288,7 +288,7 @@ local function LoadSkin() label.Text:SetText("+") hooksecurefunc(label, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") else self.Text:SetText("+") 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 b496742..6cada28 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 @@ -6,7 +6,7 @@ local S = E:GetModule("Skins"); local _G = _G local unpack = unpack local select = select -local find, split = string.find, string.split +local find, match, split = string.find, string.match, string.split --WoW API / Variables local GetItemInfo = GetItemInfo local GetItemQualityColor = GetItemQualityColor @@ -49,10 +49,10 @@ local function LoadSkin() S:HandleCloseButton(CraftFrameCloseButton) for i = 1, MAX_CRAFT_REAGENTS do - local reagent = _G["CraftReagent" .. i] - local icon = _G["CraftReagent" .. i .. "IconTexture"] - local count = _G["CraftReagent" .. i .. "Count"] - local nameFrame = _G["CraftReagent" .. i .. "NameFrame"] + local reagent = _G["CraftReagent"..i] + local icon = _G["CraftReagent"..i.."IconTexture"] + local count = _G["CraftReagent"..i.."Count"] + local nameFrame = _G["CraftReagent"..i.."NameFrame"] icon:SetTexCoord(unpack(E.TexCoords)) icon:SetDrawLayer("OVERLAY") @@ -72,8 +72,10 @@ local function LoadSkin() hooksecurefunc("CraftFrame_SetSelection", function(id) E:SetTemplate(CraftIcon, "Default", true) E:StyleButton(CraftIcon, nil, true) - CraftIcon:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) - E:SetInside(CraftIcon:GetNormalTexture()) + if CraftIcon:GetNormalTexture() then + CraftIcon:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) + E:SetInside(CraftIcon:GetNormalTexture()) + end CraftIcon:SetWidth(40) CraftIcon:SetHeight(40) @@ -83,10 +85,8 @@ local function LoadSkin() local skillLink = GetCraftItemLink(id) if skillLink then - local skillString = select(3, find(skillLink, "|H(.+)|h")) - local skillID = select(2, split(":", skillString)) - local quality = select(3, GetItemInfo(skillID)) - if quality and quality > 1 then + local _, _, quality = GetItemInfo(match(skillLink, "enchant:(%d+)")) + if quality then CraftIcon:SetBackdropBorderColor(GetItemQualityColor(quality)) CraftName:SetTextColor(GetItemQualityColor(quality)) else @@ -97,16 +97,14 @@ local function LoadSkin() local numReagents = GetCraftNumReagents(id) for i = 1, numReagents, 1 do + local icon = _G["CraftReagent"..i.."IconTexture"] + local name = _G["CraftReagent"..i.."Name"] + local _, _, reagentCount, playerReagentCount = GetCraftReagentInfo(id, i) local reagentLink = GetCraftReagentItemLink(id, i) - local icon = _G["CraftReagent" .. i .. "IconTexture"] - local name = _G["CraftReagent" .. i .. "Name"] - if reagentLink then - local reagentString = select(3, find(reagentLink, "|H(.+)|h")) - local reagentID = select(2, split(":", reagentString)) - local quality = select(3, GetItemInfo(reagentID)) - if quality and quality > 1 then + local _, _, quality = GetItemInfo(match(reagentLink, "item:(%d+)")) + if quality then icon.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality)) if playerReagentCount < reagentCount then name:SetTextColor(0.5, 0.5, 0.5) @@ -121,12 +119,12 @@ local function LoadSkin() end) for i = 1, CRAFTS_DISPLAYED do - local craftButton = _G["Craft" .. i] + local craftButton = _G["Craft"..i] craftButton:SetNormalTexture("") craftButton.SetNormalTexture = E.noop - _G["Craft" .. i .. "Highlight"]:SetTexture("") - _G["Craft" .. i .. "Highlight"].SetTexture = E.noop + _G["Craft"..i.."Highlight"]:SetTexture("") + _G["Craft"..i.."Highlight"].SetTexture = E.noop craftButton.Text = craftButton:CreateFontString(nil, "OVERLAY") E:FontTemplate(craftButton.Text, nil, 22) @@ -134,9 +132,9 @@ local function LoadSkin() craftButton.Text:SetText("+") hooksecurefunc(craftButton, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") - elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then + elseif find(texture, "PlusButton") then self.Text:SetText("+") else self.Text:SetText("") @@ -157,7 +155,7 @@ local function LoadSkin() CraftCollapseAllButton.Text:SetText("+") hooksecurefunc(CraftCollapseAllButton, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") else self.Text:SetText("+") diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Debug.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Debug.lua index 7320521..a033a26 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Debug.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Debug.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local getn = table.getn --WoW API / Variables @@ -56,12 +56,7 @@ local function LoadSkin() local noscalemult = E.mult * GetCVar("uiScale") HookScript(FrameStackTooltip, "OnShow", function() - this:SetBackdrop({ - bgFile = E["media"].blankTex, - edgeFile = E["media"].blankTex, - tile = false, tileSize = 0, edgeSize = noscalemult, - insets = { left = -noscalemult, right = -noscalemult, top = -noscalemult, bottom = -noscalemult} - }); + E:SetTemplate(this, "Transparent") this:SetBackdropColor(unpack(E["media"].backdropfadecolor)) this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Friends.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Friends.lua index 62f0777..651605d 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Friends.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Friends.lua @@ -123,9 +123,9 @@ function LoadSkin() S:HandleDropDownBox(WhoFrameDropDown) for i = 1, 17 do - local button = _G["WhoFrameButton" .. i] - local level = _G["WhoFrameButton" .. i .. "Level"] - local name = _G["WhoFrameButton" .. i .. "Name"] + local button = _G["WhoFrameButton"..i] + local level = _G["WhoFrameButton"..i.."Level"] + local name = _G["WhoFrameButton"..i.."Name"] button.icon = button:CreateTexture("$parentIcon", "ARTWORK") button.icon:SetPoint("LEFT", 45, 0) @@ -145,7 +145,7 @@ function LoadSkin() name:ClearAllPoints() name:SetPoint("LEFT", 85, 0) - _G["WhoFrameButton" .. i .. "Class"]:Hide() + _G["WhoFrameButton"..i.."Class"]:Hide() end E:StripTextures(WhoListScrollFrame) @@ -247,21 +247,21 @@ function LoadSkin() E:CreateBackdrop(button, "Default", true) button.backdrop:SetAllPoints(button.icon) - _G["GuildFrameButton" .. i .. "Level"]:ClearAllPoints() - _G["GuildFrameButton" .. i .. "Level"]:SetPoint("TOPLEFT", 10, -3) + _G["GuildFrameButton"..i.."Level"]:ClearAllPoints() + _G["GuildFrameButton"..i.."Level"]:SetPoint("TOPLEFT", 10, -3) - _G["GuildFrameButton" .. i .. "Name"]:SetWidth(100) - _G["GuildFrameButton" .. i .. "Name"]:SetHeight(14) - _G["GuildFrameButton" .. i .. "Name"]:ClearAllPoints() - _G["GuildFrameButton" .. i .. "Name"]:SetPoint("LEFT", 85, -3) + _G["GuildFrameButton"..i.."Name"]:SetWidth(100) + _G["GuildFrameButton"..i.."Name"]:SetHeight(14) + _G["GuildFrameButton"..i.."Name"]:ClearAllPoints() + _G["GuildFrameButton"..i.."Name"]:SetPoint("LEFT", 85, -3) - _G["GuildFrameButton" .. i .. "Class"]:Hide() + _G["GuildFrameButton"..i.."Class"]:Hide() end hooksecurefunc("GuildStatus_Update", function() if FriendsFrame.playerStatusFrame then for i = 1, GUILDMEMBERS_TO_DISPLAY, 1 do - local button = _G["GuildFrameButton" .. i] + local button = _G["GuildFrameButton"..i] local _, _, _, level, class, _, _, _, online = GetGuildRosterInfo(button.guildIndex) if class == UNKNOWN then return end @@ -273,9 +273,9 @@ function LoadSkin() if online then classTextColor = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class] levelTextColor = GetQuestDifficultyColor(level) - buttonText = _G["GuildFrameButton" .. i .. "Name"] + buttonText = _G["GuildFrameButton"..i.."Name"] buttonText:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b) - buttonText = _G["GuildFrameButton" .. i .. "Level"] + buttonText = _G["GuildFrameButton"..i.."Level"] buttonText:SetTextColor(levelTextColor.r, levelTextColor.g, levelTextColor.b) end button.icon:SetTexCoord(unpack(CLASS_ICON_TCOORDS[class])) @@ -284,7 +284,7 @@ function LoadSkin() else local classFileName for i = 1, GUILDMEMBERS_TO_DISPLAY, 1 do - button = _G["GuildFrameGuildStatusButton" .. i] + button = _G["GuildFrameGuildStatusButton"..i] _, _, _, _, class, _, _, _, online = GetGuildRosterInfo(button.guildIndex) if class == UNKNOWN then return end @@ -295,8 +295,8 @@ function LoadSkin() if class then if online then classTextColor = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class] - _G["GuildFrameGuildStatusButton" .. i .. "Name"]:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b) - _G["GuildFrameGuildStatusButton" .. i .. "Online"]:SetTextColor(1.0, 1.0, 1.0) + _G["GuildFrameGuildStatusButton"..i.."Name"]:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b) + _G["GuildFrameGuildStatusButton"..i.."Online"]:SetTextColor(1.0, 1.0, 1.0) end end end 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 57e90de..4cddf41 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 @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local select = select --WoW API / Variables local hooksecurefunc = hooksecurefunc @@ -34,7 +34,7 @@ local function LoadSkin() for i = 1, NUMGOSSIPBUTTONS do local obj = select(3,_G["GossipTitleButton"..i]:GetRegions()) - obj:SetTextColor(1,1,1) + obj:SetTextColor(1, 1, 1) end GossipGreetingText:SetTextColor(1,1,1) 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 37628b8..ba19157 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 @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local select = select --WoW API / Variables @@ -20,6 +20,7 @@ local function LoadSkin() S:HandleButton(GuildRegistrarFramePurchaseButton) 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 diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Help.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Help.lua index 352fe9e..d0016eb 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Help.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Help.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local getn = table.getn --WoW API / Variables @@ -36,7 +36,7 @@ local function LoadSkin() HelpFrameCloseButton:SetPoint("TOPRIGHT", -42, 0) for i = 1, getn(helpFrameButtons) do - local helpButton = _G["HelpFrame" .. helpFrameButtons[i]] + local helpButton = _G["HelpFrame"..helpFrameButtons[i]] S:HandleButton(helpButton) end diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Inspect.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Inspect.lua index 19b9eac..35fe1f8 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Inspect.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Inspect.lua @@ -6,7 +6,7 @@ local S = E:GetModule("Skins"); local _G = _G local unpack = unpack local pairs = pairs -local find, split = string.find, string.split +local find, match, split = string.find, string.match, string.split --WoW API / Variables local GetInventoryItemLink = GetInventoryItemLink local GetItemInfo = GetItemInfo @@ -67,9 +67,7 @@ local function LoadSkin() if button.hasItem then local itemLink = GetInventoryItemLink(InspectFrame.unit, button:GetID()) if itemLink then - local itemString = select(3, find(itemLink, "|H(.+)|h")) - local itemID = select(2, split(":", itemString)) - local quality = select(3, GetItemInfo(itemID)) + local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)")) if not quality then E:Delay(0.1, function() if InspectFrame.unit then @@ -77,7 +75,7 @@ local function LoadSkin() end end) return - elseif quality and quality > 1 then + elseif quality then button:SetBackdropBorderColor(GetItemQualityColor(quality)) return end 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 808e1a7..4c947f4 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 @@ -3,9 +3,10 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local select = select +local match = string.match --WoW API / Variables local UnitName = UnitName local IsFishingLoot = IsFishingLoot @@ -42,16 +43,44 @@ local function LoadSkin() LootFrame.Title:SetPoint("TOPLEFT", LootFrame.backdrop, "TOPLEFT", 4, -4) LootFrame.Title:SetJustifyH("LEFT") - for i = 1, LOOTFRAME_NUMBUTTONS do - local button = _G["LootButton" .. i] - S:HandleItemButton(button, true) - end - S:HandleNextPrevButton(LootFrameDownButton) S:HandleNextPrevButton(LootFrameUpButton) S:SquareButton_SetIcon(LootFrameUpButton, "UP") S:SquareButton_SetIcon(LootFrameDownButton, "DOWN") + LootFrameDownButton:ClearAllPoints() + LootFrameDownButton:SetPoint("RIGHT", LootFrameNext, "RIGHT", 32, 0) + LootFramePrev:SetPoint("BOTTOMLEFT", 57, 22) + + hooksecurefunc("LootFrame_Update", function() + local numLootItems = LootFrame.numLootItems + local numLootToShow = LOOTFRAME_NUMBUTTONS + if numLootItems > LOOTFRAME_NUMBUTTONS then + numLootToShow = numLootToShow - 1 + end + for i = 1, LOOTFRAME_NUMBUTTONS do + local slot = (((LootFrame.page - 1) * numLootToShow) + i) + local lootButton = _G["LootButton"..i] + local lootButtonIcon = _G["LootButton"..i.."IconTexture"] + + S:HandleItemButton(lootButton, true) + + if slot <= numLootItems then + local itemLink = GetLootSlotLink(slot) + if itemLink then + local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)")) + if quality then + lootButton.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality)) + else + lootButton.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + end + else + lootButton.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + end + end + end + end) + HookScript(LootFrame, "OnShow", function() if IsFishingLoot() then this.Title:SetText(L["Fishy Loot"]) @@ -70,44 +99,43 @@ local function LoadRollSkin() local function OnShow(self) E:SetTemplate(self, "Transparent") - local cornerTexture = _G[self:GetName() .. "Corner"] + local cornerTexture = _G[self:GetName().."Corner"] cornerTexture:SetTexture() - local iconFrame = _G[self:GetName() .. "IconFrame"] + local iconFrame = _G[self:GetName().."IconFrame"] local _, _, _, quality = GetLootRollItemInfo(self.rollID) iconFrame:SetBackdropBorderColor(GetItemQualityColor(quality)) end for i = 1, NUM_GROUP_LOOT_FRAMES do - local frame = _G["GroupLootFrame" .. i] + local frame = _G["GroupLootFrame"..i] frame:SetParent(UIParent) E:StripTextures(frame) local frameName = frame:GetName() - local iconFrame = _G[frameName .. "IconFrame"] + local iconFrame = _G[frameName.."IconFrame"] E:SetTemplate(iconFrame, "Default") - local icon = _G[frameName .. "IconFrameIcon"] + local icon = _G[frameName.."IconFrameIcon"] E:SetInside(icon) icon:SetTexCoord(unpack(E.TexCoords)) - local statusBar = _G[frameName .. "Timer"] + local statusBar = _G[frameName.."Timer"] E:StripTextures(statusBar) E:CreateBackdrop(statusBar, "Default") statusBar:SetStatusBarTexture(E["media"].normTex) E:RegisterStatusBar(statusBar) - local decoration = _G[frameName .. "Decoration"] + local decoration = _G[frameName.."Decoration"] decoration:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon") - -- decoration:Size(130) decoration:SetWidth(130) decoration:SetHeight(130) decoration:SetPoint("TOPLEFT", -37, 20) - local pass = _G[frameName .. "PassButton"] + local pass = _G[frameName.."PassButton"] S:HandleCloseButton(pass, frame) - HookScript(_G["GroupLootFrame" .. i], "OnShow", OnShow) + HookScript(_G["GroupLootFrame"..i], "OnShow", OnShow) end end diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Macro.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Macro.lua index 0140d92..cbcfc63 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Macro.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Macro.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local getn = table.getn --WoW API / Variables @@ -43,7 +43,7 @@ local function LoadSkin() end for i = 1, 2 do - local tab = _G["MacroFrameTab" .. i] + local tab = _G["MacroFrameTab"..i] tab:SetHeight(22) end 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 8f401b3..7c27d52 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 @@ -47,13 +47,12 @@ local function LoadSkin() for i = 1, INBOXITEMS_TO_DISPLAY do if index <= numItems then - local packageIcon = select(1, GetInboxHeaderInfo(index)) - local isGM = select(13, GetInboxHeaderInfo(index)) + local packageIcon, _, _, _, _, _, _, _, _, _, _, _, isGM = GetInboxHeaderInfo(index) local button = _G["MailItem"..i.."Button"] button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) if packageIcon and not isGM then - local quality = select(4, GetInboxItem(index)) + local _, _, _, quality = GetInboxItem(index) if quality then button:SetBackdropBorderColor(GetItemQualityColor(quality)) else @@ -87,30 +86,27 @@ local function LoadSkin() E:SetTemplate(SendMailScrollFrame, "Default") hooksecurefunc("SendMailFrame_Update", function() - if not SendMailPackageButton.skinned then - E:StripTextures(SendMailPackageButton) - E:SetTemplate(SendMailPackageButton, "Default", true) - E:StyleButton(SendMailPackageButton, nil, true) + if not SendMailPackageButton.skinned then + E:StripTextures(SendMailPackageButton) + E:SetTemplate(SendMailPackageButton, "Default", true) + E:StyleButton(SendMailPackageButton, nil, true) - SendMailPackageButton.skinned = true - end + SendMailPackageButton.skinned = true + end - local itemName = select(1, GetSendMailItem()) - - if itemName then - local quality = select(4, GetSendMailItem()) - - if quality and quality > 1 then - SendMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality)) - else - SendMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - end - - SendMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) - E:SetInside(SendMailPackageButton:GetNormalTexture()) + local itemName = GetSendMailItem() + if itemName then + local _, _, _, quality = GetSendMailItem() + if quality then + SendMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality)) else SendMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end + SendMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) + E:SetInside(SendMailPackageButton:GetNormalTexture()) + else + SendMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + end end) SendMailBodyEditBox:SetTextColor(1, 1, 1) @@ -142,31 +138,40 @@ local function LoadSkin() OpenMailFrame.backdrop:SetPoint("TOPLEFT", 12, -12) OpenMailFrame.backdrop:SetPoint("BOTTOMRIGHT", -34, 74) + E:StripTextures(OpenMailPackageButton) + E:StyleButton(OpenMailPackageButton) + E:SetTemplate(OpenMailPackageButton, "Default", true) + 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 - -- hooksecurefunc("OpenMail_Update", function() - -- local numItems = GetInboxNumItems() - -- local index = ((InboxFrame.pageNum - 1) * INBOXITEMS_TO_DISPLAY) + 1 + hooksecurefunc("OpenMail_Update", function() + local index = InboxFrame.openMailID + if not index then return end - -- E:SetTemplate(OpenMailPackageButton, "Default", true) - -- E:StyleButton(OpenMailPackageButton, nil, true) - -- OpenMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) - -- E:SetInside(OpenMailPackageButton:GetNormalTexture()) + local _, stationeryIcon, _, _, _, _, _, hasItem = GetInboxHeaderInfo(index) - -- local itemName = select(1, GetInboxItem(index)) - -- if itemName then - -- local quality = select(4, GetInboxItem(index)) - - -- if quality and quality > 1 then - -- OpenMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality)) - -- else - -- OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - -- end - - -- else - -- OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - -- end - -- end) + if hasItem then + local itemName = GetInboxItem(index) + if itemName then + local _, _, _, quality = GetInboxItem(index) + if quality then + OpenMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality)) + else + OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + end + OpenMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) + E:SetInside(OpenMailPackageButton:GetNormalTexture()) + else + OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + end + end + end) S:HandleCloseButton(OpenMailCloseButton) 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 09c417c..362ae56 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 @@ -93,11 +93,9 @@ local function LoadSkin() local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)")) if quality then itemName:SetTextColor(GetItemQualityColor(quality)) - if quality then - itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) - else - itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - end + itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) + else + itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end else itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) @@ -111,14 +109,12 @@ local function LoadSkin() local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)")) if quality then MerchantBuyBackItemName:SetTextColor(GetItemQualityColor(quality)) - if quality then - MerchantBuyBackItemItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) - else - MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - end + MerchantBuyBackItemItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) else MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end + else + MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end end end @@ -138,14 +134,12 @@ local function LoadSkin() local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)")) if quality then itemName:SetTextColor(GetItemQualityColor(quality)) - if quality then - itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) - else - itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - end + itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) else itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end + else + itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end end end diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua index a7f3927..831e33a 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua @@ -33,9 +33,9 @@ local function LoadSkin() end) for i = 1, MIRRORTIMER_NUMTIMERS do - local mirrorTimer = _G["MirrorTimer" .. i] - local statusBar = _G["MirrorTimer" .. i .. "StatusBar"] - local text = _G["MirrorTimer" .. i .. "Text"] + local mirrorTimer = _G["MirrorTimer"..i] + local statusBar = _G["MirrorTimer"..i.."StatusBar"] + local text = _G["MirrorTimer"..i.."Text"] E:StripTextures(mirrorTimer) mirrorTimer:SetWidth(222) @@ -55,7 +55,7 @@ local function LoadSkin() mirrorTimer.timeSinceUpdate = 0.3 - E:CreateMover(mirrorTimer, "MirrorTimer" .. i .. "Mover", L["MirrorTimer"] .. i, nil, nil, nil, "ALL,SOLO") + E:CreateMover(mirrorTimer, "MirrorTimer"..i.."Mover", L["MirrorTimer"]..i, nil, nil, nil, "ALL,SOLO") end end 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 3ad1f28..deb01d4 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 @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local find = string.find local getn = table.getn diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Petition.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Petition.lua index a77ee7b..0fa1766 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Petition.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Petition.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G --WoW API / Variables local function LoadSkin() @@ -27,7 +27,7 @@ local function LoadSkin() PetitionFrameMemberTitle:SetTextColor(1, 1, 0) for i = 1, 9 do - _G["PetitionFrameMemberName" .. i]:SetTextColor(1, 1, 1) + _G["PetitionFrameMemberName"..i]:SetTextColor(1, 1, 1) end PetitionFrameInstructions:SetTextColor(1, 1, 1) 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 6a9f894..6e049e1 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 @@ -7,7 +7,7 @@ local _G = _G local pairs = pairs local select = select local unpack = unpack -local find, format, split = string.find, string.format, string.split +local find, format, match, split = string.find, string.format, string.match, string.split --WoW API / Variables local GetItemInfo = GetItemInfo local GetItemQualityColor = GetItemQualityColor @@ -53,9 +53,9 @@ local function LoadSkin() end for i = 1, MAX_NUM_ITEMS do - local item = _G["QuestLogItem" .. i] - local icon = _G["QuestLogItem" .. i .. "IconTexture"] - local count = _G["QuestLogItem" .. i .. "Count"] + local item = _G["QuestLogItem"..i] + local icon = _G["QuestLogItem"..i.."IconTexture"] + local count = _G["QuestLogItem"..i.."Count"] E:StripTextures(item) E:SetTemplate(item, "Default") @@ -74,9 +74,9 @@ local function LoadSkin() end for i = 1, 6 do - local item = _G["QuestDetailItem" .. i] - local icon = _G["QuestDetailItem" .. i .. "IconTexture"] - local count = _G["QuestDetailItem" .. i .. "Count"] + local item = _G["QuestDetailItem"..i] + local icon = _G["QuestDetailItem"..i.."IconTexture"] + local count = _G["QuestDetailItem"..i.."Count"] E:StripTextures(item) E:SetTemplate(item, "Default") @@ -95,9 +95,9 @@ local function LoadSkin() end for i = 1, 6 do - local item = _G["QuestRewardItem" .. i] - local icon = _G["QuestRewardItem" .. i .. "IconTexture"] - local count = _G["QuestRewardItem" .. i .. "Count"] + local item = _G["QuestRewardItem"..i] + local icon = _G["QuestRewardItem"..i.."IconTexture"] + local count = _G["QuestRewardItem"..i.."Count"] E:StripTextures(item) E:SetTemplate(item, "Default") @@ -117,12 +117,10 @@ local function LoadSkin() local function QuestQualityColors(frame, text, quality, link) if link and not quality then - local itemString = select(3, find(link, "|H(.+)|h")) - local itemID = select(2, split(":", itemString)) - quality = select(3, GetItemInfo(itemID)) + _, _, quality = GetItemInfo(match(link, "item:(%d+)")) end - if quality and quality > 1 then + if quality then if frame then frame:SetBackdropBorderColor(GetItemQualityColor(quality)) frame.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality)) @@ -150,8 +148,8 @@ local function LoadSkin() _G[this:GetName() .. "Name"]:SetTextColor(1, 1, 0) for i = 1, MAX_NUM_ITEMS do - local questItem = _G["QuestRewardItem" .. i] - local questName = _G["QuestRewardItem" .. i .. "Name"] + local questItem = _G["QuestRewardItem"..i] + local questName = _G["QuestRewardItem"..i.."Name"] local link = questItem.type and GetQuestItemLink(questItem.type, questItem:GetID()) if questItem ~= this then @@ -350,9 +348,9 @@ local function LoadSkin() end) for i = 1, 6 do - local item = _G["QuestProgressItem" .. i] - local icon = _G["QuestProgressItem" .. i .. "IconTexture"] - local count = _G["QuestProgressItem" .. i .. "Count"] + local item = _G["QuestProgressItem"..i] + local icon = _G["QuestProgressItem"..i.."IconTexture"] + local count = _G["QuestProgressItem"..i.."Count"] E:StripTextures(item) E:SetTemplate(item, "Default") @@ -392,13 +390,13 @@ local function LoadSkin() end) for i = 1, QUESTS_DISPLAYED do - local questLogTitle = _G["QuestLogTitle" .. i] + local questLogTitle = _G["QuestLogTitle"..i] questLogTitle:SetNormalTexture("") questLogTitle.SetNormalTexture = E.noop - _G["QuestLogTitle" .. i .. "Highlight"]:SetTexture("") - _G["QuestLogTitle" .. i .. "Highlight"].SetTexture = E.noop + _G["QuestLogTitle"..i.."Highlight"]:SetTexture("") + _G["QuestLogTitle"..i.."Highlight"].SetTexture = E.noop questLogTitle.Text = questLogTitle:CreateFontString(nil, "OVERLAY") E:FontTemplate(questLogTitle.Text, nil, 22) @@ -406,9 +404,9 @@ local function LoadSkin() questLogTitle.Text:SetText("+") hooksecurefunc(questLogTitle, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") - elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then + elseif find(texture, "PlusButton") then self.Text:SetText("+") else self.Text:SetText("") @@ -431,7 +429,7 @@ local function LoadSkin() QuestLogCollapseAllButton.Text:SetText("+") hooksecurefunc(QuestLogCollapseAllButton, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") else self.Text:SetText("+") diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/QuestTimers.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/QuestTimers.lua index 4a89c64..7efc410 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/QuestTimers.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/QuestTimers.lua @@ -20,7 +20,6 @@ local function LoadSkin() QuestTimerFrame:SetAllPoints(QuestTimerFrameMover) local QuestTimerFrameHolder = CreateFrame("Frame", "QuestTimerFrameHolder", E.UIParent) - -- QuestTimerFrameHolder:Size(150, 22) QuestTimerFrameHolder:SetWidth(150) QuestTimerFrameHolder:SetHeight(22) QuestTimerFrameHolder:SetPoint("TOP", QuestTimerFrameMover, "TOP") diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Raid.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Raid.lua index 019a6b2..554a4a1 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Raid.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Raid.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local pairs = pairs --WoW API / Variables @@ -35,19 +35,19 @@ function LoadSkin() S:HandleButton(RaidFrameRaidInfoButton) for i = 1, NUM_RAID_GROUPS*5 do - S:HandleButton(_G["RaidGroupButton" .. i], true) + S:HandleButton(_G["RaidGroupButton"..i], true) end for i = 1, 8 do for j = 1, 5 do - E:StripTextures(_G["RaidGroup" .. i .. "Slot" .. j]) - E:SetTemplate(_G["RaidGroup" .. i .. "Slot" .. j], "Transparent") + E:StripTextures(_G["RaidGroup"..i.."Slot"..j]) + E:SetTemplate(_G["RaidGroup"..i.."Slot"..j], "Transparent") end end local function skinPulloutFrames() for i = 1, NUM_RAID_PULLOUT_FRAMES do - local rp = _G["RaidPullout" .. i] + local rp = _G["RaidPullout"..i] if not rp.backdrop then _G["RaidPullout"..i.."MenuBackdrop"]:SetBackdrop(nil) E:CreateBackdrop(rp, "Transparent") @@ -64,28 +64,28 @@ function LoadSkin() hooksecurefunc("RaidPullout_Update", function(pullOutFrame) local pfName = pullOutFrame:GetName() for i = 1, pullOutFrame.numPulloutButtons do - local pfBName = pfName .. "Button" .. i + local pfBName = pfName.."Button"..i local pfBObj = _G[pfBName] if not pfBObj.backdrop then for _, v in pairs{"HealthBar", "ManaBar", "Target", "TargetTarget"} do - local sBar = pfBName .. v + local sBar = pfBName..v E:StripTextures(_G[sBar]) _G[sBar]:SetStatusBarTexture(E["media"].normTex) end - _G[pfBName .. "ManaBar"]:SetPoint("TOP", "$parentHealthBar", "BOTTOM", 0, 0) - _G[pfBName .. "Target"]:SetPoint("TOP", "$parentManaBar", "BOTTOM", 0, -1) + _G[pfBName.."ManaBar"]:SetPoint("TOP", "$parentHealthBar", "BOTTOM", 0, 0) + _G[pfBName.."Target"]:SetPoint("TOP", "$parentManaBar", "BOTTOM", 0, -1) E:CreateBackdrop(pfBObj, "Default") pfBObj.backdrop:SetPoint("TOPLEFT", E.PixelMode and 0 or -1, -(E.PixelMode and 10 or 9)) pfBObj.backdrop:SetPoint("BOTTOMRIGHT", E.PixelMode and 0 or 1, E.PixelMode and 1 or 0) end - if not _G[pfBName .. "TargetTargetFrame"].backdrop then - E:StripTextures(_G[pfBName .. "TargetTargetFrame"]) - E:CreateBackdrop(_G[pfBName .. "TargetTargetFrame"], "Default") - _G[pfBName .. "TargetTargetFrame"].backdrop:SetPoint("TOPLEFT", E.PixelMode and 10 or 9, -(E.PixelMode and 15 or 14)) - _G[pfBName .. "TargetTargetFrame"].backdrop:SetPoint("BOTTOMRIGHT", -(E.PixelMode and 10 or 9), E.PixelMode and 8 or 7) + if not _G[pfBName.."TargetTargetFrame"].backdrop then + E:StripTextures(_G[pfBName.."TargetTargetFrame"]) + E:CreateBackdrop(_G[pfBName.."TargetTargetFrame"], "Default") + _G[pfBName.."TargetTargetFrame"].backdrop:SetPoint("TOPLEFT", E.PixelMode and 10 or 9, -(E.PixelMode and 15 or 14)) + _G[pfBName.."TargetTargetFrame"].backdrop:SetPoint("BOTTOMRIGHT", -(E.PixelMode and 10 or 9), E.PixelMode and 8 or 7) end end end) 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 decce4d..2a44c3f 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 @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local select = select local getn = table.getn @@ -42,7 +42,6 @@ local function LoadSkin() button:DisableDrawLayer("BACKGROUND") button:GetNormalTexture():SetTexture("") button:GetPushedTexture():SetTexture("") - --E:StyleButton(button, true) if iconTexture then iconTexture:SetTexCoord(unpack(E.TexCoords)) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Stable.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Stable.lua index 6540801..d302605 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Stable.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Stable.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G --WoW API / Variables local GetPetHappiness = GetPetHappiness local HasPetUI = HasPetUI @@ -28,29 +28,28 @@ function LoadSkin() _G["PetStableCurrentPetIconTexture"]:SetDrawLayer("OVERLAY") for i = 1, NUM_PET_STABLE_SLOTS do - S:HandleItemButton(_G["PetStableStabledPet" .. i], true) - _G["PetStableStabledPet" .. i .. "IconTexture"]:SetDrawLayer("OVERLAY") + S:HandleItemButton(_G["PetStableStabledPet"..i], true) + _G["PetStableStabledPet"..i.."IconTexture"]:SetDrawLayer("OVERLAY") end PetStablePetInfo:GetRegions():SetTexCoord(0.04, 0.15, 0.06, 0.30) PetStablePetInfo:SetFrameLevel(PetModelFrame:GetFrameLevel() + 2) E:CreateBackdrop(PetStablePetInfo, "Default") - -- PetStablePetInfo:Size(24, 24) PetStablePetInfo:SetWidth(24) PetStablePetInfo:SetHeight(24) hooksecurefunc("PetStable_Update", function() local happiness = GetPetHappiness() local hasPetUI, isHunterPet = HasPetUI() - if(UnitExists("pet") and hasPetUI and not isHunterPet) then + if UnitExists("pet") and hasPetUI and not isHunterPet then return end local texture = PetStablePetInfo:GetRegions() - if(happiness == 1) then + if happiness == 1 then texture:SetTexCoord(0.41, 0.53, 0.06, 0.30) - elseif(happiness == 2) then + elseif happiness == 2 then texture:SetTexCoord(0.22, 0.345, 0.06, 0.30) - elseif(happiness == 3) then + elseif happiness == 3 then texture:SetTexCoord(0.04, 0.15, 0.06, 0.30) end end) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tabard.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tabard.lua index 77b8be3..7a02996 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tabard.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tabard.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G --WoW API / Variables local hooksecurefunc = hooksecurefunc @@ -25,14 +25,14 @@ local function LoadSkin() E:StripTextures(TabardFrameCustomizationFrame) for i = 1, 5 do - local custom = "TabardFrameCustomization" .. i + local custom = "TabardFrameCustomization"..i E:StripTextures(_G[custom]) - S:HandleNextPrevButton(_G[custom .. "LeftButton"]) - S:HandleNextPrevButton(_G[custom .. "RightButton"]) + S:HandleNextPrevButton(_G[custom.."LeftButton"]) + S:HandleNextPrevButton(_G[custom.."RightButton"]) if(i > 1) then _G[custom]:ClearAllPoints() - _G[custom]:SetPoint("TOP", _G["TabardFrameCustomization" .. i-1], "BOTTOM", 0, -6) + _G[custom]:SetPoint("TOP", _G["TabardFrameCustomization"..i-1], "BOTTOM", 0, -6) else local point, anchor, point2, x, y = _G[custom]:GetPoint() _G[custom]:SetPoint(point, anchor, point2, x, y+4) diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Talent.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Talent.lua index ee30f04..f192c14 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Talent.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Talent.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack --WoW API / Variables diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tooltip.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tooltip.lua index 68e3b5d..d420fe6 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tooltip.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tooltip.lua @@ -4,7 +4,7 @@ local TT = E:GetModule("Tooltip"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local pairs = pairs --WoW API / Variables diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trade.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trade.lua index 0629dd2..0442577 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trade.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trade.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 GetItemQualityColor = GetItemQualityColor local GetTradePlayerItemInfo = GetTradePlayerItemInfo @@ -28,12 +27,12 @@ local function LoadSkin() S:HandleEditBox(TradePlayerInputMoneyFrameCopper) for i = 1, MAX_TRADE_ITEMS do - local player = _G["TradePlayerItem" .. i] - local recipient = _G["TradeRecipientItem" .. i] - local playerButton = _G["TradePlayerItem" .. i .. "ItemButton"] - local playerButtonIcon = _G["TradePlayerItem" .. i .. "ItemButtonIconTexture"] - local recipientButton = _G["TradeRecipientItem" .. i .. "ItemButton"] - local recipientButtonIcon = _G["TradeRecipientItem" .. i .. "ItemButtonIconTexture"] + local player = _G["TradePlayerItem"..i] + local recipient = _G["TradeRecipientItem"..i] + local playerButton = _G["TradePlayerItem"..i.."ItemButton"] + local playerButtonIcon = _G["TradePlayerItem"..i.."ItemButtonIconTexture"] + local recipientButton = _G["TradeRecipientItem"..i.."ItemButton"] + local recipientButtonIcon = _G["TradeRecipientItem"..i.."ItemButtonIconTexture"] local playerNameFrame = _G["TradePlayerItem"..i.."NameFrame"] local recipientNameFrame = _G["TradeRecipientItem"..i.."NameFrame"] @@ -91,14 +90,14 @@ local function LoadSkin() S:HandleButton(TradeFrameCancelButton) hooksecurefunc("TradeFrame_UpdatePlayerItem", function(id) - local tradeItemButton = _G["TradePlayerItem" .. id .. "ItemButton"] - local tradeItemName = _G["TradePlayerItem" .. id .. "Name"] + local tradeItemButton = _G["TradePlayerItem"..id.."ItemButton"] + local tradeItemName = _G["TradePlayerItem"..id.."Name"] - local name = select(1, GetTradePlayerItemInfo(id)) + local name = GetTradePlayerItemInfo(id) if name then - local quality = select(4, GetTradePlayerItemInfo(id)) + local _, _, _, quality = GetTradePlayerItemInfo(id) tradeItemName:SetTextColor(GetItemQualityColor(quality)) - if quality and quality > 1 then + if quality then tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) end else @@ -107,14 +106,14 @@ local function LoadSkin() end) hooksecurefunc("TradeFrame_UpdateTargetItem", function(id) - local tradeItemButton = _G["TradeRecipientItem" .. id .. "ItemButton"] - local tradeItemName = _G["TradeRecipientItem" .. id .. "Name"] + local tradeItemButton = _G["TradeRecipientItem"..id.."ItemButton"] + local tradeItemName = _G["TradeRecipientItem"..id.."Name"] - local name = select(1, GetTradeTargetItemInfo(id)) + local name = GetTradeTargetItemInfo(id) if name then - local quality = select(4, GetTradeTargetItemInfo(id)) + local _, _, _, quality = GetTradeTargetItemInfo(id) tradeItemName:SetTextColor(GetItemQualityColor(quality)) - if quality and quality > 1 then + if quality then tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) end else 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 de2db93..7b8724c 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 @@ -6,9 +6,7 @@ local S = E:GetModule("Skins"); local _G = _G local unpack = unpack local select = select -local find = string.find -local match = string.match -local split = string.split +local find, match, split = string.find, string.match, string.split --WoW API / Variables local GetItemInfo = GetItemInfo local GetItemQualityColor = GetItemQualityColor @@ -82,9 +80,9 @@ local function LoadSkin() skillButton.Text:SetText("+") hooksecurefunc(skillButton, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") - elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then + elseif find(texture, "PlusButton") then self.Text:SetText("+") else self.Text:SetText("") @@ -144,7 +142,7 @@ local function LoadSkin() TradeSkillSkillIcon:SetWidth(40) TradeSkillSkillIcon:SetHeight(40) - TradeSkillSkillIcon:SetPoint("TOPLEFT", 4, -3) + TradeSkillSkillIcon:SetPoint("TOPLEFT", 2, -3) local skillLink = GetTradeSkillItemLink(id) if skillLink then diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trainer.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trainer.lua index fd7e619..3da1c5c 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trainer.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Trainer.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G local unpack = unpack local find = string.find --WoW API / Variables @@ -47,12 +47,12 @@ local function LoadSkin() end) for i = 1, CLASS_TRAINER_SKILLS_DISPLAYED do - local skillButton = _G["ClassTrainerSkill" .. i] + local skillButton = _G["ClassTrainerSkill"..i] skillButton:SetNormalTexture("") skillButton.SetNormalTexture = E.noop - _G["ClassTrainerSkill" .. i .. "Highlight"]:SetTexture("") - _G["ClassTrainerSkill" .. i .. "Highlight"].SetTexture = E.noop + _G["ClassTrainerSkill"..i.."Highlight"]:SetTexture("") + _G["ClassTrainerSkill"..i.."Highlight"].SetTexture = E.noop skillButton.Text = skillButton:CreateFontString(nil, "OVERLAY") E:FontTemplate(skillButton.Text, nil, 22) @@ -60,9 +60,9 @@ local function LoadSkin() skillButton.Text:SetText("+") hooksecurefunc(skillButton, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") - elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then + elseif find(texture, "PlusButton") then self.Text:SetText("+") else self.Text:SetText("") @@ -83,7 +83,7 @@ local function LoadSkin() ClassTrainerCollapseAllButton.Text:SetText("+") hooksecurefunc(ClassTrainerCollapseAllButton, "SetNormalTexture", function(self, texture) - if texture == "Interface\\Buttons\\UI-MinusButton-Up" then + if find(texture, "MinusButton") then self.Text:SetText("-") else self.Text:SetText("+") diff --git a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tutorial.lua b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tutorial.lua index f33ba3c..7923ca6 100644 --- a/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tutorial.lua +++ b/2/3/4/5/6/7/ElvUI/Modules/Skins/Blizzard/Tutorial.lua @@ -3,7 +3,7 @@ local S = E:GetModule("Skins"); --Cache global variables --Lua functions -local _G = getfenv() +local _G = _G --WoW API / Variables local MAX_TUTORIAL_ALERTS = MAX_TUTORIAL_ALERTS @@ -14,7 +14,6 @@ local function LoadSkin() local button = _G["TutorialFrameAlertButton"..i] local icon = button:GetNormalTexture() - -- button:Size(35, 45) button:SetWidth(35) button:SetHeight(45) E:SetTemplate(button, "Default", true) 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 f469a1b..de84b6d 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 @@ -1,25 +1,25 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local S = E:NewModule("Skins", "AceHook-3.0", "AceEvent-3.0"); -local _G = getfenv(); -local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall; -local tinsert, wipe = table.insert, table.wipe; +local _G = _G +local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall +local tinsert, wipe = table.insert, table.wipe local lower = string.lower -local CreateFrame = CreateFrame; -local SetDesaturation = SetDesaturation; -local hooksecurefunc = hooksecurefunc; -local IsAddOnLoaded = IsAddOnLoaded; -local GetCVarBool = GetCVarBool; +local CreateFrame = CreateFrame +local SetDesaturation = SetDesaturation +local hooksecurefunc = hooksecurefunc +local IsAddOnLoaded = IsAddOnLoaded +local GetCVarBool = GetCVarBool -E.Skins = S; -S.addonsToLoad = {}; -S.nonAddonsToLoad = {}; -S.allowBypass = {}; -S.addonCallbacks = {}; -S.nonAddonCallbacks = {["CallPriority"] = {}}; +E.Skins = S +S.addonsToLoad = {} +S.nonAddonsToLoad = {} +S.allowBypass = {} +S.addonCallbacks = {} +S.nonAddonCallbacks = {["CallPriority"] = {}} -local find = string.find; +local find = string.find S.SQUARE_BUTTON_TEXCOORDS = { ["UP"] = { 0.45312500, 0.64062500, 0.01562500, 0.20312500}; @@ -27,47 +27,47 @@ S.SQUARE_BUTTON_TEXCOORDS = { ["LEFT"] = { 0.23437500, 0.42187500, 0.01562500, 0.20312500}; ["RIGHT"] = { 0.42187500, 0.23437500, 0.01562500, 0.20312500}; ["DELETE"] = { 0.01562500, 0.20312500, 0.01562500, 0.20312500} -}; +} function S:SquareButton_SetIcon(self, name) - local coords = S.SQUARE_BUTTON_TEXCOORDS[strupper(name)]; - if(coords) then - self.icon:SetTexCoord(coords[1], coords[2], coords[3], coords[4]); + local coords = S.SQUARE_BUTTON_TEXCOORDS[strupper(name)] + if coords then + self.icon:SetTexCoord(coords[1], coords[2], coords[3], coords[4]) end end function S:SetModifiedBackdrop(self) - if(self.backdrop) then self = self.backdrop; end - self:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor)); + if self.backdrop then self = self.backdrop end + self:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor)) end function S:SetOriginalBackdrop(self) - if(self.backdrop) then self = self.backdrop; end - self:SetBackdropBorderColor(unpack(E["media"].bordercolor)); + if self.backdrop then self = self.backdrop end + self:SetBackdropBorderColor(unpack(E["media"].bordercolor)) end function S:HandleButton(f, strip) - local name = f:GetName(); - if(name) then - local left = _G[name .."Left"]; - local middle = _G[name .."Middle"]; - local right = _G[name .."Right"]; + local name = f:GetName() + if name then + local left = _G[name .."Left"] + local middle = _G[name .."Middle"] + local right = _G[name .."Right"] - if(left) then E:Kill(left); end - if(middle) then E:Kill(middle); end - if(right) then E:Kill(right); end + if left then E:Kill(left) end + if middle then E:Kill(middle) end + if right then E:Kill(right) end end - if(f.Left) then E:Kill(f.Left); end - if(f.Middle) then E:Kill(f.Middle); end - if(f.Right) then E:Kill(f.Right); end + if f.Left then E:Kill(f.Left) end + if f.Middle then E:Kill(f.Middle) end + if f.Right then E:Kill(f.Right) end - if(f.SetNormalTexture) then f:SetNormalTexture(""); end - if(f.SetHighlightTexture) then f:SetHighlightTexture(""); end - if(f.SetPushedTexture) then f:SetPushedTexture(""); end - if(f.SetDisabledTexture) then f:SetDisabledTexture(""); end + if f.SetNormalTexture then f:SetNormalTexture("") end + if f.SetHighlightTexture then f:SetHighlightTexture("") end + if f.SetPushedTexture then f:SetPushedTexture("") end + if f.SetDisabledTexture then f:SetDisabledTexture("") end - if(strip) then E:StripTextures(f); end + if strip then E:StripTextures(f) end E:SetTemplate(f, "Default", true) HookScript(f, "OnEnter", function() S:SetModifiedBackdrop(this) end) @@ -243,7 +243,7 @@ function S:HandleEditBox(frame) if _G[frame:GetName() .."Mid"] then E:Kill(_G[frame:GetName() .."Mid"]) end if string.gfind(frame:GetName(), "Silver") or string.gfind(frame:GetName(), "Copper") then - frame.backdrop:SetPoint("BOTTOMRIGHT", -12, -2); + frame.backdrop:SetPoint("BOTTOMRIGHT", -12, -2) end end end @@ -301,10 +301,10 @@ function S:HandleIcon(icon, parent) end function S:HandleItemButton(b, shrinkIcon) - if(b.isSkinned) then return; end + if b.isSkinned then return end - local icon = b.icon or b.IconTexture or b.iconTexture; - local texture; + local icon = b.icon or b.IconTexture or b.iconTexture + local texture if b:GetName() and _G[b:GetName() .."IconTexture"] then icon = _G[b:GetName() .."IconTexture"] elseif b:GetName() and _G[b:GetName() .."Icon"] then @@ -448,7 +448,7 @@ function S:ADDON_LOADED() return end - if not E.initialized then return; end + if not E.initialized then return end if self.addonsToLoad[arg1] then self.addonsToLoad[arg1]() @@ -508,7 +508,7 @@ function S:AddCallbackForAddon(addonName, eventName, loadFunc, forceLoad, bypass end --Register loadFunc to be called when event is fired - E.RegisterCallback(E, eventName, loadFunc); + E.RegisterCallback(E, eventName, loadFunc) if forceLoad then E.callbacks:Fire(eventName) @@ -527,7 +527,7 @@ function S:AddCallback(eventName, loadFunc) return elseif not loadFunc or type(loadFunc) ~= "function" then E:Print("Invalid argument #2 to S:AddCallback (function expected)") - return; + return end if self.nonAddonCallbacks[eventName] or E.ModuleCallbacks[eventName] or E.InitialModuleCallbacks[eventName] then @@ -581,10 +581,10 @@ function S:Initialize() ScriptErrorsFrame_OnError(catch, false) end end - wipe(self.nonAddonsToLoad); + wipe(self.nonAddonsToLoad) end -S:RegisterEvent("ADDON_LOADED"); +S:RegisterEvent("ADDON_LOADED") local function InitializeCallback() S:Initialize()