mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 06:53:36 +00:00
24 lines
590 B
C++
24 lines
590 B
C++
#include "TutorialMessage.h"
|
|
|
|
#include "app/linux/LinuxGame.h"
|
|
|
|
TutorialMessage::TutorialMessage(
|
|
int messageId, bool limitRepeats /*= false*/,
|
|
unsigned char numRepeats /*= TUTORIAL_MESSAGE_DEFAULT_SHOW*/)
|
|
: messageId(messageId),
|
|
limitRepeats(limitRepeats),
|
|
numRepeats(numRepeats),
|
|
timesShown(0) {}
|
|
|
|
bool TutorialMessage::canDisplay() {
|
|
return !limitRepeats || (timesShown < numRepeats);
|
|
}
|
|
|
|
const char* TutorialMessage::getMessageForDisplay() {
|
|
if (!canDisplay()) return "";
|
|
|
|
if (limitRepeats) ++timesShown;
|
|
|
|
return app.GetString(messageId);
|
|
}
|