@@ -3,6 +3,9 @@ import flixel.FlxCamera;
33#if ACHIEVEMENTS_ALLOWED
44import haxe .Exception ;
55import objects .AchievementPopup ;
6+ #if LUA_ALLOWED
7+ import psychlua .FunkinLua .State ;
8+ #end
69
710typedef Achievement =
811{
@@ -261,7 +264,7 @@ class Achievements {
261264 #if LUA_ALLOWED
262265 public static function addLuaCallbacks (lua : State )
263266 {
264- Lua_helper . add_callback (lua , " getAchievementScore" , function (name : String ): Float
267+ Convert . addCallback (lua , " getAchievementScore" , function (name : String ): Float
265268 {
266269 if (! achievements .exists (name ))
267270 {
@@ -270,7 +273,7 @@ class Achievements {
270273 }
271274 return getScore (name );
272275 });
273- Lua_helper . add_callback (lua , " setAchievementScore" , function (name : String , ? value : Float = 1 , ? saveIfNotUnlocked : Bool = true ): Float
276+ Convert . addCallback (lua , " setAchievementScore" , function (name : String , ? value : Float = 1 , ? saveIfNotUnlocked : Bool = true ): Float
274277 {
275278 if (! achievements .exists (name ))
276279 {
@@ -279,7 +282,7 @@ class Achievements {
279282 }
280283 return setScore (name , value , saveIfNotUnlocked );
281284 });
282- Lua_helper . add_callback (lua , " addAchievementScore" , function (name : String , ? value : Float = 1 , ? saveIfNotUnlocked : Bool = true ): Float
285+ Convert . addCallback (lua , " addAchievementScore" , function (name : String , ? value : Float = 1 , ? saveIfNotUnlocked : Bool = true ): Float
283286 {
284287 if (! achievements .exists (name ))
285288 {
@@ -288,7 +291,7 @@ class Achievements {
288291 }
289292 return addScore (name , value , saveIfNotUnlocked );
290293 });
291- Lua_helper . add_callback (lua , " unlockAchievement" , function (name : String ): Dynamic
294+ Convert . addCallback (lua , " unlockAchievement" , function (name : String ): Dynamic
292295 {
293296 if (! achievements .exists (name ))
294297 {
@@ -297,7 +300,7 @@ class Achievements {
297300 }
298301 return unlock (name );
299302 });
300- Lua_helper . add_callback (lua , " isAchievementUnlocked" , function (name : String ): Dynamic
303+ Convert . addCallback (lua , " isAchievementUnlocked" , function (name : String ): Dynamic
301304 {
302305 if (! achievements .exists (name ))
303306 {
@@ -306,7 +309,7 @@ class Achievements {
306309 }
307310 return isUnlocked (name );
308311 });
309- Lua_helper . add_callback (lua , " achievementExists" , function (name : String ) return achievements .exists (name ));
312+ Convert . addCallback (lua , " achievementExists" , function (name : String ) return achievements .exists (name ));
310313 }
311314 #end
312315 #end
0 commit comments