Browse Source

HotkeyMessages: Add more quick message slots

Resolves https://github.com/diasurgical/devilutionX/issues/6542

Currently we only have 4 quick message slots, this patch adds more of
them resizing the total amount to 10.
pull/6711/head
tetektoza 2 years ago committed by Anders Jenbo
parent
commit
e0291b6f58
  1. 14
      Source/diablo.cpp
  2. 2
      Source/diablo.h

14
Source/diablo.cpp

@ -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 */
@ -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,

2
Source/diablo.h

@ -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

Loading…
Cancel
Save