From 88e7c8feecf82026dc64d5f5b9648b89441bf0c9 Mon Sep 17 00:00:00 2001 From: qndel Date: Thu, 18 May 2023 22:45:52 +0200 Subject: [PATCH] get rid of hardcoded ALT in variable/function name --- Source/diablo.cpp | 8 ++++---- Source/qol/itemlabels.cpp | 8 ++++---- Source/qol/itemlabels.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 1ca25cc87..c6fadf300 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1678,8 +1678,8 @@ void InitKeymapActions() N_("Item highlighting"), N_("Show/hide items on ground."), SDLK_LALT, - [] { AltPressed(true); }, - [] { AltPressed(false); }); + [] { HighlightKeyPressed(true); }, + [] { HighlightKeyPressed(false); }); sgOptions.Keymapper.AddAction( "Toggle Item Highlighting", N_("Toggle item highlighting"), @@ -2198,8 +2198,8 @@ void InitPadmapActions() N_("Item highlighting"), N_("Show/hide items on ground."), ControllerButton_NONE, - [] { AltPressed(true); }, - [] { AltPressed(false); }); + [] { HighlightKeyPressed(true); }, + [] { HighlightKeyPressed(false); }); sgOptions.Padmapper.AddAction( "Toggle Item Highlighting", N_("Toggle item highlighting"), diff --git a/Source/qol/itemlabels.cpp b/Source/qol/itemlabels.cpp index d11ec4f04..b409eab51 100644 --- a/Source/qol/itemlabels.cpp +++ b/Source/qol/itemlabels.cpp @@ -32,7 +32,7 @@ struct ItemLabel { std::vector labelQueue; -bool altPressed = false; +bool highlightKeyPressed = false; bool isLabelHighlighted = false; std::array, ITEMTYPES> labelCenterOffsets; @@ -74,9 +74,9 @@ void ToggleItemLabelHighlight() sgOptions.Gameplay.showItemLabels.SetValue(!*sgOptions.Gameplay.showItemLabels); } -void AltPressed(bool pressed) +void HighlightKeyPressed(bool pressed) { - altPressed = pressed; + highlightKeyPressed = pressed; } bool IsItemLabelHighlighted() @@ -91,7 +91,7 @@ void ResetItemlabelHighlighted() bool IsHighlightingLabelsEnabled() { - return stextflag == TalkID::None && altPressed != *sgOptions.Gameplay.showItemLabels; + return stextflag == TalkID::None && highlightKeyPressed != *sgOptions.Gameplay.showItemLabels; } void AddItemToLabelQueue(int id, Point position) diff --git a/Source/qol/itemlabels.h b/Source/qol/itemlabels.h index c024b7214..f77983502 100644 --- a/Source/qol/itemlabels.h +++ b/Source/qol/itemlabels.h @@ -10,7 +10,7 @@ namespace devilution { void ToggleItemLabelHighlight(); -void AltPressed(bool pressed); +void HighlightKeyPressed(bool pressed); bool IsItemLabelHighlighted(); void ResetItemlabelHighlighted(); bool IsHighlightingLabelsEnabled();