Skip to content

Commit

Permalink
Added missing Lua bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardodoria committed Dec 26, 2023
1 parent c7bd3f4 commit 8b1883e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions engine/core/script/binding/CoreClassesLua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ void LuaBinding::registerCoreClasses(lua_State *L){
.addProperty("CLAMP_TO_EDGE", TextureWrap::CLAMP_TO_EDGE)
.endNamespace();

luabridge::getGlobalNamespace(L)
.beginNamespace("AdMobRating")
.addProperty("General", AdMobRating::General)
.addProperty("ParentalGuidance", AdMobRating::ParentalGuidance)
.addProperty("Teen", AdMobRating::Teen)
.addProperty("MatureAudience", AdMobRating::MatureAudience)
.endNamespace();

luabridge::getGlobalNamespace(L)
.beginClass<Engine>("Engine")

Expand Down Expand Up @@ -534,13 +542,22 @@ void LuaBinding::registerCoreClasses(lua_State *L){
.addStaticFunction("getUserDataPath", [] () { return System::instance().getUserDataPath(); })
.addStaticFunction("getLuaPath", [] () { return System::instance().getLuaPath(); })
.addStaticFunction("getShaderPath", [] () { return System::instance().getShaderPath(); })

//UserSettings not need here

.addStaticFunction("initializeAdMob", [] () { return System::instance().initializeAdMob(); })
.addStaticFunction("setMaxAdContentRating", [] (AdMobRating rating) { return System::instance().setMaxAdContentRating(rating); })
.addStaticFunction("loadInterstitialAd", [] (std::string adUnitID) { return System::instance().loadInterstitialAd(adUnitID); })
.addStaticFunction("isInterstitialAdLoaded", [] () { return System::instance().isInterstitialAdLoaded(); })
.addStaticFunction("showInterstitialAd", [] () { return System::instance().showInterstitialAd(); })

.addStaticFunction("initializeCrazyGamesSDK", [] () { return System::instance().initializeCrazyGamesSDK(); })
.addStaticFunction("showCrazyGamesAd", [] (std::string type) { return System::instance().showCrazyGamesAd(type); })
.addStaticFunction("happytimeCrazyGames", [] () { return System::instance().happytimeCrazyGames(); })
.addStaticFunction("gameplayStartCrazyGames", [] () { return System::instance().gameplayStartCrazyGames(); })
.addStaticFunction("gameplayStopCrazyGames", [] () { return System::instance().gameplayStopCrazyGames(); })
.addStaticFunction("loadingStartCrazyGames", [] () { return System::instance().loadingStartCrazyGames(); })
.addStaticFunction("loadingStopCrazyGames", [] () { return System::instance().loadingStopCrazyGames(); })
.endClass();

#endif //DISABLE_LUA_BINDINGS
Expand Down

0 comments on commit 8b1883e

Please sign in to comment.