Making the tutrial works - Part 3

This commit is contained in:
Futuray-pgm 2024-07-27 21:18:37 +02:00
parent 39f4313f1f
commit a988191ded
1 changed files with 4 additions and 2 deletions

View File

@ -2304,18 +2304,20 @@ void the_game(
// FIXME
{
vlprintf(CN_INFO,"Tutorial Begin");
core::dimension2d<u32> screensize = driver->getScreenSize();
s32 x = (screensize.Width/2);
s32 y = (screensize.Height/2);
LocalPlayer* player = client.getLocalPlayer();
Tutorial *tuto = player->tutorial;
if (input->isKeyDown(getKeySetting(tuto->getCurrentTutorialCompletionValue())))
tuto->setCurrentTutorialToNext();
std::string tutotext = tuto->getCurrentTutorialText();
std::wstring text = narrow_to_wide(tutotext);
core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(text.c_str());
core::rect<s32> rect((x-412)-(textsize.Width/2), y+10, (x-412)+(textsize.Width/2), y+10+textsize.Height);
guienv->addStaticText(text.c_str(),rect);
vlprintf(CN_INFO,"Tutorial works");
}
}