From f36e50c1c73b5eb9406e94445fa1a4e17989e032 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Wed, 2 Nov 2022 03:19:10 +0100 Subject: [PATCH] standalone conductor part 2 --- buildnumber.txt | 2 +- source/funkin/system/MusicBeatState.hx | 36 +++++++++++++++-------- source/funkin/system/MusicBeatSubstate.hx | 25 +++++++++++++--- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index 25c83294..8f32b0ba 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -968 \ No newline at end of file +969 \ No newline at end of file diff --git a/source/funkin/system/MusicBeatState.hx b/source/funkin/system/MusicBeatState.hx index 28d13c36..98c2ecef 100644 --- a/source/funkin/system/MusicBeatState.hx +++ b/source/funkin/system/MusicBeatState.hx @@ -16,36 +16,48 @@ class MusicBeatState extends FlxUIState implements IBeatReceiver private var lastBeat:Float = 0; private var lastStep:Float = 0; + /** + * Whenever the Conductor auto update should be enabled or not. + */ + public var cancelConductorUpdate:Bool = false; + /** * Current step */ - public var curStep:Int = 0; - + public var curStep(get, never):Int; /** * Current beat */ - public var curBeat:Int = 0; - - + public var curBeat(get, never):Int; /** * Current step, as a `Float` (ex: 4.94, instead of 4) */ - public var curStepFloat:Float = 0; - + public var curStepFloat(get, never):Float; /** * Current beat, as a `Float` (ex: 1.24, instead of 1) */ - public var curBeatFloat:Float = 0; + public var curBeatFloat(get, never):Float; + /** + * Current song position (in milliseconds). + */ + public var songPos(get, never):Float; + + inline function get_curStep():Int + return Conductor.curStep; + inline function get_curBeat():Int + return Conductor.curBeat; + inline function get_curStepFloat():Float + return Conductor.curStepFloat; + inline function get_curBeatFloat():Float + return Conductor.curBeatFloat; + inline function get_songPos():Float + return Conductor.songPosition; /** * Game Controls. */ public var controls(get, never):Controls; - /** - * Whenever the Conductor auto update should be enabled or not. - */ - public var cancelConductorUpdate:Bool = false; inline function get_controls():Controls return PlayerSettings.player1.controls; diff --git a/source/funkin/system/MusicBeatSubstate.hx b/source/funkin/system/MusicBeatSubstate.hx index a26d11f0..cb21884f 100644 --- a/source/funkin/system/MusicBeatSubstate.hx +++ b/source/funkin/system/MusicBeatSubstate.hx @@ -18,22 +18,39 @@ class MusicBeatSubstate extends FlxSubState implements IBeatReceiver private var lastBeat:Float = 0; private var lastStep:Float = 0; + /** * Current step */ - public var curStep:Int = 0; + public var curStep(get, never):Int; /** * Current beat */ - public var curBeat:Int = 0; + public var curBeat(get, never):Int; /** * Current step, as a `Float` (ex: 4.94, instead of 4) */ - public var curStepFloat:Float = 0; + public var curStepFloat(get, never):Float; /** * Current beat, as a `Float` (ex: 1.24, instead of 1) */ - public var curBeatFloat:Float = 0; + public var curBeatFloat(get, never):Float; + /** + * Current song position (in milliseconds). + */ + public var songPos(get, never):Float; + + inline function get_curStep():Int + return Conductor.curStep; + inline function get_curBeat():Int + return Conductor.curBeat; + inline function get_curStepFloat():Float + return Conductor.curStepFloat; + inline function get_curBeatFloat():Float + return Conductor.curBeatFloat; + inline function get_songPos():Float + return Conductor.songPosition; + /** * Game Controls. */