1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00
luanti/src/script/scripting_mainmenu.h

38 lines
1,006 B
C
Raw Normal View History

// Luanti
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
#pragma once
#include "cpp_api/s_base.h"
#include "cpp_api/s_mainmenu.h"
#include "cpp_api/s_async.h"
/*****************************************************************************/
/* Scripting <-> Main Menu Interface */
/*****************************************************************************/
class MainMenuScripting
: virtual public ScriptApiBase,
public ScriptApiMainMenu
{
public:
MainMenuScripting(GUIEngine* guiengine);
// Global step handler to pass back async events
2014-04-15 15:10:30 -04:00
void step();
// Calls core.on_before_close()
void beforeClose();
// Pass async events from engine to async threads
2021-08-28 12:15:12 +02:00
u32 queueAsync(std::string &&serialized_func,
std::string &&serialized_param);
private:
2014-04-15 15:10:30 -04:00
void initializeModApi(lua_State *L, int top);
static void registerLuaClasses(lua_State *L, int top);
2014-04-15 15:10:30 -04:00
AsyncEngine asyncEngine;
};