Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
GameFormSpec Struct Reference

#include <game_formspec.h>

+ Collaboration diagram for GameFormSpec:

Public Member Functions

void init (Client *client, RenderingEngine *rendering_engine, InputHandler *input)
 
 ~GameFormSpec ()
 
void showFormSpec (const std::string &formspec, const std::string &formname)
 
void showCSMFormSpec (const std::string &formspec, const std::string &formname)
 
void showPauseMenuFormSpec (const std::string &formspec, const std::string &formname)
 
void showNodeFormspec (const std::string &formspec, const v3s16 &nodepos)
 
void showPlayerInventory (const std::string *fs_override)
 If !fs_override: Uses player->inventory_formspec.
 
void showDeathFormspecLegacy ()
 
void showPauseMenu ()
 
void update ()
 
void disableDebugView ()
 
bool handleCallbacks ()
 
void reset ()
 

Private Member Functions

bool handleEmptyFormspec (const std::string &formspec, const std::string &formname)
 
void deleteFormspec ()
 

Private Attributes

Clientm_client
 
RenderingEnginem_rendering_engine
 
InputHandlerm_input
 
std::unique_ptr< PauseMenuScriptingm_pause_script
 
GUIFormSpecMenum_formspec = nullptr
 The currently open formspec that is not a submenu of the pause menu FIXME: Layering is already managed by GUIModalMenu (g_menumgr), hence this variable should be removed in long-term.
 

Constructor & Destructor Documentation

◆ ~GameFormSpec()

GameFormSpec::~GameFormSpec ( )
inline

References reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ deleteFormspec()

void GameFormSpec::deleteFormspec ( )
private

References m_formspec.

Referenced by reset(), and update().

+ Here is the caller graph for this function:

◆ disableDebugView()

void GameFormSpec::disableDebugView ( )

References m_formspec, and GUIFormSpecMenu::setDebugView().

Referenced by Game::updateDebugState().

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

◆ handleCallbacks()

bool GameFormSpec::handleCallbacks ( )

References MainGameCallback::changepassword_requested, MainGameCallback::changevolume_requested, MainGameCallback::disconnect_requested, g_gamecallback, g_menumgr, Client::getTextureSource(), guienv, guiroot, m_client, m_pause_script, ScriptApiPauseMenu::open_settings(), MainGameCallback::settings_requested, MainGameCallback::show_open_url_dialog, and MainGameCallback::touchscreenlayout_requested.

Referenced by Game::run().

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

◆ handleEmptyFormspec()

bool GameFormSpec::handleEmptyFormspec ( const std::string & formspec,
const std::string & formname )
private

References g_menumgr, GUIModalMenu::quitMenu(), and MainMenuManager::tryGetTopMenu().

Referenced by showCSMFormSpec(), showFormSpec(), and showPauseMenuFormSpec().

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

◆ init()

void GameFormSpec::init ( Client * client,
RenderingEngine * rendering_engine,
InputHandler * input )

References g_gamecallback, PauseMenuScripting::loadBuiltin(), m_client, m_input, m_pause_script, and m_rendering_engine.

Referenced by Game::startup().

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

◆ reset()

void GameFormSpec::reset ( )

References deleteFormspec(), m_formspec, and GUIModalMenu::quitMenu().

Referenced by ~GameFormSpec(), and Game::shutdown().

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

◆ showCSMFormSpec()

void GameFormSpec::showCSMFormSpec ( const std::string & formspec,
const std::string & formname )

References GUIFormSpecMenu::create(), RenderingEngine::get_gui_env(), Client::getFormspecPrepend(), Client::getScript(), Client::getSoundManager(), handleEmptyFormspec(), InputHandler::joystick, m_client, m_formspec, m_input, and m_rendering_engine.

Referenced by Game::handleClientEvent_ShowCSMFormSpec().

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

◆ showDeathFormspecLegacy()

void GameFormSpec::showDeathFormspecLegacy ( )

References GUIFormSpecMenu::create(), RenderingEngine::get_gui_env(), Client::getFormspecPrepend(), Client::getSoundManager(), InputHandler::joystick, m_client, m_formspec, m_input, m_rendering_engine, GUIFormSpecMenu::setFocus(), and SIZE_TAG.

Referenced by Game::handleClientEvent_DeathscreenLegacy().

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

◆ showFormSpec()

void GameFormSpec::showFormSpec ( const std::string & formspec,
const std::string & formname )

References GUIFormSpecMenu::create(), RenderingEngine::get_gui_env(), Client::getFormspecPrepend(), Client::getSoundManager(), handleEmptyFormspec(), InputHandler::joystick, m_client, m_formspec, m_input, and m_rendering_engine.

Referenced by Game::handleClientEvent_ShowFormSpec().

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

◆ showNodeFormspec()

void GameFormSpec::showNodeFormspec ( const std::string & formspec,
const v3s16 & nodepos )

References GUIFormSpecMenu::create(), RenderingEngine::get_gui_env(), ClientEnvironment::getClientMap(), Client::getEnv(), Client::getFormspecPrepend(), Client::getSoundManager(), infostream, InputHandler::joystick, m_client, m_formspec, m_input, m_rendering_engine, GUIFormSpecMenu::setFormSpec(), and InventoryLocation::setNodeMeta().

Referenced by Game::nodePlacement().

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

◆ showPauseMenu()

void GameFormSpec::showPauseMenu ( )

References GUIFormSpecMenu::create(), GUIFormSpecMenu::doPause, g_settings, g_touchcontrols, Settings::get(), RenderingEngine::get_gui_env(), Client::getAddressName(), Settings::getBool(), Client::getFormspecPrepend(), Client::getSoundManager(), InputHandler::joystick, m_client, m_formspec, m_input, m_rendering_engine, Client::m_simple_singleplayer_mode, GUIFormSpecMenu::setFocus(), SIZE_TAG, str_formspec_escape(), and strgettext().

Referenced by Game::processKeyInput(), and Game::run().

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

◆ showPauseMenuFormSpec()

void GameFormSpec::showPauseMenuFormSpec ( const std::string & formspec,
const std::string & formname )

References GUIFormSpecMenu::create(), RenderingEngine::get_gui_env(), Client::getSoundManager(), handleEmptyFormspec(), InputHandler::joystick, m_client, m_input, m_pause_script, and m_rendering_engine.

Referenced by Game::handleClientEvent_ShowPauseMenuFormSpec().

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

◆ showPlayerInventory()

void GameFormSpec::showPlayerInventory ( const std::string * fs_override)

If !fs_override: Uses player->inventory_formspec.

If fs_override: Uses a temporary formspec until an update is received.

References GUIFormSpecMenu::create(), RenderingEngine::get_gui_env(), LocalPlayer::getCAO(), Client::getEnv(), Client::getFormspecPrepend(), Client::getInventory(), ClientEnvironment::getLocalPlayer(), Client::getScript(), Client::getSoundManager(), infostream, LocalPlayer::inventory_formspec_override, InputHandler::joystick, m_client, m_formspec, m_input, m_rendering_engine, Client::modsLoaded(), ScriptApiClient::on_inventory_open(), InventoryLocation::setCurrentPlayer(), and GUIFormSpecMenu::setFormSpec().

Referenced by Game::handleClientEvent_ShowFormSpec(), and Game::processKeyInput().

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

◆ update()

void GameFormSpec::update ( )

References deleteFormspec(), ClientEnvironment::getClientMap(), Client::getEnv(), GUIFormSpecMenu::getFormspecLocation(), Map::getNodeMetadata(), SimpleMetadata::getString(), guiroot, isMenuActive(), m_client, m_formspec, InventoryLocation::NODEMETA, and GUIModalMenu::quitMenu().

Referenced by Game::updateFrame().

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

Member Data Documentation

◆ m_client

◆ m_formspec

GUIFormSpecMenu* GameFormSpec::m_formspec = nullptr
private

The currently open formspec that is not a submenu of the pause menu FIXME: Layering is already managed by GUIModalMenu (g_menumgr), hence this variable should be removed in long-term.

Referenced by deleteFormspec(), disableDebugView(), reset(), showCSMFormSpec(), showDeathFormspecLegacy(), showFormSpec(), showNodeFormspec(), showPauseMenu(), showPlayerInventory(), and update().

◆ m_input

◆ m_pause_script

std::unique_ptr<PauseMenuScripting> GameFormSpec::m_pause_script
private

◆ m_rendering_engine


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