diff --git a/TODO.md b/TODO.md index b5d1e224..97c8fab6 100644 --- a/TODO.md +++ b/TODO.md @@ -11,27 +11,34 @@ - [x] Fix the strumlines bar when zooming out - [x] Algorithm to make note placements faster & sorted out - [x] Play here working - - [ ] Events (including Camera Movement) + - [x] Cap zoom in & out + - [x] Events (including Camera Movement) + - [x] Metadata Editing - [ ] Custom Notes - - [ ] Metadata Editing - - [ ] Cap zoom in & out - [ ] Step based zooming - [ ] Use latest hxCodec - [ ] Re-export gf-christmas, gf-car and gf-tankmen with padding - [ ] Multiple state scripts & Multiple global scripts -- [ ] Re-add shader camera stuff +- [x] Re-add shader camera stuff - [ ] Make update.bat use libs.xml instead of hmm.json - [ ] New Switch Mod menu -- [ ] Port shader camera stuff over to new flixel fork +- [x] Port shader camera stuff over to new flixel fork - [ ] Add note offset - [ ] Dialogue - [ ] Finish Base Game port - [ ] Character Editor +- [ ] Add credits +- [ ] Verbose mode (`--verbose`) - [ ] Fix bugs ## `v1.1.0` - [ ] Charter Waveforms (maybe in v1.1.0, dont wanna slow shit down) - [ ] Custom classes + - [ ] Proper super overrides (FlxText_HSX doesn't allow overrides for update because of this) + - [ ] Custom Class extending Custom Classes + - [ ] Statics on Custom Classes + - [ ] Fix Bugs - [ ] Full 3D support via stages files - [ ] Multithread sprites loading (for faster load times) ? -- [ ] Stage Editor \ No newline at end of file +- [ ] Stage Editor +- [ ] Optimize flxanimate isOnScreen \ No newline at end of file diff --git a/source/funkin/backend/scripting/Script.hx b/source/funkin/backend/scripting/Script.hx index fc673207..927e1189 100644 --- a/source/funkin/backend/scripting/Script.hx +++ b/source/funkin/backend/scripting/Script.hx @@ -4,7 +4,9 @@ import lime.app.Application; import flixel.util.FlxDestroyUtil.IFlxDestroyable; import haxe.io.Path; import hscript.IHScriptCustomConstructor; +import flixel.util.FlxStringUtil; +@:allow(funkin.backend.scripting.ScriptPack) /** * Class used for scripting. */ @@ -159,6 +161,10 @@ class Script extends FlxBasic implements IFlxDestroyable { for(k=>e in getDefaultVariables(this)) { set(k, e); } + set("disableScript", () -> { + active = false; + }); + set("__script__", this); } @@ -250,6 +256,17 @@ class Script extends FlxBasic implements IFlxDestroyable { ], ERROR); } + override public function toString():String { + return FlxStringUtil.getDebugString(didLoad ? [ + LabelValuePair.weak("path", path), + LabelValuePair.weak("active", active), + ] : [ + LabelValuePair.weak("path", path), + LabelValuePair.weak("active", active), + LabelValuePair.weak("loaded", didLoad), + ]); + } + /** * PRIVATE HANDLERS - DO NOT TOUCH */ diff --git a/source/funkin/backend/scripting/ScriptPack.hx b/source/funkin/backend/scripting/ScriptPack.hx index 2105e2c6..33799690 100644 --- a/source/funkin/backend/scripting/ScriptPack.hx +++ b/source/funkin/backend/scripting/ScriptPack.hx @@ -1,5 +1,6 @@ package funkin.backend.scripting; +import flixel.util.FlxStringUtil; import funkin.backend.scripting.events.CancellableEvent; @:access(CancellableEvent) @@ -52,7 +53,8 @@ class ScriptPack extends Script { public override function call(func:String, ?parameters:Array):Dynamic { for(e in scripts) - e.call(func, parameters); + if(e.active) + e.call(func, parameters); return null; } @@ -64,8 +66,9 @@ class ScriptPack extends Script { */ public inline function event(func:String, event:T):T { for(e in scripts) { + if(!e.active) continue; + e.call(func, [event]); - @:privateAccess if (event.cancelled && !event.__continueCalls) break; } return event; @@ -95,7 +98,7 @@ class ScriptPack extends Script { public override function onDestroy() { for(e in scripts) e.destroy(); } - + public override function onCreate(path:String) {} public function add(script:Script) { @@ -117,4 +120,11 @@ class ScriptPack extends Script { script.setPublicMap(publicVariables); for(k=>e in additionalDefaultVariables) script.set(k, e); } + + override public function toString():String { + return FlxStringUtil.getDebugString([ + LabelValuePair.weak("parent", FlxStringUtil.getClassName(parent, true)), + LabelValuePair.weak("total", scripts.length), + ]); + } } \ No newline at end of file diff --git a/source/funkin/backend/scripting/events/CancellableEvent.hx b/source/funkin/backend/scripting/events/CancellableEvent.hx index 94bf066e..084ecba3 100644 --- a/source/funkin/backend/scripting/events/CancellableEvent.hx +++ b/source/funkin/backend/scripting/events/CancellableEvent.hx @@ -2,7 +2,7 @@ package funkin.backend.scripting.events; import flixel.util.FlxDestroyUtil.IFlxDestroyable; -@:allow(ScriptPack) +@:allow(funkin.backend.scripting.ScriptPack) @:autoBuild(funkin.backend.system.macros.EventMacro.build()) @:noCustomClass class CancellableEvent implements IFlxDestroyable { diff --git a/source/funkin/editors/charter/CharterStrumline.hx b/source/funkin/editors/charter/CharterStrumline.hx index 043b6890..889fbc0b 100644 --- a/source/funkin/editors/charter/CharterStrumline.hx +++ b/source/funkin/editors/charter/CharterStrumline.hx @@ -9,8 +9,8 @@ class CharterStrumline extends UISprite { public var strumLine:ChartStrumLine; public var hitsounds:Bool = true; - var healthIcon:HealthIcon; - var button:CharterStrumlineButton; + public var healthIcon:HealthIcon; + public var button:CharterStrumlineButton; public var curMenu:UIContextMenu = null; @@ -24,6 +24,9 @@ class CharterStrumline extends UISprite { healthIcon = new HealthIcon(strumLine.characters != null ? strumLine.characters[0] : null); healthIcon.scale.set(80 / 150, 80 / 150); healthIcon.updateHitbox(); + if(strumLine.visible == null) + strumLine.visible = true; + healthIcon.alpha = strumLine.visible ? 1 : 0.4; members.push(healthIcon); @@ -81,6 +84,15 @@ class CharterStrumlineButton extends UITopMenuButton { icon: strLine.strumLine.type == ADDITIONAL ? 1 : 0 }, null, + { + label: "Visible", + onSelect: function(_) { + strLine.strumLine.visible = !strLine.strumLine.visible; + strLine.healthIcon.alpha = strLine.strumLine.visible ? 1 : 0.4; + }, + icon: strLine.strumLine.visible ? 1 : 0 + }, + null, { label: "Hitsounds", onSelect: function(_) { diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 29e7ec26..b30d8a49 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -348,6 +348,11 @@ class PlayState extends MusicBeatState */ public var defaultCamZoom:Float = 1.05; + /** + * Camera zoom at which the hud lerps to. + */ + public var defaultHudZoom:Float = 1.0; + /** * Zoom for the pixel assets. */ @@ -658,6 +663,7 @@ class PlayState extends MusicBeatState FlxG.camera.follow(camFollow, LOCKON, 0.04); FlxG.camera.zoom = defaultCamZoom; + // camHUD.zoom = defaultHudZoom; if (smoothTransitionData != null && smoothTransitionData.stage == curStage) { FlxG.camera.scroll.set(smoothTransitionData.camX, smoothTransitionData.camY); FlxG.camera.zoom = smoothTransitionData.camZoom; @@ -1153,7 +1159,7 @@ class PlayState extends MusicBeatState if (camZooming) { FlxG.camera.zoom = lerp(FlxG.camera.zoom, defaultCamZoom, 0.05); - camHUD.zoom = lerp(camHUD.zoom, 1, 0.05); + camHUD.zoom = lerp(camHUD.zoom, defaultHudZoom, 0.05); } // RESET = Quick Game Over Screen