From af53748f380e19b220ce03801ebcf9247439505a Mon Sep 17 00:00:00 2001 From: ADA_Funni Date: Tue, 28 Jul 2026 00:10:04 +0100 Subject: [PATCH] General future proofing + improvements --- .vscode/settings.json | 1 + hmm.json | 27 ++++++++++++----------- src/funkin/Conductor.hx | 8 +++---- src/funkin/ui/FunkinScene.hx | 4 ++-- src/funkin/ui/title/TitleScene.hx | 36 +++++++++++++++++++++++++------ 5 files changed, 51 insertions(+), 25 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index fdc900d..aa3f234 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -25,6 +25,7 @@ }, "editor.tabSize": 2 }, + "haxe.exclude": ["polymod"], "haxe.enableExtendedIndentation": true, "haxe.configurations": [["build/hl/debug.hxml"], ["build/hl/release.hxml"]], diff --git a/hmm.json b/hmm.json index 7401e4e..62a2b2e 100644 --- a/hmm.json +++ b/hmm.json @@ -2,36 +2,39 @@ "dependencies": [ { "name": "format", - "type": "haxelib", - "version": "3.8.0" + "type": "git", + "dir": null, + "ref": "9d69fb342d030fa120d2deafafbbffad248332b8", + "url": "https://github.com/HaxeFoundation/format" }, { "name": "hashlink", "type": "git", "dir": "other/haxelib", - "ref": "b44a11a755e85bd04baf5d2bb053dfdbdda8e25d", + "ref": "9b9b9d31572d2bacadf8ea32480c7fb88b4fc662", "url": "https://github.com/HaxeFoundation/hashlink" }, { "name": "heaps", "type": "git", "dir": null, - "ref": "e458125e740909b7aedeb1be88d946af57b0b81c", + "ref": "0c5b02f4e601868b9e1d8a9b4bd1c9b3bb2216b4", "url": "https://github.com/HeapsIO/heaps" }, + { + "name": "hldx", + "path": ".haxelib/hashlink/git/libs/directx", + "type": "dev" + }, { "name": "hlopenal", - "type": "git", - "dir": "libs/openal", - "ref": "b44a11a755e85bd04baf5d2bb053dfdbdda8e25d", - "url": "https://github.com/HaxeFoundation/hashlink" + "path": ".haxelib/hashlink/git/libs/openal", + "type": "dev" }, { "name": "hlsdl", - "type": "git", - "dir": "libs/sdl", - "ref": "b44a11a755e85bd04baf5d2bb053dfdbdda8e25d", - "url": "https://github.com/HaxeFoundation/hashlink" + "path": ".haxelib/hashlink/git/libs/sdl", + "type": "dev" }, { "name": "hxcpp", diff --git a/src/funkin/Conductor.hx b/src/funkin/Conductor.hx index 773d367..69c65a9 100644 --- a/src/funkin/Conductor.hx +++ b/src/funkin/Conductor.hx @@ -101,7 +101,7 @@ class Conductor measureHit = new SignalVoid>(); changeBPM(100); - time = 0; + time = -1; } /** @@ -325,9 +325,9 @@ class Conductor function set_time(value:Float):Float { - var oldStep:Int = curStep; - var oldBeat:Int = curBeat; - var oldMeasure:Int = curMeasure; + final oldStep:Int = curStep; + final oldBeat:Int = curBeat; + final oldMeasure:Int = curMeasure; time = value; diff --git a/src/funkin/ui/FunkinScene.hx b/src/funkin/ui/FunkinScene.hx index 207a7c4..1c0809e 100644 --- a/src/funkin/ui/FunkinScene.hx +++ b/src/funkin/ui/FunkinScene.hx @@ -40,13 +40,13 @@ class FunkinScene extends Scene implements IEventDispatcher function beatHit():Void { - final event:ConductorEvent = new ConductorEvent(STEP, Conductor.instance); + final event:ConductorEvent = new ConductorEvent(BEAT, Conductor.instance); dispatchFunkinEvent(event); } function measureHit():Void { - final event:ConductorEvent = new ConductorEvent(STEP, Conductor.instance); + final event:ConductorEvent = new ConductorEvent(MEASURE, Conductor.instance); dispatchFunkinEvent(event); } } diff --git a/src/funkin/ui/title/TitleScene.hx b/src/funkin/ui/title/TitleScene.hx index d41ba37..d032e1a 100644 --- a/src/funkin/ui/title/TitleScene.hx +++ b/src/funkin/ui/title/TitleScene.hx @@ -1,7 +1,19 @@ package funkin.ui.title; +import hxd.Event; +import hxd.Key; + +enum TitleState +{ + Intro; + Idle; + Begin; +} + class TitleScene extends FunkinScene { + public var state:TitleState = Intro; + /** * The sprite containing GF bopping to the beat. */ @@ -46,6 +58,23 @@ class TitleScene extends FunkinScene titleText.animation.addByPrefix('idle', 'Press Enter to Begin', 24, true); titleText.animation.play('idle'); addChild(titleText); + + state = Idle; + + addEventListener(event -> + { + if (event.kind == EKeyDown && event.keyCode == Key.ENTER) + pressEnter(); + }); + } + + public function pressEnter() + { + if (state == Begin) + return; + state = Begin; + + trace("entr"); } override function beatHit():Void @@ -64,10 +93,3 @@ class TitleScene extends FunkinScene super.sync(ctx); } } - -enum TitleState -{ - Intro; - Idle; - Begin; -}