Added a refresh assets button to audio UI to detect audio asset again. Usefull after download an asset or putting a file manually.
This commit is contained in:
parent
7e5bdb11a3
commit
1014d592f7
|
@ -563,6 +563,17 @@ jQuery(async () => {
|
||||||
|
|
||||||
$("#audio_bgm_cooldown").on("input", onBGMCooldownInput);
|
$("#audio_bgm_cooldown").on("input", onBGMCooldownInput);
|
||||||
|
|
||||||
|
// Reset assets container, will be redected like if ST restarted
|
||||||
|
$("#audio_refresh_assets").on("click", function(){
|
||||||
|
console.debug(DEBUG_PREFIX,"Refreshing audio assets");
|
||||||
|
fallback_BGMS = null;
|
||||||
|
ambients = null;
|
||||||
|
characterMusics = {};
|
||||||
|
currentCharacterBGM = null;
|
||||||
|
currentExpressionBGM = null;
|
||||||
|
currentBackground = null;
|
||||||
|
})
|
||||||
|
|
||||||
// DBG
|
// DBG
|
||||||
$("#audio_debug").on("click", function () {
|
$("#audio_debug").on("click", function () {
|
||||||
if ($("#audio_debug").is(':checked')) {
|
if ($("#audio_debug").is(':checked')) {
|
||||||
|
|
|
@ -14,4 +14,9 @@
|
||||||
|
|
||||||
.audio-mute-button-muted {
|
.audio-mute-button-muted {
|
||||||
color: red;
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#audio_refresh_assets {
|
||||||
|
width: 50px;
|
||||||
|
height: 30px;
|
||||||
}
|
}
|
|
@ -16,6 +16,12 @@
|
||||||
<small>Debug</small>
|
<small>Debug</small>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="audio_refresh_assets">Refresh assets</label>
|
||||||
|
<div id="audio_refresh_assets" class="menu_button">
|
||||||
|
<i class="fa-solid fa-refresh fa-lg"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -5070,13 +5070,13 @@ app.post('/asset_download', jsonParser, async (request, response) => {
|
||||||
const url = request.body.url;
|
const url = request.body.url;
|
||||||
const inputCategory = request.body.category;
|
const inputCategory = request.body.category;
|
||||||
const inputFilename = sanitize(request.body.filename);
|
const inputFilename = sanitize(request.body.filename);
|
||||||
const validCategories = ["bgm", "ambient"]
|
const validCategories = ["bgm", "ambient"];
|
||||||
|
|
||||||
// Check category
|
// Check category
|
||||||
let category = null
|
let category = null;
|
||||||
for (i of validCategories)
|
for (i of validCategories)
|
||||||
if (i == inputCategory)
|
if (i == inputCategory)
|
||||||
category = i
|
category = i;
|
||||||
|
|
||||||
if (category === null) {
|
if (category === null) {
|
||||||
console.debug("Bad request: unsuported asset category.");
|
console.debug("Bad request: unsuported asset category.");
|
||||||
|
|
Loading…
Reference in New Issue