Update tutorial system - Part 5 (end) : Game.cpp

Update tutorial system to made it works (I hope).
This commit is contained in:
Futuray-pgm 2024-07-04 21:51:02 +02:00
parent cc6ef1b7c4
commit 625f2d250a
1 changed files with 4 additions and 10 deletions

View File

@ -2302,26 +2302,20 @@ void the_game(
);
}
// Tutorial TODO
// FIXME
{
vlprintf(CN_INFO,"Tuto Begin");
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();
vlprintf(CN_INFO,"Tuto 1 OK");
Tutorial* tuto = player->tutorial;
vlprintf(CN_INFO,"Tuto 1 get OK & ");
vlprintf(CN_INFO, (char*)std::to_string(tuto->getCurrentTutorialNumber()).c_str());
Tutorial *tuto = player->tutorial;
std::string tutotext = tuto->getCurrentTutorialText();
vlprintf(CN_INFO,"Tuto 1 bis OK");
std::wstring text = narrow_to_wide(tutotext);
vlprintf(CN_INFO,"Tuto 1 bis bis OK");
core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(text.c_str());
vlprintf(CN_INFO,"Tuto 2 OK");
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,"Tuto 3 OK"); //chatline_add(&chat_lines,narrow_to_wide(gettext("HUD shown")),-103.00);
vlprintf(CN_INFO,"Tutorial works");
}
}