danoniplus 42.2.1 → 42.2.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 +34 -16
- 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/06/
|
|
8
|
-
*
|
|
7
|
+
* Revised : 2025/06/20
|
|
8
|
+
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 42.2.
|
|
12
|
-
const g_revisedDate = `2025/06/
|
|
11
|
+
const g_version = `Ver 42.2.3`;
|
|
12
|
+
const g_revisedDate = `2025/06/20`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -5088,7 +5088,7 @@ const titleInit = (_initFlg = false) => {
|
|
|
5088
5088
|
changeMSelect(Math.floor(Math.random() * (g_headerObj.musicIdxList.length - 1)) + 1),
|
|
5089
5089
|
g_lblPosObj.btnMusicSelectRandom, g_cssObj.button_Default),
|
|
5090
5090
|
createDivCss2Label(`lblMusicCnt`, ``, g_lblPosObj.lblMusicCnt),
|
|
5091
|
-
createDivCss2Label(`
|
|
5091
|
+
createDivCss2Label(`lblCommentM`, ``, g_lblPosObj.lblComment_music),
|
|
5092
5092
|
|
|
5093
5093
|
createDivCss2Label(`lblBgmVolume`, `BGM Volume`, g_lblPosObj.lblBgmVolume),
|
|
5094
5094
|
createCss2Button(`btnBgmMute`, g_stateObj.bgmMuteFlg ? g_emojiObj.muted : g_emojiObj.speaker, evt => {
|
|
@@ -5110,14 +5110,17 @@ const titleInit = (_initFlg = false) => {
|
|
|
5110
5110
|
let wheelCnt = 0;
|
|
5111
5111
|
wheelHandler = g_handler.addListener(divRoot, `wheel`, e => {
|
|
5112
5112
|
|
|
5113
|
-
|
|
5114
|
-
|
|
5113
|
+
if (document.getElementById(`lblComment`) !== null && lblComment.style.display === C_DIS_INHERIT) {
|
|
5114
|
+
return;
|
|
5115
|
+
}
|
|
5116
|
+
// コメント欄(lblCommentM)のスクロール可能性をチェック
|
|
5117
|
+
const isScrollable = lblCommentM.scrollHeight > lblCommentM.clientHeight;
|
|
5115
5118
|
|
|
5116
5119
|
// マウスがコメント欄上にあり、スクロールが可能ならイベントをスキップ
|
|
5117
|
-
if (
|
|
5120
|
+
if (lblCommentM.contains(e.target) && isScrollable) {
|
|
5118
5121
|
// スクロール位置の判定
|
|
5119
|
-
const atTop =
|
|
5120
|
-
const atBottom = (
|
|
5122
|
+
const atTop = lblCommentM.scrollTop === 0 && e.deltaY < 0;
|
|
5123
|
+
const atBottom = (lblCommentM.scrollTop + lblCommentM.clientHeight >= lblCommentM.scrollHeight) && e.deltaY > 0;
|
|
5121
5124
|
|
|
5122
5125
|
// スクロール可能&上端または下端ではないなら処理をスキップ
|
|
5123
5126
|
if (!atTop && !atBottom) {
|
|
@@ -5286,6 +5289,9 @@ const titleInit = (_initFlg = false) => {
|
|
|
5286
5289
|
lblComment.style.display = (lblCommentDef === C_DIS_NONE ? C_DIS_INHERIT : C_DIS_NONE);
|
|
5287
5290
|
}, g_lblPosObj.btnComment, g_cssObj.button_Default),
|
|
5288
5291
|
);
|
|
5292
|
+
if (g_headerObj.musicSelectUse && getQueryParamVal(`scoreId`) === null) {
|
|
5293
|
+
lblComment.style.height = `${g_sHeight - 100}px`;
|
|
5294
|
+
}
|
|
5289
5295
|
setUserSelect(lblComment.style, `text`);
|
|
5290
5296
|
}
|
|
5291
5297
|
}
|
|
@@ -5468,11 +5474,13 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5468
5474
|
const FADE_INTERVAL_MS = 100;
|
|
5469
5475
|
const FADE_DELAY_MS = 500;
|
|
5470
5476
|
|
|
5477
|
+
const currentIdx = g_headerObj.musicIdxList[g_settings.musicIdxNum];
|
|
5471
5478
|
const musicUrl = getMusicUrl(g_headerObj.viewLists[0]);
|
|
5472
5479
|
const url = getFullMusicUrl(musicUrl);
|
|
5473
5480
|
const encodeFlg = listMatching(musicUrl, [`.js`, `.txt`], { suffix: `$` });
|
|
5474
|
-
const musicStart = g_headerObj.musicStarts?.[
|
|
5475
|
-
const musicEnd = g_headerObj.musicEnds?.[
|
|
5481
|
+
const musicStart = g_headerObj.musicStarts?.[currentIdx] ?? 0;
|
|
5482
|
+
const musicEnd = g_headerObj.musicEnds?.[currentIdx] ?? 0;
|
|
5483
|
+
const isTitle = () => g_currentPage === `title`;
|
|
5476
5484
|
|
|
5477
5485
|
/**
|
|
5478
5486
|
* BGMのフェードアウトとシーク
|
|
@@ -5480,7 +5488,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5480
5488
|
const fadeOutAndSeek = () => {
|
|
5481
5489
|
let volume = g_audio.volume;
|
|
5482
5490
|
const fadeInterval = setInterval(() => {
|
|
5483
|
-
if (volume > FADE_STEP &&
|
|
5491
|
+
if (volume > FADE_STEP && isTitle()) {
|
|
5484
5492
|
volume -= FADE_STEP;
|
|
5485
5493
|
g_audio.volume = Math.max(volume, 0);
|
|
5486
5494
|
} else {
|
|
@@ -5490,7 +5498,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5490
5498
|
g_audio.currentTime = musicStart;
|
|
5491
5499
|
|
|
5492
5500
|
// フェードイン開始
|
|
5493
|
-
if (
|
|
5501
|
+
if (isTitle()) {
|
|
5494
5502
|
setTimeout(() => {
|
|
5495
5503
|
fadeIn();
|
|
5496
5504
|
if (encodeFlg) {
|
|
@@ -5517,13 +5525,20 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5517
5525
|
let volume = 0;
|
|
5518
5526
|
g_audio.play();
|
|
5519
5527
|
const fadeInterval = setInterval(() => {
|
|
5520
|
-
if (volume < g_stateObj.bgmVolume / 100 &&
|
|
5528
|
+
if (volume < g_stateObj.bgmVolume / 100 && isTitle()) {
|
|
5521
5529
|
volume += FADE_STEP;
|
|
5522
5530
|
g_audio.volume = Math.min(volume, 1);
|
|
5523
5531
|
} else {
|
|
5524
5532
|
clearInterval(fadeInterval);
|
|
5525
5533
|
g_stateObj.bgmFadeIn = null;
|
|
5526
5534
|
}
|
|
5535
|
+
|
|
5536
|
+
// フェードイン中に楽曲が変更された場合は停止
|
|
5537
|
+
if (currentIdx !== g_headerObj.musicIdxList[g_settings.musicIdxNum]) {
|
|
5538
|
+
pauseBGM();
|
|
5539
|
+
clearInterval(fadeInterval);
|
|
5540
|
+
g_stateObj.bgmFadeIn = null;
|
|
5541
|
+
}
|
|
5527
5542
|
}, FADE_INTERVAL_MS);
|
|
5528
5543
|
g_stateObj.bgmFadeIn = fadeInterval;
|
|
5529
5544
|
};
|
|
@@ -5612,6 +5627,9 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5612
5627
|
* @param {boolean} _initFlg
|
|
5613
5628
|
*/
|
|
5614
5629
|
const changeMSelect = (_num, _initFlg = false) => {
|
|
5630
|
+
if (document.getElementById(`lblComment`) !== null && lblComment.style.display === C_DIS_INHERIT) {
|
|
5631
|
+
return;
|
|
5632
|
+
}
|
|
5615
5633
|
const limitedMLength = 35;
|
|
5616
5634
|
pauseBGM();
|
|
5617
5635
|
|
|
@@ -5685,7 +5703,7 @@ const changeMSelect = (_num, _initFlg = false) => {
|
|
|
5685
5703
|
}
|
|
5686
5704
|
|
|
5687
5705
|
// コメント文の加工
|
|
5688
|
-
|
|
5706
|
+
lblCommentM.innerHTML = convertStrToVal(g_headerObj[`commentVal${g_settings.musicIdxNum}`]);
|
|
5689
5707
|
|
|
5690
5708
|
// BGM再生処理
|
|
5691
5709
|
if (!g_stateObj.bgmMuteFlg) {
|