danoniplus 41.4.5 → 41.4.6
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 +36 -13
- 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/08/21
|
|
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.6`;
|
|
12
|
+
const g_revisedDate = `2025/08/21`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -717,6 +717,21 @@ const padArray = (_array, _baseArray) => {
|
|
|
717
717
|
return _baseArray;
|
|
718
718
|
};
|
|
719
719
|
|
|
720
|
+
/**
|
|
721
|
+
* ベース配列(_baseArray)の空要素のみ、別配列(_array)の対応要素で補完する(既存値は上書きしない)
|
|
722
|
+
* @param {string[]|number[]} _array 補完元(ソース)
|
|
723
|
+
* @param {string[]|number[]} _baseArray ベース(既存値を優先)
|
|
724
|
+
* @returns {string[]|number[]}
|
|
725
|
+
*/
|
|
726
|
+
const fillMissingArrayElem = (_array = [], _baseArray = []) => {
|
|
727
|
+
const maxLen = Math.max(_baseArray.length, _array.length);
|
|
728
|
+
const res = _baseArray.slice();
|
|
729
|
+
for (let j = 0; j < maxLen; j++) {
|
|
730
|
+
if (!hasVal(res[j]) && hasVal(_array[j])) res[j] = _array[j];
|
|
731
|
+
}
|
|
732
|
+
return res;
|
|
733
|
+
};
|
|
734
|
+
|
|
720
735
|
/**
|
|
721
736
|
* 配列から上位N番目までに一致する位置を取得
|
|
722
737
|
*
|
|
@@ -2610,6 +2625,9 @@ const initialControl = async () => {
|
|
|
2610
2625
|
g_stateObj.dosDivideFlg = setBoolVal(document.getElementById(`externalDosDivide`)?.value ?? getQueryParamVal(`dosDivide`));
|
|
2611
2626
|
g_stateObj.scoreLockFlg = setBoolVal(document.getElementById(`externalDosLock`)?.value ?? getQueryParamVal(`dosLock`));
|
|
2612
2627
|
|
|
2628
|
+
// 非分割時は resetGaugeSetting が全難易度を一括構築するため、初回のみで十分
|
|
2629
|
+
const loopCount = g_stateObj.dosDivideFlg ? g_headerObj.keyLabels.length : 1;
|
|
2630
|
+
|
|
2613
2631
|
for (let j = 0; j < g_headerObj.keyLabels.length; j++) {
|
|
2614
2632
|
|
|
2615
2633
|
// 譜面ファイルが分割されている場合、譜面詳細情報取得のために譜面をロード
|
|
@@ -2618,10 +2636,10 @@ const initialControl = async () => {
|
|
|
2618
2636
|
resetColorSetting(j);
|
|
2619
2637
|
}
|
|
2620
2638
|
getScoreDetailData(j);
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2639
|
+
if (j < loopCount) {
|
|
2640
|
+
// 分割時は各譜面ごとに上書き・補完、非分割時は初回のみ実行
|
|
2641
|
+
resetGaugeSetting(j);
|
|
2642
|
+
}
|
|
2625
2643
|
}
|
|
2626
2644
|
}
|
|
2627
2645
|
g_customJsObj.preTitle.forEach(func => func());
|
|
@@ -4401,7 +4419,9 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
4401
4419
|
obj.lifeInits[_scoreId] = _gaugeDetails[3];
|
|
4402
4420
|
|
|
4403
4421
|
if (gaugeUpdateFlg && hasVal(g_gaugeOptionObj[`gauge${_name}s`])) {
|
|
4404
|
-
|
|
4422
|
+
// ゲージ上書き時は_gaugeDetails(obj)の値を優先し、デフォルト値で穴埋めする
|
|
4423
|
+
Object.keys(obj).forEach(key => g_gaugeOptionObj[`gauge${_name}s`][key] =
|
|
4424
|
+
fillMissingArrayElem(g_gaugeOptionObj[`gauge${_name}s`][key] || [], obj[key]));
|
|
4405
4425
|
return false;
|
|
4406
4426
|
}
|
|
4407
4427
|
return true;
|
|
@@ -4415,9 +4435,12 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
4415
4435
|
*/
|
|
4416
4436
|
const getGaugeDetailList = (_scoreId, _defaultGaugeList) => {
|
|
4417
4437
|
if (_scoreId > 0) {
|
|
4418
|
-
const
|
|
4438
|
+
const idHeader = setScoreIdHeader(_scoreId, g_stateObj.scoreLockFlg);
|
|
4439
|
+
const dosId = (idHeader || 0) - 1;
|
|
4440
|
+
const headerName = `gauge${_name}${idHeader}`;
|
|
4419
4441
|
if (hasVal(_dosObj[headerName])) {
|
|
4420
|
-
|
|
4442
|
+
const gauges = splitLF2(_dosObj[headerName]);
|
|
4443
|
+
return (gauges[dosId] || gauges[0])?.split(`,`);
|
|
4421
4444
|
}
|
|
4422
4445
|
}
|
|
4423
4446
|
return _defaultGaugeList;
|
|
@@ -4425,12 +4448,12 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
4425
4448
|
|
|
4426
4449
|
if (hasVal(_dosObj[`gauge${_name}`])) {
|
|
4427
4450
|
|
|
4451
|
+
const gauges = splitLF2(_dosObj[`gauge${_name}`]);
|
|
4428
4452
|
if (gaugeUpdateFlg) {
|
|
4429
|
-
gaugeCreateFlg = setGaugeDetails(scoreId,
|
|
4453
|
+
gaugeCreateFlg = setGaugeDetails(scoreId, (gauges[scoreId] || gauges[0])?.split(`,`));
|
|
4430
4454
|
} else {
|
|
4431
|
-
const gauges = splitLF2(_dosObj[`gauge${_name}`]);
|
|
4432
4455
|
for (let j = 0; j < _difLength; j++) {
|
|
4433
|
-
gaugeCreateFlg = setGaugeDetails(j, getGaugeDetailList(j, (gauges[j]
|
|
4456
|
+
gaugeCreateFlg = setGaugeDetails(j, getGaugeDetailList(j, (gauges[j] || gauges[0]).split(`,`)));
|
|
4434
4457
|
}
|
|
4435
4458
|
}
|
|
4436
4459
|
|