state the debris scrap value with the item icon, not the word

This commit is contained in:
2026-08-12 21:21:47 +02:00
parent 28656bea7e
commit 7e670fc01c
12 changed files with 126 additions and 19 deletions

View File

@@ -5,6 +5,7 @@
#include <utility>
#include <QByteArray>
#include <QFont>
#include <QPixmap>
#include <QString>
@@ -26,9 +27,11 @@ struct VisualsConfig;
// two forms: paintItem() for the world's fractional geometry, getSquarePixmap() for
// widgets that want a ready-made pixmap.
//
// The bare icon of getPixmap() has one remaining use: the inline building_block icon
// that stands in for the word "Blocks" beside a number (REQ-UI-BLOCKS-ICON), which is a
// decoration on a line of text rather than an item display and takes no square.
// The bare icon of getPixmap() has one remaining use: an inline icon standing in for the
// item's name beside a number -- building blocks beside a cost or a stock
// (REQ-UI-BLOCKS-ICON), scrap beside the amount left in debris (REQ-UI-DEBRIS-PANEL) --
// which is a decoration on a line of text rather than an item display and takes no
// square. getInlineItemIcon() in IconCaption.h is how callers ask for that form.
//
// A missing icon file is not an error: hasIcon() returns false for it and the item shows
// its colored square alone.
@@ -64,6 +67,11 @@ public:
// icon file (callers should gate on hasIcon()).
QPixmap getPixmap(const std::string& itemId, int sizePx);
// The same bare icon sized to the height of `font`'s text, for the inline form above:
// an icon standing in for the item's name on a line of text. Null when the item has
// no icon file, which is not an error -- the caller names the item in words instead.
QPixmap getInlineIcon(const std::string& itemId, const QFont& font);
// Drops every rasterized pixmap. Called when the visuals are reloaded on a restart
// (REQ-CFG-RELOAD), because the composed squares carry the colors they were painted
// with; they are re-rasterized on next use.