Minetest  5.4.0
GameUI Class Reference

#include <gameui.h>

+ Collaboration diagram for GameUI:

Classes

struct  Flags
 

Public Member Functions

 GameUI ()
 
 ~GameUI ()=default
 
void init ()
 
void update (const RunStats &stats, Client *client, MapDrawControl *draw_control, const CameraOrientation &cam, const PointedThing &pointed_old, const GUIChatConsole *chat_console, float dtime)
 
void initFlags ()
 
const FlagsgetFlags () const
 
void showMinimap (bool show)
 
void setInfoText (const std::wstring &str)
 
void clearInfoText ()
 
void showStatusText (const std::wstring &str)
 
void showTranslatedStatusText (const char *str)
 
void clearStatusText ()
 
const bool isChatVisible ()
 
void setChatText (const EnrichedString &chat_text, u32 recent_chat_count)
 
void updateProfiler ()
 
void toggleChat ()
 
void toggleHud ()
 
void toggleProfiler ()
 
GUIFormSpecMenu *& updateFormspec (const std::string &formname)
 
const std::string & getFormspecName ()
 
GUIFormSpecMenu *& getFormspecGUI ()
 
void deleteFormspec ()
 

Private Attributes

Flags m_flags
 
gui::IGUIStaticText * m_guitext = nullptr
 
gui::IGUIStaticText * m_guitext2 = nullptr
 
gui::IGUIStaticText * m_guitext_info = nullptr
 
std::wstring m_infotext
 
gui::IGUIStaticText * m_guitext_status = nullptr
 
std::wstring m_statustext
 
float m_statustext_time = 0.0f
 
video::SColor m_statustext_initial_color
 
gui::IGUIStaticText * m_guitext_chat = nullptr
 
u32 m_recent_chat_count = 0
 
gui::IGUIStaticText * m_guitext_profiler = nullptr
 
u8 m_profiler_current_page = 0
 
const u8 m_profiler_max_page = 3
 
std::string m_formname
 
GUIFormSpecMenum_formspec = nullptr
 

Friends

class Game
 
class TestGameUI
 

Constructor & Destructor Documentation

◆ GameUI()

GameUI::GameUI ( )

◆ ~GameUI()

GameUI::~GameUI ( )
default

Member Function Documentation

◆ clearInfoText()

void GameUI::clearInfoText ( )
inline

◆ clearStatusText()

void GameUI::clearStatusText ( )
inline

Referenced by update().

+ Here is the caller graph for this function:

◆ deleteFormspec()

void GameUI::deleteFormspec ( )

References m_formname, and m_formspec.

◆ getFlags()

const Flags& GameUI::getFlags ( ) const
inline

◆ getFormspecGUI()

GUIFormSpecMenu*& GameUI::getFormspecGUI ( )
inline

◆ getFormspecName()

const std::string& GameUI::getFormspecName ( )
inline

◆ init()

void GameUI::init ( )

References FM_Mono, FM_Unspecified, g_fontengine, g_settings, FontEngine::getDefaultFontSize(), FontEngine::getFont(), FontEngine::getTextHeight(), Settings::getU16(), guienv, guiroot, m_guitext, m_guitext2, m_guitext_chat, m_guitext_info, m_guitext_profiler, m_guitext_status, PROJECT_NAME_C, and utf8_to_wide().

+ Here is the call graph for this function:

◆ initFlags()

void GameUI::initFlags ( )

References g_settings, Settings::getBool(), m_flags, and GameUI::Flags::show_debug.

+ Here is the call graph for this function:

◆ isChatVisible()

const bool GameUI::isChatVisible ( )
inline

Referenced by update().

+ Here is the caller graph for this function:

◆ setChatText()

void GameUI::setChatText ( const EnrichedString chat_text,
u32  recent_chat_count 
)

References g_fontengine, RenderingEngine::get_instance(), FontEngine::getLineHeight(), RenderingEngine::getWindowSize(), m_flags, m_guitext_chat, m_recent_chat_count, and GameUI::Flags::show_debug.

+ Here is the call graph for this function:

◆ setInfoText()

void GameUI::setInfoText ( const std::wstring &  str)
inline

Referenced by TestGameUI::testInfoText().

+ Here is the caller graph for this function:

◆ showMinimap()

void GameUI::showMinimap ( bool  show)

References m_flags, and GameUI::Flags::show_minimap.

Referenced by Client::showMinimap(), and TestGameUI::testFlagSetters().

+ Here is the caller graph for this function:

◆ showStatusText()

void GameUI::showStatusText ( const std::wstring &  str)
inline

Referenced by showTranslatedStatusText(), TestGameUI::testStatusText(), and toggleProfiler().

+ Here is the caller graph for this function:

◆ showTranslatedStatusText()

void GameUI::showTranslatedStatusText ( const char *  str)

References showStatusText(), and wgettext().

Referenced by toggleChat(), toggleHud(), and toggleProfiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toggleChat()

void GameUI::toggleChat ( )

References m_flags, GameUI::Flags::show_chat, and showTranslatedStatusText().

+ Here is the call graph for this function:

◆ toggleHud()

void GameUI::toggleHud ( )

References m_flags, GameUI::Flags::show_hud, and showTranslatedStatusText().

+ Here is the call graph for this function:

◆ toggleProfiler()

void GameUI::toggleProfiler ( )

References m_profiler_current_page, m_profiler_max_page, showStatusText(), showTranslatedStatusText(), updateProfiler(), and wgettext().

+ Here is the call graph for this function:

◆ update()

◆ updateFormspec()

GUIFormSpecMenu*& GameUI::updateFormspec ( const std::string &  formname)
inline

◆ updateProfiler()

void GameUI::updateProfiler ( )

References EnrichedString::c_str(), g_profiler, Profiler::getElapsedMs(), m_guitext_profiler, m_profiler_current_page, m_profiler_max_page, Profiler::print(), EnrichedString::setBackground(), and utf8_to_wide().

Referenced by toggleProfiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Game

friend class Game
friend

◆ TestGameUI

friend class TestGameUI
friend

Member Data Documentation

◆ m_flags

Flags GameUI::m_flags
private

◆ m_formname

std::string GameUI::m_formname
private

Referenced by deleteFormspec().

◆ m_formspec

GUIFormSpecMenu* GameUI::m_formspec = nullptr
private

Referenced by deleteFormspec().

◆ m_guitext

gui::IGUIStaticText* GameUI::m_guitext = nullptr
private

Referenced by init(), and update().

◆ m_guitext2

gui::IGUIStaticText* GameUI::m_guitext2 = nullptr
private

Referenced by init(), and update().

◆ m_guitext_chat

gui::IGUIStaticText* GameUI::m_guitext_chat = nullptr
private

Referenced by init(), setChatText(), and update().

◆ m_guitext_info

gui::IGUIStaticText* GameUI::m_guitext_info = nullptr
private

Referenced by init(), and update().

◆ m_guitext_profiler

gui::IGUIStaticText* GameUI::m_guitext_profiler = nullptr
private

Referenced by init(), and updateProfiler().

◆ m_guitext_status

gui::IGUIStaticText* GameUI::m_guitext_status = nullptr
private

Referenced by init(), and update().

◆ m_infotext

std::wstring GameUI::m_infotext
private

Referenced by update().

◆ m_profiler_current_page

u8 GameUI::m_profiler_current_page = 0
private

Referenced by toggleProfiler(), and updateProfiler().

◆ m_profiler_max_page

const u8 GameUI::m_profiler_max_page = 3
private

Referenced by toggleProfiler(), and updateProfiler().

◆ m_recent_chat_count

u32 GameUI::m_recent_chat_count = 0
private

Referenced by setChatText().

◆ m_statustext

std::wstring GameUI::m_statustext
private

Referenced by update().

◆ m_statustext_initial_color

video::SColor GameUI::m_statustext_initial_color
private

Referenced by GameUI(), and update().

◆ m_statustext_time

float GameUI::m_statustext_time = 0.0f
private

Referenced by update().


The documentation for this class was generated from the following files: