Update tutorial system - Part 3 : Tutorial.cpp

Update tutorial system to made it works (I hope).
This commit is contained in:
Futuray-pgm 2024-07-04 21:42:06 +02:00
parent 10509e4f00
commit 811956a449
1 changed files with 49 additions and 1 deletions

View File

@ -26,13 +26,61 @@
************************************************************************/
#include "tutorial.h"
#include <string>
Tutorial::Tutorial():
currentTutorial(0)
{
};
Tutorial::Tutorial(int current):
currentTutorial(current)
{
};
Tutorial::~Tutorial()
{
};
std::string Tutorial::getText(int num)
{
switch(num) // TODO : translations
{
case TUTORIAL_WALK :
return (std::string)"Press the [W] button to walk forward and the spacebar to jump.";
case TUTORIAL_LOOK :
return (std::string)"Move the mouse to look around you.";
case TUTORIAL_DIG_PLACE :
return (std::string)"Use the left click to dig nodes and the right click to place them.";
case TUTORIAL_EAT :
return (std::string)"Use the [H] button to eat any food.";
case TUTORIAL_INVENTORY :
return (std::string)"Press the [I] button to open your inventory and the [Q] button to interact with nodes.";
default :
return (std::string)"Tutorial is done!";
};
}
void Tutorial::setCurrentTutorialToNext()
{
this->currentTutorial++;
}
void Tutorial::setCurrentTutorialToNumber(int number)
{
this->currentTutorial = number;
}
std::string Tutorial::getCurrentTutorialText()
{
return this->getText(this->currentTutorial);
}
std::string Tutorial::getNumberText(int number)
{
return this->getText(number);
}