Merge pull request #3167 from TaxiService/develop

clean up Items.cpp quality symbols definitions
develop
Myk 2023-04-03 15:26:42 -07:00 committed by GitHub
commit a1f41c4992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

@ -720,13 +720,14 @@ df::coord Items::getPosition(df::item *item)
return item->pos; return item->pos;
} }
// These '\xFF' chars refer to quality markers from curses.png, namely: 250 (≡), 15 (☼), 174 («) and 175 (»). static const char quality_table[] = {
static const char MARKER_EXCEPTIONAL = '\xF0'; '\0', // (base)
static const char MARKER_MASTERWORK = '\x0F'; '-', // well-crafted
static const char MARKER_IMPROVED_LEFT = '\xAE'; '+', // finely-crafted
static const char MARKER_IMPROVED_RIGHT = '\xAF'; '*', // superior quality
'\xF0', // (≡) exceptional
static char quality_table[] = { 0, '-', '+', '*', MARKER_EXCEPTIONAL, MARKER_MASTERWORK }; '\x0F' // (☼) masterful
};
static void addQuality(std::string &tmp, int quality) static void addQuality(std::string &tmp, int quality)
{ {
@ -831,7 +832,7 @@ std::string Items::getDescription(df::item *item, int type, bool decorate)
addQuality(tmp, item->getQuality()); addQuality(tmp, item->getQuality());
if (item->isImproved()) { if (item->isImproved()) {
tmp = MARKER_IMPROVED_LEFT + tmp + MARKER_IMPROVED_RIGHT; tmp = '\xAE' + tmp + '\xAF'; // («) + tmp + (»)
addQuality(tmp, item->getImprovementQuality()); addQuality(tmp, item->getImprovementQuality());
} }
} }