]> git.lizzy.rs Git - minetest.git/blobdiff - src/script/scripting_mainmenu.h
Physics overrides: Move values to a common struct (#12591)
[minetest.git] / src / script / scripting_mainmenu.h
index f4d78f6646a388d7b935b8f50cfddbbf9594f9f8..3c329654a9e715a5bf6ba6f9287bfdecdeb311f2 100644 (file)
@@ -17,12 +17,11 @@ 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_
+#pragma once
 
 #include "cpp_api/s_base.h"
 #include "cpp_api/s_mainmenu.h"
-#include "lua_api/l_async_events.h"
+#include "cpp_api/s_async.h"
 
 /*****************************************************************************/
 /* Scripting <-> Main Menu Interface                                         */
@@ -35,20 +34,16 @@ class MainMenuScripting
 public:
        MainMenuScripting(GUIEngine* guiengine);
 
-       // use ScriptApiBase::loadMod() or ScriptApiBase::loadScript()
-       // to load scripts
+       // Global step handler to pass back async events
+       void step();
 
-       /* global step handler to pass back async events */
-       void Step();
+       // Pass async events from engine to async threads
+       u32 queueAsync(std::string &&serialized_func,
+               std::string &&serialized_param);
 
-       /* pass async events from engine to async threads */
-       unsigned int DoAsync(std::string serialized_fct,
-                       std::string serialized_params);
 private:
-       void InitializeModApi(lua_State *L, int top);
+       void initializeModApi(lua_State *L, int top);
+       static void registerLuaClasses(lua_State *L, int top);
 
-       AsyncEngine m_AsyncEngine;
+       AsyncEngine asyncEngine;
 };
-
-
-#endif /* SCRIPTING_MAINMENU_H_ */