danoniplus 34.5.2 → 34.6.1
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 +85 -31
- package/js/lib/danoni_constants.js +7 -2
- 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 :
|
|
7
|
+
* Revised : 2024/01/08
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 34.
|
|
12
|
-
const g_revisedDate = `
|
|
11
|
+
const g_version = `Ver 34.6.1`;
|
|
12
|
+
const g_revisedDate = `2024/01/08`;
|
|
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 =
|
|
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 ?
|
|
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${
|
|
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
|
-
|
|
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
|
|
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}${
|
|
3371
|
-
const _frzName = `${_frzCommon}${
|
|
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,
|
|
3376
|
-
const frzColorTxt = getRefData(_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) {
|
|
@@ -4505,11 +4523,18 @@ const makeDifList = (_difList, _targetKey = ``) => {
|
|
|
4505
4523
|
_difList.appendChild(makeDifLblCssButton(`dif${k}`, text, k, _ => nextDifficulty(j - g_stateObj.scoreId),
|
|
4506
4524
|
{ btnStyle: (j === g_stateObj.scoreId ? `Setting` : `Default`) }));
|
|
4507
4525
|
if (j === g_stateObj.scoreId) {
|
|
4508
|
-
pos = k + 6
|
|
4526
|
+
pos = k + 6.5 * (g_sHeight - 239) / 261;
|
|
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
|
|
|
@@ -4541,6 +4566,7 @@ const createDifWindow = (_key = ``) => {
|
|
|
4541
4566
|
setShortcutEvent(g_currentPage);
|
|
4542
4567
|
const difList = createEmptySprite(optionsprite, `difList`, g_windowObj.difList, g_cssObj.settings_DifSelector);
|
|
4543
4568
|
const difCover = createEmptySprite(optionsprite, `difCover`, g_windowObj.difCover, g_cssObj.settings_DifSelector);
|
|
4569
|
+
const difFilter = createEmptySprite(difCover, `difFilter`, g_windowObj.difFilter, g_cssObj.settings_DifSelector)
|
|
4544
4570
|
|
|
4545
4571
|
// リスト再作成
|
|
4546
4572
|
makeDifList(difList, _key);
|
|
@@ -4554,7 +4580,7 @@ const createDifWindow = (_key = ``) => {
|
|
|
4554
4580
|
|
|
4555
4581
|
// 全リスト
|
|
4556
4582
|
difCover.appendChild(
|
|
4557
|
-
makeDifLblCssButton(`keyFilter`, `ALL`, 1.
|
|
4583
|
+
makeDifLblCssButton(`keyFilter`, `ALL`, 1.7, _ => {
|
|
4558
4584
|
resetDifWindow();
|
|
4559
4585
|
g_stateObj.filterKeys = ``;
|
|
4560
4586
|
createDifWindow();
|
|
@@ -4564,18 +4590,18 @@ const createDifWindow = (_key = ``) => {
|
|
|
4564
4590
|
// キー別フィルタボタン作成
|
|
4565
4591
|
let pos = 0;
|
|
4566
4592
|
g_headerObj.viewKeyLists.forEach((targetKey, m) => {
|
|
4567
|
-
|
|
4568
|
-
makeDifLblCssButton(`keyFilter${m}`, `${getKeyName(targetKey)} ${getStgDetailName('key')}`, m
|
|
4593
|
+
difFilter.appendChild(
|
|
4594
|
+
makeDifLblCssButton(`keyFilter${m}`, `${getKeyName(targetKey)} ${getStgDetailName('key')}`, m, _ => {
|
|
4569
4595
|
resetDifWindow();
|
|
4570
4596
|
g_stateObj.filterKeys = targetKey;
|
|
4571
4597
|
createDifWindow(targetKey);
|
|
4572
4598
|
}, { w: g_limitObj.difCoverWidth, btnStyle: (g_stateObj.filterKeys === targetKey ? `Setting` : `Default`) })
|
|
4573
4599
|
);
|
|
4574
4600
|
if (g_stateObj.filterKeys === targetKey) {
|
|
4575
|
-
pos = m +
|
|
4601
|
+
pos = m + 5 * (g_sHeight - 300) / 200;
|
|
4576
4602
|
}
|
|
4577
4603
|
});
|
|
4578
|
-
|
|
4604
|
+
difFilter.scrollTop = Math.max(pos * g_limitObj.setLblHeight - parseInt(difFilter.style.height), 0);
|
|
4579
4605
|
|
|
4580
4606
|
multiAppend(optionsprite, makeDifBtn(-1), makeDifBtn());
|
|
4581
4607
|
};
|
|
@@ -6817,11 +6843,11 @@ const updateKeyInfo = (_header, _keyCtrlPtn) => {
|
|
|
6817
6843
|
*/
|
|
6818
6844
|
const changeSetColor = _ => {
|
|
6819
6845
|
const isDefault = [`Default`, `Type0`].includes(g_colorType);
|
|
6820
|
-
const
|
|
6821
|
-
const defaultType =
|
|
6846
|
+
const idHeader = setScoreIdHeader(g_stateObj.scoreId);
|
|
6847
|
+
const defaultType = idHeader + g_colorType;
|
|
6822
6848
|
const currentTypes = {
|
|
6823
6849
|
'': (isDefault ? defaultType : g_colorType),
|
|
6824
|
-
'Shadow': (isDefault ? defaultType : `${
|
|
6850
|
+
'Shadow': (isDefault ? defaultType : `${idHeader}Default`),
|
|
6825
6851
|
};
|
|
6826
6852
|
Object.keys(currentTypes).forEach(pattern => {
|
|
6827
6853
|
g_headerObj[`set${pattern}Color`] = structuredClone(g_headerObj[`set${pattern}Color${currentTypes[pattern]}`]);
|
|
@@ -6834,7 +6860,7 @@ const changeSetColor = _ => {
|
|
|
6834
6860
|
});
|
|
6835
6861
|
|
|
6836
6862
|
// 影矢印が未指定の場合はType1, Type2の影矢印指定を無くす
|
|
6837
|
-
if (!hasVal(g_headerObj[`setShadowColor${
|
|
6863
|
+
if (!hasVal(g_headerObj[`setShadowColor${idHeader}Default`][0]) && [`Type1`, `Type2`].includes(g_colorType)) {
|
|
6838
6864
|
g_headerObj.setShadowColor = [...Array(g_headerObj.setColorInit.length)].fill(``);
|
|
6839
6865
|
}
|
|
6840
6866
|
};
|
|
@@ -7176,8 +7202,31 @@ const loadingScoreInit = async () => {
|
|
|
7176
7202
|
}, 100);
|
|
7177
7203
|
};
|
|
7178
7204
|
|
|
7205
|
+
/**
|
|
7206
|
+
* 譜面番号の取得
|
|
7207
|
+
* @param {number} _scoreId
|
|
7208
|
+
* @param {boolean} _scoreLockFlg
|
|
7209
|
+
* @returns
|
|
7210
|
+
*/
|
|
7179
7211
|
const setScoreIdHeader = (_scoreId = 0, _scoreLockFlg = false) => {
|
|
7180
|
-
if (_scoreId > 0
|
|
7212
|
+
if (!_scoreLockFlg && _scoreId > 0) {
|
|
7213
|
+
return Number(_scoreId) + 1;
|
|
7214
|
+
} else if (_scoreLockFlg && g_headerObj.scoreNos?.[_scoreId] > 1) {
|
|
7215
|
+
return g_headerObj.scoreNos[_scoreId];
|
|
7216
|
+
}
|
|
7217
|
+
return ``;
|
|
7218
|
+
};
|
|
7219
|
+
|
|
7220
|
+
/**
|
|
7221
|
+
* 譜面ファイル番号の取得
|
|
7222
|
+
* @param {number} _scoreId
|
|
7223
|
+
* @param {boolean} _scoreLockFlg
|
|
7224
|
+
* @returns
|
|
7225
|
+
*/
|
|
7226
|
+
const setDosIdHeader = (_scoreId = 0, _scoreLockFlg = false) => {
|
|
7227
|
+
if (_scoreLockFlg && g_headerObj.dosNos?.[_scoreId] > 0) {
|
|
7228
|
+
return g_headerObj.dosNos?.[_scoreId] > 1 ? g_headerObj.dosNos[_scoreId] : ``;
|
|
7229
|
+
} else if (_scoreId > 0) {
|
|
7181
7230
|
return Number(_scoreId) + 1;
|
|
7182
7231
|
}
|
|
7183
7232
|
return ``;
|
|
@@ -10771,7 +10820,7 @@ const resultInit = _ => {
|
|
|
10771
10820
|
tweetMaxCombo += `-${g_resultObj.fmaxCombo}`;
|
|
10772
10821
|
}
|
|
10773
10822
|
|
|
10774
|
-
|
|
10823
|
+
const makeResultText = _format => replaceStr(_format, [
|
|
10775
10824
|
[`[hashTag]`, hashTag],
|
|
10776
10825
|
[`[musicTitle]`, musicTitle],
|
|
10777
10826
|
[`[keyLabel]`, tweetDifData],
|
|
@@ -10784,6 +10833,9 @@ const resultInit = _ => {
|
|
|
10784
10833
|
[`[maxCombo]`, tweetMaxCombo],
|
|
10785
10834
|
[`[url]`, baseTwitUrl]
|
|
10786
10835
|
]);
|
|
10836
|
+
let tweetResultTmp = makeResultText(g_headerObj.resultFormat);
|
|
10837
|
+
let resultCommonTmp = makeResultText(g_templateObj.resultFormatDf);
|
|
10838
|
+
|
|
10787
10839
|
if (g_presetObj.resultVals !== undefined) {
|
|
10788
10840
|
Object.keys(g_presetObj.resultVals).forEach(key =>
|
|
10789
10841
|
tweetResultTmp = tweetResultTmp.split(`[${key}]`).join(g_resultObj[g_presetObj.resultVals[key]]));
|
|
@@ -10942,7 +10994,9 @@ const resultInit = _ => {
|
|
|
10942
10994
|
resetCommonBtn(`btnBack`, g_lblNameObj.b_back, g_lblPosObj.btnRsBack, titleInit, g_cssObj.button_Back),
|
|
10943
10995
|
|
|
10944
10996
|
// リザルトデータをクリップボードへコピー
|
|
10945
|
-
createCss2Button(`btnCopy`, g_lblNameObj.b_copy, _ =>
|
|
10997
|
+
createCss2Button(`btnCopy`, g_lblNameObj.b_copy, _ =>
|
|
10998
|
+
copyTextToClipboard(keyIsDown(g_kCdNameObj.shiftLKey) || keyIsDown(g_kCdNameObj.shiftRKey) ?
|
|
10999
|
+
unEscapeHtml(resultCommonTmp) : resultText, g_msgInfoObj.I_0001),
|
|
10946
11000
|
g_lblPosObj.btnRsCopy, g_cssObj.button_Setting),
|
|
10947
11001
|
);
|
|
10948
11002
|
makeLinkButton();
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised :
|
|
8
|
+
* Revised : 2024/01/08 (v34.6.1)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -186,7 +186,8 @@ const updateWindowSiz = _ => {
|
|
|
186
186
|
Object.assign(g_windowObj, {
|
|
187
187
|
optionSprite: { x: (g_sWidth - 450) / 2, y: 65, w: 450, h: 325 },
|
|
188
188
|
difList: { x: 165, y: 60, w: 280, h: 261 + g_sHeight - 500, overflow: `auto` },
|
|
189
|
-
difCover: { x: 25, y: 60, w: 140, h: 261 + g_sHeight - 500,
|
|
189
|
+
difCover: { x: 25, y: 60, w: 140, h: 261 + g_sHeight - 500, opacity: 0.95 },
|
|
190
|
+
difFilter: { x: 0, y: 61, w: 140, h: 200 + g_sHeight - 500, overflow: `auto` },
|
|
190
191
|
displaySprite: { x: 25, y: 30, w: (g_sWidth - 450) / 2, h: g_limitObj.setLblHeight * 5 },
|
|
191
192
|
scoreDetail: { x: 20, y: 85, w: (g_sWidth - 500) / 2 + 420, h: 236, visibility: `hidden` },
|
|
192
193
|
detailObj: { w: (g_sWidth - 500) / 2 + 420, h: 230, visibility: `hidden` },
|
|
@@ -775,6 +776,10 @@ const g_rankObj = {
|
|
|
775
776
|
rankColorX: `#996600`
|
|
776
777
|
};
|
|
777
778
|
|
|
779
|
+
const g_templateObj = {
|
|
780
|
+
resultFormatDf: `【#danoni[hashTag]】[musicTitle]([keyLabel]) /[maker] /Rank:[rank]/Score:[score]/Playstyle:[playStyle]/[arrowJdg]/[frzJdg]/[maxCombo] [url]`,
|
|
781
|
+
};
|
|
782
|
+
|
|
778
783
|
const g_pointAllocation = {
|
|
779
784
|
ii: 8,
|
|
780
785
|
shakin: 4,
|