Skip to content

Commit a240333

Browse files
committed
feat: larger gear icons with quality color border and top-left rank overlay, bump row height
1 parent 2189cc1 commit a240333

4 files changed

Lines changed: 26 additions & 10 deletions

File tree

Constants.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local Constants = {}
88
addon.Constants = Constants
99

1010
Constants.TITLEBAR_HEIGHT = 30
11-
Constants.TABLE_ROW_HEIGHT = 24
11+
Constants.TABLE_ROW_HEIGHT = 30
1212
Constants.TABLE_HEADER_HEIGHT = 32
1313
Constants.TABLE_CELL_PADDING = 8
1414
Constants.MAX_WINDOW_HEIGHT = 500

Interface.lua

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,22 +267,32 @@ function UI:CreateTableFrame(config)
267267
iconFrame = CreateFrame("Frame", nil, columnFrame)
268268
iconFrame.texture = iconFrame:CreateTexture(nil, "ARTWORK")
269269
iconFrame.texture:SetAllPoints()
270+
iconFrame.border = iconFrame:CreateTexture(nil, "BACKGROUND")
271+
iconFrame.border:SetAllPoints()
270272
iconFrame.overlay = iconFrame:CreateTexture(nil, "OVERLAY")
271273
columnFrame.iconFrames[i] = iconFrame
272274
end
273275

274276
local iconSize = iconData.size or 18
275277
iconFrame:SetSize(iconSize, iconSize)
276-
iconFrame.overlay:SetSize(14, 14)
277-
iconFrame.overlay:ClearAllPoints()
278-
iconFrame.overlay:SetPoint("BOTTOMRIGHT", iconFrame, "BOTTOMRIGHT", 2, -2)
279278
iconFrame.texture:SetTexture(iconData.iconFileID)
280279
if iconData.unscanned then
281-
iconFrame.texture:SetVertexColor(0.4, 0.4, 0.4, 1) -- dim unscanned slots
280+
iconFrame.texture:SetVertexColor(0.4, 0.4, 0.4, 1)
282281
else
283282
iconFrame.texture:SetVertexColor(1, 1, 1, 1)
284283
end
285284

285+
if iconData.borderColor then
286+
local bc = iconData.borderColor
287+
iconFrame.border:SetColorTexture(bc.r, bc.g, bc.b, 1)
288+
iconFrame.border:Show()
289+
else
290+
iconFrame.border:Hide()
291+
end
292+
293+
iconFrame.overlay:SetSize(10, 10)
294+
iconFrame.overlay:ClearAllPoints()
295+
iconFrame.overlay:SetPoint("TOPLEFT", iconFrame, "TOPLEFT", -2, 2)
286296
if iconData.overlayAtlas then
287297
iconFrame.overlay:SetAtlas(iconData.overlayAtlas)
288298
iconFrame.overlay:Show()

Main.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ end
4646
local gearSortAscending = nil -- nil=unsorted, false=descending, true=ascending
4747

4848
local EMPTY_SLOT_TEXTURE = 4760248 -- confirmed in-game via GetInventorySlotInfo [2]
49+
local GEAR_ICON_SIZE = 24
4950

5051
local function SlotBelongsToExpansion(slot, expansionID)
5152
return slot.itemExpansionID == expansionID
@@ -63,9 +64,9 @@ local function GearCellIcons(characterProfession, skillLineVariantID)
6364
GameTooltip:Show()
6465
end
6566
return {
66-
{ iconFileID = EMPTY_SLOT_TEXTURE, unscanned = true, onEnter = onEnter, onLeave = onLeave },
67-
{ iconFileID = EMPTY_SLOT_TEXTURE, unscanned = true, onEnter = onEnter, onLeave = onLeave },
68-
{ iconFileID = EMPTY_SLOT_TEXTURE, unscanned = true, onEnter = onEnter, onLeave = onLeave },
67+
{ iconFileID = EMPTY_SLOT_TEXTURE, unscanned = true, size = GEAR_ICON_SIZE, onEnter = onEnter, onLeave = onLeave },
68+
{ iconFileID = EMPTY_SLOT_TEXTURE, unscanned = true, size = GEAR_ICON_SIZE, onEnter = onEnter, onLeave = onLeave },
69+
{ iconFileID = EMPTY_SLOT_TEXTURE, unscanned = true, size = GEAR_ICON_SIZE, onEnter = onEnter, onLeave = onLeave },
6970
}
7071
end
7172

@@ -79,9 +80,12 @@ local function GearCellIcons(characterProfession, skillLineVariantID)
7980
if slotBelongs then
8081
-- Item equipped and belongs to this expansion: full brightness icon + quality star overlay
8182
local itemLink = slot.itemLink
83+
local qualityColor = ITEM_QUALITY_COLORS[slot.itemQuality]
8284
icons[i] = {
8385
iconFileID = slot.iconFileID,
8486
overlayAtlas = "Professions-ChatIcon-Quality-Tier" .. slot.craftingRank,
87+
borderColor = qualityColor and {r = qualityColor.r, g = qualityColor.g, b = qualityColor.b},
88+
size = GEAR_ICON_SIZE,
8589
onEnter = function(frame)
8690
GameTooltip:SetOwner(frame, "ANCHOR_RIGHT")
8791
GameTooltip:SetHyperlink(itemLink)
@@ -94,6 +98,7 @@ local function GearCellIcons(characterProfession, skillLineVariantID)
9498
local isEmpty = slot == nil or (slot and not slot.pending and expansionID ~= nil and not slotBelongs)
9599
icons[i] = {
96100
iconFileID = EMPTY_SLOT_TEXTURE,
101+
size = GEAR_ICON_SIZE,
97102
onEnter = function(frame)
98103
GameTooltip:SetOwner(frame, "ANCHOR_RIGHT")
99104
GameTooltip:SetText(isEmpty and "Empty" or "Loading...", 1, 1, 1)
@@ -1010,7 +1015,7 @@ function Main:GetTableColumns(unfiltered)
10101015
},
10111016
{
10121017
name = "Gear",
1013-
width = 70, -- 3 icons x 18px + 2px spacing + padding; adjust after visual testing
1018+
width = 90,
10141019
align = "CENTER",
10151020
toggleHidden = true,
10161021
onEnter = function(cellFrame)

Types.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@
279279

280280
---@class WK_TableDataCellIcon
281281
---@field iconFileID integer -- Main icon texture fileID
282-
---@field overlayAtlas string? -- Atlas name for bottom-right corner overlay (e.g. quality star)
282+
---@field overlayAtlas string? -- Atlas name for top-left corner overlay (e.g. quality star)
283+
---@field borderColor {r: number, g: number, b: number}? -- Border color (e.g. item quality color)
283284
---@field unscanned boolean? -- true = never scanned; dims the icon to distinguish from scanned-empty
284285
---@field size integer? -- Icon size in pixels (default 18)
285286
---@field onEnter function? -- Called on MouseEnter; use to show a tooltip

0 commit comments

Comments
 (0)