Luanti
5.11.0-dev
Loading...
Searching...
No Matches
game_formspec.h
Go to the documentation of this file.
1
// Luanti
2
// SPDX-License-Identifier: LGPL-2.1-or-later
3
// Copyright (C) 2024 cx384
4
5
#pragma once
6
7
#include <string>
8
#include "
irr_v3d.h
"
9
10
class
Client
;
11
class
RenderingEngine
;
12
class
InputHandler
;
13
class
ISoundManager
;
14
class
GUIFormSpecMenu
;
15
16
/*
17
This object intend to contain the core fromspec functionality.
18
It includes:
19
- methods to show specific formspec menus
20
- storing the opened fromspec
21
- handling fromspec related callbacks
22
*/
23
struct
GameFormSpec
24
{
25
void
init
(
Client
*
client
,
RenderingEngine
*rendering_engine,
InputHandler
*input)
26
{
27
m_client
=
client
;
28
m_rendering_engine
= rendering_engine;
29
m_input
= input;
30
}
31
32
~GameFormSpec
();
33
34
void
showFormSpec
(
const
std::string &formspec,
const
std::string &formname);
35
void
showLocalFormSpec
(
const
std::string &formspec,
const
std::string &formname);
36
void
showNodeFormspec
(
const
std::string &formspec,
const
v3s16
&nodepos);
37
void
showPlayerInventory
();
38
void
showDeathFormspecLegacy
();
39
void
showPauseMenu
();
40
41
void
update
();
42
void
disableDebugView
();
43
44
bool
handleCallbacks
();
45
46
#ifdef __ANDROID__
47
// Returns false if no formspec open
48
bool
handleAndroidUIInput();
49
#endif
50
51
private
:
52
Client
*
m_client
;
53
RenderingEngine
*
m_rendering_engine
;
54
InputHandler
*
m_input
;
55
56
// Default: "". If other than "": Empty show_formspec packets will only
57
// close the formspec when the formname matches
58
std::string
m_formname
;
59
GUIFormSpecMenu
*
m_formspec
=
nullptr
;
60
61
void
deleteFormspec
();
62
};
Client
Definition
client.h:104
GUIFormSpecMenu
Definition
guiFormSpecMenu.h:87
ISoundManager
Definition
sound.h:46
InputHandler
Definition
inputhandler.h:222
RenderingEngine
Definition
renderingengine.h:68
irr_v3d.h
v3s16
core::vector3d< s16 > v3s16
Definition
irr_v3d.h:13
client
Definition
activeobjectmgr.cpp:11
GameFormSpec
Definition
game_formspec.h:24
GameFormSpec::showNodeFormspec
void showNodeFormspec(const std::string &formspec, const v3s16 &nodepos)
Definition
game_formspec.cpp:240
GameFormSpec::disableDebugView
void disableDebugView()
Definition
game_formspec.cpp:459
GameFormSpec::showLocalFormSpec
void showLocalFormSpec(const std::string &formspec, const std::string &formname)
Definition
game_formspec.cpp:230
GameFormSpec::handleCallbacks
bool handleCallbacks()
Definition
game_formspec.cpp:468
GameFormSpec::init
void init(Client *client, RenderingEngine *rendering_engine, InputHandler *input)
Definition
game_formspec.h:25
GameFormSpec::m_formspec
GUIFormSpecMenu * m_formspec
Definition
game_formspec.h:59
GameFormSpec::m_formname
std::string m_formname
Definition
game_formspec.h:58
GameFormSpec::~GameFormSpec
~GameFormSpec()
Definition
game_formspec.cpp:205
GameFormSpec::showDeathFormspecLegacy
void showDeathFormspecLegacy()
Definition
game_formspec.cpp:408
GameFormSpec::showFormSpec
void showFormSpec(const std::string &formspec, const std::string &formname)
Definition
game_formspec.cpp:211
GameFormSpec::showPauseMenu
void showPauseMenu()
Definition
game_formspec.cpp:298
GameFormSpec::showPlayerInventory
void showPlayerInventory()
Definition
game_formspec.cpp:259
GameFormSpec::update
void update()
Definition
game_formspec.cpp:430
GameFormSpec::m_rendering_engine
RenderingEngine * m_rendering_engine
Definition
game_formspec.h:53
GameFormSpec::deleteFormspec
void deleteFormspec()
Definition
game_formspec.cpp:196
GameFormSpec::m_input
InputHandler * m_input
Definition
game_formspec.h:54
GameFormSpec::m_client
Client * m_client
Definition
game_formspec.h:52
client
game_formspec.h
Generated on Wed Jan 1 2025 10:21:55 for Luanti by
1.11.0