1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Get rid of global guienv variable

(It can already be accessed via the renderingengine.)
This commit is contained in:
Desour 2023-08-09 02:55:42 +02:00 committed by sfan5
parent 45e7a80057
commit 16da954bd7
8 changed files with 29 additions and 37 deletions

View file

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