More detailed actions

This commit is contained in:
2020-12-29 02:57:47 +01:00
parent fe5184abdc
commit 2f4d157dae
2 changed files with 23 additions and 10 deletions
+21 -8
View File
@@ -130,17 +130,17 @@ if ($display == "main")
$options = array( $options = array(
[ "./?settings", "Settings", "Go back to the setup/settings screen." ], [ "./?settings", "Settings", "Go back to the setup/settings screen." ],
[ "./?scan", "Scan", "Only scan for changes." ], [ "./?scan", "Scan", "Only scan for changes.", "Scan" ],
[ "./?rescan", "Force rescan", "Fully rescan the library. <i>(cached)</i>" ], [ "./?rescan", "Force rescan", "Fully rescan the library. <i>(cached)</i>", "Rescan", "Slow" ],
[ "./?blacken", "Remove backgrounds", "Replace the background files with 1x1 black images." ], [ "./?blacken", "Remove backgrounds", "Replace the background files with 1x1 black images." ],
[ "./?novid", "Remove videos", "" ], [ "./?novid", "Remove videos", "" ],
[ "./?nosb", "Remove storyboards", "" ], [ "./?nosb", "Remove storyboards", "" ],
[ "./?noskin", "Remove beatmap skins", "Does not remove hitsounds &amp; storyboard elements." ], [ "./?noskin", "Remove beatmap skins", "Does not remove hitsounds &amp; storyboard elements.", null, "Slow" ],
[ "./?nohit", "Remove custom hitsounds", "Does not remove storyboard elements." ], [ "./?nohit", "Remove custom hitsounds", "Does not remove storyboard elements.", null, "Slow" ],
[ "./?purify", "Remove junk files", "Remove everything that isn't referenced in .osu or .osb files." ], [ "./?purify", "Remove junk files", "Remove everything that isn't referenced in .osu or .osb files.", null, "Very slow" ],
[ "./?nuke", "NUKE", "Remove everything that isn't .osu or a referenced audio/background file. Note: old/bad maps might lose vital elements!" ], [ "./?nuke", "NUKE", "Remove everything that isn't .osu or a referenced audio/background file. Note: old/bad maps might lose vital elements!" ],
[ "./?warn=repack&forward=" . urlencode("./?repack&all"), "Repack all", "Repack all maps to .osz files. Note: you should not share exported maps; always use official osu! links." ], [ "./?warn=repack&forward=" . urlencode("./?repack&all"), "Repack all", "Repack all maps to .osz files. Note: you should not share exported maps; always use official osu! links.", "Repack ALL", "EXTREMELY slow" ],
[ "./splitter.php?page=1", "Explore", "TBD" ], [ "./splitter.php?page=1", "TBD", null, "Explore" ],
); );
$parse_time = 0; $parse_time = 0;
@@ -163,12 +163,25 @@ if ($display == "main")
$te->set_block("MAIN_PARSE_TIME", $parse_time); $te->set_block("MAIN_PARSE_TIME", $parse_time);
$te->set_block("MAIN_SCAN_TIME", $scan_time); $te->set_block("MAIN_SCAN_TIME", $scan_time);
foreach ($options as list($link, $name, $description)) foreach ($options as $option)
{ {
$link = $option[0] ?? "#";
$name = $option[1] ?? "Unnamed action";
$description = $option[2] ?? "";
$button = $option[3] ?? "Do it!";
$name_note = $option[4] ?? "";
$link_note = $option[5] ?? "";
if (!empty($name_note)) $name_note = "({$name_note})";
if (!empty($link_note)) $link_note = "({$link_note})";
$te->append_argumented_block("MAIN_OPTIONS", "MAIN_OPTION", [ $te->append_argumented_block("MAIN_OPTIONS", "MAIN_OPTION", [
"MAIN_OPTION_LINK" => $link, "MAIN_OPTION_LINK" => $link,
"MAIN_OPTION_NAME" => $name, "MAIN_OPTION_NAME" => $name,
"MAIN_OPTION_DESCRIPTION" => $description, "MAIN_OPTION_DESCRIPTION" => $description,
"MAIN_OPTION_NAME_NOTE" => $name_note,
"MAIN_OPTION_LINK_NOTE" => $link_note,
"MAIN_OPTION_BUTTON" => $button,
]); ]);
} }
+2 -2
View File
@@ -1,5 +1,5 @@
<div class="option"> <div class="option">
<p class="option-title"><b>{{ MAIN_OPTION_NAME }}</b></p> <p class="option-title"><b>{{ MAIN_OPTION_NAME }}</b> <i>{{ MAIN_OPTION_NAME_NOTE }}</i></p>
<p class="option-description">{{ MAIN_OPTION_DESCRIPTION }}</p> <p class="option-description">{{ MAIN_OPTION_DESCRIPTION }}</p>
<p class="option-link-spacer"><br /></p><p class="option-link"><a href="{{ MAIN_OPTION_LINK }}">[ Do it! ]</a></p> <p class="option-link-spacer"><br /></p><p class="option-link">{{ MAIN_OPTION_LINK_NOTE }}<a href="{{ MAIN_OPTION_LINK }}">[ {{ MAIN_OPTION_BUTTON }} ]</a></p>
</div> </div>