Cleaned up code
This commit is contained in:
@@ -106,11 +106,10 @@ class osu_parser
|
||||
continue; // this line has been analyzed
|
||||
}
|
||||
|
||||
if (mb_strpos($line, "//") === 0 || // the editor puts hella lot of comments in the files
|
||||
$section_type === false)
|
||||
if (!(mb_strpos($line, "//") === 0 || // the editor puts hella lot of comments in the files
|
||||
$section_type === false))
|
||||
{
|
||||
}
|
||||
else if ($section_type == "key-value pairs")
|
||||
if ($section_type == "key-value pairs")
|
||||
{
|
||||
// init empty array
|
||||
if (!isset($parsed[$current_section])) $parsed[$current_section] = array();
|
||||
@@ -144,9 +143,6 @@ class osu_parser
|
||||
|
||||
list($event_type, $source_files) = self::gather_source_files($list, $variables);
|
||||
|
||||
if ($event_type === false)
|
||||
{
|
||||
}
|
||||
else if ($event_type == "Background")
|
||||
{
|
||||
$parsed["background"] = $source_files[0] ?? "";
|
||||
@@ -155,7 +151,7 @@ class osu_parser
|
||||
{
|
||||
$parsed["video"] = $source_files[0] ?? "";
|
||||
}
|
||||
else
|
||||
else if ($event_type !== false)
|
||||
{
|
||||
// init empty array
|
||||
if (!isset($parsed["storyboard"])) $parsed["storyboard"] = array();
|
||||
@@ -208,6 +204,7 @@ class osu_parser
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($file); // remove the memory leak
|
||||
|
||||
// storyboards/hitsounds are overloaded with dupes (renumber to make json export to arrays)
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
<?php
|
||||
// todo: cleanup repacker
|
||||
// todo: cleanup cache
|
||||
// todo: cleanup db
|
||||
// todo: cleanup settings (full reset)
|
||||
// todo: whitelist / blacklist
|
||||
// todo: dupe checker
|
||||
// todo: stardiff deleter
|
||||
// todo: mode deleter
|
||||
|
||||
// git does not like empty folders
|
||||
if (!file_exists("session")) mkdir("session");
|
||||
@@ -33,7 +25,7 @@ $display = "start";
|
||||
|
||||
if (isset($_GET["settings"]) || empty($settings->get_osu_path()))
|
||||
{
|
||||
// $display = "start";
|
||||
$display = "start";
|
||||
}
|
||||
else if (isset($_GET["cleanup"]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user