danoniplus 43.5.0 → 43.6.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/js/danoni_main.js +120 -24
- package/js/lib/danoni_constants.js +32 -1
- 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 : 2026/01/
|
|
7
|
+
* Revised : 2026/01/23
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 43.
|
|
12
|
-
const g_revisedDate = `2026/01/
|
|
11
|
+
const g_version = `Ver 43.6.0`;
|
|
12
|
+
const g_revisedDate = `2026/01/23`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -6654,6 +6654,7 @@ const drawSpeedGraph = _scoreId => {
|
|
|
6654
6654
|
boost: { frame: [0], speed: [1], cnt: 0, strokeColor: g_graphColorObj.boost }
|
|
6655
6655
|
};
|
|
6656
6656
|
|
|
6657
|
+
const tmpSpeedPoint = [0];
|
|
6657
6658
|
Object.keys(speedObj).forEach(speedType => {
|
|
6658
6659
|
const frame = speedObj[speedType].frame;
|
|
6659
6660
|
const speed = speedObj[speedType].speed;
|
|
@@ -6663,22 +6664,28 @@ const drawSpeedGraph = _scoreId => {
|
|
|
6663
6664
|
if (speedData[i] >= startFrame) {
|
|
6664
6665
|
frame.push(speedData[i] - startFrame);
|
|
6665
6666
|
speed.push(speedData[i + 1]);
|
|
6667
|
+
tmpSpeedPoint.push(speedData[i] - startFrame);
|
|
6666
6668
|
}
|
|
6667
6669
|
speedObj[speedType].cnt++;
|
|
6668
6670
|
}
|
|
6669
6671
|
frame.push(playingFrame);
|
|
6670
6672
|
speed.push(speed.at(-1));
|
|
6673
|
+
tmpSpeedPoint.push(playingFrame);
|
|
6671
6674
|
});
|
|
6675
|
+
const speedPoints = makeDedupliArray(tmpSpeedPoint).sort((a, b) => a - b);
|
|
6676
|
+
let speedPointIdx = 0;
|
|
6672
6677
|
|
|
6673
6678
|
const canvas = document.getElementById(`graphSpeed`);
|
|
6674
6679
|
const context = canvas.getContext(`2d`);
|
|
6675
6680
|
const [_a, _b] = [-75, 100];
|
|
6676
6681
|
const [_min, _max] = [-0.2, 2.2];
|
|
6677
|
-
|
|
6682
|
+
const lineX = [0, 150], lineY = 208;
|
|
6678
6683
|
|
|
6679
6684
|
const avgX = [0, 0];
|
|
6680
6685
|
const avgSubX = [0, 0];
|
|
6681
|
-
|
|
6686
|
+
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
6687
|
+
drawBaseLine(context, { _fixed: 1, _mark: `x`, _a, _b, _min, _max });
|
|
6688
|
+
|
|
6682
6689
|
Object.keys(speedObj).forEach((speedType, j) => {
|
|
6683
6690
|
const frame = speedObj[speedType].frame;
|
|
6684
6691
|
const speed = speedObj[speedType].speed;
|
|
@@ -6695,11 +6702,13 @@ const drawSpeedGraph = _scoreId => {
|
|
|
6695
6702
|
context.lineTo(x, y);
|
|
6696
6703
|
preY = y;
|
|
6697
6704
|
|
|
6698
|
-
const
|
|
6699
|
-
|
|
6700
|
-
|
|
6705
|
+
const prevFrame = (i > 0 ? frame[i - 1] : 0); // frame[] は startFrame 相対。初回は 0 起点
|
|
6706
|
+
const deltaFrame = frame[i] - prevFrame;
|
|
6707
|
+
const prevSpeed = (i > 0 ? speed[i - 1] : 1);
|
|
6708
|
+
avgX[j] += deltaFrame * prevSpeed;
|
|
6709
|
+
if (prevSpeed !== 1) {
|
|
6701
6710
|
avgSubFrame += deltaFrame;
|
|
6702
|
-
avgSubX[j] += deltaFrame *
|
|
6711
|
+
avgSubX[j] += deltaFrame * prevSpeed;
|
|
6703
6712
|
}
|
|
6704
6713
|
}
|
|
6705
6714
|
avgX[j] /= playingFrame;
|
|
@@ -6724,6 +6733,91 @@ const drawSpeedGraph = _scoreId => {
|
|
|
6724
6733
|
updateScoreDetailLabel(`Speed`, `${speedType}S`, speedObj[speedType].cnt, j, g_lblNameObj[`s_${speedType}`]);
|
|
6725
6734
|
});
|
|
6726
6735
|
updateScoreDetailLabel(`Speed`, `avgS`, `${(avgX[0] * avgX[1]).toFixed(2)}x`, 2, g_lblNameObj.s_avg);
|
|
6736
|
+
|
|
6737
|
+
/**
|
|
6738
|
+
* 速度ポインタ位置の変更
|
|
6739
|
+
* @param {number} _num
|
|
6740
|
+
*/
|
|
6741
|
+
const changeSpdCursor = (_num = 1) => {
|
|
6742
|
+
speedPointIdx = nextPos(speedPointIdx, _num, speedPoints.length);
|
|
6743
|
+
movePointer(speedPoints[speedPointIdx]);
|
|
6744
|
+
}
|
|
6745
|
+
|
|
6746
|
+
/**
|
|
6747
|
+
* 速度ポインタの移動
|
|
6748
|
+
* @param {number} _frame
|
|
6749
|
+
*/
|
|
6750
|
+
const movePointer = _frame => {
|
|
6751
|
+
const canvasP = document.getElementById(`graphSpeed2`);
|
|
6752
|
+
const contextP = canvasP.getContext(`2d`);
|
|
6753
|
+
contextP.clearRect(0, 0, canvas.width, canvas.height);
|
|
6754
|
+
|
|
6755
|
+
const offsetX = _frame * (g_limitObj.graphWidth - 30) / playingFrame + 30;
|
|
6756
|
+
const speed = { speed: 0, boost: 0 };
|
|
6757
|
+
|
|
6758
|
+
Object.keys(speedObj).forEach(speedType => {
|
|
6759
|
+
const speedFrames = speedObj[speedType].frame.concat(Infinity);
|
|
6760
|
+
const speedIndex = speedObj[speedType].frame.findIndex((frame, i) => frame <= _frame && _frame < speedFrames[i + 1]);
|
|
6761
|
+
speed[speedType] = speedObj[speedType].speed[speedIndex];
|
|
6762
|
+
const y = (Math.min(Math.max(speed[speedType], _min - 0.05), _max + 0.05) - 1) * _a + _b;
|
|
6763
|
+
|
|
6764
|
+
contextP.beginPath();
|
|
6765
|
+
contextP.fillStyle = g_graphColorObj[speedType];
|
|
6766
|
+
contextP.arc(offsetX, y, 5, 0, 360);
|
|
6767
|
+
contextP.closePath();
|
|
6768
|
+
contextP.fill();
|
|
6769
|
+
});
|
|
6770
|
+
calculateTotalSpeed(speed.speed, speed.boost, _frame);
|
|
6771
|
+
};
|
|
6772
|
+
|
|
6773
|
+
// 速度計算用ラベルの再作成
|
|
6774
|
+
deleteDiv(detailSpeed, `lblSpdHeader`);
|
|
6775
|
+
deleteDiv(detailSpeed, `lblSpdBase`);
|
|
6776
|
+
deleteDiv(detailSpeed, `lblSpdOverall`);
|
|
6777
|
+
deleteDiv(detailSpeed, `lblSpdBoost`);
|
|
6778
|
+
deleteDiv(detailSpeed, `lblSpdTotal`);
|
|
6779
|
+
deleteDiv(detailSpeed, `lblSpdFrame`);
|
|
6780
|
+
deleteDiv(detailSpeed, `btnSpdCursorL`);
|
|
6781
|
+
deleteDiv(detailSpeed, `btnSpdCursorR`);
|
|
6782
|
+
|
|
6783
|
+
multiAppend(detailSpeed,
|
|
6784
|
+
createDivCss2Label(`lblSpdHeader`, `TotalSpeed`, g_lblPosObj.lblSpdHeader),
|
|
6785
|
+
createDivCss2Label(`lblSpdBase`, ``, g_lblPosObj.lblSpdBase),
|
|
6786
|
+
createDivCss2Label(`lblSpdOverall`, ``, g_lblPosObj.lblSpdOverall),
|
|
6787
|
+
createDivCss2Label(`lblSpdBoost`, ``, g_lblPosObj.lblSpdBoost),
|
|
6788
|
+
createDivCss2Label(`lblSpdTotal`, ``, g_lblPosObj.lblSpdTotal),
|
|
6789
|
+
createDivCss2Label(`lblSpdFrame`, ``, g_lblPosObj.lblSpdFrame),
|
|
6790
|
+
createCss2Button(`btnSpdCursorL`, `<`, () => changeSpdCursor(-1),
|
|
6791
|
+
g_lblPosObj.btnSpdCursorL, g_cssObj.button_Mini),
|
|
6792
|
+
createCss2Button(`btnSpdCursorR`, `>`, () => changeSpdCursor(),
|
|
6793
|
+
g_lblPosObj.btnSpdCursorR, g_cssObj.button_Mini),
|
|
6794
|
+
);
|
|
6795
|
+
movePointer(0);
|
|
6796
|
+
};
|
|
6797
|
+
|
|
6798
|
+
/**
|
|
6799
|
+
* 合計速度の表示更新
|
|
6800
|
+
* @param {number} _speed
|
|
6801
|
+
* @param {number} _boost
|
|
6802
|
+
* @param {number} _frame
|
|
6803
|
+
*/
|
|
6804
|
+
const calculateTotalSpeed = (_speed = null, _boost = null, _frame = 0) => {
|
|
6805
|
+
if (document.getElementById(`lblSpdOverall`) === null) {
|
|
6806
|
+
return;
|
|
6807
|
+
}
|
|
6808
|
+
let speed, boost;
|
|
6809
|
+
if (_speed !== null && _boost !== null) {
|
|
6810
|
+
speed = _speed;
|
|
6811
|
+
boost = _boost;
|
|
6812
|
+
lblSpdOverall.textContent = `x${_speed.toFixed(2)}`;
|
|
6813
|
+
lblSpdBoost.textContent = `x${_boost.toFixed(2)}`;
|
|
6814
|
+
} else {
|
|
6815
|
+
speed = Number(lblSpdOverall.textContent.slice(1));
|
|
6816
|
+
boost = Number(lblSpdBoost.textContent.slice(1));
|
|
6817
|
+
}
|
|
6818
|
+
lblSpdBase.textContent = `${g_stateObj.speed.toFixed(2)}`;
|
|
6819
|
+
lblSpdTotal.textContent = `=${(g_stateObj.speed * speed * boost).toFixed(2)}`;
|
|
6820
|
+
lblSpdFrame.textContent = `[${transFrameToTimer(_frame + g_detailObj.startFrame[g_stateObj.scoreId])}]`;
|
|
6727
6821
|
};
|
|
6728
6822
|
|
|
6729
6823
|
/**
|
|
@@ -7353,7 +7447,7 @@ const createOptionWindow = _sprite => {
|
|
|
7353
7447
|
// 縦位置: 2 短縮ショートカットあり
|
|
7354
7448
|
createGeneralSetting(spriteList.speed, `speed`, {
|
|
7355
7449
|
skipTerms: g_settings.speedTerms, hiddenBtn: true, scLabel: g_lblNameObj.sc_speed, roundNum: 5,
|
|
7356
|
-
unitName: ` ${g_lblNameObj.multi}`,
|
|
7450
|
+
unitName: ` ${g_lblNameObj.multi}`, addRFunc: () => calculateTotalSpeed(),
|
|
7357
7451
|
});
|
|
7358
7452
|
if (g_headerObj.baseSpeed !== 1) {
|
|
7359
7453
|
divRoot.appendChild(
|
|
@@ -7367,24 +7461,26 @@ const createOptionWindow = _sprite => {
|
|
|
7367
7461
|
* @param {boolean} _graphUseFlg
|
|
7368
7462
|
* @returns {HTMLDivElement}
|
|
7369
7463
|
*/
|
|
7370
|
-
const createScoreDetail = (_name, _graphUseFlg = true) => {
|
|
7464
|
+
const createScoreDetail = (_name, _graphUseFlg = true, _graphNum = 1) => {
|
|
7371
7465
|
const detailObj = createEmptySprite(scoreDetail, `detail${_name}`, g_windowObj.detailObj);
|
|
7372
7466
|
|
|
7373
7467
|
if (_graphUseFlg) {
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7468
|
+
for (let j = 0; j < _graphNum; j++) {
|
|
7469
|
+
const graphObj = document.createElement(`canvas`);
|
|
7470
|
+
const textBaseObj = document.getElementById(`lnkDifficulty`);
|
|
7471
|
+
const bkColor = window.getComputedStyle(textBaseObj, ``).backgroundColor;
|
|
7377
7472
|
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7473
|
+
graphObj.id = `graph${_name}${j > 0 ? j + 1 : ``}`;
|
|
7474
|
+
graphObj.width = g_limitObj.graphWidth;
|
|
7475
|
+
graphObj.height = g_limitObj.graphHeight;
|
|
7476
|
+
graphObj.style.left = wUnit(125);
|
|
7477
|
+
graphObj.style.top = wUnit(0);
|
|
7478
|
+
graphObj.style.position = `absolute`;
|
|
7479
|
+
graphObj.style.background = j === 0 ? bkColor : `#ffffff00`;
|
|
7480
|
+
graphObj.style.border = `dotted ${wUnit(2)}`;
|
|
7386
7481
|
|
|
7387
|
-
|
|
7482
|
+
detailObj.appendChild(graphObj);
|
|
7483
|
+
}
|
|
7388
7484
|
}
|
|
7389
7485
|
|
|
7390
7486
|
return detailObj;
|
|
@@ -7428,7 +7524,7 @@ const createOptionWindow = _sprite => {
|
|
|
7428
7524
|
};
|
|
7429
7525
|
|
|
7430
7526
|
multiAppend(scoreDetail,
|
|
7431
|
-
createScoreDetail(`Speed
|
|
7527
|
+
createScoreDetail(`Speed`, true, 2),
|
|
7432
7528
|
createScoreDetail(`Density`),
|
|
7433
7529
|
createScoreDetail(`ToolDif`, false),
|
|
7434
7530
|
createScoreDetail(`HighScore`, false),
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised : 2026/01/
|
|
8
|
+
* Revised : 2026/01/23 (v43.6.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -440,6 +440,33 @@ const updateWindowSiz = () => {
|
|
|
440
440
|
lblHRank: {
|
|
441
441
|
x: 290, y: 145, w: 120, h: 20, siz: 50, align: C_ALIGN_CENTER,
|
|
442
442
|
},
|
|
443
|
+
lblSpdHeader: {
|
|
444
|
+
x: 5, y: 180, w: 100, h: 20, siz: g_limitObj.difSelectorSiz, align: C_ALIGN_LEFT,
|
|
445
|
+
},
|
|
446
|
+
lblSpdBase: {
|
|
447
|
+
x: 0, y: 200, w: 40, h: 20, siz: 11.5, fontWeight: `bold`,
|
|
448
|
+
},
|
|
449
|
+
lblSpdOverall: {
|
|
450
|
+
x: 40, y: 200, w: 40, h: 20, siz: 11.5,
|
|
451
|
+
color: g_graphColorObj.speedChara, fontWeight: `bold`,
|
|
452
|
+
},
|
|
453
|
+
lblSpdBoost: {
|
|
454
|
+
x: 80, y: 200, w: 40, h: 20, siz: 11.5,
|
|
455
|
+
color: g_graphColorObj.boostChara, fontWeight: `bold`,
|
|
456
|
+
},
|
|
457
|
+
lblSpdTotal: {
|
|
458
|
+
x: 5, y: 215, w: 100, h: 20, siz: g_limitObj.difSelectorSiz,
|
|
459
|
+
align: C_ALIGN_LEFT, fontWeight: `bold`,
|
|
460
|
+
},
|
|
461
|
+
lblSpdFrame: {
|
|
462
|
+
x: 70, y: 218, w: 50, h: 20, siz: 12, fontWeight: `bold`,
|
|
463
|
+
},
|
|
464
|
+
btnSpdCursorL: {
|
|
465
|
+
x: 85, y: 180, w: 15, h: 20, siz: 12,
|
|
466
|
+
},
|
|
467
|
+
btnSpdCursorR: {
|
|
468
|
+
x: 100, y: 180, w: 15, h: 20, siz: 12,
|
|
469
|
+
},
|
|
443
470
|
|
|
444
471
|
/** ディスプレイ画面 */
|
|
445
472
|
scMsg: {
|
|
@@ -910,7 +937,9 @@ const g_graphColorObj = {
|
|
|
910
937
|
default3Push: `#555555cc`,
|
|
911
938
|
|
|
912
939
|
speed: `#cc3333`,
|
|
940
|
+
speedChara: `#cc6666`,
|
|
913
941
|
boost: `#999900`,
|
|
942
|
+
boostChara: `#999966`,
|
|
914
943
|
|
|
915
944
|
clear: `#33cc33`,
|
|
916
945
|
failed: `#cc3333`,
|
|
@@ -2293,6 +2322,8 @@ const g_shortcutObj = {
|
|
|
2293
2322
|
ControlLeft_KeyC: { id: `` },
|
|
2294
2323
|
ControlRight_KeyC: { id: `` },
|
|
2295
2324
|
KeyC: { id: `lnkHighScore`, reset: true },
|
|
2325
|
+
Comma: { id: `btnSpdCursorL` },
|
|
2326
|
+
Period: { id: `btnSpdCursorR` },
|
|
2296
2327
|
|
|
2297
2328
|
Escape: { id: `btnBack` },
|
|
2298
2329
|
Space: { id: `btnKeyConfig` },
|