danoniplus 40.7.3 → 40.7.5
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 40.7.
|
|
12
|
-
const g_revisedDate = `2025/
|
|
11
|
+
const g_version = `Ver 40.7.5`;
|
|
12
|
+
const g_revisedDate = `2025/08/21`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -713,6 +713,21 @@ const padArray = (_array, _baseArray) => {
|
|
|
713
713
|
return _baseArray;
|
|
714
714
|
};
|
|
715
715
|
|
|
716
|
+
/**
|
|
717
|
+
* ベース配列(_baseArray)の空要素のみ、別配列(_array)の対応要素で補完する(既存値は上書きしない)
|
|
718
|
+
* @param {string[]|number[]} _array 補完元(ソース)
|
|
719
|
+
* @param {string[]|number[]} _baseArray ベース(既存値を優先)
|
|
720
|
+
* @returns {string[]|number[]}
|
|
721
|
+
*/
|
|
722
|
+
const fillMissingArrayElem = (_array = [], _baseArray = []) => {
|
|
723
|
+
const maxLen = Math.max(_baseArray.length, _array.length);
|
|
724
|
+
const res = _baseArray.slice();
|
|
725
|
+
for (let j = 0; j < maxLen; j++) {
|
|
726
|
+
if (!hasVal(res[j]) && hasVal(_array[j])) res[j] = _array[j];
|
|
727
|
+
}
|
|
728
|
+
return res;
|
|
729
|
+
};
|
|
730
|
+
|
|
716
731
|
/**
|
|
717
732
|
* 配列から上位N番目までに一致する位置を取得
|
|
718
733
|
*
|
|
@@ -2581,6 +2596,9 @@ const initialControl = async () => {
|
|
|
2581
2596
|
g_stateObj.dosDivideFlg = setBoolVal(document.getElementById(`externalDosDivide`)?.value ?? getQueryParamVal(`dosDivide`));
|
|
2582
2597
|
g_stateObj.scoreLockFlg = setBoolVal(document.getElementById(`externalDosLock`)?.value ?? getQueryParamVal(`dosLock`));
|
|
2583
2598
|
|
|
2599
|
+
// 非分割時は resetGaugeSetting が全難易度を一括構築するため、初回のみで十分
|
|
2600
|
+
const loopCount = g_stateObj.dosDivideFlg ? g_headerObj.keyLabels.length : 1;
|
|
2601
|
+
|
|
2584
2602
|
for (let j = 0; j < g_headerObj.keyLabels.length; j++) {
|
|
2585
2603
|
|
|
2586
2604
|
// 譜面ファイルが分割されている場合、譜面詳細情報取得のために譜面をロード
|
|
@@ -2589,10 +2607,10 @@ const initialControl = async () => {
|
|
|
2589
2607
|
resetColorSetting(j);
|
|
2590
2608
|
}
|
|
2591
2609
|
getScoreDetailData(j);
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2610
|
+
if (j < loopCount) {
|
|
2611
|
+
// 分割時は各譜面ごとに上書き・補完、非分割時は初回のみ実行
|
|
2612
|
+
resetGaugeSetting(j);
|
|
2613
|
+
}
|
|
2596
2614
|
}
|
|
2597
2615
|
}
|
|
2598
2616
|
g_customJsObj.preTitle.forEach(func => func());
|
|
@@ -4278,7 +4296,9 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
4278
4296
|
obj.lifeInits[_scoreId] = _gaugeDetails[3];
|
|
4279
4297
|
|
|
4280
4298
|
if (gaugeUpdateFlg && hasVal(g_gaugeOptionObj[`gauge${_name}s`])) {
|
|
4281
|
-
|
|
4299
|
+
// ゲージ上書き時は_gaugeDetails(obj)の値を優先し、デフォルト値で穴埋めする
|
|
4300
|
+
Object.keys(obj).forEach(key => g_gaugeOptionObj[`gauge${_name}s`][key] =
|
|
4301
|
+
fillMissingArrayElem(g_gaugeOptionObj[`gauge${_name}s`][key] || [], obj[key]));
|
|
4282
4302
|
return false;
|
|
4283
4303
|
}
|
|
4284
4304
|
return true;
|
|
@@ -4292,9 +4312,12 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
4292
4312
|
*/
|
|
4293
4313
|
const getGaugeDetailList = (_scoreId, _defaultGaugeList) => {
|
|
4294
4314
|
if (_scoreId > 0) {
|
|
4295
|
-
const
|
|
4315
|
+
const idHeader = setScoreIdHeader(_scoreId, g_stateObj.scoreLockFlg);
|
|
4316
|
+
const dosId = (idHeader || 0) - 1;
|
|
4317
|
+
const headerName = `gauge${_name}${idHeader}`;
|
|
4296
4318
|
if (hasVal(_dosObj[headerName])) {
|
|
4297
|
-
|
|
4319
|
+
const gauges = splitLF2(_dosObj[headerName]);
|
|
4320
|
+
return (gauges[dosId] || gauges[0])?.split(`,`);
|
|
4298
4321
|
}
|
|
4299
4322
|
}
|
|
4300
4323
|
return _defaultGaugeList;
|
|
@@ -4302,12 +4325,12 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
|
4302
4325
|
|
|
4303
4326
|
if (hasVal(_dosObj[`gauge${_name}`])) {
|
|
4304
4327
|
|
|
4328
|
+
const gauges = splitLF2(_dosObj[`gauge${_name}`]);
|
|
4305
4329
|
if (gaugeUpdateFlg) {
|
|
4306
|
-
gaugeCreateFlg = setGaugeDetails(scoreId,
|
|
4330
|
+
gaugeCreateFlg = setGaugeDetails(scoreId, (gauges[scoreId] || gauges[0])?.split(`,`));
|
|
4307
4331
|
} else {
|
|
4308
|
-
const gauges = splitLF2(_dosObj[`gauge${_name}`]);
|
|
4309
4332
|
for (let j = 0; j < _difLength; j++) {
|
|
4310
|
-
gaugeCreateFlg = setGaugeDetails(j, getGaugeDetailList(j, (gauges[j]
|
|
4333
|
+
gaugeCreateFlg = setGaugeDetails(j, getGaugeDetailList(j, (gauges[j] || gauges[0]).split(`,`)));
|
|
4311
4334
|
}
|
|
4312
4335
|
}
|
|
4313
4336
|
|
|
@@ -10796,7 +10819,7 @@ const mainInit = () => {
|
|
|
10796
10819
|
mainSpriteJ.appendChild(createColorObject2(`filterBar${j % 2 == 0 ? j + 1 : j - 1}_HS`, g_lblPosObj.filterBar, filterCss));
|
|
10797
10820
|
}
|
|
10798
10821
|
addTransform(`mainSprite${j}`, `mainSprite${j}`,
|
|
10799
|
-
g_keyObj[`layerTrans${keyCtrlPtn}`]?.[0]?.[Math.floor(j / 2) + (j + Number(g_stateObj.reverse === C_FLG_ON)) % 2]);
|
|
10822
|
+
g_keyObj[`layerTrans${keyCtrlPtn}`]?.[0]?.[Math.floor(j / 2) * 2 + (j + Number(g_stateObj.reverse === C_FLG_ON)) % 2]);
|
|
10800
10823
|
|
|
10801
10824
|
stepSprite.push(createEmptySprite(mainSpriteJ, `stepSprite${j}`, mainCommonPos));
|
|
10802
10825
|
arrowSprite.push(createEmptySprite(mainSpriteJ, `arrowSprite${j}`, Object.assign({ y: g_workObj.hitPosition * (j % 2 === 0 ? 1 : -1) }, mainCommonPos)));
|