|
1 | 1 | local E, L, V, P, G = unpack(select(2, ...))
|
2 | 2 | local S = E:GetModule('Skins')
|
3 | 3 |
|
| 4 | +local _G = _G |
4 | 5 | local unpack = unpack
|
5 |
| - |
6 |
| -local GetReforgeItemInfo = GetReforgeItemInfo |
| 6 | +local hooksecurefunc = hooksecurefunc |
| 7 | + |
| 8 | +local GetItemIconByID = C_Item.GetItemIconByID |
| 9 | +local GetReforgeItemInfo = C_Reforge.GetReforgeItemInfo |
| 10 | + |
| 11 | +local function ReforgingFrameUpdate() |
| 12 | + local _, itemID, _, quality = GetReforgeItemInfo() |
| 13 | + local itemTexture = itemID and GetItemIconByID(itemID) |
| 14 | + if itemTexture then |
| 15 | + _G.ReforgingFrameItemButtonIconTexture:SetTexture(itemTexture) |
| 16 | + end |
| 17 | + |
| 18 | + --[[ Blizzard bug / commented out on their end / Blizzard_ReforgingUI.lua:101 |
| 19 | + if quality then |
| 20 | + local r, g, b = GetItemQualityColor(quality) |
| 21 | + _G.ReforgingFrameItemButton:SetBackdropBorderColor(r, g, b) |
| 22 | + else |
| 23 | + local r, g, b = unpack(E.media.bordercolor) |
| 24 | + _G.ReforgingFrameItemButton:SetBackdropBorderColor(r, g, b) |
| 25 | + end |
| 26 | + ]] |
| 27 | +end |
7 | 28 |
|
8 | 29 | function S:Blizzard_ReforgingUI()
|
9 | 30 | if not (E.private.skins.blizzard.enable or not E.private.skins.blizzard.reforge) then return end
|
10 | 31 |
|
11 |
| - _G.ReforgingFrame:StripTextures() |
12 |
| - _G.ReforgingFrame:SetTemplate('Transparent') |
| 32 | + local ReforgingFrame = _G.ReforgingFrame |
| 33 | + ReforgingFrame:StripTextures() |
| 34 | + ReforgingFrame:SetTemplate('Transparent') |
13 | 35 |
|
14 | 36 | _G.ReforgingFrameFinishedGlow:Kill()
|
15 |
| - |
16 | 37 | _G.ReforgingFrameButtonFrame:StripTextures()
|
17 | 38 |
|
18 |
| - _G.ReforgingFrameRestoreMessage:SetTextColor(1, 1, 1) |
19 |
| - |
20 | 39 | S:HandleButton(_G.ReforgingFrameRestoreButton, true)
|
21 |
| - |
22 | 40 | S:HandleButton(_G.ReforgingFrameReforgeButton, true)
|
23 |
| - _G.ReforgingFrameReforgeButton:Point('BOTTOMRIGHT', -3, 3) |
| 41 | + S:HandleCloseButton(_G.ReforgingFrameCloseButton) |
24 | 42 |
|
25 |
| - _G.ReforgingFrameItemButton:StripTextures() |
26 |
| - _G.ReforgingFrameItemButton:SetTemplate('Default', true) |
27 |
| - _G.ReforgingFrameItemButton:StyleButton() |
| 43 | + ReforgingFrame.missingDescription:SetTextColor(1, 1, 1) |
| 44 | + _G.ReforgingFrameRestoreMessage:SetTextColor(1, 1, 1) |
| 45 | + _G.ReforgingFrameReforgeButton:Point('BOTTOMRIGHT', -3, 3) |
28 | 46 |
|
29 | 47 | _G.ReforgingFrameItemButtonIconTexture:SetInside()
|
30 | 48 | _G.ReforgingFrameItemButtonIconTexture:SetTexCoord(unpack(E.TexCoords))
|
31 | 49 |
|
32 |
| - _G.ReforgingFrameItemButton.missingText:SetTextColor(1, 0.80, 0.10) |
33 |
| - _G.ReforgingFrame.missingDescription:SetTextColor(1, 1, 1) |
34 |
| - |
35 |
| - hooksecurefunc('ReforgingFrame_Update', function(self) |
36 |
| - local _, itemID, _, quality = C_Reforge.GetReforgeItemInfo() |
| 50 | + local ItemButton = _G.ReforgingFrameItemButton |
| 51 | + ItemButton.missingText:SetTextColor(1, 0.80, 0.10) |
| 52 | + ItemButton:StripTextures() |
| 53 | + ItemButton:SetTemplate('Default', true) |
| 54 | + ItemButton:StyleButton() |
37 | 55 |
|
38 |
| - if itemID then |
39 |
| - local itemTexture = C_Item.GetItemIconByID(itemID) |
40 |
| - _G.ReforgingFrameItemButtonIconTexture:SetTexture(itemTexture) |
41 |
| - end |
42 |
| - |
43 |
| - -- Blizzard bug / commented out on their end / Blizzard_ReforgingUI.lua:101 |
44 |
| - --[[ |
45 |
| - if quality then |
46 |
| - _G.ReforgingFrameItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) |
47 |
| - else |
48 |
| - _G.ReforgingFrameItemButton:SetBackdropBorderColor(unpack(E.media.bordercolor)) |
49 |
| - end |
50 |
| - ]] |
51 |
| - end) |
52 |
| - |
53 |
| - S:HandleCloseButton(_G.ReforgingFrameCloseButton) |
| 56 | + hooksecurefunc('ReforgingFrame_Update', ReforgingFrameUpdate) |
54 | 57 | end
|
55 | 58 |
|
56 | 59 | S:AddCallbackForAddon('Blizzard_ReforgingUI')
|
0 commit comments