Skip to content

Commit cc17b34

Browse files
committed
fix: clean up code comments, remove dead code, add missing type annotations
1 parent ea2fbb8 commit cc17b34

5 files changed

Lines changed: 11 additions & 15 deletions

File tree

Core.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function Core:OnEnable()
206206
-- or if equipment is nil (tool item was uncached so slot group was skipped entirely)
207207
if cp.equipment == nil then
208208
needsRescan = true
209-
elseif cp.equipment ~= nil then
209+
else
210210
for i = 1, 3 do
211211
if cp.equipment[i] and cp.equipment[i].pending then
212212
needsRescan = true

Data.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,6 @@ function Data:MigrateDB()
356356
end
357357
end
358358
end
359-
if self.db.global.DBVersion == 19 then
360-
-- No transform needed: new equipment/profGearScore fields default to nil (never scanned),
361-
-- which is correct -- existing characters will be rescanned on next login.
362-
end
363359
self.db.global.DBVersion = self.db.global.DBVersion + 1
364360
self:MigrateDB()
365361
end
@@ -480,7 +476,7 @@ function Data:ScanProfessionEquipment()
480476
local professionIndex1, professionIndex2 = GetProfessions()
481477
local professionIndexes = { professionIndex1, professionIndex2 }
482478

483-
for slotGroup, group in ipairs(PROF_SLOT_GROUPS) do
479+
for _, group in ipairs(PROF_SLOT_GROUPS) do
484480
-- Determine which profession owns this slot group by matching the tool slot item's
485481
-- subType (e.g. "Enchanting") against GetProfessionInfo name (position 1).
486482
-- GetProfessions() ordering does not reliably map to PROF0/PROF1 slot ordering.

Interface.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,9 @@ function UI:CreateTableFrame(config)
273273

274274
local iconSize = iconData.size or 18
275275
iconFrame:SetSize(iconSize, iconSize)
276-
-- Quality star atlas is 30x34; render at 14x14 (slight crop accepted)
277276
iconFrame.overlay:SetSize(14, 14)
278277
iconFrame.overlay:ClearAllPoints()
279278
iconFrame.overlay:SetPoint("BOTTOMRIGHT", iconFrame, "BOTTOMRIGHT", 2, -2)
280-
-- Callers must always provide iconFileID; nil renders as a blank frame (acceptable for empty slots using EMPTY_SLOT_TEXTURE).
281279
iconFrame.texture:SetTexture(iconData.iconFileID)
282280
if iconData.unscanned then
283281
iconFrame.texture:SetVertexColor(0.4, 0.4, 0.4, 1) -- dim unscanned slots

Main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ local function GearCellIcons(characterProfession, skillLineVariantID)
9191
}
9292
else
9393
-- Scanned empty, wrong expansion gear, or item data still loading
94-
local isEmpty = slot == nil or (slot and not slot.pending and not slotBelongs)
94+
local isEmpty = slot == nil or (slot and not slot.pending and expansionID ~= nil and not slotBelongs)
9595
icons[i] = {
9696
iconFileID = EMPTY_SLOT_TEXTURE,
9797
onEnter = function(frame)

Types.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@
9090
---@field completed boolean Whether the first craft has been completed
9191

9292
---@class WK_ProfessionGearSlot
93-
---@field itemLink string -- Full WoW item link
94-
---@field itemQuality integer -- 2=Uncommon, 3=Rare, 4=Epic
95-
---@field itemLevel integer -- Item level
96-
---@field iconFileID integer -- Texture fileID for the item icon
97-
---@field score integer -- 0-15 computed score for this slot
98-
---@field craftingRank integer -- 1-5 rank within tier (stored to avoid recalculation at render)
93+
---@field itemLink string -- Full WoW item link
94+
---@field itemQuality integer -- 2=Uncommon, 3=Rare, 4=Epic
95+
---@field itemLevel integer -- Item level
96+
---@field iconFileID integer -- Texture fileID for the item icon
97+
---@field score integer -- 0-15 computed score for this slot
98+
---@field craftingRank integer -- 1-5 rank within tier (stored to avoid recalculation at render)
99+
---@field itemExpansionID integer? -- Expansion that owns this item (position 15 from C_Item.GetItemInfo)
100+
---@field pending boolean? -- true = item data not yet in cache; slot will be rescanned on GET_ITEM_INFO_RECEIVED
99101

100102
---@class WK_CharacterProfession
101103
---@field enabled boolean

0 commit comments

Comments
 (0)