Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
scripting_mainmenu.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
22#include "cpp_api/s_base.h"
23#include "cpp_api/s_mainmenu.h"
24#include "cpp_api/s_async.h"
25
26/*****************************************************************************/
27/* Scripting <-> Main Menu Interface */
28/*****************************************************************************/
29
31 : virtual public ScriptApiBase,
33{
34public:
35 MainMenuScripting(GUIEngine* guiengine);
36
37 // Global step handler to pass back async events
38 void step();
39
40 // Calls core.on_before_close()
41 void beforeClose();
42
43 // Pass async events from engine to async threads
44 u32 queueAsync(std::string &&serialized_func,
45 std::string &&serialized_param);
46
47private:
48 void initializeModApi(lua_State *L, int top);
49 static void registerLuaClasses(lua_State *L, int top);
50
52};
Definition s_async.h:79
implementation of main menu based uppon formspecs
Definition guiEngine.h:128
Definition scripting_mainmenu.h:33
void step()
Definition scripting_mainmenu.cpp:101
AsyncEngine asyncEngine
Definition scripting_mainmenu.h:51
void beforeClose()
Definition scripting_mainmenu.cpp:87
MainMenuScripting(GUIEngine *guiengine)
Definition scripting_mainmenu.cpp:37
void initializeModApi(lua_State *L, int top)
Definition scripting_mainmenu.cpp:61
static void registerLuaClasses(lua_State *L, int top)
Definition scripting_mainmenu.cpp:81
u32 queueAsync(std::string &&serialized_func, std::string &&serialized_param)
Definition scripting_mainmenu.cpp:106
Definition s_base.h:79
Definition s_mainmenu.h:26