danoniplus 37.0.1 → 37.1.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 +44 -33
- package/js/lib/danoni_constants.js +8 -6
- 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 : 2024/06/
|
|
7
|
+
* Revised : 2024/06/25
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 37.0
|
|
12
|
-
const g_revisedDate = `2024/06/
|
|
11
|
+
const g_version = `Ver 37.1.0`;
|
|
12
|
+
const g_revisedDate = `2024/06/25`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -4605,7 +4605,7 @@ const makeDifList = (_difList, _targetKey = ``) => {
|
|
|
4605
4605
|
});
|
|
4606
4606
|
if (document.getElementById(`lblDifCnt`) === null) {
|
|
4607
4607
|
difCover.appendChild(createDivCss2Label(`lblDifCnt`, ``, {
|
|
4608
|
-
x: 0, y:
|
|
4608
|
+
x: 0, y: 27, w: g_limitObj.difCoverWidth, h: 16, siz: 12, fontWeight: `bold`,
|
|
4609
4609
|
}));
|
|
4610
4610
|
}
|
|
4611
4611
|
lblDifCnt.innerHTML = `${_targetKey === '' ? 'ALL' : _targetKey + 'k'}: ${curk === -1 ? '-' : curk + 1} / ${k}`;
|
|
@@ -4654,7 +4654,7 @@ const createDifWindow = (_key = ``) => {
|
|
|
4654
4654
|
|
|
4655
4655
|
// 全リスト
|
|
4656
4656
|
difCover.appendChild(
|
|
4657
|
-
makeDifLblCssButton(`keyFilter`, `ALL`, 1.
|
|
4657
|
+
makeDifLblCssButton(`keyFilter`, `ALL`, 1.9, _ => {
|
|
4658
4658
|
resetDifWindow();
|
|
4659
4659
|
g_stateObj.filterKeys = ``;
|
|
4660
4660
|
createDifWindow();
|
|
@@ -4739,48 +4739,56 @@ const drawSpeedGraph = _scoreId => {
|
|
|
4739
4739
|
|
|
4740
4740
|
const canvas = document.getElementById(`graphSpeed`);
|
|
4741
4741
|
const context = canvas.getContext(`2d`);
|
|
4742
|
-
|
|
4742
|
+
const [_a, _b] = [-75, 100];
|
|
4743
|
+
const [_min, _max] = [-0.2, 2.2];
|
|
4744
|
+
drawBaseLine(context, { _fixed: 1, _mark: `x`, _a, _b, _min, _max });
|
|
4743
4745
|
|
|
4744
4746
|
const avgX = [0, 0];
|
|
4745
|
-
const avgSubX = [
|
|
4746
|
-
const lineX = [
|
|
4747
|
+
const avgSubX = [0, 0];
|
|
4748
|
+
const lineX = [0, 150], lineY = 208;
|
|
4747
4749
|
Object.keys(speedObj).forEach((speedType, j) => {
|
|
4750
|
+
const frame = speedObj[speedType].frame;
|
|
4751
|
+
const speed = speedObj[speedType].speed;
|
|
4752
|
+
|
|
4748
4753
|
context.beginPath();
|
|
4749
4754
|
let preY;
|
|
4750
|
-
let avgSubFrame =
|
|
4755
|
+
let avgSubFrame = 0;
|
|
4751
4756
|
|
|
4752
|
-
for (let i = 0; i <
|
|
4753
|
-
const x =
|
|
4754
|
-
const y = (
|
|
4757
|
+
for (let i = 0; i < frame.length; i++) {
|
|
4758
|
+
const x = frame[i] * (g_limitObj.graphWidth - 30) / playingFrame + 30;
|
|
4759
|
+
const y = (Math.min(Math.max(speed[i], _min - 0.05), _max + 0.05) - 1) * _a + _b;
|
|
4755
4760
|
|
|
4756
4761
|
context.lineTo(x, preY);
|
|
4757
4762
|
context.lineTo(x, y);
|
|
4758
4763
|
preY = y;
|
|
4759
4764
|
|
|
4760
|
-
const deltaFrame =
|
|
4761
|
-
avgX[j] += deltaFrame * (
|
|
4762
|
-
if ((
|
|
4763
|
-
avgSubFrame
|
|
4764
|
-
|
|
4765
|
-
avgSubX[j] += deltaFrame * (speedObj[speedType].speed[i - 1]);
|
|
4765
|
+
const deltaFrame = frame[i] - (frame[i - 1] ?? startFrame);
|
|
4766
|
+
avgX[j] += deltaFrame * (speed[i - 1] ?? 1);
|
|
4767
|
+
if ((speed[i - 1] ?? 1) !== 1) {
|
|
4768
|
+
avgSubFrame += deltaFrame;
|
|
4769
|
+
avgSubX[j] += deltaFrame * (speed[i - 1]);
|
|
4766
4770
|
}
|
|
4767
4771
|
}
|
|
4768
4772
|
avgX[j] /= playingFrame;
|
|
4769
4773
|
avgSubX[j] /= Math.max(avgSubFrame, 1);
|
|
4770
4774
|
|
|
4771
|
-
context.lineWidth =
|
|
4775
|
+
context.lineWidth = 2;
|
|
4772
4776
|
context.strokeStyle = speedObj[speedType].strokeColor;
|
|
4773
4777
|
context.stroke();
|
|
4774
4778
|
|
|
4775
4779
|
context.beginPath();
|
|
4776
|
-
context.moveTo(lineX[j],
|
|
4777
|
-
context.lineTo(lineX[j] + 25,
|
|
4780
|
+
context.moveTo(lineX[j], lineY);
|
|
4781
|
+
context.lineTo(lineX[j] + 25, lineY);
|
|
4778
4782
|
context.stroke();
|
|
4779
|
-
context.font = `${wUnit(g_limitObj.
|
|
4780
|
-
context.fillText(g_lblNameObj[`s_${speedType}`], lineX[j] + 30,
|
|
4781
|
-
|
|
4783
|
+
context.font = `${wUnit(g_limitObj.mainSiz)} ${getBasicFont()}`;
|
|
4784
|
+
context.fillText(g_lblNameObj[`s_${speedType}`], lineX[j] + 30, lineY + 3);
|
|
4785
|
+
|
|
4786
|
+
const maxSpeed = Math.max(...speed);
|
|
4787
|
+
const minSpeed = Math.min(...speed);
|
|
4788
|
+
context.font = `${wUnit(g_limitObj.graphMiniSiz)} ${getBasicFont()}`;
|
|
4789
|
+
context.fillText(`(${minSpeed.toFixed(2)}x` + (minSpeed === maxSpeed ? `` : ` -- ${Math.max(...speed).toFixed(2)}x`) + `)`, lineX[j] + 30, lineY + 16);
|
|
4790
|
+
context.fillText(`Avg. ` + (avgX[j] === 1 ? `----` : `${(avgSubX[j]).toFixed(2)}x`), lineX[j] + 30, lineY + 29);
|
|
4782
4791
|
updateScoreDetailLabel(`Speed`, `${speedType}S`, speedObj[speedType].cnt, j, g_lblNameObj[`s_${speedType}`]);
|
|
4783
|
-
updateScoreDetailLabel(`Speed`, `avgD${speedType}`, avgSubX[j] === 1 ? `----` : `${(avgSubX[j]).toFixed(2)}x`, j + 4, g_lblNameObj[`s_avgD${speedType}`]);
|
|
4784
4792
|
});
|
|
4785
4793
|
updateScoreDetailLabel(`Speed`, `avgS`, `${(avgX[0] * avgX[1]).toFixed(2)}x`, 2, g_lblNameObj.s_avg);
|
|
4786
4794
|
};
|
|
@@ -4855,13 +4863,16 @@ const updateScoreDetailLabel = (_name, _label, _value, _pos = 0, _labelname = _l
|
|
|
4855
4863
|
* @param {object} _context
|
|
4856
4864
|
* @param {number} _resolution
|
|
4857
4865
|
*/
|
|
4858
|
-
const drawBaseLine = (_context, _resolution = 10) => {
|
|
4866
|
+
const drawBaseLine = (_context, { _fixed = 2, _mark = ``, _resolution = 10, _a = -90, _b = 105, _min = 0, _max = 2 } = {}) => {
|
|
4859
4867
|
_context.clearRect(0, 0, g_limitObj.graphWidth, g_limitObj.graphHeight);
|
|
4860
4868
|
|
|
4861
|
-
for (let j =
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4869
|
+
for (let j = _min * _resolution; j <= _max * _resolution; j += 5) {
|
|
4870
|
+
for (let k = 0; k < 5; k++) {
|
|
4871
|
+
if ((j + k) % 5 === 0) {
|
|
4872
|
+
drawLine(_context, (j + k) / _resolution, `main`, { _fixed, _mark, _a, _b });
|
|
4873
|
+
} else {
|
|
4874
|
+
drawLine(_context, (j + k) / _resolution, `sub`, { _fixed, _mark, _a, _b });
|
|
4875
|
+
}
|
|
4865
4876
|
}
|
|
4866
4877
|
}
|
|
4867
4878
|
};
|
|
@@ -4873,8 +4884,8 @@ const drawBaseLine = (_context, _resolution = 10) => {
|
|
|
4873
4884
|
* @param {string} _lineType
|
|
4874
4885
|
* @param {number} _fixed
|
|
4875
4886
|
*/
|
|
4876
|
-
const drawLine = (_context, _y, _lineType, _fixed =
|
|
4877
|
-
const lineY = (_y - 1) *
|
|
4887
|
+
const drawLine = (_context, _y, _lineType, { _fixed, _mark, _a, _b } = {}) => {
|
|
4888
|
+
const lineY = (_y - 1) * _a + _b;
|
|
4878
4889
|
_context.beginPath();
|
|
4879
4890
|
_context.moveTo(30, lineY);
|
|
4880
4891
|
_context.lineTo(g_limitObj.graphWidth, lineY);
|
|
@@ -4886,7 +4897,7 @@ const drawLine = (_context, _y, _lineType, _fixed = 0) => {
|
|
|
4886
4897
|
_context.strokeStyle = textColor;
|
|
4887
4898
|
_context.font = `${wUnit(12)} ${getBasicFont()}`;
|
|
4888
4899
|
_context.fillStyle = textColor;
|
|
4889
|
-
_context.fillText(_y.toFixed(_fixed),
|
|
4900
|
+
_context.fillText(_y.toFixed(_fixed) + _mark, 2, lineY + 4);
|
|
4890
4901
|
} else {
|
|
4891
4902
|
_context.strokeStyle = `#646464`;
|
|
4892
4903
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised : 2024/06/
|
|
8
|
+
* Revised : 2024/06/25 (v37.1.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -67,7 +67,8 @@ const g_limitObj = {
|
|
|
67
67
|
|
|
68
68
|
// グラフ表示部分の幅、高さ
|
|
69
69
|
graphWidth: 286,
|
|
70
|
-
graphHeight:
|
|
70
|
+
graphHeight: 240,
|
|
71
|
+
graphMiniSiz: 12,
|
|
71
72
|
|
|
72
73
|
// その他のフォントサイズ
|
|
73
74
|
titleSiz: 32,
|
|
@@ -158,11 +159,11 @@ const g_lblPosObj = {};
|
|
|
158
159
|
const updateWindowSiz = _ => {
|
|
159
160
|
Object.assign(g_windowObj, {
|
|
160
161
|
optionSprite: { x: (g_sWidth - 450) / 2, y: 65, w: 450, h: 325 },
|
|
161
|
-
difList: { x: 165, y: 60, w: 280, h:
|
|
162
|
-
difCover: { x: 20, y: 60, w: 145, h:
|
|
163
|
-
difFilter: { x: 0, y:
|
|
162
|
+
difList: { x: 165, y: 60, w: 280, h: 270 + g_sHeight - 500, overflow: `auto` },
|
|
163
|
+
difCover: { x: 20, y: 60, w: 145, h: 270 + g_sHeight - 500, opacity: 0.95 },
|
|
164
|
+
difFilter: { x: 0, y: 66, w: 140, h: 204 + g_sHeight - 500, overflow: `auto` },
|
|
164
165
|
displaySprite: { x: 25, y: 30, w: (g_sWidth - 450) / 2, h: g_limitObj.setLblHeight * 5 },
|
|
165
|
-
scoreDetail: { x: 20, y: 85, w: (g_sWidth - 500) / 2 + 420, h:
|
|
166
|
+
scoreDetail: { x: 20, y: 85, w: (g_sWidth - 500) / 2 + 420, h: 245, visibility: `hidden` },
|
|
166
167
|
detailObj: { w: (g_sWidth - 500) / 2 + 420, h: 230, visibility: `hidden` },
|
|
167
168
|
keyconSprite: { y: 105, h: g_sHeight - 105, overflow: `auto` },
|
|
168
169
|
loader: { y: g_sHeight - 10, h: 10, backgroundColor: `#333333` },
|
|
@@ -1589,6 +1590,7 @@ const g_shortcutObj = {
|
|
|
1589
1590
|
ShiftLeft_KeyA: { id: `lnkAppearanceL` },
|
|
1590
1591
|
ShiftRight_KeyA: { id: `lnkAppearanceL` },
|
|
1591
1592
|
KeyA: { id: `lnkAppearanceR` },
|
|
1593
|
+
KeyL: { id: `lnkLockBtn` },
|
|
1592
1594
|
ShiftLeft_KeyO: { id: `lnkOpacityL` },
|
|
1593
1595
|
ShiftRight_KeyO: { id: `lnkOpacityL` },
|
|
1594
1596
|
KeyO: { id: `lnkOpacityR` },
|