fix: extend quality color bounds for Artifact/Heirloom in chat links and loot roll

Handle quality indices 6 (Artifact) and 7 (Heirloom) in all remaining
quality-color lookup tables: chat link hex colors and loot roll tooltip.
This commit is contained in:
Kelsi 2026-03-13 10:30:54 -07:00
parent 8da5e5c029
commit 605d046838

View file

@ -50,8 +50,8 @@ namespace {
// Build a WoW-format item link string for chat insertion.
// Format: |cff<qualHex>|Hitem:<itemId>:0:0:0:0:0:0:0:0|h[<name>]|h|r
std::string buildItemChatLink(uint32_t itemId, uint8_t quality, const std::string& name) {
static const char* kQualHex[] = {"9d9d9d","ffffff","1eff00","0070dd","a335ee","ff8000"};
uint8_t qi = quality < 6 ? quality : 1;
static const char* kQualHex[] = {"9d9d9d","ffffff","1eff00","0070dd","a335ee","ff8000","e6cc80","e6cc80"};
uint8_t qi = quality < 8 ? quality : 1;
char buf[512];
snprintf(buf, sizeof(buf), "|cff%s|Hitem:%u:0:0:0:0:0:0:0:0|h[%s]|h|r",
kQualHex[qi], itemId, name.c_str());
@ -10801,7 +10801,7 @@ void GameScreen::renderLootRollPopup(game::GameHandler& gameHandler) {
? rollInfo->name.c_str()
: roll.itemName.c_str();
if (rollInfo && rollInfo->valid)
col = (rollInfo->quality < 6) ? kQualityColors[rollInfo->quality] : kQualityColors[1];
col = (rollInfo->quality < 8) ? kQualityColors[rollInfo->quality] : kQualityColors[1];
ImGui::TextColored(col, "[%s]", displayName);
if (ImGui::IsItemHovered() && rollInfo && rollInfo->valid) {
inventoryScreen.renderItemTooltip(*rollInfo);