Browse Source

Small Refactor for the Item Floating/Non-Floating Infobox Writing Code (#8107)

Refactored the code which writes item info to the floating or non-floating infobox depending on settings, simplifying it
pull/8109/head
Andrettin 7 months ago committed by GitHub
parent
commit
0da7f26ceb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 171
      Source/items.cpp

171
Source/items.cpp

@ -1593,96 +1593,106 @@ void ItemDoppel()
idoppely = 16; idoppely = 16;
} }
void PrintItemOil(char iDidx) void AddItemInfoBoxString(const std::string_view str)
{
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
AddInfoBoxString(str, floatingInfoBoxEnabled);
}
void AddItemInfoBoxString(std::string &&str)
{ {
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox; const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
AddInfoBoxString(std::move(str), floatingInfoBoxEnabled);
}
void PrintItemOil(char iDidx)
{
switch (iDidx) { switch (iDidx) {
case IMISC_OILACC: case IMISC_OILACC:
AddInfoBoxString(_("increases a weapon's"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increases a weapon's"));
AddInfoBoxString(_("chance to hit"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("chance to hit"));
break; break;
case IMISC_OILMAST: case IMISC_OILMAST:
AddInfoBoxString(_("greatly increases a"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("greatly increases a"));
AddInfoBoxString(_("weapon's chance to hit"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("weapon's chance to hit"));
break; break;
case IMISC_OILSHARP: case IMISC_OILSHARP:
AddInfoBoxString(_("increases a weapon's"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increases a weapon's"));
AddInfoBoxString(_("damage potential"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("damage potential"));
break; break;
case IMISC_OILDEATH: case IMISC_OILDEATH:
AddInfoBoxString(_("greatly increases a weapon's"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("greatly increases a weapon's"));
AddInfoBoxString(_("damage potential - not bows"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("damage potential - not bows"));
break; break;
case IMISC_OILSKILL: case IMISC_OILSKILL:
AddInfoBoxString(_("reduces attributes needed"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("reduces attributes needed"));
AddInfoBoxString(_("to use armor or weapons"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("to use armor or weapons"));
break; break;
case IMISC_OILBSMTH: case IMISC_OILBSMTH:
AddInfoBoxString(/*xgettext:no-c-format*/ _("restores 20% of an"), floatingInfoBoxEnabled); AddItemInfoBoxString(/*xgettext:no-c-format*/ _("restores 20% of an"));
AddInfoBoxString(_("item's durability"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("item's durability"));
break; break;
case IMISC_OILFORT: case IMISC_OILFORT:
AddInfoBoxString(_("increases an item's"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increases an item's"));
AddInfoBoxString(_("current and max durability"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("current and max durability"));
break; break;
case IMISC_OILPERM: case IMISC_OILPERM:
AddInfoBoxString(_("makes an item indestructible"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("makes an item indestructible"));
break; break;
case IMISC_OILHARD: case IMISC_OILHARD:
AddInfoBoxString(_("increases the armor class"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increases the armor class"));
AddInfoBoxString(_("of armor and shields"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("of armor and shields"));
break; break;
case IMISC_OILIMP: case IMISC_OILIMP:
AddInfoBoxString(_("greatly increases the armor"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("greatly increases the armor"));
AddInfoBoxString(_("class of armor and shields"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("class of armor and shields"));
break; break;
case IMISC_RUNEF: case IMISC_RUNEF:
AddInfoBoxString(_("sets fire trap"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("sets fire trap"));
break; break;
case IMISC_RUNEL: case IMISC_RUNEL:
case IMISC_GR_RUNEL: case IMISC_GR_RUNEL:
AddInfoBoxString(_("sets lightning trap"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("sets lightning trap"));
break; break;
case IMISC_GR_RUNEF: case IMISC_GR_RUNEF:
AddInfoBoxString(_("sets fire trap"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("sets fire trap"));
break; break;
case IMISC_RUNES: case IMISC_RUNES:
AddInfoBoxString(_("sets petrification trap"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("sets petrification trap"));
break; break;
case IMISC_FULLHEAL: case IMISC_FULLHEAL:
AddInfoBoxString(_("restore all life"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("restore all life"));
break; break;
case IMISC_HEAL: case IMISC_HEAL:
AddInfoBoxString(_("restore some life"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("restore some life"));
break; break;
case IMISC_MANA: case IMISC_MANA:
AddInfoBoxString(_("restore some mana"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("restore some mana"));
break; break;
case IMISC_FULLMANA: case IMISC_FULLMANA:
AddInfoBoxString(_("restore all mana"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("restore all mana"));
break; break;
case IMISC_ELIXSTR: case IMISC_ELIXSTR:
AddInfoBoxString(_("increase strength"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increase strength"));
break; break;
case IMISC_ELIXMAG: case IMISC_ELIXMAG:
AddInfoBoxString(_("increase magic"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increase magic"));
break; break;
case IMISC_ELIXDEX: case IMISC_ELIXDEX:
AddInfoBoxString(_("increase dexterity"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increase dexterity"));
break; break;
case IMISC_ELIXVIT: case IMISC_ELIXVIT:
AddInfoBoxString(_("increase vitality"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("increase vitality"));
break; break;
case IMISC_REJUV: case IMISC_REJUV:
AddInfoBoxString(_("restore some life and mana"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("restore some life and mana"));
break; break;
case IMISC_FULLREJUV: case IMISC_FULLREJUV:
AddInfoBoxString(_("restore all life and mana"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("restore all life and mana"));
break; break;
case IMISC_ARENAPOT: case IMISC_ARENAPOT:
AddInfoBoxString(_("restore all life and mana"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("restore all life and mana"));
AddInfoBoxString(_("(works only in arenas)"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("(works only in arenas)"));
break; break;
} }
} }
@ -1716,37 +1726,33 @@ Point DrawUniqueInfoWindow(const Surface &out)
void printItemMiscKBM(const Item &item, const bool isOil, const bool isCastOnTarget) void printItemMiscKBM(const Item &item, const bool isOil, const bool isCastOnTarget)
{ {
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
if (item._iMiscId == IMISC_MAPOFDOOM) { if (item._iMiscId == IMISC_MAPOFDOOM) {
AddInfoBoxString(_("Right-click to view"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Right-click to view"));
} else if (isOil) { } else if (isOil) {
PrintItemOil(item._iMiscId); PrintItemOil(item._iMiscId);
AddInfoBoxString(_("Right-click to use"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Right-click to use"));
} else if (isCastOnTarget) { } else if (isCastOnTarget) {
AddInfoBoxString(_("Right-click to read, then\nleft-click to target"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Right-click to read, then\nleft-click to target"));
} else if (IsAnyOf(item._iMiscId, IMISC_BOOK, IMISC_NOTE, IMISC_SCROLL, IMISC_SCROLLT)) { } else if (IsAnyOf(item._iMiscId, IMISC_BOOK, IMISC_NOTE, IMISC_SCROLL, IMISC_SCROLLT)) {
AddInfoBoxString(_("Right-click to read"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Right-click to read"));
} }
} }
void printItemMiscGenericGamepad(const Item &item, const bool isOil, bool isCastOnTarget) void printItemMiscGenericGamepad(const Item &item, const bool isOil, bool isCastOnTarget)
{ {
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
if (item._iMiscId == IMISC_MAPOFDOOM) { if (item._iMiscId == IMISC_MAPOFDOOM) {
AddInfoBoxString(_("Activate to view"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Activate to view"));
} else if (isOil) { } else if (isOil) {
PrintItemOil(item._iMiscId); PrintItemOil(item._iMiscId);
if (!invflag) { if (!invflag) {
AddInfoBoxString(_("Open inventory to use"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Open inventory to use"));
} else { } else {
AddInfoBoxString(_("Activate to use"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Activate to use"));
} }
} else if (isCastOnTarget) { } else if (isCastOnTarget) {
AddInfoBoxString(_("Select from spell book, then\ncast spell to read"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Select from spell book, then\ncast spell to read"));
} else if (IsAnyOf(item._iMiscId, IMISC_BOOK, IMISC_NOTE, IMISC_SCROLL, IMISC_SCROLLT)) { } else if (IsAnyOf(item._iMiscId, IMISC_BOOK, IMISC_NOTE, IMISC_SCROLL, IMISC_SCROLLT)) {
AddInfoBoxString(_("Activate to read"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Activate to read"));
} }
} }
@ -1759,34 +1765,30 @@ void printItemMiscGamepad(const Item &item, bool isOil, bool isCastOnTarget)
const std::string_view activateButton = GetOptions().Padmapper.InputNameForAction("SecondaryAction"); const std::string_view activateButton = GetOptions().Padmapper.InputNameForAction("SecondaryAction");
const std::string_view castButton = GetOptions().Padmapper.InputNameForAction("SpellAction"); const std::string_view castButton = GetOptions().Padmapper.InputNameForAction("SpellAction");
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
if (item._iMiscId == IMISC_MAPOFDOOM) { if (item._iMiscId == IMISC_MAPOFDOOM) {
AddInfoBoxString(fmt::format(fmt::runtime(_("{} to view")), activateButton), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("{} to view")), activateButton));
} else if (isOil) { } else if (isOil) {
PrintItemOil(item._iMiscId); PrintItemOil(item._iMiscId);
if (!invflag) { if (!invflag) {
AddInfoBoxString(_("Open inventory to use"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Open inventory to use"));
} else { } else {
AddInfoBoxString(fmt::format(fmt::runtime(_("{} to use")), activateButton), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("{} to use")), activateButton));
} }
} else if (isCastOnTarget) { } else if (isCastOnTarget) {
AddInfoBoxString(fmt::format(fmt::runtime(_("Select from spell book,\nthen {} to read")), castButton), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("Select from spell book,\nthen {} to read")), castButton));
} else if (IsAnyOf(item._iMiscId, IMISC_BOOK, IMISC_NOTE, IMISC_SCROLL, IMISC_SCROLLT)) { } else if (IsAnyOf(item._iMiscId, IMISC_BOOK, IMISC_NOTE, IMISC_SCROLL, IMISC_SCROLLT)) {
AddInfoBoxString(fmt::format(fmt::runtime(_("{} to read")), activateButton), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("{} to read")), activateButton));
} }
} }
void PrintItemMisc(const Item &item) void PrintItemMisc(const Item &item)
{ {
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
if (item._iMiscId == IMISC_EAR) { if (item._iMiscId == IMISC_EAR) {
AddInfoBoxString(fmt::format(fmt::runtime(pgettext("player", "Level: {:d}")), item._ivalue), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(pgettext("player", "Level: {:d}")), item._ivalue));
return; return;
} }
if (item._iMiscId == IMISC_AURIC) { if (item._iMiscId == IMISC_AURIC) {
AddInfoBoxString(_("Doubles gold capacity"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Doubles gold capacity"));
return; return;
} }
const bool isOil = (item._iMiscId >= IMISC_USEFIRST && item._iMiscId <= IMISC_USELAST) const bool isOil = (item._iMiscId >= IMISC_USEFIRST && item._iMiscId <= IMISC_USELAST)
@ -1826,8 +1828,7 @@ void PrintItemInfo(const Item &item)
text.append(fmt::format(fmt::runtime(_(" {:d} Mag")), mag)); text.append(fmt::format(fmt::runtime(_(" {:d} Mag")), mag));
if (dex != 0) if (dex != 0)
text.append(fmt::format(fmt::runtime(_(" {:d} Dex")), dex)); text.append(fmt::format(fmt::runtime(_(" {:d} Dex")), dex));
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox; AddItemInfoBoxString(text);
AddInfoBoxString(text, floatingInfoBoxEnabled);
} }
} }
@ -4067,38 +4068,36 @@ void PrintItemDetails(const Item &item)
if (HeadlessMode) if (HeadlessMode)
return; return;
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
if (item._iClass == ICLASS_WEAPON) { if (item._iClass == ICLASS_WEAPON) {
if (item._iMinDam == item._iMaxDam) { if (item._iMinDam == item._iMaxDam) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE) if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Indestructible")), item._iMinDam), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Indestructible")), item._iMinDam));
else else
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur));
} else { } else {
if (item._iMaxDur == DUR_INDESTRUCTIBLE) if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Indestructible")), item._iMinDam, item._iMaxDam), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Indestructible")), item._iMinDam, item._iMaxDam));
else else
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur));
} }
} }
if (item._iClass == ICLASS_ARMOR) { if (item._iClass == ICLASS_ARMOR) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE) if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Indestructible")), item._iAC), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Indestructible")), item._iAC));
else else
AddInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "armor: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_(/* TRANSLATORS: Dur: is durability */ "armor: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur));
} }
if (item._iMiscId == IMISC_STAFF && item._iMaxCharges != 0) { if (item._iMiscId == IMISC_STAFF && item._iMaxCharges != 0) {
AddInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges));
} }
if (item._iPrePower != -1) { if (item._iPrePower != -1) {
AddInfoBoxString(PrintItemPower(item._iPrePower, item), floatingInfoBoxEnabled); AddItemInfoBoxString(PrintItemPower(item._iPrePower, item));
} }
if (item._iSufPower != -1) { if (item._iSufPower != -1) {
AddInfoBoxString(PrintItemPower(item._iSufPower, item), floatingInfoBoxEnabled); AddItemInfoBoxString(PrintItemPower(item._iSufPower, item));
} }
if (item._iMagical == ITEM_QUALITY_UNIQUE) { if (item._iMagical == ITEM_QUALITY_UNIQUE) {
AddInfoBoxString(_("unique item"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("unique item"));
ShowUniqueItemInfoBox = true; ShowUniqueItemInfoBox = true;
curruitem = item; curruitem = item;
} }
@ -4110,39 +4109,37 @@ void PrintItemDur(const Item &item)
if (HeadlessMode) if (HeadlessMode)
return; return;
const bool floatingInfoBoxEnabled = *GetOptions().Gameplay.floatingInfoBox;
if (item._iClass == ICLASS_WEAPON) { if (item._iClass == ICLASS_WEAPON) {
if (item._iMinDam == item._iMaxDam) { if (item._iMinDam == item._iMaxDam) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE) if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Indestructible")), item._iMinDam), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Indestructible")), item._iMinDam));
else else
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d} Dur: {:d}/{:d}")), item._iMinDam, item._iDurability, item._iMaxDur));
} else { } else {
if (item._iMaxDur == DUR_INDESTRUCTIBLE) if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Indestructible")), item._iMinDam, item._iMaxDam), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Indestructible")), item._iMinDam, item._iMaxDam));
else else
AddInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("damage: {:d}-{:d} Dur: {:d}/{:d}")), item._iMinDam, item._iMaxDam, item._iDurability, item._iMaxDur));
} }
if (item._iMiscId == IMISC_STAFF && item._iMaxCharges > 0) { if (item._iMiscId == IMISC_STAFF && item._iMaxCharges > 0) {
AddInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges));
} }
if (item._iMagical != ITEM_QUALITY_NORMAL) if (item._iMagical != ITEM_QUALITY_NORMAL)
AddInfoBoxString(_("Not Identified"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Not Identified"));
} }
if (item._iClass == ICLASS_ARMOR) { if (item._iClass == ICLASS_ARMOR) {
if (item._iMaxDur == DUR_INDESTRUCTIBLE) if (item._iMaxDur == DUR_INDESTRUCTIBLE)
AddInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Indestructible")), item._iAC), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Indestructible")), item._iAC));
else else
AddInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("armor: {:d} Dur: {:d}/{:d}")), item._iAC, item._iDurability, item._iMaxDur));
if (item._iMagical != ITEM_QUALITY_NORMAL) if (item._iMagical != ITEM_QUALITY_NORMAL)
AddInfoBoxString(_("Not Identified"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Not Identified"));
if (item._iMiscId == IMISC_STAFF && item._iMaxCharges > 0) { if (item._iMiscId == IMISC_STAFF && item._iMaxCharges > 0) {
AddInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges), floatingInfoBoxEnabled); AddItemInfoBoxString(fmt::format(fmt::runtime(_("Charges: {:d}/{:d}")), item._iCharges, item._iMaxCharges));
} }
} }
if (IsAnyOf(item._itype, ItemType::Ring, ItemType::Amulet)) if (IsAnyOf(item._itype, ItemType::Ring, ItemType::Amulet))
AddInfoBoxString(_("Not Identified"), floatingInfoBoxEnabled); AddItemInfoBoxString(_("Not Identified"));
PrintItemInfo(item); PrintItemInfo(item);
} }

Loading…
Cancel
Save