Making the tutrial works - Part 1

This commit is contained in:
Futuray-pgm 2024-07-27 21:16:59 +02:00
parent 625f2d250a
commit a779387ef4
1 changed files with 44 additions and 9 deletions

View File

@ -46,20 +46,23 @@ 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.";
return (std::string)"Press the [W] button to walk forward.";
case TUTORIAL_JUMP :
return (std::string)"Press the spacebar to jump.";
case TUTORIAL_LOOK :
return (std::string)"Move the mouse to look around you.";
/* 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_INVENTORY :
return (std::string)"Press the [I] button to open your inventory\nand the [Q] button to interact with nodes.";
/*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!";
};
@ -75,6 +78,38 @@ void Tutorial::setCurrentTutorialToNumber(int number)
this->currentTutorial = number;
}
int Tutorial::getCurrentTutorialNumber()
{
return this->currentTutorial;
}
int Tutorial::getCurrentTutorialCompletionValue()
{
switch(this->currentTutorial)
{
case TUTORIAL_WALK :
return TUTORIAL_KEY_WALK;
case TUTORIAL_JUMP :
return TUTORIAL_KEY_JUMP;
/* case TUTORIAL_LOOK :
return (std::string)"Move the mouse to look around you."; */
case TUTORIAL_INVENTORY :
return TUTORIAL_KEY_INVENTORY;
/*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 TUTORIAL_KEY_EAT;
default :
return 0;
};
}
std::string Tutorial::getCurrentTutorialText()
{
return this->getText(this->currentTutorial);
@ -83,4 +118,4 @@ std::string Tutorial::getCurrentTutorialText()
std::string Tutorial::getNumberText(int number)
{
return this->getText(number);
}
}