Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@
<!--JS stuff needed-->
<haxelib name="hscript" />
<haxedef name="hscriptPos" />
<haxelib name="linc_luajit" if="LUA_ALLOWED"/>
<haxelib name="hxluajit" if="LUA_ALLOWED"/>
<haxelib name="tjson" />
<!--<haxelib name="hxCodec" if="VIDEOS_ALLOWED"/>-->

<haxelib name="hxvlc" if="VIDEOS_ALLOWED"/>

<haxelib name="hxdiscord_rpc" if="DISCORD_ALLOWED" />
Expand Down
4 changes: 2 additions & 2 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
"url": "https://github.com/MAJigsaw77/hxdiscord_rpc"
},
{
"name": "linc_luajit",
"name": "hxluajit",
"type": "git",
"dir": null,
"ref": "master",
"url": "https://github.com/JS-Engine-things/linc_luajit"
"url": "https://github.com/JS-Engine-things/hxluajit"
},
{
"name": "funkin.vis",
Expand Down
2 changes: 1 addition & 1 deletion setup/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ haxelib git away3d https://github.com/moxie-coder/away3d --quiet
haxelib git tjson https://github.com/moxie-coder/tjson --quiet
haxelib git hxcpp https://github.com/FunkinCrew/hxcpp --quiet
haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c072720e0d1236b94afe68e3e --quiet
haxelib git linc_luajit https://github.com/JS-Engine-things/linc_luajit --quiet
haxelib git hxluajit https://github.com/JS-Engine-things/hxluajit --quiet
haxelib git funkin.vis https://github.com/JS-Engine-things/funkVis-FrequencyFixed --quiet
haxelib git grig.audio https://github.com/JS-Engine-things/grig.audio --quiet
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc --quiet --skip-dependencies
Expand Down
2 changes: 1 addition & 1 deletion setup/windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ haxelib git away3d https://github.com/moxie-coder/away3d --quiet
haxelib git tjson https://github.com/moxie-coder/tjson --quiet
haxelib git hxcpp https://github.com/FunkinCrew/hxcpp --quiet
haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate 768740a56b26aa0c072720e0d1236b94afe68e3e --quiet
haxelib git linc_luajit https://github.com/JS-Engine-things/linc_luajit --quiet
haxelib git hxluajit https://github.com/JS-Engine-things/hxluajit --quiet
haxelib git funkin.vis https://github.com/JS-Engine-things/funkVis-FrequencyFixed --quiet
haxelib git grig.audio https://github.com/JS-Engine-things/grig.audio --quiet
haxelib git hxdiscord_rpc https://github.com/MAJigsaw77/hxdiscord_rpc --quiet --skip-dependencies
Expand Down
15 changes: 9 additions & 6 deletions source/Achievements.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import flixel.FlxCamera;
#if ACHIEVEMENTS_ALLOWED
import haxe.Exception;
import objects.AchievementPopup;
#if LUA_ALLOWED
import psychlua.FunkinLua.State;
#end

typedef Achievement =
{
Expand Down Expand Up @@ -261,7 +264,7 @@ class Achievements {
#if LUA_ALLOWED
public static function addLuaCallbacks(lua:State)
{
Lua_helper.add_callback(lua, "getAchievementScore", function(name:String):Float
Convert.addCallback(lua, "getAchievementScore", function(name:String):Float
{
if(!achievements.exists(name))
{
Expand All @@ -270,7 +273,7 @@ class Achievements {
}
return getScore(name);
});
Lua_helper.add_callback(lua, "setAchievementScore", function(name:String, ?value:Float = 1, ?saveIfNotUnlocked:Bool = true):Float
Convert.addCallback(lua, "setAchievementScore", function(name:String, ?value:Float = 1, ?saveIfNotUnlocked:Bool = true):Float
{
if(!achievements.exists(name))
{
Expand All @@ -279,7 +282,7 @@ class Achievements {
}
return setScore(name, value, saveIfNotUnlocked);
});
Lua_helper.add_callback(lua, "addAchievementScore", function(name:String, ?value:Float = 1, ?saveIfNotUnlocked:Bool = true):Float
Convert.addCallback(lua, "addAchievementScore", function(name:String, ?value:Float = 1, ?saveIfNotUnlocked:Bool = true):Float
{
if(!achievements.exists(name))
{
Expand All @@ -288,7 +291,7 @@ class Achievements {
}
return addScore(name, value, saveIfNotUnlocked);
});
Lua_helper.add_callback(lua, "unlockAchievement", function(name:String):Dynamic
Convert.addCallback(lua, "unlockAchievement", function(name:String):Dynamic
{
if(!achievements.exists(name))
{
Expand All @@ -297,7 +300,7 @@ class Achievements {
}
return unlock(name);
});
Lua_helper.add_callback(lua, "isAchievementUnlocked", function(name:String):Dynamic
Convert.addCallback(lua, "isAchievementUnlocked", function(name:String):Dynamic
{
if(!achievements.exists(name))
{
Expand All @@ -306,7 +309,7 @@ class Achievements {
}
return isUnlocked(name);
});
Lua_helper.add_callback(lua, "achievementExists", function(name:String) return achievements.exists(name));
Convert.addCallback(lua, "achievementExists", function(name:String) return achievements.exists(name));
}
#end
#end
Expand Down
7 changes: 5 additions & 2 deletions source/DiscordClient.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import cpp.ConstCharStar;
import cpp.Function;
import cpp.RawConstPointer;
#end
#if LUA_ALLOWED
import psychlua.FunkinLua.State;
#end

import hxdiscord_rpc.Discord;
import hxdiscord_rpc.Types;
Expand Down Expand Up @@ -150,8 +153,8 @@ class DiscordClient
#if LUA_ALLOWED
public static function addLuaCallbacks(lua:State)
{
Lua_helper.add_callback(lua, "changeDiscordPresence", changePresence);
Lua_helper.add_callback(lua, "changeDiscordClientID", function(?newID:String) {
Convert.addCallback(lua, "changeDiscordPresence", changePresence);
Convert.addCallback(lua, "changeDiscordClientID", function(?newID:String) {
if(newID == null) newID = _defaultID;
clientID = newID;
});
Expand Down
2 changes: 0 additions & 2 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ class Main extends Sprite {
FlxG.sound = soundFrontEnd;
funkinGame._customSoundTray = objects.CustomSoundTray.CustomSoundTray;
}
// turns out I forgot this, I'm a bit dumb for that
#if LUA_ALLOWED Lua.set_callbacks_function(cpp.Callable.fromStaticFunction(psychlua.CallbackHandler.call)); #end

addChild(funkinGame);

Expand Down
4 changes: 2 additions & 2 deletions source/import.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import sys.io.*;
#end

#if LUA_ALLOWED
import llua.*;
import llua.Lua;
import hxluajit.*;
import hxluajit.Types;
import psychlua.*;
#else
import psychlua.FunkinLua; // TODO: test and seperate this into LuaUtils
Expand Down
54 changes: 0 additions & 54 deletions source/psychlua/CallbackHandler.hx

This file was deleted.

Loading