mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
skins update
This commit is contained in:
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
@@ -96,7 +96,7 @@ local function LoadSkin()
|
|||||||
E:SetInside(this:GetNormalTexture())
|
E:SetInside(this:GetNormalTexture())
|
||||||
end
|
end
|
||||||
local _, _, _, quality = GetAuctionSellItemInfo()
|
local _, _, _, quality = GetAuctionSellItemInfo()
|
||||||
if quality and quality > 1 then
|
if quality then
|
||||||
AuctionsItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
AuctionsItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
AuctionsItemButtonName:SetTextColor(quality)
|
AuctionsItemButtonName:SetTextColor(quality)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local split = string.split
|
local split = string.split
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local hooksecurefunc = hooksecurefunc
|
local hooksecurefunc = hooksecurefunc
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ local function LoadSkin()
|
|||||||
|
|
||||||
S:HandleCloseButton(containerFrameClose)
|
S:HandleCloseButton(containerFrameClose)
|
||||||
|
|
||||||
|
S:SecureHookScript(containerFrame, "OnShow", "ContainerFrame_Update")
|
||||||
|
|
||||||
local itemButton, itemButtonIcon
|
local itemButton, itemButtonIcon
|
||||||
for k = 1, MAX_CONTAINER_ITEMS, 1 do
|
for k = 1, MAX_CONTAINER_ITEMS, 1 do
|
||||||
itemButton = _G["ContainerFrame"..i.."Item"..k]
|
itemButton = _G["ContainerFrame"..i.."Item"..k]
|
||||||
@@ -87,7 +89,6 @@ local function LoadSkin()
|
|||||||
end
|
end
|
||||||
|
|
||||||
S:SecureHook("ContainerFrame_Update")
|
S:SecureHook("ContainerFrame_Update")
|
||||||
S:SecureHookScript(ContainerFrame1, "OnShow", "ContainerFrame_Update")
|
|
||||||
|
|
||||||
-- BankFrame
|
-- BankFrame
|
||||||
E:CreateBackdrop(BankFrame, "Transparent")
|
E:CreateBackdrop(BankFrame, "Transparent")
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
local S = E:GetModule("Skins");
|
local S = E:GetModule("Skins");
|
||||||
|
|
||||||
--Cache global variables
|
|
||||||
--Lua functions
|
|
||||||
|
|
||||||
--WoW API / Variables
|
|
||||||
|
|
||||||
local function LoadSkin()
|
local function LoadSkin()
|
||||||
E:StripTextures(BattlefieldFrame)
|
E:StripTextures(BattlefieldFrame)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
local S = E:GetModule("Skins");
|
local S = E:GetModule("Skins");
|
||||||
|
|
||||||
|
--Cache global variables
|
||||||
|
--Lua functions
|
||||||
|
local _G = _G
|
||||||
|
--WoW API / Variables
|
||||||
|
|
||||||
local function LoadSkin()
|
local function LoadSkin()
|
||||||
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.binding ~= true then return end
|
-- if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.binding ~= true then return end
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local S = E:GetModule("Skins");
|
|||||||
local _G = _G
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local getn = table.getn
|
local find, getn = string.find, table.getn
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local GetInventoryItemTexture = GetInventoryItemTexture
|
local GetInventoryItemTexture = GetInventoryItemTexture
|
||||||
local GetInventoryItemQuality = GetInventoryItemQuality
|
local GetInventoryItemQuality = GetInventoryItemQuality
|
||||||
@@ -259,7 +259,7 @@ local function LoadSkin()
|
|||||||
SkillFrameCollapseAllButton.Text:SetText("+")
|
SkillFrameCollapseAllButton.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(SkillFrameCollapseAllButton, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(SkillFrameCollapseAllButton, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
else
|
else
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
@@ -288,7 +288,7 @@ local function LoadSkin()
|
|||||||
label.Text:SetText("+")
|
label.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(label, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(label, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
else
|
else
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local S = E:GetModule("Skins");
|
|||||||
local _G = _G
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local select = select
|
local select = select
|
||||||
local find, split = string.find, string.split
|
local find, match, split = string.find, string.match, string.split
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local GetItemInfo = GetItemInfo
|
local GetItemInfo = GetItemInfo
|
||||||
local GetItemQualityColor = GetItemQualityColor
|
local GetItemQualityColor = GetItemQualityColor
|
||||||
@@ -72,8 +72,10 @@ local function LoadSkin()
|
|||||||
hooksecurefunc("CraftFrame_SetSelection", function(id)
|
hooksecurefunc("CraftFrame_SetSelection", function(id)
|
||||||
E:SetTemplate(CraftIcon, "Default", true)
|
E:SetTemplate(CraftIcon, "Default", true)
|
||||||
E:StyleButton(CraftIcon, nil, true)
|
E:StyleButton(CraftIcon, nil, true)
|
||||||
|
if CraftIcon:GetNormalTexture() then
|
||||||
CraftIcon:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
|
CraftIcon:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
|
||||||
E:SetInside(CraftIcon:GetNormalTexture())
|
E:SetInside(CraftIcon:GetNormalTexture())
|
||||||
|
end
|
||||||
|
|
||||||
CraftIcon:SetWidth(40)
|
CraftIcon:SetWidth(40)
|
||||||
CraftIcon:SetHeight(40)
|
CraftIcon:SetHeight(40)
|
||||||
@@ -83,10 +85,8 @@ local function LoadSkin()
|
|||||||
|
|
||||||
local skillLink = GetCraftItemLink(id)
|
local skillLink = GetCraftItemLink(id)
|
||||||
if skillLink then
|
if skillLink then
|
||||||
local skillString = select(3, find(skillLink, "|H(.+)|h"))
|
local _, _, quality = GetItemInfo(match(skillLink, "enchant:(%d+)"))
|
||||||
local skillID = select(2, split(":", skillString))
|
if quality then
|
||||||
local quality = select(3, GetItemInfo(skillID))
|
|
||||||
if quality and quality > 1 then
|
|
||||||
CraftIcon:SetBackdropBorderColor(GetItemQualityColor(quality))
|
CraftIcon:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
CraftName:SetTextColor(GetItemQualityColor(quality))
|
CraftName:SetTextColor(GetItemQualityColor(quality))
|
||||||
else
|
else
|
||||||
@@ -97,16 +97,14 @@ local function LoadSkin()
|
|||||||
|
|
||||||
local numReagents = GetCraftNumReagents(id)
|
local numReagents = GetCraftNumReagents(id)
|
||||||
for i = 1, numReagents, 1 do
|
for i = 1, numReagents, 1 do
|
||||||
local _, _, reagentCount, playerReagentCount = GetCraftReagentInfo(id, i)
|
|
||||||
local reagentLink = GetCraftReagentItemLink(id, i)
|
|
||||||
local icon = _G["CraftReagent"..i.."IconTexture"]
|
local icon = _G["CraftReagent"..i.."IconTexture"]
|
||||||
local name = _G["CraftReagent"..i.."Name"]
|
local name = _G["CraftReagent"..i.."Name"]
|
||||||
|
|
||||||
|
local _, _, reagentCount, playerReagentCount = GetCraftReagentInfo(id, i)
|
||||||
|
local reagentLink = GetCraftReagentItemLink(id, i)
|
||||||
if reagentLink then
|
if reagentLink then
|
||||||
local reagentString = select(3, find(reagentLink, "|H(.+)|h"))
|
local _, _, quality = GetItemInfo(match(reagentLink, "item:(%d+)"))
|
||||||
local reagentID = select(2, split(":", reagentString))
|
if quality then
|
||||||
local quality = select(3, GetItemInfo(reagentID))
|
|
||||||
if quality and quality > 1 then
|
|
||||||
icon.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
|
icon.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
if playerReagentCount < reagentCount then
|
if playerReagentCount < reagentCount then
|
||||||
name:SetTextColor(0.5, 0.5, 0.5)
|
name:SetTextColor(0.5, 0.5, 0.5)
|
||||||
@@ -134,9 +132,9 @@ local function LoadSkin()
|
|||||||
craftButton.Text:SetText("+")
|
craftButton.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(craftButton, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(craftButton, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then
|
elseif find(texture, "PlusButton") then
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
else
|
else
|
||||||
self.Text:SetText("")
|
self.Text:SetText("")
|
||||||
@@ -157,7 +155,7 @@ local function LoadSkin()
|
|||||||
CraftCollapseAllButton.Text:SetText("+")
|
CraftCollapseAllButton.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(CraftCollapseAllButton, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(CraftCollapseAllButton, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
else
|
else
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local getn = table.getn
|
local getn = table.getn
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
@@ -56,12 +56,7 @@ local function LoadSkin()
|
|||||||
|
|
||||||
local noscalemult = E.mult * GetCVar("uiScale")
|
local noscalemult = E.mult * GetCVar("uiScale")
|
||||||
HookScript(FrameStackTooltip, "OnShow", function()
|
HookScript(FrameStackTooltip, "OnShow", function()
|
||||||
this:SetBackdrop({
|
E:SetTemplate(this, "Transparent")
|
||||||
bgFile = E["media"].blankTex,
|
|
||||||
edgeFile = E["media"].blankTex,
|
|
||||||
tile = false, tileSize = 0, edgeSize = noscalemult,
|
|
||||||
insets = { left = -noscalemult, right = -noscalemult, top = -noscalemult, bottom = -noscalemult}
|
|
||||||
});
|
|
||||||
this:SetBackdropColor(unpack(E["media"].backdropfadecolor))
|
this:SetBackdropColor(unpack(E["media"].backdropfadecolor))
|
||||||
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local select = select
|
local select = select
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local hooksecurefunc = hooksecurefunc
|
local hooksecurefunc = hooksecurefunc
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local select = select
|
local select = select
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
|
|
||||||
@@ -20,6 +20,7 @@ local function LoadSkin()
|
|||||||
S:HandleButton(GuildRegistrarFramePurchaseButton)
|
S:HandleButton(GuildRegistrarFramePurchaseButton)
|
||||||
S:HandleCloseButton(GuildRegistrarFrameCloseButton)
|
S:HandleCloseButton(GuildRegistrarFrameCloseButton)
|
||||||
S:HandleEditBox(GuildRegistrarFrameEditBox)
|
S:HandleEditBox(GuildRegistrarFrameEditBox)
|
||||||
|
|
||||||
for i = 1, GuildRegistrarFrameEditBox:GetNumRegions() do
|
for i = 1, GuildRegistrarFrameEditBox:GetNumRegions() do
|
||||||
local region = select(i, GuildRegistrarFrameEditBox:GetRegions())
|
local region = select(i, GuildRegistrarFrameEditBox:GetRegions())
|
||||||
if region and region:GetObjectType() == "Texture" then
|
if region and region:GetObjectType() == "Texture" then
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local getn = table.getn
|
local getn = table.getn
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local S = E:GetModule("Skins");
|
|||||||
local _G = _G
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local find, split = string.find, string.split
|
local find, match, split = string.find, string.match, string.split
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local GetInventoryItemLink = GetInventoryItemLink
|
local GetInventoryItemLink = GetInventoryItemLink
|
||||||
local GetItemInfo = GetItemInfo
|
local GetItemInfo = GetItemInfo
|
||||||
@@ -67,9 +67,7 @@ local function LoadSkin()
|
|||||||
if button.hasItem then
|
if button.hasItem then
|
||||||
local itemLink = GetInventoryItemLink(InspectFrame.unit, button:GetID())
|
local itemLink = GetInventoryItemLink(InspectFrame.unit, button:GetID())
|
||||||
if itemLink then
|
if itemLink then
|
||||||
local itemString = select(3, find(itemLink, "|H(.+)|h"))
|
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
||||||
local itemID = select(2, split(":", itemString))
|
|
||||||
local quality = select(3, GetItemInfo(itemID))
|
|
||||||
if not quality then
|
if not quality then
|
||||||
E:Delay(0.1, function()
|
E:Delay(0.1, function()
|
||||||
if InspectFrame.unit then
|
if InspectFrame.unit then
|
||||||
@@ -77,7 +75,7 @@ local function LoadSkin()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
return
|
return
|
||||||
elseif quality and quality > 1 then
|
elseif quality then
|
||||||
button:SetBackdropBorderColor(GetItemQualityColor(quality))
|
button:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local select = select
|
local select = select
|
||||||
|
local match = string.match
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local UnitName = UnitName
|
local UnitName = UnitName
|
||||||
local IsFishingLoot = IsFishingLoot
|
local IsFishingLoot = IsFishingLoot
|
||||||
@@ -42,16 +43,44 @@ local function LoadSkin()
|
|||||||
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")
|
||||||
|
|
||||||
for i = 1, LOOTFRAME_NUMBUTTONS do
|
|
||||||
local button = _G["LootButton" .. i]
|
|
||||||
S:HandleItemButton(button, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
S:HandleNextPrevButton(LootFrameDownButton)
|
S:HandleNextPrevButton(LootFrameDownButton)
|
||||||
S:HandleNextPrevButton(LootFrameUpButton)
|
S:HandleNextPrevButton(LootFrameUpButton)
|
||||||
S:SquareButton_SetIcon(LootFrameUpButton, "UP")
|
S:SquareButton_SetIcon(LootFrameUpButton, "UP")
|
||||||
S:SquareButton_SetIcon(LootFrameDownButton, "DOWN")
|
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()
|
HookScript(LootFrame, "OnShow", function()
|
||||||
if IsFishingLoot() then
|
if IsFishingLoot() then
|
||||||
this.Title:SetText(L["Fishy Loot"])
|
this.Title:SetText(L["Fishy Loot"])
|
||||||
@@ -99,7 +128,6 @@ local function LoadRollSkin()
|
|||||||
|
|
||||||
local decoration = _G[frameName.."Decoration"]
|
local decoration = _G[frameName.."Decoration"]
|
||||||
decoration:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon")
|
decoration:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon")
|
||||||
-- decoration:Size(130)
|
|
||||||
decoration:SetWidth(130)
|
decoration:SetWidth(130)
|
||||||
decoration:SetHeight(130)
|
decoration:SetHeight(130)
|
||||||
decoration:SetPoint("TOPLEFT", -37, 20)
|
decoration:SetPoint("TOPLEFT", -37, 20)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local getn = table.getn
|
local getn = table.getn
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
|
|||||||
@@ -47,13 +47,12 @@ local function LoadSkin()
|
|||||||
|
|
||||||
for i = 1, INBOXITEMS_TO_DISPLAY do
|
for i = 1, INBOXITEMS_TO_DISPLAY do
|
||||||
if index <= numItems then
|
if index <= numItems then
|
||||||
local packageIcon = select(1, GetInboxHeaderInfo(index))
|
local packageIcon, _, _, _, _, _, _, _, _, _, _, _, isGM = GetInboxHeaderInfo(index)
|
||||||
local isGM = select(13, GetInboxHeaderInfo(index))
|
|
||||||
local button = _G["MailItem"..i.."Button"]
|
local button = _G["MailItem"..i.."Button"]
|
||||||
|
|
||||||
button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
button:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
if packageIcon and not isGM then
|
if packageIcon and not isGM then
|
||||||
local quality = select(4, GetInboxItem(index))
|
local _, _, _, quality = GetInboxItem(index)
|
||||||
if quality then
|
if quality then
|
||||||
button:SetBackdropBorderColor(GetItemQualityColor(quality))
|
button:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
else
|
else
|
||||||
@@ -95,17 +94,14 @@ local function LoadSkin()
|
|||||||
SendMailPackageButton.skinned = true
|
SendMailPackageButton.skinned = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local itemName = select(1, GetSendMailItem())
|
local itemName = GetSendMailItem()
|
||||||
|
|
||||||
if itemName then
|
if itemName then
|
||||||
local quality = select(4, GetSendMailItem())
|
local _, _, _, quality = GetSendMailItem()
|
||||||
|
if quality then
|
||||||
if quality and quality > 1 then
|
|
||||||
SendMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
SendMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
else
|
else
|
||||||
SendMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
SendMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
end
|
end
|
||||||
|
|
||||||
SendMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
|
SendMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
|
||||||
E:SetInside(SendMailPackageButton:GetNormalTexture())
|
E:SetInside(SendMailPackageButton:GetNormalTexture())
|
||||||
else
|
else
|
||||||
@@ -142,31 +138,40 @@ local function LoadSkin()
|
|||||||
OpenMailFrame.backdrop:SetPoint("TOPLEFT", 12, -12)
|
OpenMailFrame.backdrop:SetPoint("TOPLEFT", 12, -12)
|
||||||
OpenMailFrame.backdrop:SetPoint("BOTTOMRIGHT", -34, 74)
|
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()
|
hooksecurefunc("OpenMail_Update", function()
|
||||||
-- local numItems = GetInboxNumItems()
|
local index = InboxFrame.openMailID
|
||||||
-- local index = ((InboxFrame.pageNum - 1) * INBOXITEMS_TO_DISPLAY) + 1
|
if not index then return end
|
||||||
|
|
||||||
-- E:SetTemplate(OpenMailPackageButton, "Default", true)
|
local _, stationeryIcon, _, _, _, _, _, hasItem = GetInboxHeaderInfo(index)
|
||||||
-- E:StyleButton(OpenMailPackageButton, nil, true)
|
|
||||||
-- OpenMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
|
|
||||||
-- E:SetInside(OpenMailPackageButton:GetNormalTexture())
|
|
||||||
|
|
||||||
-- local itemName = select(1, GetInboxItem(index))
|
if hasItem then
|
||||||
-- if itemName then
|
local itemName = GetInboxItem(index)
|
||||||
-- local quality = select(4, GetInboxItem(index))
|
if itemName then
|
||||||
|
local _, _, _, quality = GetInboxItem(index)
|
||||||
-- if quality and quality > 1 then
|
if quality then
|
||||||
-- OpenMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
OpenMailPackageButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
-- else
|
else
|
||||||
-- OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
-- end
|
end
|
||||||
|
OpenMailPackageButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
|
||||||
-- else
|
E:SetInside(OpenMailPackageButton:GetNormalTexture())
|
||||||
-- OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
else
|
||||||
-- end
|
OpenMailPackageButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
-- end)
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
S:HandleCloseButton(OpenMailCloseButton)
|
S:HandleCloseButton(OpenMailCloseButton)
|
||||||
|
|
||||||
|
|||||||
@@ -93,12 +93,10 @@ local function LoadSkin()
|
|||||||
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
||||||
if quality then
|
if quality then
|
||||||
itemName:SetTextColor(GetItemQualityColor(quality))
|
itemName:SetTextColor(GetItemQualityColor(quality))
|
||||||
if quality then
|
|
||||||
itemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
itemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
else
|
else
|
||||||
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
end
|
end
|
||||||
end
|
|
||||||
else
|
else
|
||||||
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
end
|
end
|
||||||
@@ -111,7 +109,6 @@ local function LoadSkin()
|
|||||||
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
||||||
if quality then
|
if quality then
|
||||||
MerchantBuyBackItemName:SetTextColor(GetItemQualityColor(quality))
|
MerchantBuyBackItemName:SetTextColor(GetItemQualityColor(quality))
|
||||||
if quality then
|
|
||||||
MerchantBuyBackItemItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
MerchantBuyBackItemItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
else
|
else
|
||||||
MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
@@ -121,7 +118,6 @@ local function LoadSkin()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
hooksecurefunc("MerchantFrame_UpdateBuybackInfo", function()
|
hooksecurefunc("MerchantFrame_UpdateBuybackInfo", function()
|
||||||
@@ -138,7 +134,6 @@ local function LoadSkin()
|
|||||||
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
local _, _, quality = GetItemInfo(match(itemLink, "item:(%d+)"))
|
||||||
if quality then
|
if quality then
|
||||||
itemName:SetTextColor(GetItemQualityColor(quality))
|
itemName:SetTextColor(GetItemQualityColor(quality))
|
||||||
if quality then
|
|
||||||
itemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
itemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
else
|
else
|
||||||
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
@@ -149,7 +144,6 @@ local function LoadSkin()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local find = string.find
|
local find = string.find
|
||||||
local getn = table.getn
|
local getn = table.getn
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
|
|
||||||
local function LoadSkin()
|
local function LoadSkin()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ local _G = _G
|
|||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local select = select
|
local select = select
|
||||||
local unpack = unpack
|
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
|
--WoW API / Variables
|
||||||
local GetItemInfo = GetItemInfo
|
local GetItemInfo = GetItemInfo
|
||||||
local GetItemQualityColor = GetItemQualityColor
|
local GetItemQualityColor = GetItemQualityColor
|
||||||
@@ -117,12 +117,10 @@ local function LoadSkin()
|
|||||||
|
|
||||||
local function QuestQualityColors(frame, text, quality, link)
|
local function QuestQualityColors(frame, text, quality, link)
|
||||||
if link and not quality then
|
if link and not quality then
|
||||||
local itemString = select(3, find(link, "|H(.+)|h"))
|
_, _, quality = GetItemInfo(match(link, "item:(%d+)"))
|
||||||
local itemID = select(2, split(":", itemString))
|
|
||||||
quality = select(3, GetItemInfo(itemID))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if quality and quality > 1 then
|
if quality then
|
||||||
if frame then
|
if frame then
|
||||||
frame:SetBackdropBorderColor(GetItemQualityColor(quality))
|
frame:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
frame.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
|
frame.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
@@ -406,9 +404,9 @@ local function LoadSkin()
|
|||||||
questLogTitle.Text:SetText("+")
|
questLogTitle.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(questLogTitle, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(questLogTitle, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then
|
elseif find(texture, "PlusButton") then
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
else
|
else
|
||||||
self.Text:SetText("")
|
self.Text:SetText("")
|
||||||
@@ -431,7 +429,7 @@ local function LoadSkin()
|
|||||||
QuestLogCollapseAllButton.Text:SetText("+")
|
QuestLogCollapseAllButton.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(QuestLogCollapseAllButton, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(QuestLogCollapseAllButton, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
else
|
else
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ local function LoadSkin()
|
|||||||
QuestTimerFrame:SetAllPoints(QuestTimerFrameMover)
|
QuestTimerFrame:SetAllPoints(QuestTimerFrameMover)
|
||||||
|
|
||||||
local QuestTimerFrameHolder = CreateFrame("Frame", "QuestTimerFrameHolder", E.UIParent)
|
local QuestTimerFrameHolder = CreateFrame("Frame", "QuestTimerFrameHolder", E.UIParent)
|
||||||
-- QuestTimerFrameHolder:Size(150, 22)
|
|
||||||
QuestTimerFrameHolder:SetWidth(150)
|
QuestTimerFrameHolder:SetWidth(150)
|
||||||
QuestTimerFrameHolder:SetHeight(22)
|
QuestTimerFrameHolder:SetHeight(22)
|
||||||
QuestTimerFrameHolder:SetPoint("TOP", QuestTimerFrameMover, "TOP")
|
QuestTimerFrameHolder:SetPoint("TOP", QuestTimerFrameMover, "TOP")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local select = select
|
local select = select
|
||||||
local getn = table.getn
|
local getn = table.getn
|
||||||
@@ -42,7 +42,6 @@ local function LoadSkin()
|
|||||||
button:DisableDrawLayer("BACKGROUND")
|
button:DisableDrawLayer("BACKGROUND")
|
||||||
button:GetNormalTexture():SetTexture("")
|
button:GetNormalTexture():SetTexture("")
|
||||||
button:GetPushedTexture():SetTexture("")
|
button:GetPushedTexture():SetTexture("")
|
||||||
--E:StyleButton(button, true)
|
|
||||||
|
|
||||||
if iconTexture then
|
if iconTexture then
|
||||||
iconTexture:SetTexCoord(unpack(E.TexCoords))
|
iconTexture:SetTexCoord(unpack(E.TexCoords))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local GetPetHappiness = GetPetHappiness
|
local GetPetHappiness = GetPetHappiness
|
||||||
local HasPetUI = HasPetUI
|
local HasPetUI = HasPetUI
|
||||||
@@ -35,22 +35,21 @@ function LoadSkin()
|
|||||||
PetStablePetInfo:GetRegions():SetTexCoord(0.04, 0.15, 0.06, 0.30)
|
PetStablePetInfo:GetRegions():SetTexCoord(0.04, 0.15, 0.06, 0.30)
|
||||||
PetStablePetInfo:SetFrameLevel(PetModelFrame:GetFrameLevel() + 2)
|
PetStablePetInfo:SetFrameLevel(PetModelFrame:GetFrameLevel() + 2)
|
||||||
E:CreateBackdrop(PetStablePetInfo, "Default")
|
E:CreateBackdrop(PetStablePetInfo, "Default")
|
||||||
-- PetStablePetInfo:Size(24, 24)
|
|
||||||
PetStablePetInfo:SetWidth(24)
|
PetStablePetInfo:SetWidth(24)
|
||||||
PetStablePetInfo:SetHeight(24)
|
PetStablePetInfo:SetHeight(24)
|
||||||
|
|
||||||
hooksecurefunc("PetStable_Update", function()
|
hooksecurefunc("PetStable_Update", function()
|
||||||
local happiness = GetPetHappiness()
|
local happiness = GetPetHappiness()
|
||||||
local hasPetUI, isHunterPet = HasPetUI()
|
local hasPetUI, isHunterPet = HasPetUI()
|
||||||
if(UnitExists("pet") and hasPetUI and not isHunterPet) then
|
if UnitExists("pet") and hasPetUI and not isHunterPet then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local texture = PetStablePetInfo:GetRegions()
|
local texture = PetStablePetInfo:GetRegions()
|
||||||
if(happiness == 1) then
|
if happiness == 1 then
|
||||||
texture:SetTexCoord(0.41, 0.53, 0.06, 0.30)
|
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)
|
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)
|
texture:SetTexCoord(0.04, 0.15, 0.06, 0.30)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local hooksecurefunc = hooksecurefunc
|
local hooksecurefunc = hooksecurefunc
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ local TT = E:GetModule("Tooltip");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
--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
|
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local GetItemQualityColor = GetItemQualityColor
|
local GetItemQualityColor = GetItemQualityColor
|
||||||
local GetTradePlayerItemInfo = GetTradePlayerItemInfo
|
local GetTradePlayerItemInfo = GetTradePlayerItemInfo
|
||||||
@@ -94,11 +93,11 @@ local function LoadSkin()
|
|||||||
local tradeItemButton = _G["TradePlayerItem"..id.."ItemButton"]
|
local tradeItemButton = _G["TradePlayerItem"..id.."ItemButton"]
|
||||||
local tradeItemName = _G["TradePlayerItem"..id.."Name"]
|
local tradeItemName = _G["TradePlayerItem"..id.."Name"]
|
||||||
|
|
||||||
local name = select(1, GetTradePlayerItemInfo(id))
|
local name = GetTradePlayerItemInfo(id)
|
||||||
if name then
|
if name then
|
||||||
local quality = select(4, GetTradePlayerItemInfo(id))
|
local _, _, _, quality = GetTradePlayerItemInfo(id)
|
||||||
tradeItemName:SetTextColor(GetItemQualityColor(quality))
|
tradeItemName:SetTextColor(GetItemQualityColor(quality))
|
||||||
if quality and quality > 1 then
|
if quality then
|
||||||
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -110,11 +109,11 @@ local function LoadSkin()
|
|||||||
local tradeItemButton = _G["TradeRecipientItem"..id.."ItemButton"]
|
local tradeItemButton = _G["TradeRecipientItem"..id.."ItemButton"]
|
||||||
local tradeItemName = _G["TradeRecipientItem"..id.."Name"]
|
local tradeItemName = _G["TradeRecipientItem"..id.."Name"]
|
||||||
|
|
||||||
local name = select(1, GetTradeTargetItemInfo(id))
|
local name = GetTradeTargetItemInfo(id)
|
||||||
if name then
|
if name then
|
||||||
local quality = select(4, GetTradeTargetItemInfo(id))
|
local _, _, _, quality = GetTradeTargetItemInfo(id)
|
||||||
tradeItemName:SetTextColor(GetItemQualityColor(quality))
|
tradeItemName:SetTextColor(GetItemQualityColor(quality))
|
||||||
if quality and quality > 1 then
|
if quality then
|
||||||
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ local S = E:GetModule("Skins");
|
|||||||
local _G = _G
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local select = select
|
local select = select
|
||||||
local find = string.find
|
local find, match, split = string.find, string.match, string.split
|
||||||
local match = string.match
|
|
||||||
local split = string.split
|
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local GetItemInfo = GetItemInfo
|
local GetItemInfo = GetItemInfo
|
||||||
local GetItemQualityColor = GetItemQualityColor
|
local GetItemQualityColor = GetItemQualityColor
|
||||||
@@ -82,9 +80,9 @@ local function LoadSkin()
|
|||||||
skillButton.Text:SetText("+")
|
skillButton.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(skillButton, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(skillButton, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then
|
elseif find(texture, "PlusButton") then
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
else
|
else
|
||||||
self.Text:SetText("")
|
self.Text:SetText("")
|
||||||
@@ -144,7 +142,7 @@ local function LoadSkin()
|
|||||||
|
|
||||||
TradeSkillSkillIcon:SetWidth(40)
|
TradeSkillSkillIcon:SetWidth(40)
|
||||||
TradeSkillSkillIcon:SetHeight(40)
|
TradeSkillSkillIcon:SetHeight(40)
|
||||||
TradeSkillSkillIcon:SetPoint("TOPLEFT", 4, -3)
|
TradeSkillSkillIcon:SetPoint("TOPLEFT", 2, -3)
|
||||||
|
|
||||||
local skillLink = GetTradeSkillItemLink(id)
|
local skillLink = GetTradeSkillItemLink(id)
|
||||||
if skillLink then
|
if skillLink then
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local find = string.find
|
local find = string.find
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
@@ -60,9 +60,9 @@ local function LoadSkin()
|
|||||||
skillButton.Text:SetText("+")
|
skillButton.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(skillButton, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(skillButton, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
elseif texture == "Interface\\Buttons\\UI-PlusButton-Up" then
|
elseif find(texture, "PlusButton") then
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
else
|
else
|
||||||
self.Text:SetText("")
|
self.Text:SetText("")
|
||||||
@@ -83,7 +83,7 @@ local function LoadSkin()
|
|||||||
ClassTrainerCollapseAllButton.Text:SetText("+")
|
ClassTrainerCollapseAllButton.Text:SetText("+")
|
||||||
|
|
||||||
hooksecurefunc(ClassTrainerCollapseAllButton, "SetNormalTexture", function(self, texture)
|
hooksecurefunc(ClassTrainerCollapseAllButton, "SetNormalTexture", function(self, texture)
|
||||||
if texture == "Interface\\Buttons\\UI-MinusButton-Up" then
|
if find(texture, "MinusButton") then
|
||||||
self.Text:SetText("-")
|
self.Text:SetText("-")
|
||||||
else
|
else
|
||||||
self.Text:SetText("+")
|
self.Text:SetText("+")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local S = E:GetModule("Skins");
|
|||||||
|
|
||||||
--Cache global variables
|
--Cache global variables
|
||||||
--Lua functions
|
--Lua functions
|
||||||
local _G = getfenv()
|
local _G = _G
|
||||||
--WoW API / Variables
|
--WoW API / Variables
|
||||||
local MAX_TUTORIAL_ALERTS = MAX_TUTORIAL_ALERTS
|
local MAX_TUTORIAL_ALERTS = MAX_TUTORIAL_ALERTS
|
||||||
|
|
||||||
@@ -14,7 +14,6 @@ local function LoadSkin()
|
|||||||
local button = _G["TutorialFrameAlertButton"..i]
|
local button = _G["TutorialFrameAlertButton"..i]
|
||||||
local icon = button:GetNormalTexture()
|
local icon = button:GetNormalTexture()
|
||||||
|
|
||||||
-- button:Size(35, 45)
|
|
||||||
button:SetWidth(35)
|
button:SetWidth(35)
|
||||||
button:SetHeight(45)
|
button:SetHeight(45)
|
||||||
E:SetTemplate(button, "Default", true)
|
E:SetTemplate(button, "Default", true)
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
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 S = E:NewModule("Skins", "AceHook-3.0", "AceEvent-3.0");
|
||||||
|
|
||||||
local _G = getfenv();
|
local _G = _G
|
||||||
local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall;
|
local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall
|
||||||
local tinsert, wipe = table.insert, table.wipe;
|
local tinsert, wipe = table.insert, table.wipe
|
||||||
local lower = string.lower
|
local lower = string.lower
|
||||||
|
|
||||||
local CreateFrame = CreateFrame;
|
local CreateFrame = CreateFrame
|
||||||
local SetDesaturation = SetDesaturation;
|
local SetDesaturation = SetDesaturation
|
||||||
local hooksecurefunc = hooksecurefunc;
|
local hooksecurefunc = hooksecurefunc
|
||||||
local IsAddOnLoaded = IsAddOnLoaded;
|
local IsAddOnLoaded = IsAddOnLoaded
|
||||||
local GetCVarBool = GetCVarBool;
|
local GetCVarBool = GetCVarBool
|
||||||
|
|
||||||
E.Skins = S;
|
E.Skins = S
|
||||||
S.addonsToLoad = {};
|
S.addonsToLoad = {}
|
||||||
S.nonAddonsToLoad = {};
|
S.nonAddonsToLoad = {}
|
||||||
S.allowBypass = {};
|
S.allowBypass = {}
|
||||||
S.addonCallbacks = {};
|
S.addonCallbacks = {}
|
||||||
S.nonAddonCallbacks = {["CallPriority"] = {}};
|
S.nonAddonCallbacks = {["CallPriority"] = {}}
|
||||||
|
|
||||||
local find = string.find;
|
local find = string.find
|
||||||
|
|
||||||
S.SQUARE_BUTTON_TEXCOORDS = {
|
S.SQUARE_BUTTON_TEXCOORDS = {
|
||||||
["UP"] = { 0.45312500, 0.64062500, 0.01562500, 0.20312500};
|
["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};
|
["LEFT"] = { 0.23437500, 0.42187500, 0.01562500, 0.20312500};
|
||||||
["RIGHT"] = { 0.42187500, 0.23437500, 0.01562500, 0.20312500};
|
["RIGHT"] = { 0.42187500, 0.23437500, 0.01562500, 0.20312500};
|
||||||
["DELETE"] = { 0.01562500, 0.20312500, 0.01562500, 0.20312500}
|
["DELETE"] = { 0.01562500, 0.20312500, 0.01562500, 0.20312500}
|
||||||
};
|
}
|
||||||
|
|
||||||
function S:SquareButton_SetIcon(self, name)
|
function S:SquareButton_SetIcon(self, name)
|
||||||
local coords = S.SQUARE_BUTTON_TEXCOORDS[strupper(name)];
|
local coords = S.SQUARE_BUTTON_TEXCOORDS[strupper(name)]
|
||||||
if(coords) then
|
if coords then
|
||||||
self.icon:SetTexCoord(coords[1], coords[2], coords[3], coords[4]);
|
self.icon:SetTexCoord(coords[1], coords[2], coords[3], coords[4])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function S:SetModifiedBackdrop(self)
|
function S:SetModifiedBackdrop(self)
|
||||||
if(self.backdrop) then self = self.backdrop; end
|
if self.backdrop then self = self.backdrop end
|
||||||
self:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor));
|
self:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor))
|
||||||
end
|
end
|
||||||
|
|
||||||
function S:SetOriginalBackdrop(self)
|
function S:SetOriginalBackdrop(self)
|
||||||
if(self.backdrop) then self = self.backdrop; end
|
if self.backdrop then self = self.backdrop end
|
||||||
self:SetBackdropBorderColor(unpack(E["media"].bordercolor));
|
self:SetBackdropBorderColor(unpack(E["media"].bordercolor))
|
||||||
end
|
end
|
||||||
|
|
||||||
function S:HandleButton(f, strip)
|
function S:HandleButton(f, strip)
|
||||||
local name = f:GetName();
|
local name = f:GetName()
|
||||||
if(name) then
|
if name then
|
||||||
local left = _G[name .."Left"];
|
local left = _G[name .."Left"]
|
||||||
local middle = _G[name .."Middle"];
|
local middle = _G[name .."Middle"]
|
||||||
local right = _G[name .."Right"];
|
local right = _G[name .."Right"]
|
||||||
|
|
||||||
if(left) then E:Kill(left); end
|
if left then E:Kill(left) end
|
||||||
if(middle) then E:Kill(middle); end
|
if middle then E:Kill(middle) end
|
||||||
if(right) then E:Kill(right); end
|
if right then E:Kill(right) end
|
||||||
end
|
end
|
||||||
|
|
||||||
if(f.Left) then E:Kill(f.Left); end
|
if f.Left then E:Kill(f.Left) end
|
||||||
if(f.Middle) then E:Kill(f.Middle); end
|
if f.Middle then E:Kill(f.Middle) end
|
||||||
if(f.Right) then E:Kill(f.Right); end
|
if f.Right then E:Kill(f.Right) end
|
||||||
|
|
||||||
if(f.SetNormalTexture) then f:SetNormalTexture(""); end
|
if f.SetNormalTexture then f:SetNormalTexture("") end
|
||||||
if(f.SetHighlightTexture) then f:SetHighlightTexture(""); end
|
if f.SetHighlightTexture then f:SetHighlightTexture("") end
|
||||||
if(f.SetPushedTexture) then f:SetPushedTexture(""); end
|
if f.SetPushedTexture then f:SetPushedTexture("") end
|
||||||
if(f.SetDisabledTexture) then f:SetDisabledTexture(""); 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)
|
E:SetTemplate(f, "Default", true)
|
||||||
HookScript(f, "OnEnter", function() S:SetModifiedBackdrop(this) end)
|
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 _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
|
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
|
end
|
||||||
end
|
end
|
||||||
@@ -301,10 +301,10 @@ function S:HandleIcon(icon, parent)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function S:HandleItemButton(b, shrinkIcon)
|
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 icon = b.icon or b.IconTexture or b.iconTexture
|
||||||
local texture;
|
local texture
|
||||||
if b:GetName() and _G[b:GetName() .."IconTexture"] then
|
if b:GetName() and _G[b:GetName() .."IconTexture"] then
|
||||||
icon = _G[b:GetName() .."IconTexture"]
|
icon = _G[b:GetName() .."IconTexture"]
|
||||||
elseif b:GetName() and _G[b:GetName() .."Icon"] then
|
elseif b:GetName() and _G[b:GetName() .."Icon"] then
|
||||||
@@ -448,7 +448,7 @@ function S:ADDON_LOADED()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not E.initialized then return; end
|
if not E.initialized then return end
|
||||||
|
|
||||||
if self.addonsToLoad[arg1] then
|
if self.addonsToLoad[arg1] then
|
||||||
self.addonsToLoad[arg1]()
|
self.addonsToLoad[arg1]()
|
||||||
@@ -508,7 +508,7 @@ function S:AddCallbackForAddon(addonName, eventName, loadFunc, forceLoad, bypass
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Register loadFunc to be called when event is fired
|
--Register loadFunc to be called when event is fired
|
||||||
E.RegisterCallback(E, eventName, loadFunc);
|
E.RegisterCallback(E, eventName, loadFunc)
|
||||||
|
|
||||||
if forceLoad then
|
if forceLoad then
|
||||||
E.callbacks:Fire(eventName)
|
E.callbacks:Fire(eventName)
|
||||||
@@ -527,7 +527,7 @@ function S:AddCallback(eventName, loadFunc)
|
|||||||
return
|
return
|
||||||
elseif not loadFunc or type(loadFunc) ~= "function" then
|
elseif not loadFunc or type(loadFunc) ~= "function" then
|
||||||
E:Print("Invalid argument #2 to S:AddCallback (function expected)")
|
E:Print("Invalid argument #2 to S:AddCallback (function expected)")
|
||||||
return;
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.nonAddonCallbacks[eventName] or E.ModuleCallbacks[eventName] or E.InitialModuleCallbacks[eventName] then
|
if self.nonAddonCallbacks[eventName] or E.ModuleCallbacks[eventName] or E.InitialModuleCallbacks[eventName] then
|
||||||
@@ -581,10 +581,10 @@ function S:Initialize()
|
|||||||
ScriptErrorsFrame_OnError(catch, false)
|
ScriptErrorsFrame_OnError(catch, false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
wipe(self.nonAddonsToLoad);
|
wipe(self.nonAddonsToLoad)
|
||||||
end
|
end
|
||||||
|
|
||||||
S:RegisterEvent("ADDON_LOADED");
|
S:RegisterEvent("ADDON_LOADED")
|
||||||
|
|
||||||
local function InitializeCallback()
|
local function InitializeCallback()
|
||||||
S:Initialize()
|
S:Initialize()
|
||||||
|
|||||||
Reference in New Issue
Block a user