From 93e672451df5e7f9330b8f8619085b23db022bf7 Mon Sep 17 00:00:00 2001 From: MaybeMaru <97055307+MaybeMaru@users.noreply.github.com> Date: Thu, 18 Apr 2024 02:24:43 +0200 Subject: [PATCH] update some docs --- README.md | 2 +- example_mods/TemplateScript.hx | 31 +++++++++++++++++++++--- source/funkin/util/modding/FunkScript.hx | 10 ++++---- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 39f970ab..7dc20519 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ haxelib install flixel-ui haxelib git haxeui-openfl https://github.com/haxeui/haxeui-openfl haxelib git haxeui-core https://github.com/haxeui/haxeui-core haxelib git maru-hscript https://github.com/MaybeMaru/hscript-improved -haxelib git hxCodec https://github.com/MaybeMaru/hxCodec +haxelib git hxvlc https://github.com/MaybeMaru/hxvlc haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc ``` You should have everything ready for compiling the game! diff --git a/example_mods/TemplateScript.hx b/example_mods/TemplateScript.hx index 6f46f1dc..0ea438f7 100644 --- a/example_mods/TemplateScript.hx +++ b/example_mods/TemplateScript.hx @@ -50,6 +50,7 @@ StringTools FlxG FlxSpriteExt FlxSprite // Same as FlxSpriteExt, duplicate for backwards compatibility and shortcuts +FlxBackdrop FlxText FlxTypedGroup FlxSpriteGroup @@ -62,13 +63,13 @@ FlxTween FlxEase FlxTrail -// HxCodec +// hxVlc FlxVideo FlxVideoSprite // Compilation Defines BUILD_TARGET // Target the build was compiled to (windows or linux) -VIDEOS_ALLOWED // If hxcodec is enabled +VIDEOS_ALLOWED // If hxvlc is enabled DISCORD_ALLOWED // If discord presence is enabled ZIPS_ALLOWED // If osu and quaver zips are enabled @@ -185,7 +186,7 @@ cacheCharacter(charName:String); cacheImage(imagePath:String, ?imageLibrary:String, ?quadCamera:FlxCamera); /* - Runs a PlayState song event + Runs a PlayState song event and adds a event script if neccesary @param eventName --> Name of the event to call @param eventValues --> Values of the event to call (OPTIONAL) */ @@ -197,6 +198,19 @@ runEvent(eventName:String, ?eventValues:Array); */ getBlendMode(blendModeName:String); +/* + Returns a parsed json + @param jsonString --> Contents of the json file +*/ +parseJson(jsonString:String); + +/* + Returns a json as a string + @param jsonValues --> Values of the json + @param beautyJson --> If to compact the json or make it readable (OPTIONAL) +*/ +stringifyJson(jsonValues:Dynamic, ?beautyJson:Bool); + /* Returns the preference variable @param prefName --> Identifier name of the preference EX: 'downscroll' @@ -289,6 +303,17 @@ pauseSounds(); */ resumeSounds(); +/* + Returns a new cutscene manager instance + @param targetSound -> Sound for the cutscene to be synced to (OPTION) +*/ +makeCutsceneManager(?targetSound:FlxSound); + +/* + Returns a new modchart manager instance +*/ +makeModchartManager(); + /* Changes the current Discord client presence @param details --> Small text of the Discord presence diff --git a/source/funkin/util/modding/FunkScript.hx b/source/funkin/util/modding/FunkScript.hx index 5da09a24..1d64f20b 100644 --- a/source/funkin/util/modding/FunkScript.hx +++ b/source/funkin/util/modding/FunkScript.hx @@ -74,6 +74,11 @@ class FunkScript extends hscript.Script implements IFlxDestroyable public function implement():Void { //Preloaded Variables implementNonStatic(); + set("trace", Reflect.makeVarArgs(function(el) { + var v = el.shift(); + ModdingUtil.print(Std.string(v), NONE); + })); + // Wip set('STOP_FUNCTION', STOP_FUNCTION); @@ -194,11 +199,6 @@ class FunkScript extends hscript.Script implements IFlxDestroyable return Controls.getKeyOld(key); }); - set("trace", Reflect.makeVarArgs(function(el) { - var v = el.shift(); - ModdingUtil.print(Std.string(v), NONE); - })); - set('getSound', function (key:String):FlxSound { return CoolUtil.getSound(key); });