danoniplus 31.4.1 → 31.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 +791 -780
- package/js/lib/danoni_constants.js +27 -15
- 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 : 2023/04/
|
|
7
|
+
* Revised : 2023/04/26
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 31.
|
|
12
|
-
const g_revisedDate = `2023/04/
|
|
11
|
+
const g_version = `Ver 31.6.0`;
|
|
12
|
+
const g_revisedDate = `2023/04/26`;
|
|
13
13
|
const g_alphaVersion = ``;
|
|
14
14
|
|
|
15
15
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
@@ -2066,7 +2066,7 @@ const loadLocalStorage = _ => {
|
|
|
2066
2066
|
if (checkStorage) {
|
|
2067
2067
|
g_localStorage = JSON.parse(checkStorage);
|
|
2068
2068
|
|
|
2069
|
-
// Adjustment, Volume, Appearance, Opacity,
|
|
2069
|
+
// Adjustment, Volume, Appearance, Opacity, HitPosition初期値設定
|
|
2070
2070
|
checkLocalParam(`adjustment`, C_TYP_FLOAT, g_settings.adjustmentNum);
|
|
2071
2071
|
checkLocalParam(`volume`, C_TYP_NUMBER, g_settings.volumes.length - 1);
|
|
2072
2072
|
checkLocalParam(`appearance`);
|
|
@@ -3056,9 +3056,7 @@ const headerConvert = _dosObj => {
|
|
|
3056
3056
|
});
|
|
3057
3057
|
}
|
|
3058
3058
|
|
|
3059
|
-
// ローカルストレージに保存済みの
|
|
3060
|
-
g_storeSettings.filter(tmpSetting => hasVal(g_localStorage[tmpSetting])).forEach(setting =>
|
|
3061
|
-
g_stateObj[setting] = g_localStorage[setting]);
|
|
3059
|
+
// ローカルストレージに保存済みのColorType設定からDisplayのColor設定を反映
|
|
3062
3060
|
if (g_localStorage.colorType !== undefined) {
|
|
3063
3061
|
g_colorType = g_localStorage.colorType;
|
|
3064
3062
|
if (obj.colorUse) {
|
|
@@ -4305,155 +4303,615 @@ const inputSlider = (_slider, _link) => {
|
|
|
4305
4303
|
};
|
|
4306
4304
|
|
|
4307
4305
|
/**
|
|
4308
|
-
*
|
|
4309
|
-
* @param {Object} _sprite 基準とするスプライト(ここで指定する座標は、そのスプライトからの相対位置)
|
|
4306
|
+
* 譜面変更セレクターの削除
|
|
4310
4307
|
*/
|
|
4311
|
-
const
|
|
4308
|
+
const resetDifWindow = _ => {
|
|
4309
|
+
if (document.querySelector(`#difList`) !== null) {
|
|
4310
|
+
deleteChildspriteAll(`difList`);
|
|
4311
|
+
[`difList`, `difCover`, `btnDifU`, `btnDifD`].forEach(obj => optionsprite.removeChild(document.getElementById(obj)));
|
|
4312
|
+
g_currentPage = `option`;
|
|
4313
|
+
setShortcutEvent(g_currentPage, _ => true, { displayFlg: false, dfEvtFlg: true });
|
|
4314
|
+
}
|
|
4315
|
+
};
|
|
4312
4316
|
|
|
4313
|
-
|
|
4314
|
-
|
|
4317
|
+
/**
|
|
4318
|
+
* 譜面選択処理
|
|
4319
|
+
* @param {number} _scrollNum
|
|
4320
|
+
*/
|
|
4321
|
+
const nextDifficulty = (_scrollNum = 1) => {
|
|
4322
|
+
g_keyObj.prevKey = g_headerObj.keyLabels[g_stateObj.scoreId];
|
|
4323
|
+
g_stateObj.scoreId = nextPos(g_stateObj.scoreId, _scrollNum, g_headerObj.keyLabels.length);
|
|
4324
|
+
setDifficulty(true);
|
|
4325
|
+
resetDifWindow();
|
|
4326
|
+
};
|
|
4315
4327
|
|
|
4316
|
-
|
|
4317
|
-
|
|
4328
|
+
/**
|
|
4329
|
+
* 譜面リストの作成
|
|
4330
|
+
* @param {object} _difList
|
|
4331
|
+
* @param {string} _targetKey
|
|
4332
|
+
*/
|
|
4333
|
+
const makeDifList = (_difList, _targetKey = ``) => {
|
|
4334
|
+
let k = 0;
|
|
4335
|
+
let pos = 0;
|
|
4336
|
+
g_headerObj.keyLabels.forEach((keyLabel, j) => {
|
|
4337
|
+
if (_targetKey === `` || keyLabel === _targetKey) {
|
|
4338
|
+
let text = `${getKeyName(keyLabel)} / ${g_headerObj.difLabels[j]}`;
|
|
4339
|
+
if (g_headerObj.makerView) {
|
|
4340
|
+
text += ` (${g_headerObj.creatorNames[j]})`;
|
|
4341
|
+
}
|
|
4342
|
+
_difList.appendChild(makeDifLblCssButton(`dif${k}`, text, k, _ => {
|
|
4343
|
+
nextDifficulty(j - g_stateObj.scoreId);
|
|
4344
|
+
}, { btnStyle: (j === g_stateObj.scoreId ? `Setting` : `Default`) }));
|
|
4345
|
+
if (j === g_stateObj.scoreId) {
|
|
4346
|
+
pos = k + 6;
|
|
4347
|
+
}
|
|
4348
|
+
k++;
|
|
4349
|
+
}
|
|
4350
|
+
});
|
|
4351
|
+
const overlength = pos * g_limitObj.setLblHeight - parseInt(_difList.style.height);
|
|
4352
|
+
_difList.scrollTop = (overlength > 0 ? overlength : 0);
|
|
4353
|
+
};
|
|
4318
4354
|
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4355
|
+
/**
|
|
4356
|
+
* 譜面セレクター位置の変更ボタン
|
|
4357
|
+
* @param {number} _scrollNum
|
|
4358
|
+
* @returns
|
|
4359
|
+
*/
|
|
4360
|
+
const makeDifBtn = (_scrollNum = 1) => {
|
|
4361
|
+
const dir = _scrollNum === 1 ? `D` : `U`;
|
|
4362
|
+
return createCss2Button(`btnDif${dir}`, g_settingBtnObj.chara[dir], _ => {
|
|
4363
|
+
do {
|
|
4364
|
+
g_stateObj.scoreId = nextPos(g_stateObj.scoreId, _scrollNum, g_headerObj.keyLabels.length);
|
|
4365
|
+
} while (g_stateObj.filterKeys !== `` && g_stateObj.filterKeys !== g_headerObj.keyLabels[g_stateObj.scoreId]);
|
|
4366
|
+
setDifficulty(true);
|
|
4367
|
+
deleteChildspriteAll(`difList`);
|
|
4368
|
+
makeDifList(difList, g_stateObj.filterKeys);
|
|
4369
|
+
g_keyObj.prevKey = g_keyObj.currentKey;
|
|
4370
|
+
}, {
|
|
4371
|
+
x: 430 + _scrollNum * 10, y: 40, w: 20, h: 20, siz: g_limitObj.jdgCntsSiz,
|
|
4372
|
+
}, g_cssObj.button_Mini);
|
|
4373
|
+
};
|
|
4323
4374
|
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4375
|
+
/**
|
|
4376
|
+
* 譜面変更セレクターの作成・再作成
|
|
4377
|
+
* @param {string} _key
|
|
4378
|
+
*/
|
|
4379
|
+
const createDifWindow = (_key = ``) => {
|
|
4380
|
+
g_currentPage = `difSelector`;
|
|
4381
|
+
setShortcutEvent(g_currentPage);
|
|
4382
|
+
const difList = createEmptySprite(optionsprite, `difList`, g_windowObj.difList, g_cssObj.settings_DifSelector);
|
|
4383
|
+
const difCover = createEmptySprite(optionsprite, `difCover`, g_windowObj.difCover, g_cssObj.settings_DifSelector);
|
|
4384
|
+
|
|
4385
|
+
// リスト再作成
|
|
4386
|
+
makeDifList(difList, _key);
|
|
4387
|
+
|
|
4388
|
+
// ランダム選択
|
|
4389
|
+
difCover.appendChild(
|
|
4390
|
+
makeDifLblCssButton(`difRandom`, `RANDOM`, 0, _ => {
|
|
4391
|
+
nextDifficulty(Math.floor(Math.random() * g_headerObj.keyLabels.length));
|
|
4392
|
+
}, { w: g_limitObj.difCoverWidth })
|
|
4393
|
+
);
|
|
4394
|
+
|
|
4395
|
+
// 全リスト
|
|
4396
|
+
difCover.appendChild(
|
|
4397
|
+
makeDifLblCssButton(`keyFilter`, `ALL`, 1.5, _ => {
|
|
4398
|
+
resetDifWindow();
|
|
4399
|
+
g_stateObj.filterKeys = ``;
|
|
4400
|
+
createDifWindow();
|
|
4401
|
+
}, { w: g_limitObj.difCoverWidth, btnStyle: (g_stateObj.filterKeys === `` ? `Setting` : `Default`) })
|
|
4402
|
+
);
|
|
4403
|
+
|
|
4404
|
+
// キー別フィルタボタン作成
|
|
4405
|
+
let pos = 0;
|
|
4406
|
+
g_headerObj.keyLists.forEach((targetKey, m) => {
|
|
4407
|
+
difCover.appendChild(
|
|
4408
|
+
makeDifLblCssButton(`keyFilter${m}`, `${getKeyName(targetKey)} ${getStgDetailName('key')}`, m + 2.5, _ => {
|
|
4409
|
+
resetDifWindow();
|
|
4410
|
+
g_stateObj.filterKeys = targetKey;
|
|
4411
|
+
createDifWindow(targetKey);
|
|
4412
|
+
}, { w: g_limitObj.difCoverWidth, btnStyle: (g_stateObj.filterKeys === targetKey ? `Setting` : `Default`) })
|
|
4413
|
+
);
|
|
4414
|
+
if (g_stateObj.filterKeys === targetKey) {
|
|
4415
|
+
pos = m + 9;
|
|
4333
4416
|
}
|
|
4417
|
+
});
|
|
4418
|
+
const overlength = pos * g_limitObj.setLblHeight - parseInt(difCover.style.height);
|
|
4419
|
+
difCover.scrollTop = (overlength > 0 ? overlength : 0);
|
|
4420
|
+
|
|
4421
|
+
multiAppend(optionsprite, makeDifBtn(-1), makeDifBtn());
|
|
4422
|
+
};
|
|
4423
|
+
|
|
4424
|
+
const changeDifficulty = (_num = 1) => {
|
|
4425
|
+
if (g_headerObj.difSelectorUse) {
|
|
4426
|
+
g_stateObj.filterKeys = ``;
|
|
4427
|
+
if (document.querySelector(`#difList`) === null) {
|
|
4428
|
+
g_keyObj.prevKey = g_keyObj.currentKey;
|
|
4429
|
+
createDifWindow();
|
|
4430
|
+
} else {
|
|
4431
|
+
resetDifWindow();
|
|
4432
|
+
}
|
|
4433
|
+
} else {
|
|
4434
|
+
nextDifficulty(_num);
|
|
4435
|
+
}
|
|
4436
|
+
};
|
|
4437
|
+
|
|
4438
|
+
/**
|
|
4439
|
+
* 譜面基礎データの取得
|
|
4440
|
+
* @param {number} _scoreId
|
|
4441
|
+
*/
|
|
4442
|
+
const getScoreBaseData = _scoreId => {
|
|
4443
|
+
const arrowCnts = sumData(g_detailObj.arrowCnt[_scoreId]);
|
|
4444
|
+
const frzCnts = sumData(g_detailObj.frzCnt[_scoreId]);
|
|
4445
|
+
return {
|
|
4446
|
+
arrowCnts: arrowCnts,
|
|
4447
|
+
frzCnts: frzCnts,
|
|
4448
|
+
apm: Math.round((arrowCnts + frzCnts) / (g_detailObj.playingFrame[_scoreId] / g_fps / 60)),
|
|
4449
|
+
playingTime: transFrameToTimer(g_detailObj.playingFrame[_scoreId]),
|
|
4334
4450
|
};
|
|
4451
|
+
};
|
|
4335
4452
|
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4453
|
+
/**
|
|
4454
|
+
* 速度変化グラフの描画
|
|
4455
|
+
* @param {number} _scoreId
|
|
4456
|
+
*/
|
|
4457
|
+
const drawSpeedGraph = _scoreId => {
|
|
4458
|
+
const startFrame = g_detailObj.startFrame[_scoreId];
|
|
4459
|
+
const playingFrame = g_detailObj.playingFrameWithBlank[_scoreId];
|
|
4460
|
+
const speedObj = {
|
|
4461
|
+
speed: { frame: [0], speed: [1], cnt: 0, strokeColor: g_graphColorObj.speed },
|
|
4462
|
+
boost: { frame: [0], speed: [1], cnt: 0, strokeColor: g_graphColorObj.boost }
|
|
4345
4463
|
};
|
|
4346
4464
|
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
let text = `${getKeyName(keyLabel)} / ${g_headerObj.difLabels[j]}`;
|
|
4358
|
-
if (g_headerObj.makerView) {
|
|
4359
|
-
text += ` (${g_headerObj.creatorNames[j]})`;
|
|
4360
|
-
}
|
|
4361
|
-
_difList.appendChild(makeDifLblCssButton(`dif${k}`, text, k, _ => {
|
|
4362
|
-
nextDifficulty(j - g_stateObj.scoreId);
|
|
4363
|
-
}, { btnStyle: (j === g_stateObj.scoreId ? `Setting` : `Default`) }));
|
|
4364
|
-
if (j === g_stateObj.scoreId) {
|
|
4365
|
-
pos = k + 6;
|
|
4465
|
+
Object.keys(speedObj).forEach(speedType => {
|
|
4466
|
+
let frame = speedObj[speedType].frame;
|
|
4467
|
+
let speed = speedObj[speedType].speed;
|
|
4468
|
+
const speedData = g_detailObj[`${speedType}Data`][_scoreId];
|
|
4469
|
+
|
|
4470
|
+
if (speedData !== undefined) {
|
|
4471
|
+
for (let i = 0; i < speedData.length; i += 2) {
|
|
4472
|
+
if (speedData[i] >= startFrame) {
|
|
4473
|
+
frame.push(speedData[i] - startFrame);
|
|
4474
|
+
speed.push(speedData[i + 1]);
|
|
4366
4475
|
}
|
|
4367
|
-
|
|
4476
|
+
speedObj[speedType].cnt++;
|
|
4368
4477
|
}
|
|
4478
|
+
frame.push(playingFrame);
|
|
4479
|
+
speed.push(speed[speed.length - 1]);
|
|
4480
|
+
}
|
|
4481
|
+
});
|
|
4482
|
+
|
|
4483
|
+
const canvas = document.querySelector(`#graphSpeed`);
|
|
4484
|
+
const context = canvas.getContext(`2d`);
|
|
4485
|
+
drawBaseLine(context);
|
|
4486
|
+
|
|
4487
|
+
Object.keys(speedObj).forEach((speedType, j) => {
|
|
4488
|
+
context.beginPath();
|
|
4489
|
+
let preY;
|
|
4490
|
+
|
|
4491
|
+
for (let i = 0; i < speedObj[speedType].frame.length; i++) {
|
|
4492
|
+
const x = speedObj[speedType].frame[i] * (g_limitObj.graphWidth - 30) / playingFrame + 30;
|
|
4493
|
+
const y = (speedObj[speedType].speed[i] - 1) * -90 + 105;
|
|
4494
|
+
|
|
4495
|
+
context.lineTo(x, preY);
|
|
4496
|
+
context.lineTo(x, y);
|
|
4497
|
+
preY = y;
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4500
|
+
context.lineWidth = 1;
|
|
4501
|
+
context.strokeStyle = speedObj[speedType].strokeColor;
|
|
4502
|
+
context.stroke();
|
|
4503
|
+
|
|
4504
|
+
const lineX = (speedType === `speed`) ? 125 : 210;
|
|
4505
|
+
context.beginPath();
|
|
4506
|
+
context.moveTo(lineX, 215);
|
|
4507
|
+
context.lineTo(lineX + 30, 215);
|
|
4508
|
+
context.stroke();
|
|
4509
|
+
context.font = `${g_limitObj.difSelectorSiz}px ${getBasicFont()}`;
|
|
4510
|
+
context.fillText(speedType, lineX + 35, 218);
|
|
4511
|
+
|
|
4512
|
+
updateScoreDetailLabel(`Speed`, `${speedType}S`, speedObj[speedType].cnt, j, g_lblNameObj[`s_${speedType}`]);
|
|
4513
|
+
});
|
|
4514
|
+
};
|
|
4515
|
+
|
|
4516
|
+
/**
|
|
4517
|
+
* 譜面密度グラフの描画
|
|
4518
|
+
* @param {number} _scoreId
|
|
4519
|
+
*/
|
|
4520
|
+
const drawDensityGraph = _scoreId => {
|
|
4521
|
+
|
|
4522
|
+
const canvas = document.querySelector(`#graphDensity`);
|
|
4523
|
+
const context = canvas.getContext(`2d`);
|
|
4524
|
+
drawBaseLine(context);
|
|
4525
|
+
for (let j = 0; j < g_limitObj.densityDivision; j++) {
|
|
4526
|
+
context.beginPath();
|
|
4527
|
+
[``, `2Push`, `3Push`].forEach(val => {
|
|
4528
|
+
context.fillStyle = (g_detailObj.maxDensity[_scoreId].includes(j) ? g_graphColorObj[`max${val}`] : g_graphColorObj[`default${val}`]);
|
|
4529
|
+
context.fillRect(16 * j * 16 / g_limitObj.densityDivision + 30, 195 - 9 * g_detailObj[`density${val}Data`][_scoreId][j] / 10,
|
|
4530
|
+
15.5 * 16 / g_limitObj.densityDivision, 9 * g_detailObj[`density${val}Diff`][_scoreId][j] / 10
|
|
4531
|
+
);
|
|
4369
4532
|
});
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4533
|
+
context.stroke();
|
|
4534
|
+
}
|
|
4535
|
+
|
|
4536
|
+
const lineNames = [`Single`, `Chord`, `Triad+`];
|
|
4537
|
+
Object.keys(g_graphColorObj).filter(val => val.indexOf(`max`) !== -1).forEach((val, j) => {
|
|
4538
|
+
const lineX = 70 + j * 70;
|
|
4539
|
+
|
|
4540
|
+
context.beginPath();
|
|
4541
|
+
context.lineWidth = 3;
|
|
4542
|
+
context.fillStyle = g_rankObj.rankColorAllPerfect;
|
|
4543
|
+
context.strokeStyle = g_graphColorObj[val];
|
|
4544
|
+
context.moveTo(lineX, 215);
|
|
4545
|
+
context.lineTo(lineX + 20, 215);
|
|
4546
|
+
context.stroke();
|
|
4547
|
+
context.font = `${g_limitObj.difSelectorSiz}px ${getBasicFont()}`;
|
|
4548
|
+
context.fillText(lineNames[j], lineX + 20, 218);
|
|
4549
|
+
});
|
|
4373
4550
|
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
}
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4551
|
+
const obj = getScoreBaseData(_scoreId);
|
|
4552
|
+
updateScoreDetailLabel(`Density`, `APM`, obj.apm, 0, g_lblNameObj.s_apm);
|
|
4553
|
+
updateScoreDetailLabel(`Density`, `Time`, obj.playingTime, 1, g_lblNameObj.s_time);
|
|
4554
|
+
updateScoreDetailLabel(`Density`, `Arrow`, obj.arrowCnts, 3, g_lblNameObj.s_arrow);
|
|
4555
|
+
updateScoreDetailLabel(`Density`, `Frz`, obj.frzCnts, 4, g_lblNameObj.s_frz);
|
|
4556
|
+
};
|
|
4557
|
+
|
|
4558
|
+
/**
|
|
4559
|
+
* 譜面明細内の補足情報の登録・更新
|
|
4560
|
+
* @param {string} _name 表示する譜面明細のラベル
|
|
4561
|
+
* @param {string} _label
|
|
4562
|
+
* @param {string} _value
|
|
4563
|
+
* @param {number} _pos 表示位置
|
|
4564
|
+
* @param {string} _labelname
|
|
4565
|
+
*/
|
|
4566
|
+
const updateScoreDetailLabel = (_name, _label, _value, _pos = 0, _labelname = _label) => {
|
|
4567
|
+
const baseLabel = (_bLabel, _bLabelname, _bAlign) =>
|
|
4568
|
+
document.querySelector(`#detail${_name}`).appendChild(
|
|
4569
|
+
createDivCss2Label(`${_bLabel}`, `${_bLabelname}`, {
|
|
4570
|
+
x: 10, y: 105 + _pos * 20, w: 100, h: 20, siz: g_limitObj.difSelectorSiz, align: _bAlign,
|
|
4571
|
+
})
|
|
4572
|
+
);
|
|
4573
|
+
if (document.querySelector(`#data${_label}`) === null) {
|
|
4574
|
+
baseLabel(`lbl${_label}`, `${_labelname}`, C_ALIGN_LEFT);
|
|
4575
|
+
baseLabel(`data${_label}`, `${_value}`, C_ALIGN_RIGHT);
|
|
4576
|
+
} else {
|
|
4577
|
+
document.querySelector(`#data${_label}`).textContent = `${_value}`;
|
|
4578
|
+
}
|
|
4579
|
+
};
|
|
4580
|
+
|
|
4581
|
+
/**
|
|
4582
|
+
* グラフの縦軸を描画
|
|
4583
|
+
* @param {object} _context
|
|
4584
|
+
* @param {number} _resolution
|
|
4585
|
+
*/
|
|
4586
|
+
const drawBaseLine = (_context, _resolution = 10) => {
|
|
4587
|
+
_context.clearRect(0, 0, g_limitObj.graphWidth, g_limitObj.graphHeight);
|
|
4395
4588
|
|
|
4589
|
+
for (let j = 0; j <= 2 * _resolution; j += 5) {
|
|
4590
|
+
drawLine(_context, j / _resolution, `main`, 2);
|
|
4591
|
+
for (let k = 1; k < 5; k++) {
|
|
4592
|
+
drawLine(_context, (j + k) / _resolution, `sub`, 2);
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
};
|
|
4596
|
+
|
|
4597
|
+
/**
|
|
4598
|
+
* グラフ上に目盛を表示
|
|
4599
|
+
* @param {object} _context
|
|
4600
|
+
* @param {number} _y
|
|
4601
|
+
* @param {string} _lineType
|
|
4602
|
+
* @param {number} _fixed
|
|
4603
|
+
*/
|
|
4604
|
+
const drawLine = (_context, _y, _lineType, _fixed = 0) => {
|
|
4605
|
+
const lineY = (_y - 1) * -90 + 105;
|
|
4606
|
+
_context.beginPath();
|
|
4607
|
+
_context.moveTo(30, lineY);
|
|
4608
|
+
_context.lineTo(g_limitObj.graphWidth, lineY);
|
|
4609
|
+
_context.lineWidth = 1;
|
|
4610
|
+
|
|
4611
|
+
if (_lineType === `main`) {
|
|
4612
|
+
const textBaseObj = document.querySelector(`#lnkDifficulty`);
|
|
4613
|
+
const textColor = window.getComputedStyle(textBaseObj, ``).color;
|
|
4614
|
+
_context.strokeStyle = textColor;
|
|
4615
|
+
_context.font = `12px ${getBasicFont()}`;
|
|
4616
|
+
_context.fillStyle = textColor;
|
|
4617
|
+
_context.fillText(_y.toFixed(_fixed), 0, lineY + 4);
|
|
4618
|
+
} else {
|
|
4619
|
+
_context.strokeStyle = `#646464`;
|
|
4620
|
+
}
|
|
4621
|
+
_context.stroke();
|
|
4622
|
+
};
|
|
4623
|
+
|
|
4624
|
+
/**
|
|
4625
|
+
* 譜面の難易度情報用ラベル作成
|
|
4626
|
+
* @param {number} _scoreId
|
|
4627
|
+
*/
|
|
4628
|
+
const makeDifInfoLabels = _scoreId => {
|
|
4629
|
+
|
|
4630
|
+
// ツール難易度
|
|
4631
|
+
const detailToolDif = document.querySelector(`#detailToolDif`);
|
|
4396
4632
|
/**
|
|
4397
|
-
*
|
|
4398
|
-
* @param {string}
|
|
4633
|
+
* 譜面の難易度情報ラベルの作成
|
|
4634
|
+
* @param {string} _lbl
|
|
4635
|
+
* @param {string} _data
|
|
4636
|
+
* @param {object} _obj
|
|
4399
4637
|
*/
|
|
4400
|
-
const
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4638
|
+
const makeDifInfoLabel = (_lbl, _data, { x = 130, y = 25, w = 125, h = 35, siz = g_limitObj.difSelectorSiz, ...rest } = {}) =>
|
|
4639
|
+
createDivCss2Label(_lbl, _data, { x, y, w, h, siz, align: C_ALIGN_LEFT, ...rest });
|
|
4640
|
+
|
|
4641
|
+
let printData = ``;
|
|
4642
|
+
for (let j = 0; j < g_detailObj.arrowCnt.length; j++) {
|
|
4643
|
+
const obj = getScoreBaseData(j);
|
|
4644
|
+
printData +=
|
|
4645
|
+
// 譜面番号
|
|
4646
|
+
`[${j + 1}]\t` +
|
|
4647
|
+
// ツール値
|
|
4648
|
+
`${g_detailObj.toolDif[j].tool}\t` +
|
|
4649
|
+
// 同時
|
|
4650
|
+
`${g_detailObj.toolDif[j].douji}\t` +
|
|
4651
|
+
// 縦連
|
|
4652
|
+
`${g_detailObj.toolDif[j].tate}\t` +
|
|
4653
|
+
// 総矢印数
|
|
4654
|
+
`${(obj.arrowCnts + obj.frzCnts)}\t` +
|
|
4655
|
+
// 矢印
|
|
4656
|
+
`${obj.arrowCnts}\t` +
|
|
4657
|
+
// フリーズアロー
|
|
4658
|
+
`${obj.frzCnts}\t` +
|
|
4659
|
+
// APM
|
|
4660
|
+
`${obj.apm}\t` +
|
|
4661
|
+
// 時間(分秒)
|
|
4662
|
+
`${obj.playingTime}\r\n`;
|
|
4663
|
+
}
|
|
4664
|
+
multiAppend(detailToolDif,
|
|
4665
|
+
makeDifInfoLabel(`lblTooldif`, g_lblNameObj.s_level, g_lblPosObj.lblTooldif),
|
|
4666
|
+
makeDifInfoLabel(`dataTooldif`, ``, g_lblPosObj.dataTooldif),
|
|
4667
|
+
makeDifInfoLabel(`lblDouji`, g_lblNameObj.s_douji, g_lblPosObj.lblDouji),
|
|
4668
|
+
makeDifInfoLabel(`lblTate`, g_lblNameObj.s_tate, g_lblPosObj.lblTate),
|
|
4669
|
+
makeDifInfoLabel(`dataDouji`, ``, g_lblPosObj.dataDouji),
|
|
4670
|
+
makeDifInfoLabel(`dataTate`, ``, g_lblPosObj.dataTate),
|
|
4671
|
+
makeDifInfoLabel(`lblArrowInfo`, g_lblNameObj.s_cnts, g_lblPosObj.lblArrowInfo),
|
|
4672
|
+
makeDifInfoLabel(`dataArrowInfo`, ``, g_lblPosObj.dataArrowInfo),
|
|
4673
|
+
makeDifInfoLabel(`lblArrowInfo2`, ``, g_lblPosObj.lblArrowInfo2),
|
|
4674
|
+
makeDifInfoLabel(`dataArrowInfo2`, ``, g_lblPosObj.dataArrowInfo2),
|
|
4675
|
+
makeDifLblCssButton(`lnkDifInfo`, g_lblNameObj.s_print, 8, _ => {
|
|
4676
|
+
copyTextToClipboard(
|
|
4677
|
+
`****** ${g_lblNameObj.s_printTitle} [${g_version}] ******\r\n\r\n`
|
|
4678
|
+
+ `\t${g_lblNameObj.s_printHeader}\r\n\r\n${printData}`, g_msgInfoObj.I_0003
|
|
4679
|
+
);
|
|
4680
|
+
}, g_lblPosObj.lnkDifInfo),
|
|
4681
|
+
);
|
|
4682
|
+
createScText(lnkDifInfo, `DifInfo`, { targetLabel: `lnkDifInfo`, x: -10 });
|
|
4683
|
+
};
|
|
4405
4684
|
|
|
4406
|
-
|
|
4407
|
-
|
|
4685
|
+
/**
|
|
4686
|
+
* 譜面の難易度情報更新
|
|
4687
|
+
* @param {number} _scoreId
|
|
4688
|
+
*/
|
|
4689
|
+
const makeDifInfo = _scoreId => {
|
|
4408
4690
|
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
nextDifficulty(Math.floor(Math.random() * g_headerObj.keyLabels.length));
|
|
4413
|
-
}, { w: g_limitObj.difCoverWidth })
|
|
4414
|
-
);
|
|
4691
|
+
const arrowCnts = sumData(g_detailObj.arrowCnt[_scoreId]);
|
|
4692
|
+
const frzCnts = sumData(g_detailObj.frzCnt[_scoreId]);
|
|
4693
|
+
const push3CntStr = (g_detailObj.toolDif[_scoreId].push3.length === 0 ? `None` : `(${g_detailObj.toolDif[_scoreId].push3})`);
|
|
4415
4694
|
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4695
|
+
if (document.querySelector(`#lblTooldif`) === null) {
|
|
4696
|
+
makeDifInfoLabels(_scoreId);
|
|
4697
|
+
}
|
|
4698
|
+
dataTooldif.textContent = g_detailObj.toolDif[_scoreId].tool;
|
|
4699
|
+
dataDouji.textContent = g_detailObj.toolDif[_scoreId].douji;
|
|
4700
|
+
dataTate.textContent = g_detailObj.toolDif[_scoreId].tate;
|
|
4701
|
+
lblArrowInfo2.innerHTML = g_lblNameObj.s_linecnts.split(`{0}`).join(g_detailObj.toolDif[_scoreId].push3cnt);
|
|
4702
|
+
dataArrowInfo.innerHTML = `${arrowCnts + frzCnts} <span style="font-size:${g_limitObj.difSelectorSiz}px;">(${arrowCnts} + ${frzCnts})</span>`;
|
|
4703
|
+
dataArrowInfo2.innerHTML = `<br>(${g_detailObj.arrowCnt[_scoreId]})<br><br>
|
|
4704
|
+
(${g_detailObj.frzCnt[_scoreId]})<br><br>
|
|
4705
|
+
${push3CntStr}`.split(`,`).join(`/`);
|
|
4706
|
+
};
|
|
4424
4707
|
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4708
|
+
/**
|
|
4709
|
+
* 譜面初期化処理
|
|
4710
|
+
* - 譜面の基本設定(キー数、初期速度、リバース、ゲージ設定)をここで行う
|
|
4711
|
+
* - g_canLoadDifInfoFlg は譜面初期化フラグで、初期化したくない場合は対象画面にて false にしておく
|
|
4712
|
+
* (Display設定画面、キーコンフィグ画面では通常OFF)
|
|
4713
|
+
* この関数を実行後、このフラグはONに戻るようになっている
|
|
4714
|
+
* - [キーコン]->[初期化]->[名称設定]の順に配置する。
|
|
4715
|
+
* 初期化処理にてキー数関連の設定を行っているため、この順序で無いとデータが正しく格納されない
|
|
4716
|
+
*/
|
|
4717
|
+
const setDifficulty = (_initFlg) => {
|
|
4718
|
+
|
|
4719
|
+
const getCurrentNo = (_list, _target) => roundZero(_list.findIndex(item => item === _target));
|
|
4720
|
+
|
|
4721
|
+
// ---------------------------------------------------
|
|
4722
|
+
// 1. キーコンフィグ設定 (KeyConfig)
|
|
4723
|
+
g_keyObj.currentKey = g_headerObj.keyLabels[g_stateObj.scoreId];
|
|
4724
|
+
const isNotSameKey = (g_keyObj.prevKey !== g_keyObj.currentKey);
|
|
4725
|
+
|
|
4726
|
+
if (g_headerObj.dummyScoreNos !== undefined) {
|
|
4727
|
+
g_stateObj.dummyId = setIntVal(g_headerObj.dummyScoreNos[g_stateObj.scoreId], ``);
|
|
4728
|
+
}
|
|
4729
|
+
// 特殊キーフラグ
|
|
4730
|
+
g_stateObj.extraKeyFlg = g_headerObj.keyExtraList.includes(g_keyObj.currentKey);
|
|
4731
|
+
|
|
4732
|
+
// ---------------------------------------------------
|
|
4733
|
+
// 2. 初期化設定
|
|
4734
|
+
|
|
4735
|
+
// 保存した設定の再読込条件(設定画面切り替え時はスキップ)
|
|
4736
|
+
// ローカルストレージで保存した設定を呼び出し
|
|
4737
|
+
if ((g_canLoadDifInfoFlg && (isNotSameKey && g_stateObj.dataSaveFlg)) || _initFlg) {
|
|
4738
|
+
|
|
4739
|
+
if (isNotSameKey && g_keyObj.prevKey !== `Dummy`) {
|
|
4740
|
+
// キーパターン初期化
|
|
4741
|
+
g_keyObj.currentPtn = 0;
|
|
4742
|
+
g_keycons.keySwitchNum = 0;
|
|
4743
|
+
}
|
|
4744
|
+
const hasKeyStorage = localStorage.getItem(`danonicw-${g_keyObj.currentKey}k`);
|
|
4745
|
+
let storageObj, addKey = ``;
|
|
4746
|
+
|
|
4747
|
+
if (!g_stateObj.extraKeyFlg) {
|
|
4748
|
+
|
|
4749
|
+
// キー別のローカルストレージの初期設定 ※特殊キーは除く
|
|
4750
|
+
g_localKeyStorage = hasKeyStorage ? JSON.parse(hasKeyStorage) : {
|
|
4751
|
+
reverse: C_FLG_OFF,
|
|
4752
|
+
keyCtrl: [[]],
|
|
4753
|
+
keyCtrlPtn: 0,
|
|
4754
|
+
setColor: [],
|
|
4755
|
+
};
|
|
4756
|
+
storageObj = g_localKeyStorage;
|
|
4757
|
+
|
|
4758
|
+
} else {
|
|
4759
|
+
storageObj = g_localStorage;
|
|
4760
|
+
addKey = g_keyObj.currentKey;
|
|
4761
|
+
}
|
|
4762
|
+
if (isNotSameKey) {
|
|
4763
|
+
getKeyReverse(storageObj, addKey);
|
|
4764
|
+
|
|
4765
|
+
// キーコンフィグ初期値設定
|
|
4766
|
+
if (storageObj[`keyCtrlPtn${addKey}`] === undefined) {
|
|
4767
|
+
storageObj[`keyCtrlPtn${addKey}`] = 0;
|
|
4437
4768
|
}
|
|
4438
|
-
|
|
4439
|
-
const overlength = pos * g_limitObj.setLblHeight - parseInt(difCover.style.height);
|
|
4440
|
-
difCover.scrollTop = (overlength > 0 ? overlength : 0);
|
|
4769
|
+
getKeyCtrl(storageObj, addKey);
|
|
4441
4770
|
|
|
4442
|
-
|
|
4443
|
-
|
|
4771
|
+
// カラーセット初期値設定
|
|
4772
|
+
if (storageObj[`setColor${addKey}`] === undefined) {
|
|
4773
|
+
storageObj[`setColor${addKey}`] = [];
|
|
4774
|
+
}
|
|
4775
|
+
if (storageObj[`setColor${addKey}`].length > 0) {
|
|
4776
|
+
g_keycons.colorTypes = addValtoArray(g_keycons.colorTypes, g_keycons.colorSelf);
|
|
4777
|
+
resetColorType({ _fromObj: storageObj, _from: addKey, _to: g_keycons.colorSelf });
|
|
4778
|
+
resetColorType({ _fromObj: storageObj, _from: addKey, _toObj: g_dfColorObj, _to: g_keycons.colorSelf });
|
|
4444
4779
|
|
|
4445
|
-
const changeDifficulty = (_num = 1) => {
|
|
4446
|
-
if (g_headerObj.difSelectorUse) {
|
|
4447
|
-
g_stateObj.filterKeys = ``;
|
|
4448
|
-
if (document.querySelector(`#difList`) === null) {
|
|
4449
|
-
createDifWindow();
|
|
4450
4780
|
} else {
|
|
4451
|
-
|
|
4781
|
+
if (g_localStorage.colorType === g_keycons.colorSelf) {
|
|
4782
|
+
g_colorType = `Default`;
|
|
4783
|
+
}
|
|
4784
|
+
g_keycons.colorTypes = g_keycons.colorTypes.filter(val => val !== g_keycons.colorSelf);
|
|
4452
4785
|
}
|
|
4453
|
-
|
|
4454
|
-
|
|
4786
|
+
|
|
4787
|
+
const keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`;
|
|
4788
|
+
|
|
4789
|
+
// カラーグループ、シャッフルグループの設定
|
|
4790
|
+
g_keycons.groups.forEach(type => {
|
|
4791
|
+
resetGroupList(type, keyCtrlPtn);
|
|
4792
|
+
if (g_keyObj.currentPtn === -1) {
|
|
4793
|
+
const storageKeyName = storageObj[`${type}${addKey}`] || storageObj[`${type}${g_keyObj.currentKey}_-1_-1`];
|
|
4794
|
+
if (storageKeyName !== undefined) {
|
|
4795
|
+
g_keyObj[`${type}${g_keyObj.currentKey}_-1`] = structuredClone(storageKeyName);
|
|
4796
|
+
}
|
|
4797
|
+
g_keyObj[`${type}${g_keyObj.currentKey}_-1_-1`] = structuredClone(g_keyObj[`${type}${g_keyObj.currentKey}_-1`]);
|
|
4798
|
+
} else {
|
|
4799
|
+
g_keyObj[`${type}${keyCtrlPtn}`] = structuredClone(g_keyObj[`${type}${keyCtrlPtn}_0`]);
|
|
4800
|
+
}
|
|
4801
|
+
});
|
|
4802
|
+
|
|
4455
4803
|
}
|
|
4456
|
-
|
|
4804
|
+
|
|
4805
|
+
const keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`;
|
|
4806
|
+
if (g_headerObj.keyRetryDef === C_KEY_RETRY) {
|
|
4807
|
+
g_headerObj.keyRetry = setIntVal(getKeyCtrlVal(g_keyObj[`keyRetry${keyCtrlPtn}`]), g_headerObj.keyRetryDef);
|
|
4808
|
+
}
|
|
4809
|
+
if (g_headerObj.keyTitleBackDef === C_KEY_TITLEBACK) {
|
|
4810
|
+
g_headerObj.keyTitleBack = setIntVal(getKeyCtrlVal(g_keyObj[`keyTitleBack${keyCtrlPtn}`]), g_headerObj.keyTitleBackDef);
|
|
4811
|
+
}
|
|
4812
|
+
}
|
|
4813
|
+
|
|
4814
|
+
// スクロール設定用の配列を入れ替え
|
|
4815
|
+
g_settings.scrolls = structuredClone(
|
|
4816
|
+
typeof g_keyObj[`scrollDir${g_keyObj.currentKey}_${g_keyObj.currentPtn}`] === C_TYP_OBJECT ?
|
|
4817
|
+
Object.keys(g_keyObj[`scrollDir${g_keyObj.currentKey}_${g_keyObj.currentPtn}`]) : g_keyObj.scrollName_def
|
|
4818
|
+
);
|
|
4819
|
+
|
|
4820
|
+
// アシスト設定の配列を入れ替え
|
|
4821
|
+
g_settings.autoPlays = (typeof g_keyObj[`assistPos${g_keyObj.currentKey}_${g_keyObj.currentPtn}`] === C_TYP_OBJECT ?
|
|
4822
|
+
g_autoPlaysBase.concat(Object.keys(g_keyObj[`assistPos${g_keyObj.currentKey}_${g_keyObj.currentPtn}`])) :
|
|
4823
|
+
g_autoPlaysBase.concat());
|
|
4824
|
+
|
|
4825
|
+
// 速度、ゲージ、スクロール、アシスト設定のカーソル位置調整
|
|
4826
|
+
if (_initFlg) {
|
|
4827
|
+
g_stateObj.speed = g_headerObj.initSpeeds[g_stateObj.scoreId];
|
|
4828
|
+
g_settings.speedNum = getCurrentNo(g_settings.speeds, g_stateObj.speed);
|
|
4829
|
+
g_settings.gaugeNum = 0;
|
|
4830
|
+
}
|
|
4831
|
+
g_settings.scrollNum = getCurrentNo(g_settings.scrolls, g_stateObj.scroll);
|
|
4832
|
+
g_settings.autoPlayNum = getCurrentNo(g_settings.autoPlays, g_stateObj.autoPlay);
|
|
4833
|
+
|
|
4834
|
+
// ---------------------------------------------------
|
|
4835
|
+
// 3. 名称の設定
|
|
4836
|
+
|
|
4837
|
+
// 譜面名設定 (Difficulty)
|
|
4838
|
+
const difWidth = parseFloat(lnkDifficulty.style.width);
|
|
4839
|
+
const difNames = [`${getKeyName(g_keyObj.currentKey)} ${getStgDetailName('key')} / ${g_headerObj.difLabels[g_stateObj.scoreId]}`];
|
|
4840
|
+
lnkDifficulty.style.fontSize = `${getFontSize(difNames[0], difWidth, getBasicFont(), g_limitObj.setLblSiz)}px`;
|
|
4841
|
+
|
|
4842
|
+
if (g_headerObj.makerView) {
|
|
4843
|
+
difNames.push(`(${g_headerObj.creatorNames[g_stateObj.scoreId]})`);
|
|
4844
|
+
difNames.forEach((difName, j) => {
|
|
4845
|
+
const tmpSize = getFontSize(difName, difWidth, getBasicFont(), 14);
|
|
4846
|
+
difNames[j] = `<span style="font-size:${tmpSize}px">${difName}</span>`;
|
|
4847
|
+
});
|
|
4848
|
+
}
|
|
4849
|
+
lnkDifficulty.innerHTML = difNames.join(``);
|
|
4850
|
+
|
|
4851
|
+
// 速度設定 (Speed)
|
|
4852
|
+
setSetting(0, `speed`, ` ${g_lblNameObj.multi}`);
|
|
4853
|
+
if (g_headerObj.scoreDetailUse) {
|
|
4854
|
+
drawSpeedGraph(g_stateObj.scoreId);
|
|
4855
|
+
drawDensityGraph(g_stateObj.scoreId);
|
|
4856
|
+
makeDifInfo(g_stateObj.scoreId);
|
|
4857
|
+
}
|
|
4858
|
+
|
|
4859
|
+
// リバース設定 (Reverse, Scroll)
|
|
4860
|
+
if (g_headerObj.scrollUse) {
|
|
4861
|
+
g_stateObj.scroll = g_settings.scrolls[g_settings.scrollNum];
|
|
4862
|
+
const [visibleScr, hiddenScr] = (g_settings.scrolls.length > 1 ? [`scroll`, `reverse`] : [`reverse`, `scroll`]);
|
|
4863
|
+
document.getElementById(`${visibleScr}Sprite`).style.display = C_DIS_INHERIT;
|
|
4864
|
+
document.getElementById(`${hiddenScr}Sprite`).style.display = C_DIS_NONE;
|
|
4865
|
+
setSetting(0, visibleScr);
|
|
4866
|
+
|
|
4867
|
+
g_shortcutObj.option.KeyR.id = g_settings.scrolls.includes(`Reverse`) ?
|
|
4868
|
+
g_shortcutObj.option.KeyR.exId : g_shortcutObj.option.KeyR.dfId;
|
|
4869
|
+
|
|
4870
|
+
if (g_settings.scrolls.length > 1) {
|
|
4871
|
+
setReverseView(document.querySelector(`#btnReverse`));
|
|
4872
|
+
}
|
|
4873
|
+
} else {
|
|
4874
|
+
g_settings.scrolls = structuredClone(g_keyObj.scrollName_def);
|
|
4875
|
+
setSetting(0, `reverse`);
|
|
4876
|
+
}
|
|
4877
|
+
|
|
4878
|
+
// オート・アシスト設定 (AutoPlay)
|
|
4879
|
+
g_stateObj.autoPlay = g_settings.autoPlays[g_settings.autoPlayNum];
|
|
4880
|
+
lnkAutoPlay.textContent = getStgDetailName(g_stateObj.autoPlay);
|
|
4881
|
+
|
|
4882
|
+
// ゲージ設定 (Gauge)
|
|
4883
|
+
const defaultCustomGauge = g_gaugeOptionObj.custom0 || g_gaugeOptionObj.customDefault;
|
|
4884
|
+
if (hasVal(defaultCustomGauge)) {
|
|
4885
|
+
g_gaugeOptionObj.custom = (g_gaugeOptionObj[`custom${g_stateObj.scoreId}`] || defaultCustomGauge).concat();
|
|
4886
|
+
g_gaugeOptionObj.varCustom = (g_gaugeOptionObj[`varCustom${g_stateObj.scoreId}`] || g_gaugeOptionObj.varCustom0 || g_gaugeOptionObj.varCustomDefault).concat();
|
|
4887
|
+
}
|
|
4888
|
+
setGauge(0);
|
|
4889
|
+
|
|
4890
|
+
// ユーザカスタムイベント(初期)
|
|
4891
|
+
g_customJsObj.difficulty.forEach(func => func(_initFlg, g_canLoadDifInfoFlg));
|
|
4892
|
+
|
|
4893
|
+
// ---------------------------------------------------
|
|
4894
|
+
// 4. 譜面初期情報ロード許可フラグの設定
|
|
4895
|
+
g_canLoadDifInfoFlg = true;
|
|
4896
|
+
};
|
|
4897
|
+
|
|
4898
|
+
/**
|
|
4899
|
+
* 設定・オプション画面のラベル・ボタン処理の描画
|
|
4900
|
+
* @param {Object} _sprite 基準とするスプライト(ここで指定する座標は、そのスプライトからの相対位置)
|
|
4901
|
+
*/
|
|
4902
|
+
const createOptionWindow = _sprite => {
|
|
4903
|
+
|
|
4904
|
+
// 各ボタン用のスプライトを作成
|
|
4905
|
+
const optionsprite = createOptionSprite(_sprite);
|
|
4906
|
+
|
|
4907
|
+
// 設定毎に個別のスプライトを作成し、その中にラベル・ボタン類を配置
|
|
4908
|
+
const spriteList = setSpriteList(g_settingPos.option);
|
|
4909
|
+
|
|
4910
|
+
// ---------------------------------------------------
|
|
4911
|
+
// 難易度 (Difficulty)
|
|
4912
|
+
// 縦位置: 0
|
|
4913
|
+
spriteList.difficulty.appendChild(createLblSetting(`Difficulty`, -5));
|
|
4914
|
+
|
|
4457
4915
|
const lnkDifficulty = makeSettingLblCssButton(`lnkDifficulty`, ``, 0, _ => changeDifficulty(), {
|
|
4458
4916
|
y: -10, h: g_limitObj.setLblHeight + 10, cxtFunc: _ => changeDifficulty(-1),
|
|
4459
4917
|
});
|
|
@@ -4577,276 +5035,6 @@ const createOptionWindow = _sprite => {
|
|
|
4577
5035
|
g_shortcutObj.option.KeyQ.id = g_settings.scoreDetailCursors[0];
|
|
4578
5036
|
};
|
|
4579
5037
|
|
|
4580
|
-
/**
|
|
4581
|
-
* 譜面基礎データの取得
|
|
4582
|
-
* @param {number} _scoreId
|
|
4583
|
-
*/
|
|
4584
|
-
const getScoreBaseData = _scoreId => {
|
|
4585
|
-
const arrowCnts = sumData(g_detailObj.arrowCnt[_scoreId]);
|
|
4586
|
-
const frzCnts = sumData(g_detailObj.frzCnt[_scoreId]);
|
|
4587
|
-
return {
|
|
4588
|
-
arrowCnts: arrowCnts,
|
|
4589
|
-
frzCnts: frzCnts,
|
|
4590
|
-
apm: Math.round((arrowCnts + frzCnts) / (g_detailObj.playingFrame[_scoreId] / g_fps / 60)),
|
|
4591
|
-
playingTime: transFrameToTimer(g_detailObj.playingFrame[_scoreId]),
|
|
4592
|
-
};
|
|
4593
|
-
};
|
|
4594
|
-
|
|
4595
|
-
/**
|
|
4596
|
-
* 速度変化グラフの描画
|
|
4597
|
-
* @param {number} _scoreId
|
|
4598
|
-
*/
|
|
4599
|
-
const drawSpeedGraph = _scoreId => {
|
|
4600
|
-
const startFrame = g_detailObj.startFrame[_scoreId];
|
|
4601
|
-
const playingFrame = g_detailObj.playingFrameWithBlank[_scoreId];
|
|
4602
|
-
const speedObj = {
|
|
4603
|
-
speed: { frame: [0], speed: [1], cnt: 0, strokeColor: g_graphColorObj.speed },
|
|
4604
|
-
boost: { frame: [0], speed: [1], cnt: 0, strokeColor: g_graphColorObj.boost }
|
|
4605
|
-
};
|
|
4606
|
-
|
|
4607
|
-
Object.keys(speedObj).forEach(speedType => {
|
|
4608
|
-
let frame = speedObj[speedType].frame;
|
|
4609
|
-
let speed = speedObj[speedType].speed;
|
|
4610
|
-
const speedData = g_detailObj[`${speedType}Data`][_scoreId];
|
|
4611
|
-
|
|
4612
|
-
if (speedData !== undefined) {
|
|
4613
|
-
for (let i = 0; i < speedData.length; i += 2) {
|
|
4614
|
-
if (speedData[i] >= startFrame) {
|
|
4615
|
-
frame.push(speedData[i] - startFrame);
|
|
4616
|
-
speed.push(speedData[i + 1]);
|
|
4617
|
-
}
|
|
4618
|
-
speedObj[speedType].cnt++;
|
|
4619
|
-
}
|
|
4620
|
-
frame.push(playingFrame);
|
|
4621
|
-
speed.push(speed[speed.length - 1]);
|
|
4622
|
-
}
|
|
4623
|
-
});
|
|
4624
|
-
|
|
4625
|
-
const canvas = document.querySelector(`#graphSpeed`);
|
|
4626
|
-
const context = canvas.getContext(`2d`);
|
|
4627
|
-
drawBaseLine(context);
|
|
4628
|
-
|
|
4629
|
-
Object.keys(speedObj).forEach((speedType, j) => {
|
|
4630
|
-
context.beginPath();
|
|
4631
|
-
let preY;
|
|
4632
|
-
|
|
4633
|
-
for (let i = 0; i < speedObj[speedType].frame.length; i++) {
|
|
4634
|
-
const x = speedObj[speedType].frame[i] * (g_limitObj.graphWidth - 30) / playingFrame + 30;
|
|
4635
|
-
const y = (speedObj[speedType].speed[i] - 1) * -90 + 105;
|
|
4636
|
-
|
|
4637
|
-
context.lineTo(x, preY);
|
|
4638
|
-
context.lineTo(x, y);
|
|
4639
|
-
preY = y;
|
|
4640
|
-
}
|
|
4641
|
-
|
|
4642
|
-
context.lineWidth = 1;
|
|
4643
|
-
context.strokeStyle = speedObj[speedType].strokeColor;
|
|
4644
|
-
context.stroke();
|
|
4645
|
-
|
|
4646
|
-
const lineX = (speedType === `speed`) ? 125 : 210;
|
|
4647
|
-
context.beginPath();
|
|
4648
|
-
context.moveTo(lineX, 215);
|
|
4649
|
-
context.lineTo(lineX + 30, 215);
|
|
4650
|
-
context.stroke();
|
|
4651
|
-
context.font = `${g_limitObj.difSelectorSiz}px ${getBasicFont()}`;
|
|
4652
|
-
context.fillText(speedType, lineX + 35, 218);
|
|
4653
|
-
|
|
4654
|
-
updateScoreDetailLabel(`Speed`, `${speedType}S`, speedObj[speedType].cnt, j, g_lblNameObj[`s_${speedType}`]);
|
|
4655
|
-
});
|
|
4656
|
-
};
|
|
4657
|
-
|
|
4658
|
-
/**
|
|
4659
|
-
* 譜面密度グラフの描画
|
|
4660
|
-
* @param {number} _scoreId
|
|
4661
|
-
*/
|
|
4662
|
-
const drawDensityGraph = _scoreId => {
|
|
4663
|
-
|
|
4664
|
-
const canvas = document.querySelector(`#graphDensity`);
|
|
4665
|
-
const context = canvas.getContext(`2d`);
|
|
4666
|
-
drawBaseLine(context);
|
|
4667
|
-
for (let j = 0; j < g_limitObj.densityDivision; j++) {
|
|
4668
|
-
context.beginPath();
|
|
4669
|
-
[``, `2Push`, `3Push`].forEach(val => {
|
|
4670
|
-
context.fillStyle = (g_detailObj.maxDensity[_scoreId].includes(j) ? g_graphColorObj[`max${val}`] : g_graphColorObj[`default${val}`]);
|
|
4671
|
-
context.fillRect(16 * j * 16 / g_limitObj.densityDivision + 30, 195 - 9 * g_detailObj[`density${val}Data`][_scoreId][j] / 10,
|
|
4672
|
-
15.5 * 16 / g_limitObj.densityDivision, 9 * g_detailObj[`density${val}Diff`][_scoreId][j] / 10
|
|
4673
|
-
);
|
|
4674
|
-
});
|
|
4675
|
-
context.stroke();
|
|
4676
|
-
}
|
|
4677
|
-
|
|
4678
|
-
const lineNames = [`Single`, `Chord`, `Triad+`];
|
|
4679
|
-
Object.keys(g_graphColorObj).filter(val => val.indexOf(`max`) !== -1).forEach((val, j) => {
|
|
4680
|
-
const lineX = 70 + j * 70;
|
|
4681
|
-
|
|
4682
|
-
context.beginPath();
|
|
4683
|
-
context.lineWidth = 3;
|
|
4684
|
-
context.fillStyle = g_rankObj.rankColorAllPerfect;
|
|
4685
|
-
context.strokeStyle = g_graphColorObj[val];
|
|
4686
|
-
context.moveTo(lineX, 215);
|
|
4687
|
-
context.lineTo(lineX + 20, 215);
|
|
4688
|
-
context.stroke();
|
|
4689
|
-
context.font = `${g_limitObj.difSelectorSiz}px ${getBasicFont()}`;
|
|
4690
|
-
context.fillText(lineNames[j], lineX + 20, 218);
|
|
4691
|
-
});
|
|
4692
|
-
|
|
4693
|
-
const obj = getScoreBaseData(_scoreId);
|
|
4694
|
-
updateScoreDetailLabel(`Density`, `APM`, obj.apm, 0, g_lblNameObj.s_apm);
|
|
4695
|
-
updateScoreDetailLabel(`Density`, `Time`, obj.playingTime, 1, g_lblNameObj.s_time);
|
|
4696
|
-
updateScoreDetailLabel(`Density`, `Arrow`, obj.arrowCnts, 3, g_lblNameObj.s_arrow);
|
|
4697
|
-
updateScoreDetailLabel(`Density`, `Frz`, obj.frzCnts, 4, g_lblNameObj.s_frz);
|
|
4698
|
-
};
|
|
4699
|
-
|
|
4700
|
-
/**
|
|
4701
|
-
* 譜面明細内の補足情報の登録・更新
|
|
4702
|
-
* @param {string} _name 表示する譜面明細のラベル
|
|
4703
|
-
* @param {string} _label
|
|
4704
|
-
* @param {string} _value
|
|
4705
|
-
* @param {number} _pos 表示位置
|
|
4706
|
-
* @param {string} _labelname
|
|
4707
|
-
*/
|
|
4708
|
-
const updateScoreDetailLabel = (_name, _label, _value, _pos = 0, _labelname = _label) => {
|
|
4709
|
-
const baseLabel = (_bLabel, _bLabelname, _bAlign) =>
|
|
4710
|
-
document.querySelector(`#detail${_name}`).appendChild(
|
|
4711
|
-
createDivCss2Label(`${_bLabel}`, `${_bLabelname}`, {
|
|
4712
|
-
x: 10, y: 105 + _pos * 20, w: 100, h: 20, siz: g_limitObj.difSelectorSiz, align: _bAlign,
|
|
4713
|
-
})
|
|
4714
|
-
);
|
|
4715
|
-
if (document.querySelector(`#data${_label}`) === null) {
|
|
4716
|
-
baseLabel(`lbl${_label}`, `${_labelname}`, C_ALIGN_LEFT);
|
|
4717
|
-
baseLabel(`data${_label}`, `${_value}`, C_ALIGN_RIGHT);
|
|
4718
|
-
} else {
|
|
4719
|
-
document.querySelector(`#data${_label}`).textContent = `${_value}`;
|
|
4720
|
-
}
|
|
4721
|
-
};
|
|
4722
|
-
|
|
4723
|
-
/**
|
|
4724
|
-
* グラフの縦軸を描画
|
|
4725
|
-
* @param {object} _context
|
|
4726
|
-
* @param {number} _resolution
|
|
4727
|
-
*/
|
|
4728
|
-
const drawBaseLine = (_context, _resolution = 10) => {
|
|
4729
|
-
_context.clearRect(0, 0, g_limitObj.graphWidth, g_limitObj.graphHeight);
|
|
4730
|
-
|
|
4731
|
-
for (let j = 0; j <= 2 * _resolution; j += 5) {
|
|
4732
|
-
drawLine(_context, j / _resolution, `main`, 2);
|
|
4733
|
-
for (let k = 1; k < 5; k++) {
|
|
4734
|
-
drawLine(_context, (j + k) / _resolution, `sub`, 2);
|
|
4735
|
-
}
|
|
4736
|
-
}
|
|
4737
|
-
};
|
|
4738
|
-
|
|
4739
|
-
/**
|
|
4740
|
-
* グラフ上に目盛を表示
|
|
4741
|
-
* @param {object} _context
|
|
4742
|
-
* @param {number} _y
|
|
4743
|
-
* @param {string} _lineType
|
|
4744
|
-
* @param {number} _fixed
|
|
4745
|
-
*/
|
|
4746
|
-
const drawLine = (_context, _y, _lineType, _fixed = 0) => {
|
|
4747
|
-
const lineY = (_y - 1) * -90 + 105;
|
|
4748
|
-
_context.beginPath();
|
|
4749
|
-
_context.moveTo(30, lineY);
|
|
4750
|
-
_context.lineTo(g_limitObj.graphWidth, lineY);
|
|
4751
|
-
_context.lineWidth = 1;
|
|
4752
|
-
|
|
4753
|
-
if (_lineType === `main`) {
|
|
4754
|
-
const textBaseObj = document.querySelector(`#lnkDifficulty`);
|
|
4755
|
-
const textColor = window.getComputedStyle(textBaseObj, ``).color;
|
|
4756
|
-
_context.strokeStyle = textColor;
|
|
4757
|
-
_context.font = `12px ${getBasicFont()}`;
|
|
4758
|
-
_context.fillStyle = textColor;
|
|
4759
|
-
_context.fillText(_y.toFixed(_fixed), 0, lineY + 4);
|
|
4760
|
-
} else {
|
|
4761
|
-
_context.strokeStyle = `#646464`;
|
|
4762
|
-
}
|
|
4763
|
-
_context.stroke();
|
|
4764
|
-
};
|
|
4765
|
-
|
|
4766
|
-
/**
|
|
4767
|
-
* 譜面の難易度情報用ラベル作成
|
|
4768
|
-
* @param {number} _scoreId
|
|
4769
|
-
*/
|
|
4770
|
-
const makeDifInfoLabels = _scoreId => {
|
|
4771
|
-
|
|
4772
|
-
// ツール難易度
|
|
4773
|
-
const detailToolDif = document.querySelector(`#detailToolDif`);
|
|
4774
|
-
/**
|
|
4775
|
-
* 譜面の難易度情報ラベルの作成
|
|
4776
|
-
* @param {string} _lbl
|
|
4777
|
-
* @param {string} _data
|
|
4778
|
-
* @param {object} _obj
|
|
4779
|
-
*/
|
|
4780
|
-
const makeDifInfoLabel = (_lbl, _data, { x = 130, y = 25, w = 125, h = 35, siz = g_limitObj.difSelectorSiz, ...rest } = {}) =>
|
|
4781
|
-
createDivCss2Label(_lbl, _data, { x, y, w, h, siz, align: C_ALIGN_LEFT, ...rest });
|
|
4782
|
-
|
|
4783
|
-
let printData = ``;
|
|
4784
|
-
for (let j = 0; j < g_detailObj.arrowCnt.length; j++) {
|
|
4785
|
-
const obj = getScoreBaseData(j);
|
|
4786
|
-
printData +=
|
|
4787
|
-
// 譜面番号
|
|
4788
|
-
`[${j + 1}]\t` +
|
|
4789
|
-
// ツール値
|
|
4790
|
-
`${g_detailObj.toolDif[j].tool}\t` +
|
|
4791
|
-
// 同時
|
|
4792
|
-
`${g_detailObj.toolDif[j].douji}\t` +
|
|
4793
|
-
// 縦連
|
|
4794
|
-
`${g_detailObj.toolDif[j].tate}\t` +
|
|
4795
|
-
// 総矢印数
|
|
4796
|
-
`${(obj.arrowCnts + obj.frzCnts)}\t` +
|
|
4797
|
-
// 矢印
|
|
4798
|
-
`${obj.arrowCnts}\t` +
|
|
4799
|
-
// フリーズアロー
|
|
4800
|
-
`${obj.frzCnts}\t` +
|
|
4801
|
-
// APM
|
|
4802
|
-
`${obj.apm}\t` +
|
|
4803
|
-
// 時間(分秒)
|
|
4804
|
-
`${obj.playingTime}\r\n`;
|
|
4805
|
-
}
|
|
4806
|
-
multiAppend(detailToolDif,
|
|
4807
|
-
makeDifInfoLabel(`lblTooldif`, g_lblNameObj.s_level, g_lblPosObj.lblTooldif),
|
|
4808
|
-
makeDifInfoLabel(`dataTooldif`, ``, g_lblPosObj.dataTooldif),
|
|
4809
|
-
makeDifInfoLabel(`lblDouji`, g_lblNameObj.s_douji, g_lblPosObj.lblDouji),
|
|
4810
|
-
makeDifInfoLabel(`lblTate`, g_lblNameObj.s_tate, g_lblPosObj.lblTate),
|
|
4811
|
-
makeDifInfoLabel(`dataDouji`, ``, g_lblPosObj.dataDouji),
|
|
4812
|
-
makeDifInfoLabel(`dataTate`, ``, g_lblPosObj.dataTate),
|
|
4813
|
-
makeDifInfoLabel(`lblArrowInfo`, g_lblNameObj.s_cnts, g_lblPosObj.lblArrowInfo),
|
|
4814
|
-
makeDifInfoLabel(`dataArrowInfo`, ``, g_lblPosObj.dataArrowInfo),
|
|
4815
|
-
makeDifInfoLabel(`lblArrowInfo2`, ``, g_lblPosObj.lblArrowInfo2),
|
|
4816
|
-
makeDifInfoLabel(`dataArrowInfo2`, ``, g_lblPosObj.dataArrowInfo2),
|
|
4817
|
-
makeDifLblCssButton(`lnkDifInfo`, g_lblNameObj.s_print, 8, _ => {
|
|
4818
|
-
copyTextToClipboard(
|
|
4819
|
-
`****** ${g_lblNameObj.s_printTitle} [${g_version}] ******\r\n\r\n`
|
|
4820
|
-
+ `\t${g_lblNameObj.s_printHeader}\r\n\r\n${printData}`, g_msgInfoObj.I_0003
|
|
4821
|
-
);
|
|
4822
|
-
}, g_lblPosObj.lnkDifInfo),
|
|
4823
|
-
);
|
|
4824
|
-
createScText(lnkDifInfo, `DifInfo`, { targetLabel: `lnkDifInfo`, x: -10 });
|
|
4825
|
-
};
|
|
4826
|
-
|
|
4827
|
-
/**
|
|
4828
|
-
* 譜面の難易度情報更新
|
|
4829
|
-
* @param {number} _scoreId
|
|
4830
|
-
*/
|
|
4831
|
-
const makeDifInfo = _scoreId => {
|
|
4832
|
-
|
|
4833
|
-
const arrowCnts = sumData(g_detailObj.arrowCnt[_scoreId]);
|
|
4834
|
-
const frzCnts = sumData(g_detailObj.frzCnt[_scoreId]);
|
|
4835
|
-
const push3CntStr = (g_detailObj.toolDif[_scoreId].push3.length === 0 ? `None` : `(${g_detailObj.toolDif[_scoreId].push3})`);
|
|
4836
|
-
|
|
4837
|
-
if (document.querySelector(`#lblTooldif`) === null) {
|
|
4838
|
-
makeDifInfoLabels(_scoreId);
|
|
4839
|
-
}
|
|
4840
|
-
dataTooldif.textContent = g_detailObj.toolDif[_scoreId].tool;
|
|
4841
|
-
dataDouji.textContent = g_detailObj.toolDif[_scoreId].douji;
|
|
4842
|
-
dataTate.textContent = g_detailObj.toolDif[_scoreId].tate;
|
|
4843
|
-
lblArrowInfo2.innerHTML = g_lblNameObj.s_linecnts.split(`{0}`).join(g_detailObj.toolDif[_scoreId].push3cnt);
|
|
4844
|
-
dataArrowInfo.innerHTML = `${arrowCnts + frzCnts} <span style="font-size:${g_limitObj.difSelectorSiz}px;">(${arrowCnts} + ${frzCnts})</span>`;
|
|
4845
|
-
dataArrowInfo2.innerHTML = `<br>(${g_detailObj.arrowCnt[_scoreId]})<br><br>
|
|
4846
|
-
(${g_detailObj.frzCnt[_scoreId]})<br><br>
|
|
4847
|
-
${push3CntStr}`.split(`,`).join(`/`);
|
|
4848
|
-
};
|
|
4849
|
-
|
|
4850
5038
|
// ---------------------------------------------------
|
|
4851
5039
|
// 速度モーション (Motion)
|
|
4852
5040
|
// 縦位置: 3
|
|
@@ -4879,25 +5067,6 @@ const createOptionWindow = _sprite => {
|
|
|
4879
5067
|
spriteList.scroll.style.pointerEvents = C_DIS_NONE;
|
|
4880
5068
|
}
|
|
4881
5069
|
|
|
4882
|
-
const setReverse = _btn => {
|
|
4883
|
-
if (!g_settings.scrolls.includes(`Reverse`)) {
|
|
4884
|
-
g_settings.reverseNum = (g_settings.reverseNum + 1) % 2;
|
|
4885
|
-
g_stateObj.reverse = g_settings.reverses[g_settings.reverseNum];
|
|
4886
|
-
setReverseView(_btn);
|
|
4887
|
-
}
|
|
4888
|
-
};
|
|
4889
|
-
|
|
4890
|
-
const setReverseView = _btn => {
|
|
4891
|
-
_btn.classList.replace(g_cssObj[`button_Rev${g_settings.reverses[(g_settings.reverseNum + 1) % 2]}`],
|
|
4892
|
-
g_cssObj[`button_Rev${g_settings.reverses[g_settings.reverseNum]}`]);
|
|
4893
|
-
if (!g_settings.scrolls.includes(`Reverse`)) {
|
|
4894
|
-
_btn.textContent = `${g_lblNameObj.Reverse}:${getStgDetailName(g_stateObj.reverse)}`;
|
|
4895
|
-
} else {
|
|
4896
|
-
_btn.textContent = `X`;
|
|
4897
|
-
setReverseDefault();
|
|
4898
|
-
}
|
|
4899
|
-
};
|
|
4900
|
-
|
|
4901
5070
|
// ---------------------------------------------------
|
|
4902
5071
|
// ミラー・ランダム (Shuffle)
|
|
4903
5072
|
// 縦位置: 5.5
|
|
@@ -4916,165 +5085,6 @@ const createOptionWindow = _sprite => {
|
|
|
4916
5085
|
// ゲージ設定詳細 縦位置: ゲージ設定+1
|
|
4917
5086
|
spriteList.gauge.appendChild(createDivCss2Label(`lblGauge2`, ``, g_lblPosObj.lblGauge2));
|
|
4918
5087
|
|
|
4919
|
-
/**
|
|
4920
|
-
* ゲージ設定メイン
|
|
4921
|
-
* @param {number} _scrollNum
|
|
4922
|
-
*/
|
|
4923
|
-
const setGauge = _scrollNum => {
|
|
4924
|
-
|
|
4925
|
-
// カーソルを動かさない場合は先にゲージ設定をリロード
|
|
4926
|
-
if (_scrollNum === 0) {
|
|
4927
|
-
gaugeChange(g_settings.gaugeNum);
|
|
4928
|
-
}
|
|
4929
|
-
setSetting(_scrollNum, `gauge`);
|
|
4930
|
-
|
|
4931
|
-
// カーソルを動かす場合は設定変更後にゲージ設定を再設定
|
|
4932
|
-
if (_scrollNum !== 0) {
|
|
4933
|
-
gaugeChange(g_settings.gaugeNum);
|
|
4934
|
-
}
|
|
4935
|
-
lblGauge2.innerHTML = gaugeFormat(g_stateObj.lifeMode,
|
|
4936
|
-
g_stateObj.lifeBorder, g_stateObj.lifeRcv, g_stateObj.lifeDmg, g_stateObj.lifeInit, g_stateObj.lifeVariable);
|
|
4937
|
-
};
|
|
4938
|
-
|
|
4939
|
-
/**
|
|
4940
|
-
* ゲージ設定の切替処理
|
|
4941
|
-
* @param {number} _gaugeNum
|
|
4942
|
-
*/
|
|
4943
|
-
const gaugeChange = _gaugeNum => {
|
|
4944
|
-
const tmpScoreId = g_stateObj.scoreId;
|
|
4945
|
-
|
|
4946
|
-
/**
|
|
4947
|
-
* ゲージ詳細変更
|
|
4948
|
-
* @param {object} _baseProperty
|
|
4949
|
-
* @param {string} _setProperty
|
|
4950
|
-
* @param {number} _magnification
|
|
4951
|
-
*/
|
|
4952
|
-
const setLife = (_baseProperty, _setProperty, _magnification = 1) => {
|
|
4953
|
-
if (setVal(_baseProperty[tmpScoreId], ``, C_TYP_FLOAT) !== ``) {
|
|
4954
|
-
g_stateObj[_setProperty] = _baseProperty[tmpScoreId] * _magnification;
|
|
4955
|
-
}
|
|
4956
|
-
};
|
|
4957
|
-
|
|
4958
|
-
/**
|
|
4959
|
-
* ゲージ詳細一括変更
|
|
4960
|
-
* @param {object} _baseObj
|
|
4961
|
-
* @param {object} _obj
|
|
4962
|
-
*/
|
|
4963
|
-
const setLifeCategory = (_baseObj, { _magInit = 1, _magRcv = 1, _magDmg = 1 } = {}) => {
|
|
4964
|
-
setLife(_baseObj.lifeInits, `lifeInit`, _magInit);
|
|
4965
|
-
setLife(_baseObj.lifeRecoverys, `lifeRcv`, _magRcv);
|
|
4966
|
-
setLife(_baseObj.lifeDamages, `lifeDmg`, _magDmg);
|
|
4967
|
-
};
|
|
4968
|
-
|
|
4969
|
-
/**
|
|
4970
|
-
* ライフモード切替
|
|
4971
|
-
* @param {object} _baseObj
|
|
4972
|
-
*/
|
|
4973
|
-
const changeLifeMode = (_baseObj) => {
|
|
4974
|
-
if (_baseObj.lifeBorders[tmpScoreId] === `x`) {
|
|
4975
|
-
g_stateObj.lifeBorder = 0;
|
|
4976
|
-
g_stateObj.lifeMode = C_LFE_SURVIVAL;
|
|
4977
|
-
} else {
|
|
4978
|
-
g_stateObj.lifeBorder = _baseObj.lifeBorders[tmpScoreId];
|
|
4979
|
-
g_stateObj.lifeMode = C_LFE_BORDER;
|
|
4980
|
-
}
|
|
4981
|
-
};
|
|
4982
|
-
|
|
4983
|
-
// ゲージ初期化
|
|
4984
|
-
if (_gaugeNum === 0) {
|
|
4985
|
-
if (hasVal(g_headerObj.lifeBorders[tmpScoreId])) {
|
|
4986
|
-
changeLifeMode(g_headerObj);
|
|
4987
|
-
g_gaugeType = (g_gaugeOptionObj.custom.length > 0 ? C_LFE_CUSTOM : g_stateObj.lifeMode);
|
|
4988
|
-
|
|
4989
|
-
g_stateObj.lifeVariable = g_gaugeOptionObj[`var${g_gaugeType}`][_gaugeNum];
|
|
4990
|
-
g_settings.gauges = structuredClone(g_gaugeOptionObj[g_gaugeType.toLowerCase()]);
|
|
4991
|
-
g_stateObj.gauge = g_settings.gauges[g_settings.gaugeNum];
|
|
4992
|
-
}
|
|
4993
|
-
setLifeCategory(g_headerObj);
|
|
4994
|
-
|
|
4995
|
-
} else {
|
|
4996
|
-
// 設定されたゲージ設定、カーソルに合わせて設定値を更新
|
|
4997
|
-
g_stateObj.lifeVariable = g_gaugeOptionObj[`var${g_gaugeType}`][_gaugeNum];
|
|
4998
|
-
if (g_gaugeOptionObj.custom.length === 0 ||
|
|
4999
|
-
g_gaugeOptionObj.defaultList.includes(g_gaugeOptionObj[`defaultGauge${tmpScoreId}`])) {
|
|
5000
|
-
const gType = (g_gaugeType === C_LFE_CUSTOM ?
|
|
5001
|
-
toCapitalize(g_gaugeOptionObj[`defaultGauge${tmpScoreId}`]) : g_gaugeType);
|
|
5002
|
-
g_stateObj.lifeMode = g_gaugeOptionObj[`type${gType}`][_gaugeNum];
|
|
5003
|
-
g_stateObj.lifeBorder = g_gaugeOptionObj[`clear${gType}`][_gaugeNum];
|
|
5004
|
-
g_stateObj.lifeInit = g_gaugeOptionObj[`init${gType}`][_gaugeNum];
|
|
5005
|
-
g_stateObj.lifeRcv = g_gaugeOptionObj[`rcv${gType}`][_gaugeNum];
|
|
5006
|
-
g_stateObj.lifeDmg = g_gaugeOptionObj[`dmg${gType}`][_gaugeNum];
|
|
5007
|
-
}
|
|
5008
|
-
}
|
|
5009
|
-
|
|
5010
|
-
// ゲージ設定(Light, Easy)の初期化
|
|
5011
|
-
if (g_stateObj.gauge === `Light` || g_stateObj.gauge === `Easy`) {
|
|
5012
|
-
setLifeCategory(g_headerObj, { _magRcv: 2 });
|
|
5013
|
-
}
|
|
5014
|
-
|
|
5015
|
-
// ゲージ設定別に個別設定した場合はここで設定を上書き
|
|
5016
|
-
// 譜面ヘッダー:gaugeXXX で設定した値がここで適用される
|
|
5017
|
-
if (hasVal(g_gaugeOptionObj[`gauge${g_stateObj.gauge}s`])) {
|
|
5018
|
-
const tmpGaugeObj = g_gaugeOptionObj[`gauge${g_stateObj.gauge}s`];
|
|
5019
|
-
if (hasVal(tmpGaugeObj.lifeBorders[tmpScoreId])) {
|
|
5020
|
-
changeLifeMode(tmpGaugeObj);
|
|
5021
|
-
}
|
|
5022
|
-
setLifeCategory(tmpGaugeObj);
|
|
5023
|
-
}
|
|
5024
|
-
};
|
|
5025
|
-
|
|
5026
|
-
/**
|
|
5027
|
-
* ゲージ設定の詳細表示を整形
|
|
5028
|
-
*/
|
|
5029
|
-
const gaugeFormat = (_mode, _border, _rcv, _dmg, _init, _lifeValFlg) => {
|
|
5030
|
-
const initVal = g_headerObj.maxLifeVal * _init / 100;
|
|
5031
|
-
const borderVal = (_mode === C_LFE_BORDER && _border !== 0 ?
|
|
5032
|
-
Math.round(g_headerObj.maxLifeVal * _border / 100) : `-`);
|
|
5033
|
-
|
|
5034
|
-
let lifeValCss = ``;
|
|
5035
|
-
if (_lifeValFlg === C_FLG_ON) {
|
|
5036
|
-
lifeValCss = ` settings_lifeVal`;
|
|
5037
|
-
}
|
|
5038
|
-
|
|
5039
|
-
// 整形用にライフ初期値を整数、回復・ダメージ量を小数第1位で丸める
|
|
5040
|
-
const init = Math.round(initVal);
|
|
5041
|
-
const border = (borderVal !== `-` ? borderVal : `-`);
|
|
5042
|
-
const rcv = Math.round(_rcv * 100) / 100;
|
|
5043
|
-
const dmg = Math.round(_dmg * 100) / 100;
|
|
5044
|
-
|
|
5045
|
-
return `<div id="gaugeDivCover" class="settings_gaugeDivCover">
|
|
5046
|
-
<div id="lblGaugeDivTable" class="settings_gaugeDivTable">
|
|
5047
|
-
<div id="lblGaugeStart" class="settings_gaugeDivTableCol settings_gaugeStart">
|
|
5048
|
-
${g_lblNameObj.g_start}
|
|
5049
|
-
</div>
|
|
5050
|
-
<div id="lblGaugeBorder" class="settings_gaugeDivTableCol settings_gaugeEtc">
|
|
5051
|
-
${g_lblNameObj.g_border}
|
|
5052
|
-
</div>
|
|
5053
|
-
<div id="lblGaugeRecovery" class="settings_gaugeDivTableCol settings_gaugeEtc">
|
|
5054
|
-
${g_lblNameObj.g_recovery}
|
|
5055
|
-
</div>
|
|
5056
|
-
<div id="lblGaugeDamage" class="settings_gaugeDivTableCol settings_gaugeEtc">
|
|
5057
|
-
${g_lblNameObj.g_damage}
|
|
5058
|
-
</div>
|
|
5059
|
-
</div>
|
|
5060
|
-
<div id="dataGaugeDivTable" class="settings_gaugeDivTable">
|
|
5061
|
-
<div id="dataGaugeStart" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeStart">
|
|
5062
|
-
${init}/${g_headerObj.maxLifeVal}
|
|
5063
|
-
</div>
|
|
5064
|
-
<div id="dataGaugeBorder" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeEtc">
|
|
5065
|
-
${border}
|
|
5066
|
-
</div>
|
|
5067
|
-
<div id="dataGaugeRecovery" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeEtc${lifeValCss}">
|
|
5068
|
-
${rcv}
|
|
5069
|
-
</div>
|
|
5070
|
-
<div id="dataGaugeDamage" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeEtc${lifeValCss}">
|
|
5071
|
-
${dmg}
|
|
5072
|
-
</div>
|
|
5073
|
-
</div>
|
|
5074
|
-
</div>
|
|
5075
|
-
`;
|
|
5076
|
-
};
|
|
5077
|
-
|
|
5078
5088
|
if (g_headerObj.gaugeUse) {
|
|
5079
5089
|
multiAppend(spriteList.gauge,
|
|
5080
5090
|
makeSettingLblCssButton(`lnkGauge`, ``, 0, _ => setGauge(1), { cxtFunc: _ => setGauge(-1) }),
|
|
@@ -5131,196 +5141,6 @@ const createOptionWindow = _sprite => {
|
|
|
5131
5141
|
// 縦位置: 12.5
|
|
5132
5142
|
createGeneralSetting(spriteList.volume, `volume`, { unitName: g_lblNameObj.percent });
|
|
5133
5143
|
|
|
5134
|
-
/**
|
|
5135
|
-
* 譜面初期化処理
|
|
5136
|
-
* - 譜面の基本設定(キー数、初期速度、リバース、ゲージ設定)をここで行う
|
|
5137
|
-
* - g_canLoadDifInfoFlg は譜面初期化フラグで、初期化したくない場合は対象画面にて false にしておく
|
|
5138
|
-
* (Display設定画面、キーコンフィグ画面では通常OFF)
|
|
5139
|
-
* この関数を実行後、このフラグはONに戻るようになっている
|
|
5140
|
-
* - [キーコン]->[初期化]->[名称設定]の順に配置する。
|
|
5141
|
-
* 初期化処理にてキー数関連の設定を行っているため、この順序で無いとデータが正しく格納されない
|
|
5142
|
-
*/
|
|
5143
|
-
const setDifficulty = (_initFlg) => {
|
|
5144
|
-
|
|
5145
|
-
const getCurrentNo = (_list, _target) => roundZero(_list.findIndex(item => item === _target));
|
|
5146
|
-
|
|
5147
|
-
// ---------------------------------------------------
|
|
5148
|
-
// 1. キーコンフィグ設定 (KeyConfig)
|
|
5149
|
-
g_keyObj.currentKey = g_headerObj.keyLabels[g_stateObj.scoreId];
|
|
5150
|
-
const isNotSameKey = (g_keyObj.prevKey !== g_keyObj.currentKey);
|
|
5151
|
-
|
|
5152
|
-
if (g_headerObj.dummyScoreNos !== undefined) {
|
|
5153
|
-
g_stateObj.dummyId = setIntVal(g_headerObj.dummyScoreNos[g_stateObj.scoreId], ``);
|
|
5154
|
-
}
|
|
5155
|
-
// 特殊キーフラグ
|
|
5156
|
-
g_stateObj.extraKeyFlg = g_headerObj.keyExtraList.includes(g_keyObj.currentKey);
|
|
5157
|
-
|
|
5158
|
-
// ---------------------------------------------------
|
|
5159
|
-
// 2. 初期化設定
|
|
5160
|
-
|
|
5161
|
-
// 保存した設定の再読込条件(設定画面切り替え時はスキップ)
|
|
5162
|
-
// ローカルストレージで保存した設定を呼び出し
|
|
5163
|
-
if ((g_canLoadDifInfoFlg && (isNotSameKey && g_stateObj.dataSaveFlg)) || _initFlg) {
|
|
5164
|
-
|
|
5165
|
-
if (isNotSameKey && g_keyObj.prevKey !== `Dummy`) {
|
|
5166
|
-
// キーパターン初期化
|
|
5167
|
-
g_keyObj.currentPtn = 0;
|
|
5168
|
-
g_keycons.keySwitchNum = 0;
|
|
5169
|
-
}
|
|
5170
|
-
const hasKeyStorage = localStorage.getItem(`danonicw-${g_keyObj.currentKey}k`);
|
|
5171
|
-
let storageObj, addKey = ``;
|
|
5172
|
-
|
|
5173
|
-
if (!g_stateObj.extraKeyFlg) {
|
|
5174
|
-
|
|
5175
|
-
// キー別のローカルストレージの初期設定 ※特殊キーは除く
|
|
5176
|
-
g_localKeyStorage = hasKeyStorage ? JSON.parse(hasKeyStorage) : {
|
|
5177
|
-
reverse: C_FLG_OFF,
|
|
5178
|
-
keyCtrl: [[]],
|
|
5179
|
-
keyCtrlPtn: 0,
|
|
5180
|
-
setColor: [],
|
|
5181
|
-
};
|
|
5182
|
-
storageObj = g_localKeyStorage;
|
|
5183
|
-
|
|
5184
|
-
} else {
|
|
5185
|
-
storageObj = g_localStorage;
|
|
5186
|
-
addKey = g_keyObj.currentKey;
|
|
5187
|
-
}
|
|
5188
|
-
if (isNotSameKey) {
|
|
5189
|
-
getKeyReverse(storageObj, addKey);
|
|
5190
|
-
|
|
5191
|
-
// キーコンフィグ初期値設定
|
|
5192
|
-
if (storageObj[`keyCtrlPtn${addKey}`] === undefined) {
|
|
5193
|
-
storageObj[`keyCtrlPtn${addKey}`] = 0;
|
|
5194
|
-
}
|
|
5195
|
-
getKeyCtrl(storageObj, addKey);
|
|
5196
|
-
|
|
5197
|
-
// カラーセット初期値設定
|
|
5198
|
-
if (storageObj[`setColor${addKey}`] === undefined) {
|
|
5199
|
-
storageObj[`setColor${addKey}`] = [];
|
|
5200
|
-
}
|
|
5201
|
-
if (storageObj[`setColor${addKey}`].length > 0) {
|
|
5202
|
-
g_keycons.colorTypes = addValtoArray(g_keycons.colorTypes, g_keycons.colorSelf);
|
|
5203
|
-
resetColorType({ _fromObj: storageObj, _from: addKey, _to: g_keycons.colorSelf });
|
|
5204
|
-
resetColorType({ _fromObj: storageObj, _from: addKey, _toObj: g_dfColorObj, _to: g_keycons.colorSelf });
|
|
5205
|
-
|
|
5206
|
-
} else {
|
|
5207
|
-
if (g_localStorage.colorType === g_keycons.colorSelf) {
|
|
5208
|
-
g_colorType = `Default`;
|
|
5209
|
-
}
|
|
5210
|
-
g_keycons.colorTypes = g_keycons.colorTypes.filter(val => val !== g_keycons.colorSelf);
|
|
5211
|
-
}
|
|
5212
|
-
|
|
5213
|
-
const keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`;
|
|
5214
|
-
|
|
5215
|
-
// カラーグループ、シャッフルグループの設定
|
|
5216
|
-
g_keycons.groups.forEach(type => {
|
|
5217
|
-
resetGroupList(type, keyCtrlPtn);
|
|
5218
|
-
if (g_keyObj.currentPtn === -1) {
|
|
5219
|
-
const storageKeyName = storageObj[`${type}${addKey}`] || storageObj[`${type}${g_keyObj.currentKey}_-1_-1`];
|
|
5220
|
-
if (storageKeyName !== undefined) {
|
|
5221
|
-
g_keyObj[`${type}${g_keyObj.currentKey}_-1`] = structuredClone(storageKeyName);
|
|
5222
|
-
}
|
|
5223
|
-
g_keyObj[`${type}${g_keyObj.currentKey}_-1_-1`] = structuredClone(g_keyObj[`${type}${g_keyObj.currentKey}_-1`]);
|
|
5224
|
-
} else {
|
|
5225
|
-
g_keyObj[`${type}${keyCtrlPtn}`] = structuredClone(g_keyObj[`${type}${keyCtrlPtn}_0`]);
|
|
5226
|
-
}
|
|
5227
|
-
});
|
|
5228
|
-
|
|
5229
|
-
}
|
|
5230
|
-
|
|
5231
|
-
const keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`;
|
|
5232
|
-
if (g_headerObj.keyRetryDef === C_KEY_RETRY) {
|
|
5233
|
-
g_headerObj.keyRetry = setIntVal(getKeyCtrlVal(g_keyObj[`keyRetry${keyCtrlPtn}`]), g_headerObj.keyRetryDef);
|
|
5234
|
-
}
|
|
5235
|
-
if (g_headerObj.keyTitleBackDef === C_KEY_TITLEBACK) {
|
|
5236
|
-
g_headerObj.keyTitleBack = setIntVal(getKeyCtrlVal(g_keyObj[`keyTitleBack${keyCtrlPtn}`]), g_headerObj.keyTitleBackDef);
|
|
5237
|
-
}
|
|
5238
|
-
}
|
|
5239
|
-
|
|
5240
|
-
// スクロール設定用の配列を入れ替え
|
|
5241
|
-
g_settings.scrolls = structuredClone(
|
|
5242
|
-
typeof g_keyObj[`scrollDir${g_keyObj.currentKey}_${g_keyObj.currentPtn}`] === C_TYP_OBJECT ?
|
|
5243
|
-
Object.keys(g_keyObj[`scrollDir${g_keyObj.currentKey}_${g_keyObj.currentPtn}`]) : g_keyObj.scrollName_def
|
|
5244
|
-
);
|
|
5245
|
-
|
|
5246
|
-
// アシスト設定の配列を入れ替え
|
|
5247
|
-
g_settings.autoPlays = (typeof g_keyObj[`assistPos${g_keyObj.currentKey}_${g_keyObj.currentPtn}`] === C_TYP_OBJECT ?
|
|
5248
|
-
g_autoPlaysBase.concat(Object.keys(g_keyObj[`assistPos${g_keyObj.currentKey}_${g_keyObj.currentPtn}`])) :
|
|
5249
|
-
g_autoPlaysBase.concat());
|
|
5250
|
-
|
|
5251
|
-
// 速度、ゲージ、スクロール、アシスト設定のカーソル位置調整
|
|
5252
|
-
if (_initFlg) {
|
|
5253
|
-
g_stateObj.speed = g_headerObj.initSpeeds[g_stateObj.scoreId];
|
|
5254
|
-
g_settings.speedNum = getCurrentNo(g_settings.speeds, g_stateObj.speed);
|
|
5255
|
-
g_settings.gaugeNum = 0;
|
|
5256
|
-
}
|
|
5257
|
-
g_settings.scrollNum = getCurrentNo(g_settings.scrolls, g_stateObj.scroll);
|
|
5258
|
-
g_settings.autoPlayNum = getCurrentNo(g_settings.autoPlays, g_stateObj.autoPlay);
|
|
5259
|
-
|
|
5260
|
-
// ---------------------------------------------------
|
|
5261
|
-
// 3. 名称の設定
|
|
5262
|
-
|
|
5263
|
-
// 譜面名設定 (Difficulty)
|
|
5264
|
-
const difWidth = parseFloat(lnkDifficulty.style.width);
|
|
5265
|
-
const difNames = [`${getKeyName(g_keyObj.currentKey)} ${getStgDetailName('key')} / ${g_headerObj.difLabels[g_stateObj.scoreId]}`];
|
|
5266
|
-
lnkDifficulty.style.fontSize = `${getFontSize(difNames[0], difWidth, getBasicFont(), g_limitObj.setLblSiz)}px`;
|
|
5267
|
-
|
|
5268
|
-
if (g_headerObj.makerView) {
|
|
5269
|
-
difNames.push(`(${g_headerObj.creatorNames[g_stateObj.scoreId]})`);
|
|
5270
|
-
difNames.forEach((difName, j) => {
|
|
5271
|
-
const tmpSize = getFontSize(difName, difWidth, getBasicFont(), 14);
|
|
5272
|
-
difNames[j] = `<span style="font-size:${tmpSize}px">${difName}</span>`;
|
|
5273
|
-
});
|
|
5274
|
-
}
|
|
5275
|
-
lnkDifficulty.innerHTML = difNames.join(``);
|
|
5276
|
-
|
|
5277
|
-
// 速度設定 (Speed)
|
|
5278
|
-
setSetting(0, `speed`, ` ${g_lblNameObj.multi}`);
|
|
5279
|
-
if (g_headerObj.scoreDetailUse) {
|
|
5280
|
-
drawSpeedGraph(g_stateObj.scoreId);
|
|
5281
|
-
drawDensityGraph(g_stateObj.scoreId);
|
|
5282
|
-
makeDifInfo(g_stateObj.scoreId);
|
|
5283
|
-
}
|
|
5284
|
-
|
|
5285
|
-
// リバース設定 (Reverse, Scroll)
|
|
5286
|
-
if (g_headerObj.scrollUse) {
|
|
5287
|
-
g_stateObj.scroll = g_settings.scrolls[g_settings.scrollNum];
|
|
5288
|
-
const [visibleScr, hiddenScr] = (g_settings.scrolls.length > 1 ? [`scroll`, `reverse`] : [`reverse`, `scroll`]);
|
|
5289
|
-
spriteList[visibleScr].style.display = C_DIS_INHERIT;
|
|
5290
|
-
spriteList[hiddenScr].style.display = C_DIS_NONE;
|
|
5291
|
-
setSetting(0, visibleScr);
|
|
5292
|
-
|
|
5293
|
-
g_shortcutObj.option.KeyR.id = g_settings.scrolls.includes(`Reverse`) ?
|
|
5294
|
-
g_shortcutObj.option.KeyR.exId : g_shortcutObj.option.KeyR.dfId;
|
|
5295
|
-
|
|
5296
|
-
if (g_settings.scrolls.length > 1) {
|
|
5297
|
-
setReverseView(document.querySelector(`#btnReverse`));
|
|
5298
|
-
}
|
|
5299
|
-
} else {
|
|
5300
|
-
g_settings.scrolls = structuredClone(g_keyObj.scrollName_def);
|
|
5301
|
-
setSetting(0, `reverse`);
|
|
5302
|
-
}
|
|
5303
|
-
|
|
5304
|
-
// オート・アシスト設定 (AutoPlay)
|
|
5305
|
-
g_stateObj.autoPlay = g_settings.autoPlays[g_settings.autoPlayNum];
|
|
5306
|
-
lnkAutoPlay.textContent = getStgDetailName(g_stateObj.autoPlay);
|
|
5307
|
-
|
|
5308
|
-
// ゲージ設定 (Gauge)
|
|
5309
|
-
const defaultCustomGauge = g_gaugeOptionObj.custom0 || g_gaugeOptionObj.customDefault;
|
|
5310
|
-
if (hasVal(defaultCustomGauge)) {
|
|
5311
|
-
g_gaugeOptionObj.custom = (g_gaugeOptionObj[`custom${g_stateObj.scoreId}`] || defaultCustomGauge).concat();
|
|
5312
|
-
g_gaugeOptionObj.varCustom = (g_gaugeOptionObj[`varCustom${g_stateObj.scoreId}`] || g_gaugeOptionObj.varCustom0 || g_gaugeOptionObj.varCustomDefault).concat();
|
|
5313
|
-
}
|
|
5314
|
-
setGauge(0);
|
|
5315
|
-
|
|
5316
|
-
// ユーザカスタムイベント(初期)
|
|
5317
|
-
g_customJsObj.difficulty.forEach(func => func(_initFlg, g_canLoadDifInfoFlg));
|
|
5318
|
-
|
|
5319
|
-
// ---------------------------------------------------
|
|
5320
|
-
// 4. 譜面初期情報ロード許可フラグの設定
|
|
5321
|
-
g_canLoadDifInfoFlg = true;
|
|
5322
|
-
};
|
|
5323
|
-
|
|
5324
5144
|
// 設定画面の一通りのオブジェクトを作成後に譜面・速度・ゲージ設定をまとめて行う
|
|
5325
5145
|
setDifficulty(false);
|
|
5326
5146
|
optionsprite.oncontextmenu = _ => false;
|
|
@@ -5488,6 +5308,184 @@ const setReverseDefault = _ => {
|
|
|
5488
5308
|
g_settings.reverseNum = 0;
|
|
5489
5309
|
};
|
|
5490
5310
|
|
|
5311
|
+
const setReverse = _btn => {
|
|
5312
|
+
if (!g_settings.scrolls.includes(`Reverse`)) {
|
|
5313
|
+
g_settings.reverseNum = (g_settings.reverseNum + 1) % 2;
|
|
5314
|
+
g_stateObj.reverse = g_settings.reverses[g_settings.reverseNum];
|
|
5315
|
+
setReverseView(_btn);
|
|
5316
|
+
}
|
|
5317
|
+
};
|
|
5318
|
+
|
|
5319
|
+
const setReverseView = _btn => {
|
|
5320
|
+
_btn.classList.replace(g_cssObj[`button_Rev${g_settings.reverses[(g_settings.reverseNum + 1) % 2]}`],
|
|
5321
|
+
g_cssObj[`button_Rev${g_settings.reverses[g_settings.reverseNum]}`]);
|
|
5322
|
+
if (!g_settings.scrolls.includes(`Reverse`)) {
|
|
5323
|
+
_btn.textContent = `${g_lblNameObj.Reverse}:${getStgDetailName(g_stateObj.reverse)}`;
|
|
5324
|
+
} else {
|
|
5325
|
+
_btn.textContent = `X`;
|
|
5326
|
+
setReverseDefault();
|
|
5327
|
+
}
|
|
5328
|
+
};
|
|
5329
|
+
|
|
5330
|
+
/**
|
|
5331
|
+
* ゲージ設定メイン
|
|
5332
|
+
* @param {number} _scrollNum
|
|
5333
|
+
*/
|
|
5334
|
+
const setGauge = _scrollNum => {
|
|
5335
|
+
|
|
5336
|
+
// カーソルを動かさない場合は先にゲージ設定をリロード
|
|
5337
|
+
if (_scrollNum === 0) {
|
|
5338
|
+
gaugeChange(g_settings.gaugeNum);
|
|
5339
|
+
}
|
|
5340
|
+
setSetting(_scrollNum, `gauge`);
|
|
5341
|
+
|
|
5342
|
+
// カーソルを動かす場合は設定変更後にゲージ設定を再設定
|
|
5343
|
+
if (_scrollNum !== 0) {
|
|
5344
|
+
gaugeChange(g_settings.gaugeNum);
|
|
5345
|
+
}
|
|
5346
|
+
lblGauge2.innerHTML = gaugeFormat(g_stateObj.lifeMode,
|
|
5347
|
+
g_stateObj.lifeBorder, g_stateObj.lifeRcv, g_stateObj.lifeDmg, g_stateObj.lifeInit, g_stateObj.lifeVariable);
|
|
5348
|
+
};
|
|
5349
|
+
|
|
5350
|
+
/**
|
|
5351
|
+
* ゲージ設定の切替処理
|
|
5352
|
+
* @param {number} _gaugeNum
|
|
5353
|
+
*/
|
|
5354
|
+
const gaugeChange = _gaugeNum => {
|
|
5355
|
+
const tmpScoreId = g_stateObj.scoreId;
|
|
5356
|
+
|
|
5357
|
+
/**
|
|
5358
|
+
* ゲージ詳細変更
|
|
5359
|
+
* @param {object} _baseProperty
|
|
5360
|
+
* @param {string} _setProperty
|
|
5361
|
+
* @param {number} _magnification
|
|
5362
|
+
*/
|
|
5363
|
+
const setLife = (_baseProperty, _setProperty, _magnification = 1) => {
|
|
5364
|
+
if (setVal(_baseProperty[tmpScoreId], ``, C_TYP_FLOAT) !== ``) {
|
|
5365
|
+
g_stateObj[_setProperty] = _baseProperty[tmpScoreId] * _magnification;
|
|
5366
|
+
}
|
|
5367
|
+
};
|
|
5368
|
+
|
|
5369
|
+
/**
|
|
5370
|
+
* ゲージ詳細一括変更
|
|
5371
|
+
* @param {object} _baseObj
|
|
5372
|
+
* @param {object} _obj
|
|
5373
|
+
*/
|
|
5374
|
+
const setLifeCategory = (_baseObj, { _magInit = 1, _magRcv = 1, _magDmg = 1 } = {}) => {
|
|
5375
|
+
setLife(_baseObj.lifeInits, `lifeInit`, _magInit);
|
|
5376
|
+
setLife(_baseObj.lifeRecoverys, `lifeRcv`, _magRcv);
|
|
5377
|
+
setLife(_baseObj.lifeDamages, `lifeDmg`, _magDmg);
|
|
5378
|
+
};
|
|
5379
|
+
|
|
5380
|
+
/**
|
|
5381
|
+
* ライフモード切替
|
|
5382
|
+
* @param {object} _baseObj
|
|
5383
|
+
*/
|
|
5384
|
+
const changeLifeMode = (_baseObj) => {
|
|
5385
|
+
if (_baseObj.lifeBorders[tmpScoreId] === `x`) {
|
|
5386
|
+
g_stateObj.lifeBorder = 0;
|
|
5387
|
+
g_stateObj.lifeMode = C_LFE_SURVIVAL;
|
|
5388
|
+
} else {
|
|
5389
|
+
g_stateObj.lifeBorder = _baseObj.lifeBorders[tmpScoreId];
|
|
5390
|
+
g_stateObj.lifeMode = C_LFE_BORDER;
|
|
5391
|
+
}
|
|
5392
|
+
};
|
|
5393
|
+
|
|
5394
|
+
// ゲージ初期化
|
|
5395
|
+
if (_gaugeNum === 0) {
|
|
5396
|
+
if (hasVal(g_headerObj.lifeBorders[tmpScoreId])) {
|
|
5397
|
+
changeLifeMode(g_headerObj);
|
|
5398
|
+
g_gaugeType = (g_gaugeOptionObj.custom.length > 0 ? C_LFE_CUSTOM : g_stateObj.lifeMode);
|
|
5399
|
+
|
|
5400
|
+
g_stateObj.lifeVariable = g_gaugeOptionObj[`var${g_gaugeType}`][_gaugeNum];
|
|
5401
|
+
g_settings.gauges = structuredClone(g_gaugeOptionObj[g_gaugeType.toLowerCase()]);
|
|
5402
|
+
g_stateObj.gauge = g_settings.gauges[g_settings.gaugeNum];
|
|
5403
|
+
}
|
|
5404
|
+
setLifeCategory(g_headerObj);
|
|
5405
|
+
|
|
5406
|
+
} else {
|
|
5407
|
+
// 設定されたゲージ設定、カーソルに合わせて設定値を更新
|
|
5408
|
+
g_stateObj.lifeVariable = g_gaugeOptionObj[`var${g_gaugeType}`][_gaugeNum];
|
|
5409
|
+
if (g_gaugeOptionObj.custom.length === 0 ||
|
|
5410
|
+
g_gaugeOptionObj.defaultList.includes(g_gaugeOptionObj[`defaultGauge${tmpScoreId}`])) {
|
|
5411
|
+
const gType = (g_gaugeType === C_LFE_CUSTOM ?
|
|
5412
|
+
toCapitalize(g_gaugeOptionObj[`defaultGauge${tmpScoreId}`]) : g_gaugeType);
|
|
5413
|
+
g_stateObj.lifeMode = g_gaugeOptionObj[`type${gType}`][_gaugeNum];
|
|
5414
|
+
g_stateObj.lifeBorder = g_gaugeOptionObj[`clear${gType}`][_gaugeNum];
|
|
5415
|
+
g_stateObj.lifeInit = g_gaugeOptionObj[`init${gType}`][_gaugeNum];
|
|
5416
|
+
g_stateObj.lifeRcv = g_gaugeOptionObj[`rcv${gType}`][_gaugeNum];
|
|
5417
|
+
g_stateObj.lifeDmg = g_gaugeOptionObj[`dmg${gType}`][_gaugeNum];
|
|
5418
|
+
}
|
|
5419
|
+
}
|
|
5420
|
+
|
|
5421
|
+
// ゲージ設定(Light, Easy)の初期化
|
|
5422
|
+
if (g_stateObj.gauge === `Light` || g_stateObj.gauge === `Easy`) {
|
|
5423
|
+
setLifeCategory(g_headerObj, { _magRcv: 2 });
|
|
5424
|
+
}
|
|
5425
|
+
|
|
5426
|
+
// ゲージ設定別に個別設定した場合はここで設定を上書き
|
|
5427
|
+
// 譜面ヘッダー:gaugeXXX で設定した値がここで適用される
|
|
5428
|
+
if (hasVal(g_gaugeOptionObj[`gauge${g_stateObj.gauge}s`])) {
|
|
5429
|
+
const tmpGaugeObj = g_gaugeOptionObj[`gauge${g_stateObj.gauge}s`];
|
|
5430
|
+
if (hasVal(tmpGaugeObj.lifeBorders[tmpScoreId])) {
|
|
5431
|
+
changeLifeMode(tmpGaugeObj);
|
|
5432
|
+
}
|
|
5433
|
+
setLifeCategory(tmpGaugeObj);
|
|
5434
|
+
}
|
|
5435
|
+
};
|
|
5436
|
+
|
|
5437
|
+
/**
|
|
5438
|
+
* ゲージ設定の詳細表示を整形
|
|
5439
|
+
*/
|
|
5440
|
+
const gaugeFormat = (_mode, _border, _rcv, _dmg, _init, _lifeValFlg) => {
|
|
5441
|
+
const initVal = g_headerObj.maxLifeVal * _init / 100;
|
|
5442
|
+
const borderVal = (_mode === C_LFE_BORDER && _border !== 0 ?
|
|
5443
|
+
Math.round(g_headerObj.maxLifeVal * _border / 100) : `-`);
|
|
5444
|
+
|
|
5445
|
+
let lifeValCss = ``;
|
|
5446
|
+
if (_lifeValFlg === C_FLG_ON) {
|
|
5447
|
+
lifeValCss = ` settings_lifeVal`;
|
|
5448
|
+
}
|
|
5449
|
+
|
|
5450
|
+
// 整形用にライフ初期値を整数、回復・ダメージ量を小数第1位で丸める
|
|
5451
|
+
const init = Math.round(initVal);
|
|
5452
|
+
const border = (borderVal !== `-` ? borderVal : `-`);
|
|
5453
|
+
const rcv = Math.round(_rcv * 100) / 100;
|
|
5454
|
+
const dmg = Math.round(_dmg * 100) / 100;
|
|
5455
|
+
|
|
5456
|
+
return `<div id="gaugeDivCover" class="settings_gaugeDivCover">
|
|
5457
|
+
<div id="lblGaugeDivTable" class="settings_gaugeDivTable">
|
|
5458
|
+
<div id="lblGaugeStart" class="settings_gaugeDivTableCol settings_gaugeStart">
|
|
5459
|
+
${g_lblNameObj.g_start}
|
|
5460
|
+
</div>
|
|
5461
|
+
<div id="lblGaugeBorder" class="settings_gaugeDivTableCol settings_gaugeEtc">
|
|
5462
|
+
${g_lblNameObj.g_border}
|
|
5463
|
+
</div>
|
|
5464
|
+
<div id="lblGaugeRecovery" class="settings_gaugeDivTableCol settings_gaugeEtc">
|
|
5465
|
+
${g_lblNameObj.g_recovery}
|
|
5466
|
+
</div>
|
|
5467
|
+
<div id="lblGaugeDamage" class="settings_gaugeDivTableCol settings_gaugeEtc">
|
|
5468
|
+
${g_lblNameObj.g_damage}
|
|
5469
|
+
</div>
|
|
5470
|
+
</div>
|
|
5471
|
+
<div id="dataGaugeDivTable" class="settings_gaugeDivTable">
|
|
5472
|
+
<div id="dataGaugeStart" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeStart">
|
|
5473
|
+
${init}/${g_headerObj.maxLifeVal}
|
|
5474
|
+
</div>
|
|
5475
|
+
<div id="dataGaugeBorder" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeEtc">
|
|
5476
|
+
${border}
|
|
5477
|
+
</div>
|
|
5478
|
+
<div id="dataGaugeRecovery" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeEtc${lifeValCss}">
|
|
5479
|
+
${rcv}
|
|
5480
|
+
</div>
|
|
5481
|
+
<div id="dataGaugeDamage" class="settings_gaugeDivTableCol settings_gaugeVal settings_gaugeEtc${lifeValCss}">
|
|
5482
|
+
${dmg}
|
|
5483
|
+
</div>
|
|
5484
|
+
</div>
|
|
5485
|
+
</div>
|
|
5486
|
+
`;
|
|
5487
|
+
};
|
|
5488
|
+
|
|
5491
5489
|
/**
|
|
5492
5490
|
* 保存済みキーコンフィグ取得処理
|
|
5493
5491
|
* @param {object} _localStorage 保存先のローカルストレージ名
|
|
@@ -7029,6 +7027,20 @@ const applyMirror = (_keyNum, _shuffleGroup, _asymFlg = false) => {
|
|
|
7029
7027
|
applyShuffle(_keyNum, _shuffleGroup, style);
|
|
7030
7028
|
};
|
|
7031
7029
|
|
|
7030
|
+
/**
|
|
7031
|
+
* Turningの適用
|
|
7032
|
+
* @param {number} _keyNum
|
|
7033
|
+
* @param {array} _shuffleGroup
|
|
7034
|
+
*/
|
|
7035
|
+
const applyTurning = (_keyNum, _shuffleGroup) => {
|
|
7036
|
+
const mirrorOrNot = _array => Math.random() >= 0.5 ? _array.reverse() : _array;
|
|
7037
|
+
const style = structuredClone(_shuffleGroup).map(_group => {
|
|
7038
|
+
const startNum = Math.floor(Math.random() * (_group.length - 1)) + 1;
|
|
7039
|
+
return mirrorOrNot(makeDedupliArray(_group.slice(startNum), _group.slice(0, startNum)));
|
|
7040
|
+
});
|
|
7041
|
+
applyShuffle(_keyNum, _shuffleGroup, style);
|
|
7042
|
+
};
|
|
7043
|
+
|
|
7032
7044
|
/**
|
|
7033
7045
|
* Randomの適用
|
|
7034
7046
|
* @param {number} _keyNum
|
|
@@ -7039,9 +7051,7 @@ const applyRandom = (_keyNum, _shuffleGroup) => {
|
|
|
7039
7051
|
const style = structuredClone(_shuffleGroup).map(_group => {
|
|
7040
7052
|
for (let i = _group.length - 1; i > 0; i--) {
|
|
7041
7053
|
const random = Math.floor(Math.random() * (i + 1));
|
|
7042
|
-
|
|
7043
|
-
_group[i] = _group[random];
|
|
7044
|
-
_group[random] = tmp;
|
|
7054
|
+
[_group[i], _group[random]] = [_group[random], _group[i]];
|
|
7045
7055
|
}
|
|
7046
7056
|
return _group;
|
|
7047
7057
|
});
|
|
@@ -8394,20 +8404,21 @@ const getArrowSettings = _ => {
|
|
|
8394
8404
|
g_gameOverFlg = false;
|
|
8395
8405
|
g_finishFlg = true;
|
|
8396
8406
|
|
|
8407
|
+
if (g_stateObj.dataSaveFlg) {
|
|
8408
|
+
// ローカルストレージへAdjustment, HitPosition, Volume設定を保存
|
|
8409
|
+
g_storeSettings.forEach(setting => g_localStorage[setting] = g_stateObj[setting]);
|
|
8410
|
+
localStorage.setItem(g_localStorageUrl, JSON.stringify(g_localStorage));
|
|
8411
|
+
}
|
|
8412
|
+
|
|
8397
8413
|
// リバース、キーコンフィグなどをローカルストレージへ保存(Data Save: ON かつ別キーモードで無い場合)
|
|
8398
8414
|
if (g_stateObj.dataSaveFlg && !hasVal(g_keyObj[`transKey${keyCtrlPtn}`])) {
|
|
8399
8415
|
|
|
8400
8416
|
// 次回キーコンフィグ画面へ戻ったとき、保存済みキーコンフィグ設定が表示されるようにする
|
|
8401
8417
|
g_keyObj.prevKey = `Dummy`;
|
|
8402
8418
|
|
|
8403
|
-
// ローカルストレージへ
|
|
8404
|
-
g_localStorage.adjustment = g_stateObj.adjustment;
|
|
8405
|
-
g_localStorage.hitPosition = g_stateObj.hitPosition;
|
|
8406
|
-
g_localStorage.volume = g_stateObj.volume;
|
|
8419
|
+
// ローカルストレージへcolorType設定を保存
|
|
8407
8420
|
g_localStorage.colorType = g_colorType;
|
|
8408
8421
|
|
|
8409
|
-
g_storeSettings.forEach(setting => g_localStorage[setting] = g_stateObj[setting]);
|
|
8410
|
-
|
|
8411
8422
|
let storageObj = g_localKeyStorage;
|
|
8412
8423
|
let addKey = ``;
|
|
8413
8424
|
|
|
@@ -10542,7 +10553,9 @@ const resultInit = _ => {
|
|
|
10542
10553
|
|
|
10543
10554
|
// ハイスコア差分計算
|
|
10544
10555
|
const assistFlg = (g_autoPlaysBase.includes(g_stateObj.autoPlay) ? `` : `-${g_stateObj.autoPlay}less`);
|
|
10545
|
-
|
|
10556
|
+
const mirrorName = (g_stateObj.shuffle.indexOf(`Mirror`) !== -1 ? `-Mirror` : ``);
|
|
10557
|
+
const transKeyName = (hasVal(g_keyObj[`transKey${keyCtrlPtn}`]) ? `(${g_keyObj[`transKey${keyCtrlPtn}`]})` : ``);
|
|
10558
|
+
let scoreName = `${g_headerObj.keyLabels[g_stateObj.scoreId]}${transKeyName}${getStgDetailName('k-')}${g_headerObj.difLabels[g_stateObj.scoreId]}${assistFlg}${mirrorName}`;
|
|
10546
10559
|
if (g_headerObj.makerView) {
|
|
10547
10560
|
scoreName += `-${g_headerObj.creatorNames[g_stateObj.scoreId]}`;
|
|
10548
10561
|
}
|
|
@@ -10552,9 +10565,7 @@ const resultInit = _ => {
|
|
|
10552
10565
|
maxCombo: 0, fmaxCombo: 0, score: 0,
|
|
10553
10566
|
};
|
|
10554
10567
|
|
|
10555
|
-
const highscoreCondition = (g_stateObj.autoAll === C_FLG_OFF && g_stateObj.shuffle === C_FLG_OFF
|
|
10556
|
-
!hasVal(g_keyObj[`transKey${keyCtrlPtn}`]));
|
|
10557
|
-
|
|
10568
|
+
const highscoreCondition = (g_stateObj.autoAll === C_FLG_OFF && (g_stateObj.shuffle === C_FLG_OFF || mirrorName !== ``));
|
|
10558
10569
|
if (highscoreCondition) {
|
|
10559
10570
|
|
|
10560
10571
|
// ハイスコア差分描画
|