Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
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 setInfoText (const std::wstring &str)
 
void clearInfoText ()
 
void showStatusText (const std::wstring &str)
 
void showTranslatedStatusText (const char *str)
 
void clearStatusText ()
 
bool isChatVisible ()
 
void setChatText (const EnrichedString &chat_text, u32 recent_chat_count)
 
void updateChatSize ()
 
void updateProfiler ()
 
void toggleChat (Client *client)
 
void toggleHud ()
 
void toggleProfiler ()
 
GUIFormSpecMenu *& updateFormspec (const std::string &formname)
 
const std::string & getFormspecName ()
 
GUIFormSpecMenu *& getFormspecGUI ()
 
void deleteFormspec ()
 
void clearText ()
 

Private Attributes

Flags m_flags
 
float m_drawtime_avg = 0
 
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
 
core::rect< s32 > m_current_chat_size {0, 0, 0, 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

References m_infotext.

Referenced by Game::run().

+ Here is the caller graph for this function:

◆ clearStatusText()

void GameUI::clearStatusText ( )
inline

References m_statustext.

Referenced by update().

+ Here is the caller graph for this function:

◆ clearText()

void GameUI::clearText ( )

References m_guitext, m_guitext2, m_guitext_chat, m_guitext_info, m_guitext_profiler, and m_guitext_status.

Referenced by Game::shutdown().

+ Here is the caller graph for this function:

◆ deleteFormspec()

void GameUI::deleteFormspec ( )

References m_formname, and m_formspec.

Referenced by Game::shutdown(), and Game::updateFrame().

+ Here is the caller graph for this function:

◆ getFlags()

const Flags & GameUI::getFlags ( ) const
inline

References m_flags.

◆ getFormspecGUI()

GUIFormSpecMenu *& GameUI::getFormspecGUI ( )
inline

References m_formspec.

Referenced by Game::handleClientEvent_ShowFormSpec(), Game::handleClientEvent_ShowLocalFormSpec(), Game::processUserInput(), Game::showDeathFormspecLegacy(), Game::showPauseMenu(), Game::shutdown(), Game::updateDebugState(), and Game::updateFrame().

+ Here is the caller graph for this function:

◆ getFormspecName()

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

References m_formname.

Referenced by Game::handleClientEvent_ShowFormSpec().

+ Here is the caller graph for this function:

◆ init()

void GameUI::init ( )

References irr::gui::StaticText::add(), 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, rangelim, and utf8_to_wide().

Referenced by Game::initGui().

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

◆ initFlags()

void GameUI::initFlags ( )

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

Referenced by Game::startup(), and TestGameUI::testInit().

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

◆ isChatVisible()

bool GameUI::isChatVisible ( )
inline

References m_flags, m_profiler_current_page, m_recent_chat_count, and GameUI::Flags::show_chat.

Referenced by update().

+ Here is the caller graph for this function:

◆ setChatText()

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

References m_guitext_chat, m_recent_chat_count, and setStaticText().

Referenced by Game::updateChat().

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

◆ setInfoText()

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

References m_infotext.

Referenced by Game::handlePointingAtNode(), Game::handlePointingAtObject(), and TestGameUI::testInfoText().

+ Here is the caller graph for this function:

◆ showStatusText()

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

References m_statustext, and m_statustext_time.

Referenced by Game::decreaseViewRange(), Game::increaseViewRange(), Game::processKeyInput(), showTranslatedStatusText(), TestGameUI::testStatusText(), Game::toggleMinimap(), and toggleProfiler().

+ Here is the caller graph for this function:

◆ showTranslatedStatusText()

void GameUI::showTranslatedStatusText ( const char * str)

References showStatusText(), and wstrgettext().

Referenced by Game::checkZoomEnabled(), Game::processKeyInput(), Game::toggleAutoforward(), Game::toggleBlockBounds(), toggleChat(), Game::toggleCinematic(), Game::toggleDebug(), Game::toggleFast(), Game::toggleFog(), Game::toggleFreeMove(), Game::toggleFullViewRange(), toggleHud(), Game::toggleMinimap(), Game::toggleNoClip(), Game::togglePitchMove(), toggleProfiler(), and Game::toggleUpdateCamera().

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

◆ toggleChat()

void GameUI::toggleChat ( Client * client)

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

Referenced by Game::processKeyInput().

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

◆ toggleHud()

void GameUI::toggleHud ( )

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

Referenced by Game::processKeyInput().

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

◆ toggleProfiler()

void GameUI::toggleProfiler ( )

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

Referenced by Game::processKeyInput().

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

◆ update()

void GameUI::update ( const RunStats & stats,
Client * client,
MapDrawControl * draw_control,
const CameraOrientation & cam,
const PointedThing & pointed_old,
const GUIChatConsole * chat_console,
float dtime )

◆ updateChatSize()

void GameUI::updateChatSize ( )

References RenderingEngine::getWindowSize(), m_current_chat_size, m_flags, m_guitext, m_guitext2, m_guitext_chat, GameUI::Flags::show_basic_debug, and GameUI::Flags::show_minimal_debug.

Referenced by Game::updateChat().

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

◆ updateFormspec()

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

References m_formname, and m_formspec.

Referenced by Game::handleClientEvent_ShowFormSpec(), Game::nodePlacement(), and Game::openInventory().

+ Here is the caller graph for this function:

◆ updateProfiler()

void GameUI::updateProfiler ( )

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

Referenced by toggleProfiler(), and Game::updateProfilers().

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

Friends And Related Symbol Documentation

◆ Game

friend class Game
friend

◆ TestGameUI

friend class TestGameUI
friend

Member Data Documentation

◆ m_current_chat_size

core::rect<s32> GameUI::m_current_chat_size {0, 0, 0, 0}
private

Referenced by updateChatSize().

◆ m_drawtime_avg

float GameUI::m_drawtime_avg = 0
private

Referenced by update().

◆ m_flags

◆ m_formname

std::string GameUI::m_formname
private

◆ m_formspec

GUIFormSpecMenu* GameUI::m_formspec = nullptr
private

◆ m_guitext

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

◆ m_guitext2

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

◆ m_guitext_chat

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

◆ m_guitext_info

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

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

◆ m_guitext_profiler

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

Referenced by clearText(), init(), and updateProfiler().

◆ m_guitext_status

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

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

◆ m_infotext

std::wstring GameUI::m_infotext
private

Referenced by clearInfoText(), setInfoText(), and update().

◆ m_profiler_current_page

u8 GameUI::m_profiler_current_page = 0
private

◆ 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 isChatVisible(), and setChatText().

◆ m_statustext

std::wstring GameUI::m_statustext
private

◆ 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 showStatusText(), and update().


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