Browse Source

Introduce CancelCurrentDiabloMsg and hide msgdelay

pull/2712/head
obligaron 5 years ago committed by Anders Jenbo
parent
commit
6325d87e04
  1. 6
      Source/diablo.cpp
  2. 8
      Source/error.cpp
  3. 3
      Source/error.h

6
Source/diablo.cpp

@ -533,7 +533,7 @@ void PressKey(int vkey)
stream_stop();
}
AutomapActive = false;
msgdelay = 0;
CancelCurrentDiabloMsg();
gamemenu_off();
doom_close();
}
@ -1228,7 +1228,7 @@ void HelpKeyPressed()
}
QuestLogIsOpen = false;
AutomapActive = false;
msgdelay = 0;
CancelCurrentDiabloMsg();
gamemenu_off();
DisplayHelp();
doom_close();
@ -1738,7 +1738,7 @@ bool PressEscKey()
}
if (IsDiabloMsgAvailable()) {
msgdelay = 0;
CancelCurrentDiabloMsg();
rv = true;
}

8
Source/error.cpp

@ -13,13 +13,12 @@
namespace devilution {
uint32_t msgdelay;
namespace {
diablo_message msgtable[MAX_SEND_STR_LEN];
uint8_t msgcnt;
diablo_message msgflag;
uint32_t msgdelay;
} // namespace
@ -104,6 +103,11 @@ bool IsDiabloMsgAvailable()
return msgflag != EMSG_NONE;
}
void CancelCurrentDiabloMsg()
{
msgdelay = 0;
}
void ClrDiabloMsg()
{
for (auto &msg : msgtable)

3
Source/error.h

@ -69,10 +69,9 @@ enum diablo_message : uint8_t {
EMSG_SHRINE_MURPHYS,
};
extern uint32_t msgdelay;
void InitDiabloMsg(diablo_message e);
bool IsDiabloMsgAvailable();
void CancelCurrentDiabloMsg();
void ClrDiabloMsg();
void DrawDiabloMsg(const Surface &out);

Loading…
Cancel
Save