Update tutorial system - Part 5 (end) : Game.cpp
Update tutorial system to made it works (I hope).
This commit is contained in:
parent
cc6ef1b7c4
commit
625f2d250a
14
src/game.cpp
14
src/game.cpp
|
@ -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();
|
core::dimension2d<u32> screensize = driver->getScreenSize();
|
||||||
s32 x = (screensize.Width/2);
|
s32 x = (screensize.Width/2);
|
||||||
s32 y = (screensize.Height/2);
|
s32 y = (screensize.Height/2);
|
||||||
LocalPlayer* player = client.getLocalPlayer();
|
LocalPlayer* player = client.getLocalPlayer();
|
||||||
vlprintf(CN_INFO,"Tuto 1 OK");
|
Tutorial *tuto = player->tutorial;
|
||||||
Tutorial* tuto = player->tutorial;
|
|
||||||
vlprintf(CN_INFO,"Tuto 1 get OK & ");
|
|
||||||
vlprintf(CN_INFO, (char*)std::to_string(tuto->getCurrentTutorialNumber()).c_str());
|
|
||||||
std::string tutotext = tuto->getCurrentTutorialText();
|
std::string tutotext = tuto->getCurrentTutorialText();
|
||||||
vlprintf(CN_INFO,"Tuto 1 bis OK");
|
|
||||||
std::wstring text = narrow_to_wide(tutotext);
|
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());
|
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);
|
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);
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue