Skip to content

Commit 1ca98b3

Browse files
authored
Add LoopTime to CoolUtil.playMusic ini Files (#673)
* Update CoolUtil.hx * Update CoolUtil.hx * realized i like it in sec more than ms
1 parent 291c1d2 commit 1ca98b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/funkin/backend/utils/CoolUtil.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,14 @@ class CoolUtil
389389
if (Assets.exists(infoPath)) {
390390
var musicInfo = IniUtil.parseAsset(infoPath, [
391391
"BPM" => null,
392-
"TimeSignature" => "4/4"
392+
"TimeSignature" => "4/4",
393+
"LoopTime" => "0.0"
393394
]);
394395

396+
397+
if (FlxG.sound.music != null) {
398+
FlxG.sound.music.loopTime = Std.parseFloat(musicInfo["LoopTime"]) * 1000;
399+
}
395400
var timeSignParsed:Array<Null<Float>> = musicInfo["TimeSignature"] == null ? [] : [for(s in musicInfo["TimeSignature"].split("/")) Std.parseFloat(s)];
396401
var beatsPerMeasure:Float = 4;
397402
var stepsPerBeat:Float = 4;

0 commit comments

Comments
 (0)