danoniplus 41.4.2 → 41.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/danoni_main.js +17 -8
- package/package.json +1 -1
package/js/danoni_main.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Source by tickle
|
|
6
6
|
* Created : 2018/10/08
|
|
7
|
-
* Revised : 2025/
|
|
7
|
+
* Revised : 2025/06/18
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 41.4.
|
|
12
|
-
const g_revisedDate = `2025/
|
|
11
|
+
const g_version = `Ver 41.4.3`;
|
|
12
|
+
const g_revisedDate = `2025/06/18`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -5405,11 +5405,13 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5405
5405
|
const FADE_INTERVAL_MS = 100;
|
|
5406
5406
|
const FADE_DELAY_MS = 500;
|
|
5407
5407
|
|
|
5408
|
+
const currentIdx = g_headerObj.musicIdxList[g_settings.musicIdxNum];
|
|
5408
5409
|
const musicUrl = getMusicUrl(g_headerObj.viewLists[0]);
|
|
5409
5410
|
const url = getFullMusicUrl(musicUrl);
|
|
5410
5411
|
const encodeFlg = listMatching(musicUrl, [`.js`, `.txt`], { suffix: `$` });
|
|
5411
|
-
const musicStart = g_headerObj.musicStarts?.[
|
|
5412
|
-
const musicEnd = g_headerObj.musicEnds?.[
|
|
5412
|
+
const musicStart = g_headerObj.musicStarts?.[currentIdx] ?? 0;
|
|
5413
|
+
const musicEnd = g_headerObj.musicEnds?.[currentIdx] ?? 0;
|
|
5414
|
+
const isTitle = () => g_currentPage === `title`;
|
|
5413
5415
|
|
|
5414
5416
|
/**
|
|
5415
5417
|
* BGMのフェードアウトとシーク
|
|
@@ -5417,7 +5419,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5417
5419
|
const fadeOutAndSeek = () => {
|
|
5418
5420
|
let volume = g_audio.volume;
|
|
5419
5421
|
const fadeInterval = setInterval(() => {
|
|
5420
|
-
if (volume > FADE_STEP &&
|
|
5422
|
+
if (volume > FADE_STEP && isTitle()) {
|
|
5421
5423
|
volume -= FADE_STEP;
|
|
5422
5424
|
g_audio.volume = Math.max(volume, 0);
|
|
5423
5425
|
} else {
|
|
@@ -5427,7 +5429,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5427
5429
|
g_audio.currentTime = musicStart;
|
|
5428
5430
|
|
|
5429
5431
|
// フェードイン開始
|
|
5430
|
-
if (
|
|
5432
|
+
if (isTitle()) {
|
|
5431
5433
|
setTimeout(() => {
|
|
5432
5434
|
fadeIn();
|
|
5433
5435
|
if (encodeFlg) {
|
|
@@ -5454,13 +5456,20 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5454
5456
|
let volume = 0;
|
|
5455
5457
|
g_audio.play();
|
|
5456
5458
|
const fadeInterval = setInterval(() => {
|
|
5457
|
-
if (volume < g_stateObj.bgmVolume / 100 &&
|
|
5459
|
+
if (volume < g_stateObj.bgmVolume / 100 && isTitle()) {
|
|
5458
5460
|
volume += FADE_STEP;
|
|
5459
5461
|
g_audio.volume = Math.min(volume, 1);
|
|
5460
5462
|
} else {
|
|
5461
5463
|
clearInterval(fadeInterval);
|
|
5462
5464
|
g_stateObj.bgmFadeIn = null;
|
|
5463
5465
|
}
|
|
5466
|
+
|
|
5467
|
+
// フェードイン中に楽曲が変更された場合は停止
|
|
5468
|
+
if (currentIdx !== g_headerObj.musicIdxList[g_settings.musicIdxNum]) {
|
|
5469
|
+
pauseBGM();
|
|
5470
|
+
clearInterval(fadeInterval);
|
|
5471
|
+
g_stateObj.bgmFadeIn = null;
|
|
5472
|
+
}
|
|
5464
5473
|
}, FADE_INTERVAL_MS);
|
|
5465
5474
|
g_stateObj.bgmFadeIn = fadeInterval;
|
|
5466
5475
|
};
|