Skip to content

Commit 1c0e14e

Browse files
committed
Fixed beatmaps using AudioLeadIn not starting at the correct time
1 parent d0c757f commit 1c0e14e

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

com/clubpenguin/games/dancing/GameEngine.as

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@
265265
SHELL = _global.getCurrentShell();
266266
} // end if
267267
com.clubpenguin.games.dancing.GameEngine.SHELL.stopMusic();
268-
_global.AudioFilename.start();
268+
//_global.AudioFilename.start();
269+
var timer = setInterval(function () {_global.AudioFilename.start(); clearInterval(timer)}, _global.AudioLeadIn);
269270
this.handleScoreUpdate(Number.MAX_VALUE);
270271
isPlayingGame = true;
271272
isDancing = true;

com/clubpenguin/games/dancing/MenuSystem.as

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,13 @@ class com.clubpenguin.games.dancing.MenuSystem
617617
_global.noteLengths = result_lv.noteLengths.split(',');
618618
var AudioFilename2 = result_lv.AudioFilename;
619619
_global.playtime_seconds = result_lv.playtime_seconds;
620+
_global.AudioLeadIn = 0;
621+
if (result_lv.AudioLeadIn != null)
622+
{
623+
_global.AudioLeadIn = result_lv.AudioLeadIn;
624+
}
620625
trace(_global.AudioFilename);
626+
trace(_global.AudioLeadIn);
621627
trace("playtime_seconds " + _global.playtime_seconds);
622628
_global.AudioFilename = new Sound();
623629
_global.AudioFilename.onLoad = function () {

convert_osu!_to_DC.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
include("getid3/getid3.php");
3-
// $fileName = '1196084 Usada Pekora - Discommunication Alien.osz';
3+
// $fileName = '404318 Waterflame - Electroman Adventures.osz';
44
$fileName = $_GET["fileName"];
5-
// $chart = 'Usada Pekora - Discommunication Alien (LLENN-) [Easy]';
5+
// $chart = 'Waterflame - Electroman Adventures (rinaldi28) [EZ]';
66
$chart = $_GET["chart"];
77
echo $fileName;
88
echo $chart;
99
$file = "./tmp/" . $fileName;
1010
$zip = new ZipArchive;
1111
$res = $zip->open($file);
12-
$AudioLeadIn = 0;
12+
$audioLeadIn = 0;
1313
if ($res === TRUE) {
1414
$result = file('zip://' . realpath($file) . '#' . $chart . '.osu');
1515
$result_GC = file_get_contents('zip://' . realpath($file) . '#' . $chart . '.osu');
@@ -34,7 +34,7 @@
3434
}
3535
if(trim($tempExplodeVar[0]) == 'AudioLeadIn')
3636
{
37-
$AudioLeadIn = trim(end($tempExplodeVar));
37+
$audioLeadIn = trim(end($tempExplodeVar));
3838
}
3939
}
4040
}
@@ -48,7 +48,7 @@
4848

4949
$numLists = interpret_numbers_list($noteData);
5050
// print_r($numLists[0][0]);
51-
handle_number_lists($numLists);
51+
handle_number_lists($numLists, $audioLeadIn);
5252
// print_r($GLOBALS[0]);
5353
$outputdata = format_output_lines();
5454
// file_put_contents('output.txt', print_r($outputdata, true));
@@ -92,8 +92,8 @@ function handle_first_number($num) {
9292
break;
9393
}
9494
}
95-
function handle_third_number($num) {
96-
write_to_line(1, strval($num + intval($AudioLeadIn)));
95+
function handle_third_number($num, $audioLeadIn) {
96+
write_to_line(1, strval($num + intval($audioLeadIn)));
9797
}
9898
function handle_fourth_and_fifth_number($third_num,$fourth_num,$sixth_num) {
9999
if (($fourth_num == 128)) {
@@ -104,10 +104,10 @@ function handle_fourth_and_fifth_number($third_num,$fourth_num,$sixth_num) {
104104
}
105105
}
106106

107-
function handle_number_lists($numLists) {
107+
function handle_number_lists($numLists, $audioLeadIn) {
108108
foreach($numLists as $numList) {
109109
handle_first_number($numList[0]);
110-
handle_third_number($numList[2]);
110+
handle_third_number($numList[2], $audioLeadIn);
111111
handle_fourth_and_fifth_number($numList[2], $numList[3], $numList[5]);
112112
}
113113
}

~dance.swf

84 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)