From 50d28b2205841906fec5f7d238e4b04b16c539ee Mon Sep 17 00:00:00 2001 From: vaisest <4550061+vaisest@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:10:17 +0200 Subject: [PATCH] Add item type icons and (equipped) text to items tab --- src/Assets/icon_flask.png | Bin 0 -> 174 bytes src/Assets/icon_jewel.png | Bin 0 -> 196 bytes src/Classes/DropDownControl.lua | 13 +++++++++---- src/Classes/ItemDBControl.lua | 5 +++++ src/Classes/ItemListControl.lua | 5 +++++ src/Classes/ItemSlotControl.lua | 23 +++++++++++++++++++++-- src/Classes/ItemsTab.lua | 26 ++++++++++++++++++++++++++ src/Classes/ListControl.lua | 19 ++++++++----------- 8 files changed, 74 insertions(+), 17 deletions(-) create mode 100644 src/Assets/icon_flask.png create mode 100644 src/Assets/icon_jewel.png diff --git a/src/Assets/icon_flask.png b/src/Assets/icon_flask.png new file mode 100644 index 0000000000000000000000000000000000000000..18668370ca7c031efa71256eaccae2c8e529198f GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|GCW-zLo9le z6BejO7}lTqFZy};pX1Bh1ZO{JzMZ}?D=5J9*s6IN%mtFCTzV9DmO5T>Lo9le z6C^SYba+2H_;&OEi9fkk9gDbXB)Gcr=pW7h8&@7(B`IlaU|?{-MA(ES_H*;?^#6;q zk7aV0o!t@Bki&7!z=2Ksng37ui8Bs&_(b1`cvQw{c+QnSMZ__QiDxzA4U=SJmgQ+N sZ4;JA&R5)F^4RCpi-o<~n*26E>pK^2|IWC^0q7D2Pgg&ebxsLQ0K colWidth - 2 then - local clipIndex = DrawStringCursorIndex(textHeight, colFont, text, colWidth - clipWidth - 2, 0) + if textWidth > colWidth - textX - 2 then + local clipIndex = DrawStringCursorIndex(textHeight, colFont, text, colWidth - textX - clipWidth - 2, 0) text = text:sub(1, clipIndex - 1) .. "..." textWidth = DrawStringWidth(textHeight, colFont, text) end @@ -241,7 +240,7 @@ function ListClass:Draw(viewPort, noTooltip) ttValue = value ttX = x + 2 + colOffset ttY = lineY + y + 2 - ttWidth = m_max(textWidth + 8, relX - colOffset) + ttWidth = m_max(textX + textWidth + 8, relX - colOffset) end end if self.showRowSeparators then @@ -283,12 +282,10 @@ function ListClass:Draw(viewPort, noTooltip) SetDrawColor(1, 1, 1) end -- TODO: handle icon size properly, for now assume they are 16x16 - if icon == nil then - DrawString(colOffset, lineY + textOffsetY, "LEFT", textHeight, colFont, text) - else + if icon then DrawImage(icon, colOffset, lineY, 16, 16) - DrawString(colOffset + 16 + 2, lineY + textOffsetY, "LEFT", textHeight, colFont, text) end + DrawString(colOffset + textX, lineY + textOffsetY, "LEFT", textHeight, colFont, text) end if self.colLabels then local mOver = relX >= colOffset and relX <= colOffset + colWidth and relY >= 0 and relY <= 18