1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Revert "Get rid of global guienv variable"

This reverts commit 16da954bd7.
This commit is contained in:
Desour 2023-08-22 19:20:49 +02:00 committed by DS
parent f98726c516
commit 7e4dccb3b5
8 changed files with 37 additions and 29 deletions

View file

@ -43,12 +43,17 @@ inline static const char *yawToDirectionString(int yaw)
return direction[yaw];
}
void GameUI::init(gui::IGUIEnvironment *guienv)
GameUI::GameUI()
{
if (guienv->getSkin())
if (guienv && guienv->getSkin())
m_statustext_initial_color = guienv->getSkin()->getColor(gui::EGDC_BUTTON_TEXT);
else
m_statustext_initial_color = video::SColor(255, 0, 0, 0);
gui::IGUIElement *guiroot = guienv->getRootGUIElement();
}
void GameUI::init()
{
IGUIElement *guiroot = guienv->getRootGUIElement();
// First line of debug text
m_guitext = gui::StaticText::add(guienv, utf8_to_wide(PROJECT_NAME_C).c_str(),