danoniplus 34.5.1 → 34.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 CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2023/11/05
7
+ * Revised : 2024/01/07
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 34.5.1`;
12
- const g_revisedDate = `2023/11/05`;
11
+ const g_version = `Ver 34.6.0`;
12
+ const g_revisedDate = `2024/01/07`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -2114,15 +2114,13 @@ const initialControl = async () => {
2114
2114
  }
2115
2115
  }
2116
2116
 
2117
- getScoreDetailData(0);
2118
-
2119
2117
  if (g_loadObj.main) {
2120
2118
 
2121
2119
  // 譜面分割、譜面番号固定かどうかをチェック
2122
2120
  g_stateObj.dosDivideFlg = setBoolVal(document.getElementById(`externalDosDivide`)?.value ?? getQueryParamVal(`dosDivide`));
2123
2121
  g_stateObj.scoreLockFlg = setBoolVal(document.getElementById(`externalDosLock`)?.value ?? getQueryParamVal(`dosLock`));
2124
2122
 
2125
- for (let j = 1; j < g_headerObj.keyLabels.length; j++) {
2123
+ for (let j = 0; j < g_headerObj.keyLabels.length; j++) {
2126
2124
 
2127
2125
  // 譜面ファイルが分割されている場合、譜面詳細情報取得のために譜面をロード
2128
2126
  if (g_stateObj.dosDivideFlg) {
@@ -2256,7 +2254,8 @@ const loadChartFile = async (_scoreId = g_stateObj.scoreId) => {
2256
2254
  const fileBase = queryDos.match(/.+\..*/)[0];
2257
2255
  const fileExtension = fileBase.split(`.`).pop();
2258
2256
  const fileCommon = fileBase.split(`.${fileExtension}`)[0];
2259
- const filename = `${fileCommon}${g_stateObj.dosDivideFlg ? setScoreIdHeader(_scoreId) : ''}.${fileExtension}`;
2257
+ const filename = `${fileCommon}${g_stateObj.dosDivideFlg ?
2258
+ setDosIdHeader(_scoreId, g_stateObj.scoreLockFlg) : ''}.${fileExtension}`;
2260
2259
 
2261
2260
  await loadScript2(`${filename}?${Date.now()}`, false, charset);
2262
2261
  if (typeof externalDosInit === C_TYP_FUNCTION) {
@@ -2297,10 +2296,12 @@ const resetColorAndGauge = _scoreId => {
2297
2296
  */
2298
2297
  const copySetColor = (_baseObj, _scoreId) => {
2299
2298
  const obj = {};
2300
- const scoreIdHeader = setScoreIdHeader(_scoreId);
2299
+ const scoreIdHeader = setScoreIdHeader(_scoreId, g_stateObj.scoreLockFlg);
2300
+ const idHeader = setScoreIdHeader(_scoreId);
2301
2301
  [``, `Shadow`].forEach(pattern =>
2302
2302
  [`set`, `frz`].filter(arrow => hasVal(_baseObj[`${arrow}${pattern}Color`]))
2303
- .forEach(arrow => obj[`${arrow}${pattern}Color${scoreIdHeader}`] = _baseObj[`${arrow}${pattern}Color`].concat()));
2303
+ .forEach(arrow => obj[`${arrow}${pattern}Color${idHeader}`] =
2304
+ (_baseObj[`${arrow}${pattern}Color${scoreIdHeader}`] ?? _baseObj[`${arrow}${pattern}Color`]).concat()));
2304
2305
  return obj;
2305
2306
  };
2306
2307
 
@@ -2803,6 +2804,24 @@ const headerConvert = _dosObj => {
2803
2804
  }
2804
2805
  obj.tuningInit = obj.tuning;
2805
2806
 
2807
+ obj.dosNos = [];
2808
+ obj.scoreNos = [];
2809
+ if (hasVal(_dosObj.dosNo)) {
2810
+ splitLF2(_dosObj.dosNo).map((val, j) => [obj.dosNos[j], obj.scoreNos[j]] = val.split(`,`));
2811
+ const dosNoCnt = {};
2812
+ obj.dosNos.forEach((val, j) => {
2813
+ if (dosNoCnt[val] === undefined) {
2814
+ dosNoCnt[val] = 0;
2815
+ }
2816
+ if (obj.scoreNos[j] === undefined) {
2817
+ dosNoCnt[val]++;
2818
+ obj.scoreNos[j] = dosNoCnt[val];
2819
+ } else {
2820
+ dosNoCnt[val] = Number(obj.scoreNos[j]);
2821
+ }
2822
+ });
2823
+ }
2824
+
2806
2825
  // 譜面情報
2807
2826
  if (hasVal(_dosObj.difData)) {
2808
2827
  const difs = splitLF2(_dosObj.difData);
@@ -3257,8 +3276,7 @@ const headerConvert = _dosObj => {
3257
3276
  obj.justFrames = (g_isLocal) ? 0 : 1;
3258
3277
 
3259
3278
  // リザルトデータのカスタマイズ
3260
- const resultFormatDefault = `【#danoni[hashTag]】[musicTitle]([keyLabel]) /[maker] /Rank:[rank]/Score:[score]/Playstyle:[playStyle]/[arrowJdg]/[frzJdg]/[maxCombo] [url]`;
3261
- obj.resultFormat = escapeHtmlForEnabledTag(_dosObj.resultFormat ?? g_presetObj.resultFormat ?? resultFormatDefault);
3279
+ obj.resultFormat = escapeHtmlForEnabledTag(_dosObj.resultFormat ?? g_presetObj.resultFormat ?? g_templateObj.resultFormatDf);
3262
3280
 
3263
3281
  // リザルト画像データのカスタム設定
3264
3282
  obj.resultValsView = _dosObj.resultValsView?.split(`,`) ?? g_presetObj.resultValsView ?? Array.from(Object.keys(g_presetObj.resultVals ?? {}));
@@ -3357,7 +3375,7 @@ const addGaugeFulls = _obj => _obj.map(key => g_gaugeOptionObj.customFulls[key]
3357
3375
  const resetBaseColorList = (_baseObj, _dosObj, { scoreId = `` } = {}) => {
3358
3376
 
3359
3377
  const obj = {};
3360
- const scoreIdHeader = setScoreIdHeader(scoreId);
3378
+ const idHeader = setScoreIdHeader(scoreId);
3361
3379
  const getRefData = (_header, _dataName) => {
3362
3380
  const data = _dosObj[`${_header}${_dataName}`];
3363
3381
  return data?.startsWith(_header) ? _dosObj[data] : data;
@@ -3367,13 +3385,13 @@ const resetBaseColorList = (_baseObj, _dosObj, { scoreId = `` } = {}) => {
3367
3385
  const _arrowCommon = `set${pattern}Color`;
3368
3386
  const _frzCommon = `frz${pattern}Color`;
3369
3387
 
3370
- const _name = `${_arrowCommon}${scoreIdHeader}`;
3371
- const _frzName = `${_frzCommon}${scoreIdHeader}`;
3388
+ const _name = `${_arrowCommon}${idHeader}`;
3389
+ const _frzName = `${_frzCommon}${idHeader}`;
3372
3390
  const _arrowInit = `${_arrowCommon}Init`;
3373
3391
  const _frzInit = `${_frzCommon}Init`;
3374
3392
 
3375
- const arrowColorTxt = getRefData(_arrowCommon, scoreIdHeader) || _dosObj[_arrowCommon];
3376
- const frzColorTxt = getRefData(_frzCommon, scoreIdHeader) || _dosObj[_frzCommon];
3393
+ const arrowColorTxt = getRefData(_arrowCommon, idHeader) || _dosObj[_arrowCommon];
3394
+ const frzColorTxt = getRefData(_frzCommon, idHeader) || _dosObj[_frzCommon];
3377
3395
 
3378
3396
  // 矢印色
3379
3397
  Object.keys(_baseObj.dfColorgrdSet).forEach(type => {
@@ -3585,7 +3603,7 @@ const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
3585
3603
  */
3586
3604
  const getGaugeDetailList = (_scoreId, _defaultGaugeList) => {
3587
3605
  if (_scoreId > 0) {
3588
- const headerName = `gauge${_name}${setScoreIdHeader(_scoreId)}`;
3606
+ const headerName = `gauge${_name}${setScoreIdHeader(_scoreId, g_stateObj.scoreLockFlg)}`;
3589
3607
  if (hasVal(_dosObj[headerName])) {
3590
3608
  return _dosObj[headerName].split(`,`);
3591
3609
  }
@@ -4494,7 +4512,7 @@ const nextDifficulty = (_scrollNum = 1) => {
4494
4512
  * @param {string} _targetKey
4495
4513
  */
4496
4514
  const makeDifList = (_difList, _targetKey = ``) => {
4497
- let k = 0, pos = 0;
4515
+ let k = 0, pos = 0, curk = -1;
4498
4516
  g_headerObj.viewLists.forEach(j => {
4499
4517
  const keyLabel = g_headerObj.keyLabels[j];
4500
4518
  if (_targetKey === `` || keyLabel === _targetKey) {
@@ -4506,10 +4524,17 @@ const makeDifList = (_difList, _targetKey = ``) => {
4506
4524
  { btnStyle: (j === g_stateObj.scoreId ? `Setting` : `Default`) }));
4507
4525
  if (j === g_stateObj.scoreId) {
4508
4526
  pos = k + 6 + (g_sHeight - 500) / 50;
4527
+ curk = k;
4509
4528
  }
4510
4529
  k++;
4511
4530
  }
4512
4531
  });
4532
+ if (document.getElementById(`lblDifCnt`) === null) {
4533
+ difCover.appendChild(createDivCss2Label(`lblDifCnt`, ``, {
4534
+ x: 0, y: 22.5, w: g_limitObj.difCoverWidth, h: 16, siz: 12, fontWeight: `bold`,
4535
+ }));
4536
+ }
4537
+ lblDifCnt.innerHTML = `${_targetKey === '' ? 'ALL' : _targetKey + 'k'}: ${curk === -1 ? '-' : curk + 1} / ${k}`;
4513
4538
  _difList.scrollTop = Math.max(pos * g_limitObj.setLblHeight - parseInt(_difList.style.height), 0);
4514
4539
  };
4515
4540
 
@@ -4554,7 +4579,7 @@ const createDifWindow = (_key = ``) => {
4554
4579
 
4555
4580
  // 全リスト
4556
4581
  difCover.appendChild(
4557
- makeDifLblCssButton(`keyFilter`, `ALL`, 1.5, _ => {
4582
+ makeDifLblCssButton(`keyFilter`, `ALL`, 1.7, _ => {
4558
4583
  resetDifWindow();
4559
4584
  g_stateObj.filterKeys = ``;
4560
4585
  createDifWindow();
@@ -4565,7 +4590,7 @@ const createDifWindow = (_key = ``) => {
4565
4590
  let pos = 0;
4566
4591
  g_headerObj.viewKeyLists.forEach((targetKey, m) => {
4567
4592
  difCover.appendChild(
4568
- makeDifLblCssButton(`keyFilter${m}`, `${getKeyName(targetKey)} ${getStgDetailName('key')}`, m + 2.5, _ => {
4593
+ makeDifLblCssButton(`keyFilter${m}`, `${getKeyName(targetKey)} ${getStgDetailName('key')}`, m + 2.7, _ => {
4569
4594
  resetDifWindow();
4570
4595
  g_stateObj.filterKeys = targetKey;
4571
4596
  createDifWindow(targetKey);
@@ -6817,11 +6842,11 @@ const updateKeyInfo = (_header, _keyCtrlPtn) => {
6817
6842
  */
6818
6843
  const changeSetColor = _ => {
6819
6844
  const isDefault = [`Default`, `Type0`].includes(g_colorType);
6820
- const scoreIdHeader = setScoreIdHeader(g_stateObj.scoreId);
6821
- const defaultType = scoreIdHeader + g_colorType;
6845
+ const idHeader = setScoreIdHeader(g_stateObj.scoreId);
6846
+ const defaultType = idHeader + g_colorType;
6822
6847
  const currentTypes = {
6823
6848
  '': (isDefault ? defaultType : g_colorType),
6824
- 'Shadow': (isDefault ? defaultType : `${scoreIdHeader}Default`),
6849
+ 'Shadow': (isDefault ? defaultType : `${idHeader}Default`),
6825
6850
  };
6826
6851
  Object.keys(currentTypes).forEach(pattern => {
6827
6852
  g_headerObj[`set${pattern}Color`] = structuredClone(g_headerObj[`set${pattern}Color${currentTypes[pattern]}`]);
@@ -6834,7 +6859,7 @@ const changeSetColor = _ => {
6834
6859
  });
6835
6860
 
6836
6861
  // 影矢印が未指定の場合はType1, Type2の影矢印指定を無くす
6837
- if (!hasVal(g_headerObj[`setShadowColor${scoreIdHeader}Default`][0]) && [`Type1`, `Type2`].includes(g_colorType)) {
6862
+ if (!hasVal(g_headerObj[`setShadowColor${idHeader}Default`][0]) && [`Type1`, `Type2`].includes(g_colorType)) {
6838
6863
  g_headerObj.setShadowColor = [...Array(g_headerObj.setColorInit.length)].fill(``);
6839
6864
  }
6840
6865
  };
@@ -7176,8 +7201,31 @@ const loadingScoreInit = async () => {
7176
7201
  }, 100);
7177
7202
  };
7178
7203
 
7204
+ /**
7205
+ * 譜面番号の取得
7206
+ * @param {number} _scoreId
7207
+ * @param {boolean} _scoreLockFlg
7208
+ * @returns
7209
+ */
7179
7210
  const setScoreIdHeader = (_scoreId = 0, _scoreLockFlg = false) => {
7180
- if (_scoreId > 0 && _scoreLockFlg === false) {
7211
+ if (!_scoreLockFlg && _scoreId > 0) {
7212
+ return Number(_scoreId) + 1;
7213
+ } else if (_scoreLockFlg && g_headerObj.scoreNos?.[_scoreId] > 1) {
7214
+ return g_headerObj.scoreNos[_scoreId];
7215
+ }
7216
+ return ``;
7217
+ };
7218
+
7219
+ /**
7220
+ * 譜面ファイル番号の取得
7221
+ * @param {number} _scoreId
7222
+ * @param {boolean} _scoreLockFlg
7223
+ * @returns
7224
+ */
7225
+ const setDosIdHeader = (_scoreId = 0, _scoreLockFlg = false) => {
7226
+ if (_scoreLockFlg && g_headerObj.dosNos?.[_scoreId] > 0) {
7227
+ return g_headerObj.dosNos?.[_scoreId] > 1 ? g_headerObj.dosNos[_scoreId] : ``;
7228
+ } else if (_scoreId > 0) {
7181
7229
  return Number(_scoreId) + 1;
7182
7230
  }
7183
7231
  return ``;
@@ -7850,7 +7898,7 @@ const getFirstArrowFrame = (_dataObj, _keyCtrlPtn = `${g_keyObj.currentKey}_${g_
7850
7898
  * @param {number} _scoreId
7851
7899
  */
7852
7900
  const getStartFrame = (_lastFrame, _fadein = 0, _scoreId = g_stateObj.scoreId) => {
7853
- let frameNum = parseInt(g_headerObj.startFrame?.[_scoreId] ?? g_headerObj.startFrame?.[0] ?? 0);
7901
+ let frameNum = setIntVal(g_headerObj.startFrame?.[_scoreId], setIntVal(g_headerObj.startFrame?.[0], 0));
7854
7902
  if (_lastFrame >= frameNum) {
7855
7903
  frameNum = Math.round(_fadein / 100 * (_lastFrame - frameNum)) + frameNum;
7856
7904
  }
@@ -10771,7 +10819,7 @@ const resultInit = _ => {
10771
10819
  tweetMaxCombo += `-${g_resultObj.fmaxCombo}`;
10772
10820
  }
10773
10821
 
10774
- let tweetResultTmp = replaceStr(g_headerObj.resultFormat, [
10822
+ const makeResultText = _format => replaceStr(_format, [
10775
10823
  [`[hashTag]`, hashTag],
10776
10824
  [`[musicTitle]`, musicTitle],
10777
10825
  [`[keyLabel]`, tweetDifData],
@@ -10784,6 +10832,9 @@ const resultInit = _ => {
10784
10832
  [`[maxCombo]`, tweetMaxCombo],
10785
10833
  [`[url]`, baseTwitUrl]
10786
10834
  ]);
10835
+ let tweetResultTmp = makeResultText(g_headerObj.resultFormat);
10836
+ let resultCommonTmp = makeResultText(g_templateObj.resultFormatDf);
10837
+
10787
10838
  if (g_presetObj.resultVals !== undefined) {
10788
10839
  Object.keys(g_presetObj.resultVals).forEach(key =>
10789
10840
  tweetResultTmp = tweetResultTmp.split(`[${key}]`).join(g_resultObj[g_presetObj.resultVals[key]]));
@@ -10942,7 +10993,9 @@ const resultInit = _ => {
10942
10993
  resetCommonBtn(`btnBack`, g_lblNameObj.b_back, g_lblPosObj.btnRsBack, titleInit, g_cssObj.button_Back),
10943
10994
 
10944
10995
  // リザルトデータをクリップボードへコピー
10945
- createCss2Button(`btnCopy`, g_lblNameObj.b_copy, _ => copyTextToClipboard(resultText, g_msgInfoObj.I_0001),
10996
+ createCss2Button(`btnCopy`, g_lblNameObj.b_copy, _ =>
10997
+ copyTextToClipboard(keyIsDown(g_kCdNameObj.shiftLKey) || keyIsDown(g_kCdNameObj.shiftRKey) ?
10998
+ unEscapeHtml(resultCommonTmp) : resultText, g_msgInfoObj.I_0001),
10946
10999
  g_lblPosObj.btnRsCopy, g_cssObj.button_Setting),
10947
11000
  );
10948
11001
  makeLinkButton();
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2023/11/05 (v34.5.0)
8
+ * Revised : 2024/01/07 (v34.6.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -775,6 +775,10 @@ const g_rankObj = {
775
775
  rankColorX: `#996600`
776
776
  };
777
777
 
778
+ const g_templateObj = {
779
+ resultFormatDf: `【#danoni[hashTag]】[musicTitle]([keyLabel]) /[maker] /Rank:[rank]/Score:[score]/Playstyle:[playStyle]/[arrowJdg]/[frzJdg]/[maxCombo] [url]`,
780
+ };
781
+
778
782
  const g_pointAllocation = {
779
783
  ii: 8,
780
784
  shakin: 4,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "34.5.1",
3
+ "version": "34.6.0",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {