]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/scripting_mainmenu.h
Fix double free caused by CGUITTFont code
[dragonfireclient.git] / src / script / scripting_mainmenu.h
index 7592c8e23de720cfa14f5b96ed581e2836a756de..9e23bdc1b39ceb2652264819bf46e51f8e6b4131 100644 (file)
@@ -17,11 +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 "cpp_api/s_async.h"
 
 /*****************************************************************************/
 /* Scripting <-> Main Menu Interface                                         */
@@ -34,12 +34,15 @@ 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();
 
+       // Pass async events from engine to async threads
+       unsigned int queueAsync(const std::string &serialized_func,
+                       const 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);
 
-#endif /* SCRIPTING_MAINMENU_H_ */
+       AsyncEngine asyncEngine;
+};