aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/Tutorial/TutorialMessage.cpp
blob: 1f007035470b645ff2248053f9bc2685675ffc43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "stdafx.h"
#include "TutorialMessage.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);
}

LPCWSTR TutorialMessage::getMessageForDisplay()
{
	if(!canDisplay())
		return L"";

	if(limitRepeats)
		++timesShown;

	return app.GetString( messageId );
}