danoniplus 50.1.1 → 50.2.0
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/README.md +1 -1
- package/js/danoni_main.js +26 -17
- package/js/lib/danoni_constants.js +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/cwtickle/danoniplus/actions?query=workflow%3ACodeQL)
|
|
4
4
|
[](https://www.coderabbit.ai/)
|
|
5
5
|
[](https://discord.gg/YVWUdUGyMy)
|
|
6
|
-
[](https://deepwiki.com/cwtickle/danoniplus)
|
|
7
7
|
[](https://github.com/cwtickle/danoniplus/security/policy)
|
|
8
8
|
[](https://github.com/cwtickle/danoniplus/releases)
|
|
9
9
|
[](https://github.com/cwtickle/danoniplus/blob/develop/LICENSE)
|
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 : 2026/
|
|
7
|
+
* Revised : 2026/09/01
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 50.
|
|
12
|
-
const g_revisedDate = `2026/
|
|
11
|
+
const g_version = `Ver 50.2.0`;
|
|
12
|
+
const g_revisedDate = `2026/09/01`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -8492,7 +8492,8 @@ const setDifficulty = (_initFlg) => {
|
|
|
8492
8492
|
/**
|
|
8493
8493
|
* keyLabelの系統ごとに、選択時に強制したい設定値・選択/離脱時の個別処理を登録する
|
|
8494
8494
|
* @param {string} _name 系統名
|
|
8495
|
-
* @param {(key: string) => boolean} _match
|
|
8495
|
+
* @param {(key: string, context: { scoreId: number, ptn: string, prevKey: string }) => boolean} _match
|
|
8496
|
+
* この系統に属するkeyLabelかどうかの判定関数。第二引数のcontextは任意で利用可能
|
|
8496
8497
|
* @param {object} [_fields] path -> 値 or 値を返す関数(単純代入で済むもの)
|
|
8497
8498
|
* @param {object} [_hooks] { onAcquire, onRelease } 選択/離脱の瞬間に1回だけ呼ばれる(複合処理用)
|
|
8498
8499
|
* @param {object} [_appliers] path -> 個別の適用関数(単純代入で済まないfields用)
|
|
@@ -8506,8 +8507,15 @@ const registerKeyFamily = (_name, _match, _fields = {}, _hooks = {}, _appliers =
|
|
|
8506
8507
|
* 各パラメータの値・スナップショット・フックを管理・適用する
|
|
8507
8508
|
*/
|
|
8508
8509
|
const resolveKeyFamily = () => {
|
|
8510
|
+
// match() へ渡す追加情報。第一引数(keyLabel)だけで判定できる場合は無視してよい
|
|
8511
|
+
const context = {
|
|
8512
|
+
scoreId: g_stateObj.scoreId,
|
|
8513
|
+
ptn: g_keyObj.currentPtn,
|
|
8514
|
+
prevKey: g_keyObj.prevKey,
|
|
8515
|
+
};
|
|
8516
|
+
|
|
8509
8517
|
// 1. 現在のキーに一致するファミリーを検索(見つからなければ null = 標準状態)
|
|
8510
|
-
const newFamily = g_familyObj.families.find(f => f.match(g_keyObj.currentKey)) ?? null;
|
|
8518
|
+
const newFamily = g_familyObj.families.find(f => f.match(g_keyObj.currentKey, context)) ?? null;
|
|
8511
8519
|
|
|
8512
8520
|
// 2. ファミリーが切り替わった瞬間(入場・離脱)にフック(固有の副作用)を実行
|
|
8513
8521
|
if (newFamily !== g_familyObj.currentFamily) {
|
|
@@ -8520,41 +8528,41 @@ const resolveKeyFamily = () => {
|
|
|
8520
8528
|
const allPaths = new Set(g_familyObj.families.flatMap(f => Object.keys(f.fields)));
|
|
8521
8529
|
allPaths.forEach(path => {
|
|
8522
8530
|
const spec = newFamily?.fields[path];
|
|
8523
|
-
// 該当プロパティのカスタム処理があれば優先し、なければ通常のプロパティ代入を使用
|
|
8524
|
-
const applier = g_familyObj.families.map(f => f.appliers[path]).find(Boolean) ?? (v => setPathVal(path, v));
|
|
8525
8531
|
|
|
8526
8532
|
if (spec !== undefined) {
|
|
8527
8533
|
// 【変更値の適用】現在のファミリーにそのプロパティの設定がある場合
|
|
8528
8534
|
// 初めて書き換えるプロパティの場合のみ、元の値をスナップショット(初期値)として退避
|
|
8529
8535
|
if (!g_familyObj.ownership[path]) {
|
|
8530
8536
|
g_familyObj.snapshot[path] = getPathVal(path);
|
|
8531
|
-
g_familyObj.ownership[path] = true;
|
|
8532
8537
|
}
|
|
8533
8538
|
// 関数なら評価し、値ならそのまま適用値とする
|
|
8539
|
+
g_familyObj.ownership[path] = newFamily;
|
|
8540
|
+
const applier = newFamily.appliers[path] ?? (v => setPathVal(path, v));
|
|
8534
8541
|
applyIfChanged(path, typeof spec === `function` ? spec() : spec, applier);
|
|
8542
|
+
|
|
8535
8543
|
} else if (g_familyObj.ownership[path]) {
|
|
8536
8544
|
// 【標準への復元】別のファミリーに移行し、かつ元々自分が書き換えていたプロパティの場合
|
|
8537
8545
|
// スナップショットから元の値(初期値)を復元し、オーナーシップを解放
|
|
8546
|
+
const applier = g_familyObj.ownership[path].appliers[path] ?? (v => setPathVal(path, v));
|
|
8538
8547
|
applyIfChanged(path, g_familyObj.snapshot[path], applier);
|
|
8539
|
-
g_familyObj.ownership[path] =
|
|
8548
|
+
g_familyObj.ownership[path] = null;
|
|
8540
8549
|
}
|
|
8541
|
-
// ownership[path]が
|
|
8550
|
+
// ownership[path]がnullのままなら、標準同士の切り替えでも一切触らない
|
|
8542
8551
|
});
|
|
8543
8552
|
};
|
|
8544
8553
|
|
|
8545
8554
|
/**
|
|
8546
|
-
*
|
|
8555
|
+
* 値に変更がある場合のみ、代入またはカスタム処理を実行する
|
|
8556
|
+
* - 「エンジンが前回適用した値」ではなく「実際に今その場所にある値」と比較することで、
|
|
8557
|
+
* ユーザーの手動操作など、本エンジンを介さずに値が変更されたケースでも
|
|
8558
|
+
* 正しく差分を検知できるようにしている
|
|
8547
8559
|
* @param {string} _path 設定のパス
|
|
8548
8560
|
* @param {string|number} _value 適用する値
|
|
8549
8561
|
* @param {Function} _applier 実際の適用処理を行う関数
|
|
8550
8562
|
*/
|
|
8551
8563
|
const applyIfChanged = (_path, _value, _applier) => {
|
|
8552
|
-
//
|
|
8553
|
-
if (
|
|
8554
|
-
|
|
8555
|
-
// 適用値をキャッシュに保存
|
|
8556
|
-
g_familyObj.applied[_path] = _value;
|
|
8557
|
-
g_familyObj.appliedPaths.add(_path);
|
|
8564
|
+
// 実際の現在値と適用したい値が一致していれば、無駄な再描画や再代入を防ぐためスキップ
|
|
8565
|
+
if (getPathVal(_path) === _value) return;
|
|
8558
8566
|
|
|
8559
8567
|
// 実際の反映処理(値の代入、または画像再描画などの副作用)を実行
|
|
8560
8568
|
_applier(_value);
|
|
@@ -17233,6 +17241,7 @@ const judgeArrow = _j => {
|
|
|
17233
17241
|
// 空押し判定(有効かつ早押し時のみ)
|
|
17234
17242
|
displayDiff(_difFrame);
|
|
17235
17243
|
stepHitTargetArrow(`Excessive`);
|
|
17244
|
+
safeExecuteCustomHooks(`g_customJsObj.judg_excessive`, g_customJsObj.judg_excessive, _difFrame, _j);
|
|
17236
17245
|
return true;
|
|
17237
17246
|
|
|
17238
17247
|
} else if (_difCnt <= g_judgObj.arrowJ[g_judgPosObj.shobon]) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised : 2026/
|
|
8
|
+
* Revised : 2026/09/01 (v50.2.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -5259,6 +5259,7 @@ const g_customJsObj = {
|
|
|
5259
5259
|
judg_uwan: [],
|
|
5260
5260
|
judg_kita: [],
|
|
5261
5261
|
judg_iknai: [],
|
|
5262
|
+
judg_excessive: [],
|
|
5262
5263
|
|
|
5263
5264
|
judg_frzHit: [],
|
|
5264
5265
|
judg_dummyFrzHit: [],
|
|
@@ -5293,6 +5294,10 @@ const g_root = {
|
|
|
5293
5294
|
get g_headerObj() { return g_headerObj; },
|
|
5294
5295
|
get g_stateObj() { return g_stateObj; },
|
|
5295
5296
|
get g_keycons() { return g_keycons; },
|
|
5297
|
+
get g_settings() { return g_settings; },
|
|
5298
|
+
get g_imgObj() { return g_imgObj },
|
|
5299
|
+
get g_judgObj() { return g_judgObj },
|
|
5300
|
+
get g_judgRanges() { return g_judgRanges },
|
|
5296
5301
|
};
|
|
5297
5302
|
const getPathVal = _path => _path.split(`.`).reduce((o, k) => o?.[k], g_root);
|
|
5298
5303
|
const setPathVal = (_path, _value) => {
|
|
@@ -5306,7 +5311,7 @@ const setPathVal = (_path, _value) => {
|
|
|
5306
5311
|
target[last] = _value;
|
|
5307
5312
|
};
|
|
5308
5313
|
|
|
5309
|
-
const g_familyObj = { families: [], currentFamily: null, ownership: {}, snapshot: {}
|
|
5314
|
+
const g_familyObj = { families: [], currentFamily: null, ownership: {}, snapshot: {} };
|
|
5310
5315
|
|
|
5311
5316
|
const g_errorCache = {
|
|
5312
5317
|
'g_customJsObj.titleEnterFrame': [],
|