Fix HTTP API not being available in async mainmenu (#10086)

This commit is contained in:
rubenwardy 2020-06-22 14:40:04 +01:00 committed by GitHub
parent e99415e0c5
commit 4cb18d4874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

@ -230,3 +230,10 @@ void ModApiHttp::Initialize(lua_State *L, int top)
#endif
}
void ModApiHttp::InitializeAsync(lua_State *L, int top)
{
#if USE_CURL
API_FCT(get_http_api);
#endif
}

@ -50,4 +50,5 @@ private:
public:
static void Initialize(lua_State *L, int top);
static void InitializeAsync(lua_State *L, int top);
};

@ -73,6 +73,7 @@ void MainMenuScripting::initializeModApi(lua_State *L, int top)
asyncEngine.registerStateInitializer(registerLuaClasses);
asyncEngine.registerStateInitializer(ModApiMainMenu::InitializeAsync);
asyncEngine.registerStateInitializer(ModApiUtil::InitializeAsync);
asyncEngine.registerStateInitializer(ModApiHttp::InitializeAsync);
// Initialize async environment
//TODO possibly make number of async threads configurable