Luanti 5.16.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 ()
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
u8 m_profiler_max_page = 1

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.

◆ clearStatusText()

void GameUI::clearStatusText ( )
inline

References m_statustext.

Referenced by update().

Here is the caller graph for this function:

◆ clearText()

void GameUI::clearText ( )

◆ getFlags()

const Flags & GameUI::getFlags ( ) const
inline

References m_flags.

◆ init()

void GameUI::init ( )

References gui::StaticText::add(), FM_Mono, FM_Unspecified, g_fontengine, g_settings, guienv, guiroot, m_guitext, m_guitext2, m_guitext_chat, m_guitext_info, m_guitext_profiler, m_guitext_status, rangelim(), and utf8_to_wide().

Here is the call graph for this function:

◆ initFlags()

void GameUI::initFlags ( )

References m_flags.

◆ isChatVisible()

bool GameUI::isChatVisible ( )
inline

References m_flags, m_profiler_current_page, and m_recent_chat_count.

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().

Here is the call graph for this function:

◆ setInfoText()

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

References m_infotext.

◆ showStatusText()

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

References m_statustext, and m_statustext_time.

Referenced by showTranslatedStatusText(), and toggleProfiler().

Here is the caller graph for this function:

◆ showTranslatedStatusText()

void GameUI::showTranslatedStatusText ( const char * str)

References showStatusText(), and wstrgettext().

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 ( Client * client)

References HUD_FLAG_CHAT_VISIBLE, m_flags, and showTranslatedStatusText().

Here is the call graph for this function:

◆ toggleHud()

void GameUI::toggleHud ( )

References m_flags, and showTranslatedStatusText().

Here is the call graph for this function:

◆ toggleProfiler()

void GameUI::toggleProfiler ( )

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

Here is the call graph for this function:

◆ update()

◆ updateChatSize()

void GameUI::updateChatSize ( )

References RenderingEngine::getWindowSize(), m_current_chat_size, m_flags, m_guitext, m_guitext2, and m_guitext_chat.

Here is the call graph for this function:

◆ updateProfiler()

void GameUI::updateProfiler ( )

References g_profiler, RenderingEngine::getWindowSize(), m_flags, m_guitext, m_guitext2, m_guitext_profiler, m_profiler_current_page, m_profiler_max_page, EnrichedString::setBackground(), setStaticText(), updateProfiler(), and utf8_to_wide().

Referenced by toggleProfiler(), and updateProfiler().

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

◆ Game

friend class Game
friend

References Game.

Referenced by Game.

◆ TestGameUI

friend class TestGameUI
friend

References TestGameUI.

Referenced by TestGameUI.

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_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

u8 GameUI::m_profiler_max_page = 1
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: