2013-08-11 04:09:45 +02:00
|
|
|
/*
|
|
|
|
Minetest
|
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCRIPTING_MAINMENU_H_
|
|
|
|
#define SCRIPTING_MAINMENU_H_
|
|
|
|
|
|
|
|
#include "cpp_api/s_base.h"
|
|
|
|
#include "cpp_api/s_mainmenu.h"
|
2014-04-15 19:41:07 +02:00
|
|
|
#include "cpp_api/s_async.h"
|
2013-08-11 04:09:45 +02:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Scripting <-> Main Menu Interface */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
class MainMenuScripting
|
|
|
|
: virtual public ScriptApiBase,
|
|
|
|
public ScriptApiMainMenu
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MainMenuScripting(GUIEngine* guiengine);
|
|
|
|
|
2014-04-15 19:41:07 +02:00
|
|
|
// Global step handler to pass back async events
|
2014-04-15 21:10:30 +02:00
|
|
|
void step();
|
2013-11-26 18:15:31 +01:00
|
|
|
|
2014-04-15 19:41:07 +02:00
|
|
|
// Pass async events from engine to async threads
|
2017-04-20 00:12:52 +02:00
|
|
|
unsigned int queueAsync(const std::string &serialized_func,
|
|
|
|
const std::string &serialized_params);
|
2013-08-11 04:09:45 +02:00
|
|
|
private:
|
2014-04-15 21:10:30 +02:00
|
|
|
void initializeModApi(lua_State *L, int top);
|
2014-12-12 20:49:19 +01:00
|
|
|
static void registerLuaClasses(lua_State *L, int top);
|
2013-11-26 18:15:31 +01:00
|
|
|
|
2014-04-15 21:10:30 +02:00
|
|
|
AsyncEngine asyncEngine;
|
2013-08-11 04:09:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SCRIPTING_MAINMENU_H_ */
|