Skip to content

Commit

Permalink
Update FunkinLua.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Jun 10, 2024
1 parent 3edb1bb commit 6d0f5a3
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions source/meta/data/scripts/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2332,15 +2332,12 @@ class FunkinLua {
});
#end

Lua_helper.add_callback(lua, "debugPrint", function(text1:Dynamic = '', text2:Dynamic = '', text3:Dynamic = '', text4:Dynamic = '', text5:Dynamic = ''):Void
{
if (text1 == null) text1 = '';
if (text2 == null) text2 = '';
if (text3 == null) text3 = '';
if (text4 == null) text4 = '';
if (text5 == null) text5 = '';
Lua_helper.add_callback(lua, "debugPrint", function(text1:Dynamic = '', text2:Dynamic = '', text3:Dynamic = '', text4:Dynamic = '', text5:Dynamic = '') {
for (i in [text1, text2, text3, text4, text5])
if (i == null)
i = '';

luaTrace(text1 + text2 + text3 + text4 + text5, true, false);
luaTrace('' + text1 + text2 + text3 + text4 + text5, true, false);
});

Lua_helper.add_callback(lua, "close", function() {
Expand All @@ -2354,16 +2351,15 @@ class FunkinLua {
#end
});


// LUA TEXTS
Lua_helper.add_callback(lua, "makeLuaText", function(tag:String:String, width:Int, x:Float, y:Float) {
Lua_helper.add_callback(lua, "makeLuaText", function(tag:String, text:String, width:Int, x:Float, y:Float) {
tag = tag.replace('.', '');
resetTextTag(tag);
var leText:ModchartText = new ModchartText(x, y, width);
var leText:ModchartText = new ModchartText(x, y, text, width);
PlayState.instance.modchartTexts.set(tag, leText);
});

Lua_helper.add_callback(lua, "setTextString", function(tag:String:String) {
Lua_helper.add_callback(lua, "setTextString", function(tag:String, text:String) {
var obj:FlxText = getTextObject(tag);
if(obj != null)
{
Expand Down Expand Up @@ -3508,9 +3504,9 @@ class ModchartSprite extends FlxSprite
class ModchartText extends FlxText
{
public var wasAdded:Bool = false;
public function new(x:Float, y:Float:String, width:Float)
public function new(x:Float, y:Float:String, text:String, width:Float)
{
super(x, y, width, 16);
super(x, y, width, text, 16);
setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
cameras = [PlayState.instance.camHUD];
scrollFactor.set();
Expand All @@ -3524,7 +3520,7 @@ class DebugLuaText extends FlxText
public var parentGroup:FlxTypedGroup<DebugLuaText>;
public function new(text:String, parentGroup:FlxTypedGroup<DebugLuaText>, color:FlxColor) {
this.parentGroup = parentGroup;
super(10, 10, 0, 16);
super(10, 10, 0, text, 16);
setFormat(Paths.font("vcr.ttf"), 20, color, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
scrollFactor.set();
borderSize = 1;
Expand Down

0 comments on commit 6d0f5a3

Please sign in to comment.