danoniplus 37.0.0 → 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 CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2024/06/15
7
+ * Revised : 2024/06/25
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 37.0.0`;
12
- const g_revisedDate = `2024/06/15`;
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: 22.5, w: g_limitObj.difCoverWidth, h: 16, siz: 12, fontWeight: `bold`,
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.7, _ => {
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
- drawBaseLine(context);
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 = [1, 1];
4746
- const lineX = [125, 210];
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 = playingFrame;
4755
+ let avgSubFrame = 0;
4751
4756
 
4752
- for (let i = 0; i < speedObj[speedType].frame.length; i++) {
4753
- const x = speedObj[speedType].frame[i] * (g_limitObj.graphWidth - 30) / playingFrame + 30;
4754
- const y = (speedObj[speedType].speed[i] - 1) * -90 + 105;
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 = speedObj[speedType].frame[i] - (speedObj[speedType].frame[i - 1] ?? startFrame);
4761
- avgX[j] += deltaFrame * (speedObj[speedType].speed[i - 1] ?? 1);
4762
- if ((speedObj[speedType].speed[i - 1] ?? 1) === 1) {
4763
- avgSubFrame -= deltaFrame;
4764
- } else {
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 = 1;
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], 215);
4777
- context.lineTo(lineX[j] + 25, 215);
4780
+ context.moveTo(lineX[j], lineY);
4781
+ context.lineTo(lineX[j] + 25, lineY);
4778
4782
  context.stroke();
4779
- context.font = `${wUnit(g_limitObj.difSelectorSiz)} ${getBasicFont()}`;
4780
- context.fillText(g_lblNameObj[`s_${speedType}`], lineX[j] + 30, 218);
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 = 0; j <= 2 * _resolution; j += 5) {
4862
- drawLine(_context, j / _resolution, `main`, 2);
4863
- for (let k = 1; k < 5; k++) {
4864
- drawLine(_context, (j + k) / _resolution, `sub`, 2);
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 = 0) => {
4877
- const lineY = (_y - 1) * -90 + 105;
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), 0, lineY + 4);
4900
+ _context.fillText(_y.toFixed(_fixed) + _mark, 2, lineY + 4);
4890
4901
  } else {
4891
4902
  _context.strokeStyle = `#646464`;
4892
4903
  }
@@ -7992,16 +8003,15 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
7992
8003
  }
7993
8004
 
7994
8005
  /**
7995
- * 譜面データの優先順配列の取得
7996
- * @param {string} _header
8006
+ * 譜面データの優先順配列パターンの取得
7997
8007
  * @param {string} _type
7998
8008
  * @param {number} _scoreNo
7999
8009
  */
8000
- const getPriorityList = (_header, _type, _scoreNo) => [
8001
- getRefData(_header, `${_type}${g_localeObj.val}${_scoreNo}_data`),
8002
- getRefData(_header, `${_type}${g_localeObj.val}_data`),
8003
- getRefData(_header, `${_type}${_scoreNo}_data`),
8004
- getRefData(_header, `${_type}_data`)
8010
+ const getPriorityVal = (_type, _scoreNo) => [
8011
+ `${_type}${g_localeObj.val}${_scoreNo}_data`,
8012
+ `${_type}${g_localeObj.val}_data`,
8013
+ `${_type}${_scoreNo}_data`,
8014
+ `${_type}_data`
8005
8015
  ];
8006
8016
 
8007
8017
  /**
@@ -8039,16 +8049,25 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
8039
8049
  */
8040
8050
  const makeWordData = _scoreNo => {
8041
8051
  const wordDataList = [];
8052
+ const wordTargets = [];
8042
8053
  let wordReverseFlg = false;
8043
8054
  const divideCnt = getKeyInfo().divideCnt;
8044
- const addDataList = (_type = ``) => wordDataList.push(...getPriorityList(`word`, _type, _scoreNo));
8055
+ const addDataList = (_type = ``) => wordTargets.push(...getPriorityVal(_type, _scoreNo));
8045
8056
  getPriorityHeader().forEach(val => addDataList(val));
8057
+ makeDedupliArray(wordTargets).forEach(val => wordDataList.push(getRefData(`word`, val)));
8046
8058
 
8047
8059
  if (g_stateObj.reverse === C_FLG_ON) {
8060
+ let wordTarget = ``;
8061
+ for (let val of makeDedupliArray(wordTargets)) {
8062
+ if (getRefData(`word`, val) !== undefined) {
8063
+ wordTarget = val;
8064
+ break;
8065
+ }
8066
+ }
8048
8067
 
8049
8068
  // wordRev_dataが指定されている場合はそのままの位置を採用
8050
8069
  // word_dataのみ指定されている場合、下記ルールに従って設定
8051
- if (wordDataList.find((v) => v !== undefined) === undefined) {
8070
+ if (!wordTarget.includes(`Rev`) && g_stateObj.scroll === `---`) {
8052
8071
  // Reverse時の歌詞の自動反転制御設定
8053
8072
  if (g_headerObj.wordAutoReverse !== `auto`) {
8054
8073
  wordReverseFlg = g_headerObj.wordAutoReverse === C_FLG_ON;
@@ -8129,9 +8148,11 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
8129
8148
  */
8130
8149
  const makeBackgroundData = (_header, _scoreNo, { resultTypes = [] } = {}) => {
8131
8150
  const dataList = [];
8151
+ const animationTargets = [];
8132
8152
  const calcFrameFunc = resultTypes.length > 0 ? undefined : calcFrame;
8133
- const addDataList = (_type = ``) => dataList.push(...getPriorityList(_header, _type, _scoreNo));
8153
+ const addDataList = (_type = ``) => animationTargets.push(...getPriorityVal(_type, _scoreNo));
8134
8154
  getPriorityHeader(resultTypes).forEach(val => addDataList(val));
8155
+ makeDedupliArray(animationTargets).forEach(val => dataList.push(getRefData(_header, val)));
8135
8156
 
8136
8157
  const data = dataList.find((v) => v !== undefined);
8137
8158
  return (data !== undefined ? g_animationFunc.make[_header](data, calcFrameFunc) : [[], -1]);
@@ -9021,7 +9042,8 @@ const getArrowSettings = _ => {
9021
9042
 
9022
9043
  g_typeLists.frzColor.forEach((frzType, k) => {
9023
9044
  g_workObj[`frz${frzType}Colors${type}`][j] = g_headerObj.frzColor[colorj][k] || ``;
9024
- g_workObj[`dummyFrz${frzType}Colors${type}`][j] = g_headerObj.setDummyColor[colorj];
9045
+ g_workObj[`dummyFrz${frzType}Colors${type}`][j] =
9046
+ frzType.includes(`Shadow`) ? `` : g_headerObj.setDummyColor[colorj] || ``;
9025
9047
  });
9026
9048
  g_workObj[`frzNormalShadowColors${type}`][j] = g_headerObj.frzShadowColor[colorj][0] || ``;
9027
9049
  g_workObj[`frzHitShadowColors${type}`][j] = g_headerObj.frzShadowColor[colorj][1] || ``;
@@ -10281,7 +10303,7 @@ const mainInit = _ => {
10281
10303
  // ダミーフリーズアロー生成
10282
10304
  g_workObj.mkDummyFrzArrow[currentFrame]?.forEach(data =>
10283
10305
  makeFrzArrow(data, ++dummyFrzCnts[data], `dummyFrz`, g_workObj.dummyFrzNormalColors[data],
10284
- _workObj.dummyFrzNormalBarColors[data], g_workObj.dummyFrzNormalShadowColors[data]));
10306
+ g_workObj.dummyFrzNormalBarColors[data], g_workObj.dummyFrzNormalShadowColors[data]));
10285
10307
 
10286
10308
  // フリーズアロー生成
10287
10309
  g_workObj.mkFrzArrow[currentFrame]?.forEach(data =>
@@ -10589,6 +10611,7 @@ const changeHitFrz = (_j, _k, _name, _difFrame = 0) => {
10589
10611
 
10590
10612
  const styfrzBar = $id(`${_name}Bar${frzNo}`);
10591
10613
  const styfrzBtm = $id(`${_name}Btm${frzNo}`);
10614
+ const styfrzTop = $id(`${_name}Top${frzNo}`);
10592
10615
  const styfrzTopShadow = $id(`${_name}TopShadow${frzNo}`);
10593
10616
  const styfrzBtmShadow = $id(`${_name}BtmShadow${frzNo}`);
10594
10617
 
@@ -10625,7 +10648,8 @@ const changeHitFrz = (_j, _k, _name, _difFrame = 0) => {
10625
10648
  styfrzBar.background = getColor(`HitBar`);
10626
10649
  styfrzBtm.top = wUnit(currentFrz.btmY);
10627
10650
  styfrzBtm.background = tmpHitColor;
10628
- styfrzTopShadow.opacity = 0;
10651
+ styfrzTop.top = wUnit(- hitPos);
10652
+ styfrzTopShadow.top = styfrzTop.top;
10629
10653
  styfrzBtmShadow.top = styfrzBtm.top;
10630
10654
  if (_name === `frz`) {
10631
10655
  const tmpShadowColor = getColor(`HitShadow`);
@@ -10650,17 +10674,11 @@ const changeFailedFrz = (_j, _k) => {
10650
10674
  $id(`frzHit${_j}`).opacity = 0;
10651
10675
  $id(`frzTop${frzNo}`).display = C_DIS_INHERIT;
10652
10676
  $id(`frzTop${frzNo}`).background = `#cccccc`;
10653
- $id(`frzTopShadow${frzNo}`).opacity = 1;
10654
10677
  $id(`frzTopShadow${frzNo}`).background = `#333333`;
10655
10678
  $id(`frzBtmShadow${frzNo}`).background = `#333333`;
10656
10679
  $id(`frzBar${frzNo}`).background = `#999999`;
10657
10680
  $id(`frzBar${frzNo}`).opacity = 1;
10658
10681
  $id(`frzBtm${frzNo}`).background = `#cccccc`;
10659
-
10660
- // 判定位置調整分の補正
10661
- const hitPos = g_workObj.hitPosition * g_workObj.scrollDir[_j];
10662
- $id(`frzTop${frzNo}`).top = wUnit(- hitPos);
10663
- $id(`frzTopShadow${frzNo}`).top = wUnit(- hitPos);
10664
10682
  };
10665
10683
 
10666
10684
  /**
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2024/06/15 (v37.0.0)
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: 226,
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: 265 + g_sHeight - 500, overflow: `auto` },
162
- difCover: { x: 20, y: 60, w: 145, h: 265 + g_sHeight - 500, opacity: 0.95 },
163
- difFilter: { x: 0, y: 61, w: 140, h: 204 + g_sHeight - 500, overflow: `auto` },
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: 240, visibility: `hidden` },
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` },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "37.0.0",
3
+ "version": "37.1.0",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {