danoniplus 41.4.2 → 41.4.4

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.
Files changed (2) hide show
  1. package/js/danoni_main.js +18 -8
  2. 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/05/23
7
+ * Revised : 2025/06/20
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 41.4.2`;
12
- const g_revisedDate = `2025/05/23`;
11
+ const g_version = `Ver 41.4.4`;
12
+ const g_revisedDate = `2025/06/20`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -5215,6 +5215,7 @@ const titleInit = (_initFlg = false) => {
5215
5215
  if (document.getElementById(`commentArea`) !== null) {
5216
5216
  commentArea.innerHTML = convCommentVal;
5217
5217
  }
5218
+ } else if (g_headerObj.musicSelectUse && getQueryParamVal(`scoreId`) === null) {
5218
5219
  } else {
5219
5220
  multiAppend(divRoot,
5220
5221
  createDivCss2Label(`lblComment`, convCommentVal, g_lblPosObj.lblComment),
@@ -5405,11 +5406,13 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5405
5406
  const FADE_INTERVAL_MS = 100;
5406
5407
  const FADE_DELAY_MS = 500;
5407
5408
 
5409
+ const currentIdx = g_headerObj.musicIdxList[g_settings.musicIdxNum];
5408
5410
  const musicUrl = getMusicUrl(g_headerObj.viewLists[0]);
5409
5411
  const url = getFullMusicUrl(musicUrl);
5410
5412
  const encodeFlg = listMatching(musicUrl, [`.js`, `.txt`], { suffix: `$` });
5411
- const musicStart = g_headerObj.musicStarts?.[g_headerObj.musicIdxList[g_settings.musicIdxNum]] ?? 0;
5412
- const musicEnd = g_headerObj.musicEnds?.[g_headerObj.musicIdxList[g_settings.musicIdxNum]] ?? 0;
5413
+ const musicStart = g_headerObj.musicStarts?.[currentIdx] ?? 0;
5414
+ const musicEnd = g_headerObj.musicEnds?.[currentIdx] ?? 0;
5415
+ const isTitle = () => g_currentPage === `title`;
5413
5416
 
5414
5417
  /**
5415
5418
  * BGMのフェードアウトとシーク
@@ -5417,7 +5420,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5417
5420
  const fadeOutAndSeek = () => {
5418
5421
  let volume = g_audio.volume;
5419
5422
  const fadeInterval = setInterval(() => {
5420
- if (volume > FADE_STEP && g_currentPage === `title`) {
5423
+ if (volume > FADE_STEP && isTitle()) {
5421
5424
  volume -= FADE_STEP;
5422
5425
  g_audio.volume = Math.max(volume, 0);
5423
5426
  } else {
@@ -5427,7 +5430,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5427
5430
  g_audio.currentTime = musicStart;
5428
5431
 
5429
5432
  // フェードイン開始
5430
- if (g_currentPage === `title`) {
5433
+ if (isTitle()) {
5431
5434
  setTimeout(() => {
5432
5435
  fadeIn();
5433
5436
  if (encodeFlg) {
@@ -5454,13 +5457,20 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5454
5457
  let volume = 0;
5455
5458
  g_audio.play();
5456
5459
  const fadeInterval = setInterval(() => {
5457
- if (volume < g_stateObj.bgmVolume / 100 && g_currentPage === `title`) {
5460
+ if (volume < g_stateObj.bgmVolume / 100 && isTitle()) {
5458
5461
  volume += FADE_STEP;
5459
5462
  g_audio.volume = Math.min(volume, 1);
5460
5463
  } else {
5461
5464
  clearInterval(fadeInterval);
5462
5465
  g_stateObj.bgmFadeIn = null;
5463
5466
  }
5467
+
5468
+ // フェードイン中に楽曲が変更された場合は停止
5469
+ if (currentIdx !== g_headerObj.musicIdxList[g_settings.musicIdxNum]) {
5470
+ pauseBGM();
5471
+ clearInterval(fadeInterval);
5472
+ g_stateObj.bgmFadeIn = null;
5473
+ }
5464
5474
  }, FADE_INTERVAL_MS);
5465
5475
  g_stateObj.bgmFadeIn = fadeInterval;
5466
5476
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "41.4.2",
3
+ "version": "41.4.4",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {