Skip to content

Commit

Permalink
HotkeyMessages: Add more quick message slots
Browse files Browse the repository at this point in the history
Resolves #6542

Currently we only have 4 quick message slots, this patch adds more of
them resizing the total amount to 10.
  • Loading branch information
tetektoza authored and AJenbo committed Oct 16, 2023
1 parent fbc5424 commit e0291b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,16 @@ std::vector<std::string> DebugCmdsFromCommandLine;
#endif
GameLogicStep gGameLogicStep = GameLogicStep::None;
QuickMessage QuickMessages[QUICK_MESSAGE_OPTIONS] = {
{ "QuickMessage1", N_("I need help! Come Here!") },
{ "QuickMessage1", N_("I need help! Come here!") },
{ "QuickMessage2", N_("Follow me.") },
{ "QuickMessage3", N_("Here's something for you.") },
{ "QuickMessage4", N_("Now you DIE!") }
{ "QuickMessage4", N_("Now you DIE!") },
{ "QuickMessage5", N_("Heal yourself!") },
{ "QuickMessage6", N_("Watch out!") },
{ "QuickMessage7", N_("Thanks.") },
{ "QuickMessage8", N_("Retreat!") },
{ "QuickMessage9", N_("Sorry.") },
{ "QuickMessage10", N_("I'm waiting.") },
};

/** This and the following mouse variables are for handling in-game click-and-hold actions */
Expand Down Expand Up @@ -1766,12 +1772,12 @@ void InitKeymapActions()
SpellBookKeyPressed,
nullptr,
CanPlayerTakeAction);
for (int i = 0; i < 4; ++i) {
for (size_t i = 0; i < QUICK_MESSAGE_OPTIONS; ++i) {
sgOptions.Keymapper.AddAction(
"QuickMessage{}",
N_("Quick Message {}"),
N_("Use Quick Message in chat."),
SDLK_F9 + i,
(i < 4) ? SDLK_F9 + i : SDLK_UNKNOWN,
[i]() { DiabloHotkeyMsg(i); },
nullptr,
nullptr,
Expand Down
2 changes: 1 addition & 1 deletion Source/diablo.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct QuickMessage {
const char *const message;
};

constexpr size_t QUICK_MESSAGE_OPTIONS = 4;
constexpr size_t QUICK_MESSAGE_OPTIONS = 10;
extern QuickMessage QuickMessages[QUICK_MESSAGE_OPTIONS];
/**
* @brief Specifices what game logic step is currently executed
Expand Down

0 comments on commit e0291b6

Please sign in to comment.