Skip to content

Commit

Permalink
add hotkey for showing base stat
Browse files Browse the repository at this point in the history
  • Loading branch information
qndel committed Sep 23, 2024
1 parent 49d6246 commit d1e8442
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,6 +1792,13 @@ void InitKeymapActions()
SDLK_RCTRL,
nullptr,
[] { ToggleItemLabelHighlight(); });
sgOptions.Keymapper.AddAction(
"Show Base Stats",
N_("Show item base stats"),
N_("Shows item base armor/damage without including bonuses"),
SDLK_LCTRL,
[] { showItemBaseStats = true; },
[] { showItemBaseStats = false; });
sgOptions.Keymapper.AddAction(
"Toggle Automap",
N_("Toggle automap"),
Expand Down
3 changes: 2 additions & 1 deletion Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bool ShowUniqueItemInfoBox;
CornerStoneStruct CornerStone;
bool UniqueItemFlags[128];
int MaxGold = GOLD_MAX_LIMIT;
bool showItemBaseStats = false;

/** Maps from item_cursor_graphic to in-memory item type. */
int8_t ItemCAnimTbl[] = {
Expand Down Expand Up @@ -4110,7 +4111,7 @@ void PrintItemDetails(const Item &item)
}
if (item._iClass == ICLASS_ARMOR) {
int realAC = item._iAC;
if (item._iIdentified) {
if (!showItemBaseStats && item._iIdentified) {
realAC += GetBonusAC(item);
}
if (item._iMaxDur == DUR_INDESTRUCTIBLE)
Expand Down
1 change: 1 addition & 0 deletions Source/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ extern int8_t dItem[MAXDUNX][MAXDUNY];
extern bool ShowUniqueItemInfoBox;
extern CornerStoneStruct CornerStone;
extern DVL_API_FOR_TEST bool UniqueItemFlags[128];
extern bool showItemBaseStats;

uint8_t GetOutlineColor(const Item &item, bool checkReq);
bool IsItemAvailable(int i);
Expand Down

0 comments on commit d1e8442

Please sign in to comment.