Skip to content

Commit

Permalink
feat: replace role icon
Browse files Browse the repository at this point in the history
  • Loading branch information
ffainy committed Jun 4, 2022
1 parent 062eb1b commit 3c6ccb1
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 84 deletions.
Binary file added assets/textures/leader_big.tga
Binary file not shown.
Binary file added assets/textures/roles_big.tga
Binary file not shown.
2 changes: 2 additions & 0 deletions core/media.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ C.Assets.Texture = {
Target = C.ASSET_PATH .. 'textures\\np_target',
Collector = C.ASSET_PATH .. 'textures\\collector',
Diff = C.ASSET_PATH .. 'textures\\map_diff',
Leader = C.ASSET_PATH .. 'textures\\leader_big',
Roles = C.ASSET_PATH .. 'textures\\roles_big',
}

C.Assets.Statusbar = {
Expand Down
33 changes: 30 additions & 3 deletions modules/theme/blizzard/Blizzard_PVPUI.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
local F, C = unpack(select(2, ...))

local function HandleRoleChecks(button, ...)
button:StripTextures()
button:DisableDrawLayer('ARTWORK')
button:DisableDrawLayer('OVERLAY')

button.tex = button:CreateTexture(nil, 'BACKGROUND', nil, -7)
button.tex:SetTexture(C.Assets.Texture.Roles)
button.tex:SetTexCoord(...)
button.tex:SetPoint('CENTER')
button.tex:SetSize(40, 40)
button.tex:SetAlpha(0.6)

local checkButton = button.checkButton or button.CheckButton or button.CheckBox
if checkButton then
checkButton:SetFrameLevel(button:GetFrameLevel() + 2)
checkButton:SetPoint('BOTTOMLEFT', -2, -2)
checkButton:SetSize(20, 20)
F.ReskinCheck(checkButton, true)
end
end

local function ReskinPvPFrame(frame)
frame:DisableDrawLayer('BACKGROUND')
frame:DisableDrawLayer('BORDER')
F.ReskinRole(frame.TankIcon, 'TANK')
F.ReskinRole(frame.HealerIcon, 'HEALER')
F.ReskinRole(frame.DPSIcon, 'DPS')
-- F.ReskinRole(frame.TankIcon, 'TANK')
-- F.ReskinRole(frame.HealerIcon, 'HEALER')
-- F.ReskinRole(frame.DPSIcon, 'DPS')

HandleRoleChecks(_G.HonorFrame.TankIcon, _G.LFDQueueFrameRoleButtonTank.background:GetTexCoord())
HandleRoleChecks(_G.HonorFrame.HealerIcon, _G.LFDQueueFrameRoleButtonHealer.background:GetTexCoord())
HandleRoleChecks(_G.HonorFrame.DPSIcon, _G.LFDQueueFrameRoleButtonDPS.background:GetTexCoord())

local bar = frame.ConquestBar
F.StripTextures(bar)
Expand All @@ -24,6 +49,8 @@ local function ConquestFrameButton_OnEnter(self)
_G.ConquestTooltip:SetPoint('TOPLEFT', self, 'TOPRIGHT', 1, 0)
end



C.Themes['Blizzard_PVPUI'] = function()
local r, g, b = C.r, C.g, C.b

Expand Down
170 changes: 144 additions & 26 deletions modules/theme/blizzard/FrameXML/LFGFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ local function updateRoleBonus(roleButton)
if not roleButton.bg then
return
end
if roleButton.shortageBorder and roleButton.shortageBorder:IsShown() then
if roleButton.cover:IsShown() then
roleButton.bg:SetBackdropBorderColor(0.5, 0.45, 0.03)
else
roleButton.bg:SetBackdropBorderColor(1, 0.9, 0.06)
end
else
roleButton.bg:SetBackdropBorderColor(0, 0, 0)
end
-- if roleButton.shortageBorder and roleButton.shortageBorder:IsShown() then
-- if roleButton.cover:IsShown() then
-- roleButton.bg:SetBackdropBorderColor(0.5, 0.45, 0.03)
-- else
-- roleButton.bg:SetBackdropBorderColor(1, 0.9, 0.06)
-- end
-- else
-- roleButton.bg:SetBackdropBorderColor(0, 0, 0)
-- end
end

local function styleRewardRole(roleIcon)
Expand Down Expand Up @@ -118,6 +118,14 @@ table.insert(C.BlizzThemes, function()
2
)

_G.LFDQueueFrameRoleButtonTankBackground:SetTexture(C.Assets.Texture.Roles)
_G.LFDQueueFrameRoleButtonHealerBackground:SetTexture(C.Assets.Texture.Roles)
_G.LFDQueueFrameRoleButtonDPSBackground:SetTexture(C.Assets.Texture.Roles)

_G.RaidFinderQueueFrameRoleButtonTankBackground:SetTexture(C.Assets.Texture.Roles)
_G.RaidFinderQueueFrameRoleButtonHealerBackground:SetTexture(C.Assets.Texture.Roles)
_G.RaidFinderQueueFrameRoleButtonDPSBackground:SetTexture(C.Assets.Texture.Roles)

-- LFGFrame
hooksecurefunc('LFGRewardsFrame_SetItemButton', function(parentFrame, _, index)
local parentName = parentFrame:GetName()
Expand All @@ -140,22 +148,39 @@ table.insert(C.BlizzThemes, function()
F.ReskinRole(leaderIcon, 'LEADER')

local iconTexture = _G.LFGDungeonReadyDialogRoleIconTexture
iconTexture:SetTexture(C.Assets.Texture.LfgRole)
local bg = F.CreateBDFrame(iconTexture)
iconTexture:SetTexture(C.Assets.Texture.Roles)
--local bg = F.CreateBDFrame(iconTexture)

hooksecurefunc('LFGDungeonReadyPopup_Update', function()
_G.LFGDungeonReadyDialog:SetBackdrop(nil)
leaderFrame:SetShown(_G.LFGDungeonReadyDialogRoleIconLeaderIcon:IsShown())

-- if _G.LFGDungeonReadyDialogRoleIcon:IsShown() then
-- local role = select(7, GetLFGProposal())
-- if not role or role == 'NONE' then
-- role = 'DAMAGER'
-- end
-- iconTexture:SetTexCoord(F.GetRoleTexCoord(role))
-- bg:Show()
-- else
-- bg:Hide()
-- end

if _G.LFGDungeonReadyDialogRoleIcon:IsShown() then
local role = select(7, GetLFGProposal())
if not role or role == 'NONE' then
role = 'DAMAGER'
local _, _, _, _, _, _, role = GetLFGProposal()
if role == 'DAMAGER' then
_G.LFGDungeonReadyDialogRoleIconTexture:SetTexCoord(
_G.LFDQueueFrameRoleButtonDPS.background:GetTexCoord()
)
elseif role == 'TANK' then
_G.LFGDungeonReadyDialogRoleIconTexture:SetTexCoord(
_G.LFDQueueFrameRoleButtonTank.background:GetTexCoord()
)
elseif role == 'HEALER' then
_G.LFGDungeonReadyDialogRoleIconTexture:SetTexCoord(
_G.LFDQueueFrameRoleButtonHealer.background:GetTexCoord()
)
end
iconTexture:SetTexCoord(F.GetRoleTexCoord(role))
bg:Show()
else
bg:Hide()
end
end)

Expand Down Expand Up @@ -203,7 +228,7 @@ table.insert(C.BlizzThemes, function()
_G.LFGListApplicationDialog.TankButton,
_G.LFGDungeonReadyStatusGroupedTank,
}
reskinRoleButton(tanks, 'TANK')
--reskinRoleButton(tanks, 'TANK')

local healers = {
_G.LFDQueueFrameRoleButtonHealer,
Expand All @@ -213,7 +238,7 @@ table.insert(C.BlizzThemes, function()
_G.LFGListApplicationDialog.HealerButton,
_G.LFGDungeonReadyStatusGroupedHealer,
}
reskinRoleButton(healers, 'HEALER')
--reskinRoleButton(healers, 'HEALER')

local dps = {
_G.LFDQueueFrameRoleButtonDPS,
Expand All @@ -223,12 +248,92 @@ table.insert(C.BlizzThemes, function()
_G.LFGListApplicationDialog.DamagerButton,
_G.LFGDungeonReadyStatusGroupedDamager,
}
reskinRoleButton(dps, 'DPS')
--reskinRoleButton(dps, 'DPS')

F.ReskinRole(_G.LFDQueueFrameRoleButtonLeader, 'LEADER')
F.ReskinRole(_G.RaidFinderQueueFrameRoleButtonLeader, 'LEADER')
-- F.ReskinRole(_G.LFDQueueFrameRoleButtonLeader, 'LEADER')
-- F.ReskinRole(_G.RaidFinderQueueFrameRoleButtonLeader, 'LEADER')
F.ReskinRole(_G.LFGDungeonReadyStatusRolelessReady, 'READY')

_G.LFDQueueFrameRoleButtonLeader.leadIcon = _G.LFDQueueFrameRoleButtonLeader:CreateTexture(nil, 'BACKGROUND')
_G.LFDQueueFrameRoleButtonLeader.leadIcon:SetTexture(C.Assets.Texture.Leader)
_G.LFDQueueFrameRoleButtonLeader.leadIcon:SetPoint(
_G.LFDQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint(),
-14,
16
)
_G.LFDQueueFrameRoleButtonLeader.leadIcon:SetSize(80, 80)
_G.LFDQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.6)

_G.RaidFinderQueueFrameRoleButtonLeader.leadIcon = _G.RaidFinderQueueFrameRoleButtonLeader:CreateTexture(
nil,
'BACKGROUND'
)
_G.RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetTexture(C.Assets.Texture.Leader)
_G.RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetPoint(
_G.RaidFinderQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint(),
-14,
16
)
_G.RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetSize(80, 80)
_G.RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.6)

----------------------
----------------------
local RoleButtons1 = {
_G.LFDQueueFrameRoleButtonHealer,
_G.LFDQueueFrameRoleButtonDPS,
_G.LFDQueueFrameRoleButtonLeader,
_G.LFDQueueFrameRoleButtonTank,
_G.RaidFinderQueueFrameRoleButtonHealer,
_G.RaidFinderQueueFrameRoleButtonDPS,
_G.RaidFinderQueueFrameRoleButtonLeader,
_G.RaidFinderQueueFrameRoleButtonTank,
_G.LFGInvitePopupRoleButtonTank,
_G.LFGInvitePopupRoleButtonHealer,
_G.LFGInvitePopupRoleButtonDPS,
_G.LFGListApplicationDialog.TankButton,
_G.LFGListApplicationDialog.HealerButton,
_G.LFGListApplicationDialog.DamagerButton,
_G.RolePollPopupRoleButtonTank,
_G.RolePollPopupRoleButtonHealer,
_G.RolePollPopupRoleButtonDPS,
}

for _, roleButton in pairs(RoleButtons1) do
roleButton:DisableDrawLayer('ARTWORK')
roleButton:DisableDrawLayer('OVERLAY')

if not roleButton.background then
local isLeader = roleButton:GetName() ~= nil and roleButton:GetName():find('Leader') or false
if not isLeader then
roleButton.background = roleButton:CreateTexture(nil, 'BACKGROUND')
roleButton.background:SetSize(80, 80)
roleButton.background:SetPoint('CENTER')
roleButton.background:SetTexture(C.Assets.Texture.Roles)
roleButton.background:SetAlpha(0.65)

local buttonName = roleButton:GetName() ~= nil and roleButton:GetName() or roleButton.role
roleButton.background:SetTexCoord(
GetBackgroundTexCoordsForRole(
(strlower(buttonName):find('tank') and 'TANK')
or (strlower(buttonName):find('healer') and 'HEALER')
or 'DAMAGER'
)
)
end
end

local checkButton = roleButton.checkButton or roleButton.CheckButton or roleButton.CheckBox
if checkButton then
checkButton:SetFrameLevel(roleButton:GetFrameLevel() + 2)
checkButton:SetPoint('BOTTOMLEFT', -2, -2)
checkButton:SetSize(20, 20)
F.ReskinCheck(checkButton, true)
end
end
----------------------
----------------------

hooksecurefunc('SetCheckButtonIsRadio', function(button)
button:SetNormalTexture('')
button:SetHighlightTexture(C.Assets.Texture.Backdrop)
Expand Down Expand Up @@ -270,12 +375,25 @@ table.insert(C.BlizzThemes, function()
end

hooksecurefunc('LFGDungeonReadyStatusIndividual_UpdateIcon', function(button)
local role = select(2, GetLFGProposalMember(button:GetID()))
button.texture:SetTexCoord(F.GetRoleTexCoord(role))
-- local role = select(2, GetLFGProposalMember(button:GetID()))
-- button.texture:SetTexCoord(F.GetRoleTexCoord(role))

local _, role = GetLFGProposalMember(button:GetID())

button.texture:SetTexture(C.Assets.Texture.Roles)
button.texture:SetAlpha(0.6)

if role == 'DAMAGER' then
button.texture:SetTexCoord(_G.LFDQueueFrameRoleButtonDPS.background:GetTexCoord())
elseif role == 'TANK' then
button.texture:SetTexCoord(_G.LFDQueueFrameRoleButtonTank.background:GetTexCoord())
elseif role == 'HEALER' then
button.texture:SetTexCoord(_G.LFDQueueFrameRoleButtonHealer.background:GetTexCoord())
end
end)

hooksecurefunc('LFGDungeonReadyStatusGrouped_UpdateIcon', function(button, role)
button.texture:SetTexCoord(F.GetRoleTexCoord(role))
--button.texture:SetTexCoord(F.GetRoleTexCoord(role))
end)

-- RaidFinder
Expand Down
12 changes: 6 additions & 6 deletions modules/theme/blizzard/FrameXML/LFGList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ table.insert(C.BlizzThemes, function()
F.Reskin(LFGListInviteDialog.AcknowledgeButton)

local roleIcon = LFGListInviteDialog.RoleIcon
roleIcon:SetTexture(C.Assets.Texture.LfgRole)
F.CreateBDFrame(roleIcon)
roleIcon:SetTexture(C.Assets.Texture.Roles)
--F.CreateBDFrame(roleIcon)

hooksecurefunc('LFGListInviteDialog_Show', function(self, resultID)
local role = select(5, C_LFGList.GetApplicationInfo(resultID))
self.RoleIcon:SetTexCoord(F.GetRoleTexCoord(role))
end)
-- hooksecurefunc('LFGListInviteDialog_Show', function(self, resultID)
-- local role = select(5, C_LFGList.GetApplicationInfo(resultID))
-- self.RoleIcon:SetTexCoord(F.GetRoleTexCoord(role))
-- end)
end)
4 changes: 3 additions & 1 deletion modules/theme/blizzard/FrameXML/PVPMatch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ table.insert(C.BlizzThemes, function()
F.StripTextures(PVPReadyDialog)
_G.PVPReadyDialogBackground:Hide()
F.SetBD(PVPReadyDialog)
_G.PVPReadyDialogRoleIconTexture:SetTexture(C.Assets.Texture.LfgRole)
--_G.PVPReadyDialogRoleIconTexture:SetTexture(C.Assets.Texture.LfgRole)
_G.PVPReadyDialogRoleIcon.texture:SetTexture(C.Assets.Texture.Roles)
_G.PVPReadyDialogRoleIcon.texture:SetAlpha(0.5)
F.CreateBDFrame(_G.PVPReadyDialogRoleIcon)

hooksecurefunc('PVPReadyDialog_Display', function(self, _, _, _, _, _, role)
Expand Down
Loading

0 comments on commit 3c6ccb1

Please sign in to comment.