danoniplus 39.8.4 → 39.8.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 +37 -14
- 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 39.8.
|
|
12
|
-
const g_revisedDate = `2025/
|
|
11
|
+
const g_version = `Ver 39.8.6`;
|
|
12
|
+
const g_revisedDate = `2025/08/21`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -575,6 +575,21 @@ const padArray = (_array, _baseArray) => {
|
|
|
575
575
|
return _baseArray;
|
|
576
576
|
};
|
|
577
577
|
|
|
578
|
+
/**
|
|
579
|
+
* ベース配列(_baseArray)の空要素のみ、別配列(_array)の対応要素で補完する(既存値は上書きしない)
|
|
580
|
+
* @param {string[]|number[]} _array 補完元(ソース)
|
|
581
|
+
* @param {string[]|number[]} _baseArray ベース(既存値を優先)
|
|
582
|
+
* @returns {string[]|number[]}
|
|
583
|
+
*/
|
|
584
|
+
const fillMissingArrayElem = (_array = [], _baseArray = []) => {
|
|
585
|
+
const maxLen = Math.max(_baseArray.length, _array.length);
|
|
586
|
+
const res = _baseArray.slice();
|
|
587
|
+
for (let j = 0; j < maxLen; j++) {
|
|
588
|
+
if (!hasVal(res[j]) && hasVal(_array[j])) res[j] = _array[j];
|
|
589
|
+
}
|
|
590
|
+
return res;
|
|
591
|
+
};
|
|
592
|
+
|
|
578
593
|
/**
|
|
579
594
|
* 配列から上位N番目までに一致する位置を取得
|
|
580
595
|
*
|
|
@@ -2438,6 +2453,9 @@ const initialControl = async () => {
|
|
|
2438
2453
|
g_stateObj.dosDivideFlg = setBoolVal(document.getElementById(`externalDosDivide`)?.value ?? getQueryParamVal(`dosDivide`));
|
|
2439
2454
|
g_stateObj.scoreLockFlg = setBoolVal(document.getElementById(`externalDosLock`)?.value ?? getQueryParamVal(`dosLock`));
|
|
2440
2455
|
|
|
2456
|
+
// 非分割時は resetGaugeSetting が全難易度を一括構築するため、初回のみで十分
|
|
2457
|
+
const loopCount = g_stateObj.dosDivideFlg ? g_headerObj.keyLabels.length : 1;
|
|
2458
|
+
|
|
2441
2459
|
for (let j = 0; j < g_headerObj.keyLabels.length; j++) {
|
|
2442
2460
|
|
|
2443
2461
|
// 譜面ファイルが分割されている場合、譜面詳細情報取得のために譜面をロード
|
|
@@ -2446,10 +2464,10 @@ const initialControl = async () => {
|
|
|
2446
2464
|
resetColorSetting(j);
|
|
2447
2465
|
}
|
|
2448
2466
|
getScoreDetailData(j);
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2467
|
+
if (j < loopCount) {
|
|
2468
|
+
// 分割時は各譜面ごとに上書き・補完、非分割時は初回のみ実行
|
|
2469
|
+
resetGaugeSetting(j);
|
|
2470
|
+
}
|
|
2453
2471
|
}
|
|
2454
2472
|
}
|
|
2455
2473
|
g_customJsObj.preTitle.forEach(func => func());
|
|
@@ -3963,7 +3981,9 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
3963
3981
|
obj.lifeInits[_scoreId] = _gaugeDetails[3];
|
|
3964
3982
|
|
|
3965
3983
|
if (gaugeUpdateFlg && hasVal(g_gaugeOptionObj[`gauge${_name}s`])) {
|
|
3966
|
-
|
|
3984
|
+
// ゲージ上書き時は_gaugeDetails(obj)の値を優先し、デフォルト値で穴埋めする
|
|
3985
|
+
Object.keys(obj).forEach(key => g_gaugeOptionObj[`gauge${_name}s`][key] =
|
|
3986
|
+
fillMissingArrayElem(g_gaugeOptionObj[`gauge${_name}s`][key] || [], obj[key]));
|
|
3967
3987
|
return false;
|
|
3968
3988
|
}
|
|
3969
3989
|
return true;
|
|
@@ -3977,9 +3997,12 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
3977
3997
|
*/
|
|
3978
3998
|
const getGaugeDetailList = (_scoreId, _defaultGaugeList) => {
|
|
3979
3999
|
if (_scoreId > 0) {
|
|
3980
|
-
const
|
|
4000
|
+
const idHeader = setScoreIdHeader(_scoreId, g_stateObj.scoreLockFlg);
|
|
4001
|
+
const dosId = (idHeader || 0) - 1;
|
|
4002
|
+
const headerName = `gauge${_name}${idHeader}`;
|
|
3981
4003
|
if (hasVal(_dosObj[headerName])) {
|
|
3982
|
-
|
|
4004
|
+
const gauges = splitLF2(_dosObj[headerName]);
|
|
4005
|
+
return (gauges[dosId] || gauges[0])?.split(`,`);
|
|
3983
4006
|
}
|
|
3984
4007
|
}
|
|
3985
4008
|
return _defaultGaugeList;
|
|
@@ -3987,12 +4010,12 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
3987
4010
|
|
|
3988
4011
|
if (hasVal(_dosObj[`gauge${_name}`])) {
|
|
3989
4012
|
|
|
4013
|
+
const gauges = splitLF2(_dosObj[`gauge${_name}`]);
|
|
3990
4014
|
if (gaugeUpdateFlg) {
|
|
3991
|
-
gaugeCreateFlg = setGaugeDetails(scoreId,
|
|
4015
|
+
gaugeCreateFlg = setGaugeDetails(scoreId, (gauges[scoreId] || gauges[0])?.split(`,`));
|
|
3992
4016
|
} else {
|
|
3993
|
-
const gauges = splitLF2(_dosObj[`gauge${_name}`]);
|
|
3994
4017
|
for (let j = 0; j < _difLength; j++) {
|
|
3995
|
-
gaugeCreateFlg = setGaugeDetails(j, getGaugeDetailList(j, (gauges[j]
|
|
4018
|
+
gaugeCreateFlg = setGaugeDetails(j, getGaugeDetailList(j, (gauges[j] || gauges[0]).split(`,`)));
|
|
3996
4019
|
}
|
|
3997
4020
|
}
|
|
3998
4021
|
|
|
@@ -10357,7 +10380,7 @@ const mainInit = () => {
|
|
|
10357
10380
|
mainSpriteJ.appendChild(createColorObject2(`filterBar${j % 2 == 0 ? j + 1 : j - 1}_HS`, g_lblPosObj.filterBar, filterCss));
|
|
10358
10381
|
}
|
|
10359
10382
|
addTransform(`mainSprite${j}`, `mainSprite${j}`,
|
|
10360
|
-
g_keyObj[`layerTrans${keyCtrlPtn}`]?.[0]?.[Math.floor(j / 2) + (j + Number(g_stateObj.reverse === C_FLG_ON)) % 2]);
|
|
10383
|
+
g_keyObj[`layerTrans${keyCtrlPtn}`]?.[0]?.[Math.floor(j / 2) * 2 + (j + Number(g_stateObj.reverse === C_FLG_ON)) % 2]);
|
|
10361
10384
|
|
|
10362
10385
|
stepSprite.push(createEmptySprite(mainSpriteJ, `stepSprite${j}`, mainCommonPos));
|
|
10363
10386
|
arrowSprite.push(createEmptySprite(mainSpriteJ, `arrowSprite${j}`, Object.assign({ y: g_workObj.hitPosition * (j % 2 === 0 ? 1 : -1) }, mainCommonPos)));
|