mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 04:50:49 +00:00
skin: reuse blizzards questlog item buttons
This commit is contained in:
+17
-31
@@ -5,7 +5,7 @@ pfUI:RegisterSkin("Quest Log", function ()
|
|||||||
_G.QUESTS_DISPLAYED = 23
|
_G.QUESTS_DISPLAYED = 23
|
||||||
_G.MAX_WATCHABLE_QUESTS = 20 -- TODO
|
_G.MAX_WATCHABLE_QUESTS = 20 -- TODO
|
||||||
|
|
||||||
do -- quest frame
|
do -- quest log frame
|
||||||
hooksecurefunc("QuestLog_OnShow", function()
|
hooksecurefunc("QuestLog_OnShow", function()
|
||||||
QuestLogFrame:ClearAllPoints()
|
QuestLogFrame:ClearAllPoints()
|
||||||
QuestLogFrame:SetPoint("TOPLEFT", 10, -104)
|
QuestLogFrame:SetPoint("TOPLEFT", 10, -104)
|
||||||
@@ -170,39 +170,25 @@ pfUI:RegisterSkin("Quest Log", function ()
|
|||||||
QuestLogDetailScrollFrame.backdrop:SetPoint("BOTTOMRIGHT", 26, -5)
|
QuestLogDetailScrollFrame.backdrop:SetPoint("BOTTOMRIGHT", 26, -5)
|
||||||
|
|
||||||
-- skin item buttons
|
-- skin item buttons
|
||||||
for i = 1, MAX_OBJECTIVES do
|
for i = 1, MAX_NUM_ITEMS do
|
||||||
local button = _G["QuestLogItem"..i]
|
local name = "QuestLogItem" .. i
|
||||||
StripTextures(button)
|
local item = _G[name]
|
||||||
CreateBackdrop(button, nil, true, .5)
|
local icon = _G[name.."IconTexture"]
|
||||||
|
local count = _G[name.."Count"]
|
||||||
|
local xsize = item:GetWidth() - 10
|
||||||
|
local ysize = item:GetHeight() - 10
|
||||||
|
|
||||||
local itemButton = CreateFrame("Button", button:GetName().."ItemButton", button)
|
StripTextures(item)
|
||||||
itemButton:SetWidth(37)
|
SkinButton(item)
|
||||||
itemButton:SetHeight(37)
|
item:SetWidth(xsize)
|
||||||
itemButton:SetPoint("LEFT", 2, 0)
|
|
||||||
itemButton.icon = itemButton:CreateTexture("ARTWORK")
|
icon:SetWidth(ysize)
|
||||||
itemButton.icon:SetTexture(_G[button:GetName().."IconTexture"]:GetTexture())
|
icon:SetHeight(ysize)
|
||||||
SkinButton(itemButton, nil, nil, nil, itemButton.icon, true)
|
icon:ClearAllPoints()
|
||||||
itemButton.text = itemButton:CreateFontString("Status", "LOW", "GameFontNormal")
|
icon:SetPoint("LEFT", 3, 0)
|
||||||
itemButton.text:SetFontObject(GameFontWhite)
|
icon:SetTexCoord(.08, .92, .08, .92)
|
||||||
itemButton.text:SetPoint("BOTTOMRIGHT", -4, 1)
|
|
||||||
itemButton.text:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
hooksecurefunc("QuestLog_UpdateQuestDetails", function()
|
|
||||||
for i = 1, MAX_OBJECTIVES do
|
|
||||||
local button = _G["QuestLogItem"..i]
|
|
||||||
if button:IsShown() then
|
|
||||||
local itemButton = _G[button:GetName().."ItemButton"]
|
|
||||||
local texture = _G[button:GetName().."IconTexture"]:GetTexture()
|
|
||||||
local numItems = _G[button:GetName().."Count"]:GetText() or 1
|
|
||||||
|
|
||||||
itemButton.icon:SetTexture(texture)
|
|
||||||
itemButton.text:SetText(tonumber(numItems) > 1 and numItems)
|
|
||||||
_G[button:GetName().."Count"]:SetText()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end, 1)
|
|
||||||
|
|
||||||
do -- overwrite colors
|
do -- overwrite colors
|
||||||
hooksecurefunc("QuestLog_UpdateQuestDetails", function()
|
hooksecurefunc("QuestLog_UpdateQuestDetails", function()
|
||||||
for i=1, GetNumQuestLeaderBoards() do
|
for i=1, GetNumQuestLeaderBoards() do
|
||||||
|
|||||||
Reference in New Issue
Block a user