Skip to content

Commit

Permalink
ain't no way lua functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored May 23, 2024
1 parent 263b831 commit 86b35f3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions source/meta/data/scripts/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,26 @@ class FunkinLua {
}
});

Lua_helper.add_callback(lua, "switchLang", function(lang:String) {
var target:String = lang;
return Localization.switchLanguage(target);
});

Lua_helper.add_callback(lua, "translateText", function(key:String, lang:String) {
var target:String = lang;
return Localization.get(key, target);
});

Lua_helper.add_callback(lua, "translateImage", function(path:String, lang:String) {
var target:String = lang;
return Localization.getLocalizedImage(path, target);
});

Lua_helper.add_callback(lua, "translateSound", function(path:String, lang:String) {
var target:String = lang;
return Localization.getLocalizedSound(path, target);
});

Lua_helper.add_callback(lua, "getProperty", function(variable:String) {
var result:Dynamic = null;
var killMe:Array<String> = variable.split('.');
Expand Down

0 comments on commit 86b35f3

Please sign in to comment.