danoniplus 26.6.0 → 27.0.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 +214 -343
- package/js/lib/danoni_constants.js +55 -19
- package/js/lib/danoni_legacy_function.js +84 -1
- 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 : 2022/03/
|
|
7
|
+
* Revised : 2022/03/12
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver
|
|
12
|
-
const g_revisedDate = `2022/03/
|
|
11
|
+
const g_version = `Ver 27.0.0`;
|
|
12
|
+
const g_revisedDate = `2022/03/18`;
|
|
13
13
|
const g_alphaVersion = ``;
|
|
14
14
|
|
|
15
15
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
@@ -281,6 +281,22 @@ const setVal = (_checkStr, _default, _type) => {
|
|
|
281
281
|
return convertStr;
|
|
282
282
|
};
|
|
283
283
|
|
|
284
|
+
/**
|
|
285
|
+
* ブール値への変換
|
|
286
|
+
* @param {string} _val
|
|
287
|
+
* @param {boolean} _defaultVal
|
|
288
|
+
* @returns
|
|
289
|
+
*/
|
|
290
|
+
const setBoolVal = (_val, _defaultVal = false) => setVal(_val, _defaultVal, C_TYP_BOOLEAN);
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* 整数値への変換
|
|
294
|
+
* @param {string} _val
|
|
295
|
+
* @param {number} _defaultVal
|
|
296
|
+
* @returns
|
|
297
|
+
*/
|
|
298
|
+
const setIntVal = (_val, _defaultVal = 0) => setVal(_val, _defaultVal, C_TYP_NUMBER);
|
|
299
|
+
|
|
284
300
|
/**
|
|
285
301
|
* 先頭のみ大文字に変換(それ以降はそのまま)
|
|
286
302
|
* @param {string} _str
|
|
@@ -366,7 +382,7 @@ const fuzzyListMatching = (_str, _headerList, _footerList) =>
|
|
|
366
382
|
const replaceStr = (_str, _pairs) => {
|
|
367
383
|
let tmpStr = _str;
|
|
368
384
|
_pairs.forEach(pair => {
|
|
369
|
-
tmpStr = tmpStr.
|
|
385
|
+
tmpStr = tmpStr.replaceAll(pair[0], pair[1]);
|
|
370
386
|
});
|
|
371
387
|
return tmpStr;
|
|
372
388
|
};
|
|
@@ -415,7 +431,7 @@ const nextPos = (_basePos, _num, _length) => (_basePos + _length + _num) % _leng
|
|
|
415
431
|
*/
|
|
416
432
|
const transCode = _setCode => {
|
|
417
433
|
if ([`Control`, `Shift`, `Alt`].includes(_setCode.slice(0, -5))) {
|
|
418
|
-
return _setCode.
|
|
434
|
+
return _setCode.replaceAll(`Right`, `Left`);
|
|
419
435
|
}
|
|
420
436
|
return _setCode;
|
|
421
437
|
};
|
|
@@ -590,36 +606,6 @@ const preloadFile = (_as, _href, _type = ``, _crossOrigin = `anonymous`) => {
|
|
|
590
606
|
}
|
|
591
607
|
};
|
|
592
608
|
|
|
593
|
-
/**
|
|
594
|
-
* 外部jsファイルの読込 (callback)
|
|
595
|
-
* 読込可否を g_loadObj[ファイル名] で管理 (true: 読込成功, false: 読込失敗)
|
|
596
|
-
* @deprecated v27以降非推奨予定
|
|
597
|
-
* @param {string} _url
|
|
598
|
-
* @param {function} _callback
|
|
599
|
-
* @param {boolean} _requiredFlg (default : true / 読込必須)
|
|
600
|
-
* @param {string} _charset (default : UTF-8)
|
|
601
|
-
*/
|
|
602
|
-
function loadScript(_url, _callback, _requiredFlg = true, _charset = `UTF-8`) {
|
|
603
|
-
const baseUrl = _url.split(`?`)[0];
|
|
604
|
-
g_loadObj[baseUrl] = false;
|
|
605
|
-
const script = document.createElement(`script`);
|
|
606
|
-
script.type = `text/javascript`;
|
|
607
|
-
script.src = _url;
|
|
608
|
-
script.charset = _charset;
|
|
609
|
-
script.onload = _ => {
|
|
610
|
-
g_loadObj[baseUrl] = true;
|
|
611
|
-
_callback();
|
|
612
|
-
};
|
|
613
|
-
script.onerror = _ => {
|
|
614
|
-
if (_requiredFlg) {
|
|
615
|
-
makeWarningWindow(g_msgInfoObj.E_0041.split(`{0}`).join(_url.split(`?`)[0]));
|
|
616
|
-
} else {
|
|
617
|
-
_callback();
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
document.querySelector(`head`).appendChild(script);
|
|
621
|
-
}
|
|
622
|
-
|
|
623
609
|
/**
|
|
624
610
|
* 外部jsファイルの読込 (Promise)
|
|
625
611
|
* 読込可否を g_loadObj[ファイル名] で管理 (true: 読込成功, false: 読込失敗)
|
|
@@ -652,30 +638,6 @@ const loadScript2 = (_url, _requiredFlg = true, _charset = `UTF-8`) => {
|
|
|
652
638
|
});
|
|
653
639
|
};
|
|
654
640
|
|
|
655
|
-
/**
|
|
656
|
-
* CSSファイルの読み込み (callback)
|
|
657
|
-
* デフォルトは danoni_skin_default.css を読み込む
|
|
658
|
-
* @deprecated v27以降非推奨予定
|
|
659
|
-
* @param {url} _href
|
|
660
|
-
* @param {function} _func
|
|
661
|
-
*/
|
|
662
|
-
function importCssFile(_href, _func) {
|
|
663
|
-
const baseUrl = _href.split(`?`)[0];
|
|
664
|
-
g_loadObj[baseUrl] = false;
|
|
665
|
-
const link = document.createElement(`link`);
|
|
666
|
-
link.rel = `stylesheet`;
|
|
667
|
-
link.href = _href;
|
|
668
|
-
link.onload = _ => {
|
|
669
|
-
g_loadObj[baseUrl] = true;
|
|
670
|
-
_func();
|
|
671
|
-
};
|
|
672
|
-
link.onerror = _ => {
|
|
673
|
-
makeWarningWindow(g_msgInfoObj.E_0041.split(`{0}`).join(baseUrl), { resetFlg: `title` });
|
|
674
|
-
_func();
|
|
675
|
-
};
|
|
676
|
-
document.head.appendChild(link);
|
|
677
|
-
}
|
|
678
|
-
|
|
679
641
|
/**
|
|
680
642
|
* CSSファイルの読み込み (Promise)
|
|
681
643
|
* デフォルトは danoni_skin_default.css を読み込む
|
|
@@ -701,35 +663,6 @@ const importCssFile2 = _href => {
|
|
|
701
663
|
});
|
|
702
664
|
};
|
|
703
665
|
|
|
704
|
-
/**
|
|
705
|
-
* js, cssファイルの連続読込 (callback)
|
|
706
|
-
* @deprecated v27以降非推奨予定
|
|
707
|
-
* @param {number} _j
|
|
708
|
-
* @param {array} _fileData
|
|
709
|
-
* @param {string} _loadType
|
|
710
|
-
* @param {function} _afterFunc
|
|
711
|
-
*/
|
|
712
|
-
function loadMultipleFiles(_j, _fileData, _loadType, _afterFunc = _ => true) {
|
|
713
|
-
if (_j < _fileData.length) {
|
|
714
|
-
const filePath = `${_fileData[_j][1]}${_fileData[_j][0]}?${new Date().getTime()}`;
|
|
715
|
-
if (_fileData[_j][0].endsWith(`.css`)) {
|
|
716
|
-
_loadType = `css`;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
// jsファイル、cssファイルにより呼び出す関数を切替
|
|
720
|
-
if (_loadType === `js`) {
|
|
721
|
-
loadScript(filePath, _ =>
|
|
722
|
-
loadMultipleFiles(_j + 1, _fileData, _loadType, _afterFunc), false);
|
|
723
|
-
} else if (_loadType === `css`) {
|
|
724
|
-
const cssPath = filePath.split(`.js`).join(`.css`);
|
|
725
|
-
importCssFile(cssPath, _ =>
|
|
726
|
-
loadMultipleFiles(_j + 1, _fileData, _loadType, _afterFunc));
|
|
727
|
-
}
|
|
728
|
-
} else {
|
|
729
|
-
_afterFunc();
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
|
|
733
666
|
/**
|
|
734
667
|
* js, cssファイルの連続読込 (async function)
|
|
735
668
|
* @param {array} _fileData
|
|
@@ -842,7 +775,7 @@ const colorToHex = (_color) => {
|
|
|
842
775
|
const tmpColor = _color.split(`;`);
|
|
843
776
|
const colorSet = tmpColor[0].split(` `);
|
|
844
777
|
return colorNameToCode(colorSet[0]) +
|
|
845
|
-
(tmpColor.length > 1 ? byteToHex(
|
|
778
|
+
(tmpColor.length > 1 ? byteToHex(setIntVal(tmpColor[1], 255)) : '') +
|
|
846
779
|
(colorSet[1] !== undefined ? ` ${colorSet.slice(1).join(' ')}` : '');
|
|
847
780
|
};
|
|
848
781
|
|
|
@@ -881,7 +814,7 @@ const makeColorGradation = (_colorStr, { _defaultColorgrd = g_headerObj.defaultC
|
|
|
881
814
|
const tmpColorStr = _colorStr.split(`@`);
|
|
882
815
|
const colorArray = tmpColorStr[0].split(`:`);
|
|
883
816
|
for (let j = 0; j < colorArray.length; j++) {
|
|
884
|
-
colorArray[j] = colorCdPadding(_colorCdPaddingUse, colorToHex(colorArray[j].
|
|
817
|
+
colorArray[j] = colorCdPadding(_colorCdPaddingUse, colorToHex(colorArray[j].replaceAll(`0x`, `#`)));
|
|
885
818
|
if (isColorCd(colorArray[j]) && colorArray[j].length === 7) {
|
|
886
819
|
colorArray[j] += alphaVal;
|
|
887
820
|
}
|
|
@@ -1146,6 +1079,17 @@ const deleteChildspriteAll = _parentObjName => {
|
|
|
1146
1079
|
}
|
|
1147
1080
|
};
|
|
1148
1081
|
|
|
1082
|
+
/**
|
|
1083
|
+
* div要素の削除
|
|
1084
|
+
* @param {object} _parentId
|
|
1085
|
+
* @param {string} _idName
|
|
1086
|
+
*/
|
|
1087
|
+
const deleteDiv = (_parentId, _idName) => {
|
|
1088
|
+
if (document.getElementById(_idName) !== null) {
|
|
1089
|
+
_parentId.removeChild(document.getElementById(_idName));
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1149
1093
|
/**
|
|
1150
1094
|
* ボタンの作成 (CSS版・拡張属性対応)
|
|
1151
1095
|
* @param {string} _id
|
|
@@ -1162,7 +1106,6 @@ const createCss2Button = (_id, _text, _func = _ => true, { x = 0, y = g_sHeight
|
|
|
1162
1106
|
div.classList.add(`button_common`, ..._classes);
|
|
1163
1107
|
div.innerHTML = _text;
|
|
1164
1108
|
div.title = title;
|
|
1165
|
-
div.ontouchstart = ``;
|
|
1166
1109
|
|
|
1167
1110
|
const style = div.style;
|
|
1168
1111
|
style.textAlign = align;
|
|
@@ -1185,13 +1128,13 @@ const createCss2Button = (_id, _text, _func = _ => true, { x = 0, y = g_sHeight
|
|
|
1185
1128
|
|
|
1186
1129
|
// ボタンを押したときの動作
|
|
1187
1130
|
const lsnrkey = g_handler.addListener(div, `click`, evt => {
|
|
1188
|
-
if (!
|
|
1131
|
+
if (!setBoolVal(g_btnDeleteFlg[_id])) {
|
|
1189
1132
|
_func(evt);
|
|
1190
1133
|
}
|
|
1191
1134
|
if (typeof g_btnAddFunc[_id] === C_TYP_FUNCTION) {
|
|
1192
1135
|
g_btnAddFunc[_id](evt, _func, resetFunc);
|
|
1193
1136
|
}
|
|
1194
|
-
if (!
|
|
1137
|
+
if (!setBoolVal(g_btnDeleteFlg[_id])) {
|
|
1195
1138
|
resetFunc(evt);
|
|
1196
1139
|
}
|
|
1197
1140
|
});
|
|
@@ -1199,7 +1142,7 @@ const createCss2Button = (_id, _text, _func = _ => true, { x = 0, y = g_sHeight
|
|
|
1199
1142
|
// 右クリック時の処理
|
|
1200
1143
|
div.oncontextmenu = evt => {
|
|
1201
1144
|
if (typeof cxtFunc === C_TYP_FUNCTION) {
|
|
1202
|
-
if (!
|
|
1145
|
+
if (!setBoolVal(g_cxtDeleteFlg[_id])) {
|
|
1203
1146
|
cxtFunc(evt);
|
|
1204
1147
|
}
|
|
1205
1148
|
if (typeof g_cxtAddFunc[_id] === C_TYP_FUNCTION) {
|
|
@@ -1279,8 +1222,6 @@ const clearWindow = (_redrawFlg = false, _customDisplayName = ``) => {
|
|
|
1279
1222
|
const layer0 = document.querySelector(`#layer0`);
|
|
1280
1223
|
const l0ctx = layer0.getContext(`2d`);
|
|
1281
1224
|
|
|
1282
|
-
const C_MARGIN = 0;
|
|
1283
|
-
|
|
1284
1225
|
// 線画、図形をクリア
|
|
1285
1226
|
l0ctx.clearRect(0, 0, g_sWidth, g_sHeight);
|
|
1286
1227
|
|
|
@@ -1292,14 +1233,14 @@ const clearWindow = (_redrawFlg = false, _customDisplayName = ``) => {
|
|
|
1292
1233
|
// 線画 (title-line)
|
|
1293
1234
|
l1ctx.beginPath();
|
|
1294
1235
|
l1ctx.strokeStyle = `#cccccc`;
|
|
1295
|
-
l1ctx.moveTo(
|
|
1296
|
-
l1ctx.lineTo(g_sWidth
|
|
1236
|
+
l1ctx.moveTo(0, 0);
|
|
1237
|
+
l1ctx.lineTo(g_sWidth, 0);
|
|
1297
1238
|
l1ctx.stroke();
|
|
1298
1239
|
|
|
1299
1240
|
l1ctx.beginPath();
|
|
1300
1241
|
l1ctx.strokeStyle = `#cccccc`;
|
|
1301
|
-
l1ctx.moveTo(
|
|
1302
|
-
l1ctx.lineTo(g_sWidth
|
|
1242
|
+
l1ctx.moveTo(0, g_sHeight);
|
|
1243
|
+
l1ctx.lineTo(g_sWidth, g_sHeight);
|
|
1303
1244
|
l1ctx.stroke();
|
|
1304
1245
|
}
|
|
1305
1246
|
if (document.querySelector(`#layer2`) !== null) {
|
|
@@ -1356,17 +1297,14 @@ const drawDefaultBackImage = _key => {
|
|
|
1356
1297
|
* @param {object} _obj
|
|
1357
1298
|
*/
|
|
1358
1299
|
const makeSpriteImage = _obj => {
|
|
1359
|
-
let tmpInnerHTML = `<img src=${_obj.path} class="${_obj.class}"
|
|
1360
|
-
|
|
1361
|
-
if (_obj.width !== 0 && _obj.width > 0) {
|
|
1300
|
+
let tmpInnerHTML = `<img src=${_obj.path} class="${_obj.class}" style="position:absolute;left:${_obj.left}px;top:${_obj.top}px`;
|
|
1301
|
+
if (_obj.width > 0) {
|
|
1362
1302
|
tmpInnerHTML += `;width:${_obj.width}px`;
|
|
1363
1303
|
}
|
|
1364
|
-
if (
|
|
1304
|
+
if (setIntVal(_obj.height) > 0) {
|
|
1365
1305
|
tmpInnerHTML += `;height:${_obj.height}px`;
|
|
1366
1306
|
}
|
|
1367
|
-
tmpInnerHTML += `;animation-name:${_obj.animationName}
|
|
1368
|
-
;animation-duration:${_obj.animationDuration}s
|
|
1369
|
-
;opacity:${_obj.opacity}">`;
|
|
1307
|
+
tmpInnerHTML += `;animation-name:${_obj.animationName};animation-duration:${_obj.animationDuration}s;opacity:${_obj.opacity}">`;
|
|
1370
1308
|
return tmpInnerHTML;
|
|
1371
1309
|
};
|
|
1372
1310
|
|
|
@@ -1375,11 +1313,10 @@ const makeSpriteImage = _obj => {
|
|
|
1375
1313
|
* @param {object} _obj
|
|
1376
1314
|
*/
|
|
1377
1315
|
const makeSpriteText = _obj => {
|
|
1378
|
-
let tmpInnerHTML = `<span class="${_obj.class}"
|
|
1379
|
-
style="display:inline-block;position:absolute;left:${_obj.left}px;top:${_obj.top}px`;
|
|
1316
|
+
let tmpInnerHTML = `<span class="${_obj.class}" style="display:inline-block;position:absolute;left:${_obj.left}px;top:${_obj.top}px`;
|
|
1380
1317
|
|
|
1381
1318
|
// この場合のwidthは font-size と解釈する
|
|
1382
|
-
if (_obj.width
|
|
1319
|
+
if (_obj.width > 0) {
|
|
1383
1320
|
tmpInnerHTML += `;font-size:${_obj.width}px`;
|
|
1384
1321
|
}
|
|
1385
1322
|
|
|
@@ -1387,9 +1324,7 @@ const makeSpriteText = _obj => {
|
|
|
1387
1324
|
if (_obj.height !== ``) {
|
|
1388
1325
|
tmpInnerHTML += `;color:${_obj.height}`;
|
|
1389
1326
|
}
|
|
1390
|
-
tmpInnerHTML += `;animation-name:${_obj.animationName}
|
|
1391
|
-
;animation-duration:${_obj.animationDuration}s
|
|
1392
|
-
;opacity:${_obj.opacity}">${_obj.path}</span>`;
|
|
1327
|
+
tmpInnerHTML += `;animation-name:${_obj.animationName};animation-duration:${_obj.animationDuration}s;opacity:${_obj.opacity}">${_obj.path}</span>`;
|
|
1393
1328
|
return tmpInnerHTML;
|
|
1394
1329
|
};
|
|
1395
1330
|
|
|
@@ -1433,7 +1368,7 @@ const makeSpriteData = (_data, _calcFrame = _frame => _frame) => {
|
|
|
1433
1368
|
|
|
1434
1369
|
// 値チェックとエスケープ処理
|
|
1435
1370
|
let tmpFrame;
|
|
1436
|
-
if (
|
|
1371
|
+
if (setIntVal(tmpSpriteData[0], -1) === 0) {
|
|
1437
1372
|
tmpFrame = 0;
|
|
1438
1373
|
} else {
|
|
1439
1374
|
tmpFrame = roundZero(_calcFrame(setVal(tmpSpriteData[0], 200, C_TYP_CALC)));
|
|
@@ -1444,15 +1379,15 @@ const makeSpriteData = (_data, _calcFrame = _frame => _frame) => {
|
|
|
1444
1379
|
}
|
|
1445
1380
|
|
|
1446
1381
|
const tmpObj = {
|
|
1447
|
-
path: escapeHtml(tmpSpriteData[2] ?? ``, g_escapeStr.escapeCode),
|
|
1448
|
-
class: escapeHtml(tmpSpriteData[3] ?? ``),
|
|
1449
|
-
left: setVal(tmpSpriteData[4], 0, C_TYP_CALC),
|
|
1450
|
-
top: setVal(tmpSpriteData[5], 0, C_TYP_CALC),
|
|
1451
|
-
width:
|
|
1452
|
-
height: escapeHtml(tmpSpriteData[7] ?? ``),
|
|
1382
|
+
path: escapeHtml(tmpSpriteData[2] ?? ``, g_escapeStr.escapeCode), // 画像パス or テキスト
|
|
1383
|
+
class: escapeHtml(tmpSpriteData[3] ?? ``), // CSSクラス
|
|
1384
|
+
left: setVal(tmpSpriteData[4], 0, C_TYP_CALC), // X座標
|
|
1385
|
+
top: setVal(tmpSpriteData[5], 0, C_TYP_CALC), // Y座標
|
|
1386
|
+
width: setIntVal(tmpSpriteData[6]), // spanタグの場合は font-size
|
|
1387
|
+
height: escapeHtml(tmpSpriteData[7] ?? ``), // spanタグの場合は color(文字列可)
|
|
1453
1388
|
opacity: setVal(tmpSpriteData[8], 1, C_TYP_FLOAT),
|
|
1454
1389
|
animationName: escapeHtml(setVal(tmpSpriteData[9], C_DIS_NONE, C_TYP_STRING)),
|
|
1455
|
-
animationDuration:
|
|
1390
|
+
animationDuration: setIntVal(tmpSpriteData[10]) / g_fps,
|
|
1456
1391
|
};
|
|
1457
1392
|
if (g_headerObj.autoPreload) {
|
|
1458
1393
|
if (checkImage(tmpObj.path)) {
|
|
@@ -1497,9 +1432,32 @@ const checkImage = _str => listMatching(_str, g_imgExtensions, { prefix: `[.]`,
|
|
|
1497
1432
|
const getSpriteJumpFrame = _frames => {
|
|
1498
1433
|
const jumpFrames = _frames.split(`:`);
|
|
1499
1434
|
const jumpCnt = Math.floor(Math.random() * jumpFrames.length);
|
|
1500
|
-
return
|
|
1435
|
+
return setIntVal(Number(jumpFrames[jumpCnt]) - 1);
|
|
1501
1436
|
};
|
|
1502
1437
|
|
|
1438
|
+
/**
|
|
1439
|
+
* 背景・マスクモーションの表示(共通処理)
|
|
1440
|
+
* @param {object} _spriteData
|
|
1441
|
+
* @param {string} _name
|
|
1442
|
+
* @param {boolean} _condition
|
|
1443
|
+
*/
|
|
1444
|
+
const drawBaseSpriteData = (_spriteData, _name, _condition = true) => {
|
|
1445
|
+
const baseSprite = document.querySelector(`#${_name}Sprite${_spriteData.depth}`);
|
|
1446
|
+
if (_spriteData.command === ``) {
|
|
1447
|
+
if (_spriteData.depth === C_FLG_ALL) {
|
|
1448
|
+
for (let j = 0; j <= g_scoreObj[`${_name}MaxDepth`]; j++) {
|
|
1449
|
+
document.querySelector(`#${_name}Sprite${j}`).textContent = ``;
|
|
1450
|
+
}
|
|
1451
|
+
} else {
|
|
1452
|
+
baseSprite.textContent = ``;
|
|
1453
|
+
}
|
|
1454
|
+
} else {
|
|
1455
|
+
if (_condition) {
|
|
1456
|
+
baseSprite.innerHTML = _spriteData.htmlText;
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1503
1461
|
/**
|
|
1504
1462
|
* 背景・マスクモーションの表示(タイトル・リザルト用)
|
|
1505
1463
|
* @param {number} _frame
|
|
@@ -1513,31 +1471,19 @@ const drawSpriteData = (_frame, _displayName, _depthName) => {
|
|
|
1513
1471
|
|
|
1514
1472
|
for (let j = 0; j < tmpObjs.length; j++) {
|
|
1515
1473
|
const tmpObj = tmpObjs[j];
|
|
1516
|
-
|
|
1517
|
-
if (tmpObj.command
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1474
|
+
drawBaseSpriteData(tmpObj, spriteName, ![`[loop]`, `[jump]`].includes(tmpObj.command));
|
|
1475
|
+
if (tmpObj.command === `[loop]`) {
|
|
1476
|
+
// キーワード指定:ループ
|
|
1477
|
+
// 指定フレーム(class)へ移動する
|
|
1478
|
+
g_scoreObj[`${spriteName}LoopCount`]++;
|
|
1479
|
+
return getSpriteJumpFrame(tmpObj.jumpFrame);
|
|
1480
|
+
|
|
1481
|
+
} else if (tmpObj.command === `[jump]`) {
|
|
1482
|
+
// キーワード指定:フレームジャンプ
|
|
1483
|
+
// 指定回数以上のループ(maxLoop)があれば指定フレーム(jumpFrame)へ移動する
|
|
1484
|
+
if (g_scoreObj[`${spriteName}LoopCount`] >= Number(tmpObj.maxLoop)) {
|
|
1485
|
+
g_scoreObj[`${spriteName}LoopCount`] = 0;
|
|
1522
1486
|
return getSpriteJumpFrame(tmpObj.jumpFrame);
|
|
1523
|
-
|
|
1524
|
-
} else if (tmpObj.command === `[jump]`) {
|
|
1525
|
-
// キーワード指定:フレームジャンプ
|
|
1526
|
-
// 指定回数以上のループ(maxLoop)があれば指定フレーム(jumpFrame)へ移動する
|
|
1527
|
-
if (g_scoreObj[`${spriteName}LoopCount`] >= Number(tmpObj.maxLoop)) {
|
|
1528
|
-
g_scoreObj[`${spriteName}LoopCount`] = 0;
|
|
1529
|
-
return getSpriteJumpFrame(tmpObj.jumpFrame);
|
|
1530
|
-
}
|
|
1531
|
-
} else {
|
|
1532
|
-
baseSprite.innerHTML = tmpObj.htmlText;
|
|
1533
|
-
}
|
|
1534
|
-
} else {
|
|
1535
|
-
if (tmpObj.depth === C_FLG_ALL) {
|
|
1536
|
-
for (let j = 0; j <= g_headerObj[`${spriteName}MaxDepth`]; j++) {
|
|
1537
|
-
document.querySelector(`#${spriteName}Sprite${j}`).textContent = ``;
|
|
1538
|
-
}
|
|
1539
|
-
} else {
|
|
1540
|
-
baseSprite.textContent = ``;
|
|
1541
1487
|
}
|
|
1542
1488
|
}
|
|
1543
1489
|
}
|
|
@@ -1549,25 +1495,8 @@ const drawSpriteData = (_frame, _displayName, _depthName) => {
|
|
|
1549
1495
|
* @param {number} _frame
|
|
1550
1496
|
* @param {string} _depthName
|
|
1551
1497
|
*/
|
|
1552
|
-
const drawMainSpriteData = (_frame, _depthName) =>
|
|
1553
|
-
|
|
1554
|
-
const tmpObjs = g_scoreObj[`${_depthName}Data`][_frame];
|
|
1555
|
-
|
|
1556
|
-
tmpObjs.forEach(tmpObj => {
|
|
1557
|
-
const baseSprite = document.querySelector(`#${_depthName}Sprite${tmpObj.depth}`);
|
|
1558
|
-
if (tmpObj.command !== ``) {
|
|
1559
|
-
baseSprite.innerHTML = tmpObj.htmlText;
|
|
1560
|
-
} else {
|
|
1561
|
-
if (tmpObj.depth === C_FLG_ALL) {
|
|
1562
|
-
for (let j = 0; j <= g_scoreObj[`${_depthName}MaxDepth`]; j++) {
|
|
1563
|
-
document.querySelector(`#${_depthName}Sprite${j}`).textContent = ``;
|
|
1564
|
-
}
|
|
1565
|
-
} else {
|
|
1566
|
-
baseSprite.textContent = ``;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
});
|
|
1570
|
-
};
|
|
1498
|
+
const drawMainSpriteData = (_frame, _depthName) =>
|
|
1499
|
+
g_scoreObj[`${_depthName}Data`][_frame].forEach(tmpObj => drawBaseSpriteData(tmpObj, _depthName));
|
|
1571
1500
|
|
|
1572
1501
|
/**
|
|
1573
1502
|
* タイトル・リザルトモーションの描画
|
|
@@ -1751,12 +1680,8 @@ const transTimerToFrame = _str => {
|
|
|
1751
1680
|
|
|
1752
1681
|
const initialControl = async () => {
|
|
1753
1682
|
|
|
1754
|
-
[g_sWidth, g_sHeight] = [
|
|
1755
|
-
setVal($id(`canvas-frame`).width, 600, C_TYP_FLOAT), setVal($id(`canvas-frame`).height, 500, C_TYP_FLOAT)
|
|
1756
|
-
];
|
|
1757
|
-
|
|
1758
1683
|
const stage = document.querySelector(`#canvas-frame`);
|
|
1759
|
-
const divRoot = createEmptySprite(stage, `divRoot`,
|
|
1684
|
+
const divRoot = createEmptySprite(stage, `divRoot`, g_windowObj.divRoot);
|
|
1760
1685
|
|
|
1761
1686
|
// 背景の表示
|
|
1762
1687
|
if (document.querySelector(`#layer0`) !== null) {
|
|
@@ -1768,7 +1693,7 @@ const initialControl = async () => {
|
|
|
1768
1693
|
l0ctx.fillStyle = grd;
|
|
1769
1694
|
l0ctx.fillRect(0, 0, g_sWidth, g_sHeight);
|
|
1770
1695
|
} else {
|
|
1771
|
-
createEmptySprite(divRoot, `divBack`,
|
|
1696
|
+
createEmptySprite(divRoot, `divBack`, g_windowObj.divBack);
|
|
1772
1697
|
}
|
|
1773
1698
|
|
|
1774
1699
|
// Now Loadingを表示
|
|
@@ -1780,12 +1705,12 @@ const initialControl = async () => {
|
|
|
1780
1705
|
// 譜面データの読み込みオプション
|
|
1781
1706
|
const ampSplitInput = document.querySelector(`#enableAmpersandSplit`);
|
|
1782
1707
|
if (ampSplitInput !== null) {
|
|
1783
|
-
g_enableAmpersandSplit =
|
|
1708
|
+
g_enableAmpersandSplit = setBoolVal(ampSplitInput.value, true);
|
|
1784
1709
|
}
|
|
1785
1710
|
|
|
1786
1711
|
const decodeUriInput = document.querySelector(`#enableDecodeURI`);
|
|
1787
1712
|
if (decodeUriInput !== null) {
|
|
1788
|
-
g_enableDecodeURI =
|
|
1713
|
+
g_enableDecodeURI = setBoolVal(decodeUriInput.value);
|
|
1789
1714
|
}
|
|
1790
1715
|
|
|
1791
1716
|
// 作品別ローカルストレージの読み込み
|
|
@@ -1803,19 +1728,17 @@ const initialControl = async () => {
|
|
|
1803
1728
|
// 共通設定ファイルの読込
|
|
1804
1729
|
await loadScript2(`${settingRoot}danoni_setting${settingType}.js?${g_randTime}`, false);
|
|
1805
1730
|
loadLegacySettingFunc();
|
|
1806
|
-
|
|
1807
|
-
divRoot.removeChild(document.querySelector(`#lblLoading`));
|
|
1808
|
-
}
|
|
1731
|
+
deleteDiv(divRoot, `lblLoading`);
|
|
1809
1732
|
|
|
1810
1733
|
// クエリで譜面番号が指定されていればセット
|
|
1811
|
-
g_stateObj.scoreId =
|
|
1734
|
+
g_stateObj.scoreId = setIntVal(getQueryParamVal(`scoreId`));
|
|
1812
1735
|
|
|
1813
1736
|
// 譜面ヘッダーの読込
|
|
1814
1737
|
Object.assign(g_headerObj, preheaderConvert(g_rootObj));
|
|
1815
1738
|
|
|
1816
1739
|
// CSSファイル内のbackgroundを取得するために再描画
|
|
1817
1740
|
if (document.querySelector(`#layer0`) === null) {
|
|
1818
|
-
divRoot
|
|
1741
|
+
deleteDiv(divRoot, `divBack`);
|
|
1819
1742
|
createEmptySprite(divRoot, `divBack`);
|
|
1820
1743
|
} else if (!g_headerObj.defaultSkinFlg && !g_headerObj.customBackUse) {
|
|
1821
1744
|
createEmptySprite(divRoot, `divBack`);
|
|
@@ -1867,16 +1790,16 @@ const initialControl = async () => {
|
|
|
1867
1790
|
|
|
1868
1791
|
if (termRoopCnts.length === 1) {
|
|
1869
1792
|
// Pattern Bの場合
|
|
1870
|
-
lastCnt =
|
|
1793
|
+
lastCnt = setIntVal(tmpPreloadImages[1], 1);
|
|
1871
1794
|
paddingLen = String(setVal(tmpPreloadImages[1], 1, C_TYP_STRING)).length;
|
|
1872
1795
|
} else {
|
|
1873
1796
|
// Pattern C, Dの場合
|
|
1874
|
-
startCnt =
|
|
1875
|
-
lastCnt =
|
|
1797
|
+
startCnt = setIntVal(termRoopCnts[0], 1);
|
|
1798
|
+
lastCnt = setIntVal(termRoopCnts[1], 1);
|
|
1876
1799
|
paddingLen = String(setVal(termRoopCnts[1], 1, C_TYP_STRING)).length;
|
|
1877
1800
|
}
|
|
1878
1801
|
for (let k = startCnt; k <= lastCnt; k++) {
|
|
1879
|
-
preloadFile(`image`, tmpPreloadImages[0].
|
|
1802
|
+
preloadFile(`image`, tmpPreloadImages[0].replaceAll(`*`, String(k).padStart(paddingLen, `0`)));
|
|
1880
1803
|
}
|
|
1881
1804
|
}
|
|
1882
1805
|
});
|
|
@@ -1897,8 +1820,8 @@ const initialControl = async () => {
|
|
|
1897
1820
|
if (g_loadObj.main) {
|
|
1898
1821
|
|
|
1899
1822
|
// 譜面分割、譜面番号固定かどうかをチェック
|
|
1900
|
-
g_stateObj.dosDivideFlg =
|
|
1901
|
-
g_stateObj.scoreLockFlg =
|
|
1823
|
+
g_stateObj.dosDivideFlg = setBoolVal(document.querySelector(`#externalDosDivide`)?.value ?? getQueryParamVal(`dosDivide`));
|
|
1824
|
+
g_stateObj.scoreLockFlg = setBoolVal(document.querySelector(`#externalDosLock`)?.value ?? getQueryParamVal(`dosLock`));
|
|
1902
1825
|
|
|
1903
1826
|
for (let j = 1; j < g_headerObj.keyLabels.length; j++) {
|
|
1904
1827
|
|
|
@@ -2034,9 +1957,7 @@ const loadChartFile = async (_scoreId = g_stateObj.scoreId) => {
|
|
|
2034
1957
|
|
|
2035
1958
|
await loadScript2(`${filename}?${Date.now()}`, false, charset);
|
|
2036
1959
|
if (typeof externalDosInit === C_TYP_FUNCTION) {
|
|
2037
|
-
|
|
2038
|
-
divRoot.removeChild(document.querySelector(`#lblLoading`));
|
|
2039
|
-
}
|
|
1960
|
+
deleteDiv(divRoot, `lblLoading`);
|
|
2040
1961
|
|
|
2041
1962
|
// 外部データを読込(ファイルが見つからなかった場合は譜面追記をスキップ)
|
|
2042
1963
|
externalDosInit();
|
|
@@ -2404,11 +2325,11 @@ const preheaderConvert = _dosObj => {
|
|
|
2404
2325
|
g_titleLists.init.forEach(objName => {
|
|
2405
2326
|
const objUpper = toCapitalize(objName);
|
|
2406
2327
|
obj[`custom${objUpper}Use`] =
|
|
2407
|
-
|
|
2328
|
+
setBoolVal(_dosObj[`custom${objUpper}Use`] ?? g_presetObj.customDesignUse?.[objName]);
|
|
2408
2329
|
});
|
|
2409
2330
|
|
|
2410
2331
|
// 背景・マスクモーションのパス指定方法を他の設定に合わせる設定
|
|
2411
|
-
obj.syncBackPath =
|
|
2332
|
+
obj.syncBackPath = setBoolVal(_dosObj.syncBackPath ?? g_presetObj.syncBackPath);
|
|
2412
2333
|
|
|
2413
2334
|
return obj;
|
|
2414
2335
|
};
|
|
@@ -2441,7 +2362,7 @@ const headerConvert = _dosObj => {
|
|
|
2441
2362
|
obj.imgType[j] = {
|
|
2442
2363
|
name: imgTypes[0],
|
|
2443
2364
|
extension: imgTypes[1] || `svg`,
|
|
2444
|
-
rotateEnabled:
|
|
2365
|
+
rotateEnabled: setBoolVal(imgTypes[2], true),
|
|
2445
2366
|
flatStepHeight: setVal(imgTypes[3], C_ARW_WIDTH, C_TYP_FLOAT),
|
|
2446
2367
|
};
|
|
2447
2368
|
g_keycons.imgTypes[j] = (imgTypes[0] === `` ? `Original` : imgTypes[0]);
|
|
@@ -2521,13 +2442,13 @@ const headerConvert = _dosObj => {
|
|
|
2521
2442
|
g_settings.speeds = [...Array((obj.maxSpeed - obj.minSpeed) * 20 + 1).keys()].map(i => obj.minSpeed + i / 20);
|
|
2522
2443
|
|
|
2523
2444
|
// プレイ中のショートカットキー
|
|
2524
|
-
obj.keyRetry =
|
|
2445
|
+
obj.keyRetry = setIntVal(_dosObj.keyRetry, C_KEY_RETRY);
|
|
2525
2446
|
obj.keyRetryDef = obj.keyRetry;
|
|
2526
|
-
obj.keyTitleBack =
|
|
2447
|
+
obj.keyTitleBack = setIntVal(_dosObj.keyTitleBack, C_KEY_TITLEBACK);
|
|
2527
2448
|
obj.keyTitleBackDef = obj.keyTitleBack;
|
|
2528
2449
|
|
|
2529
2450
|
// フリーズアローの許容フレーム数設定
|
|
2530
|
-
obj.frzAttempt =
|
|
2451
|
+
obj.frzAttempt = setIntVal(_dosObj.frzAttempt, C_FRM_FRZATTEMPT);
|
|
2531
2452
|
|
|
2532
2453
|
// 製作者表示
|
|
2533
2454
|
if (hasVal(_dosObj.tuning)) {
|
|
@@ -2600,7 +2521,7 @@ const headerConvert = _dosObj => {
|
|
|
2600
2521
|
obj.undefinedKeyLists = obj.keyLists.filter(key => g_keyObj[`chara${key}_0`] === undefined);
|
|
2601
2522
|
|
|
2602
2523
|
// 譜面変更セレクターの利用有無
|
|
2603
|
-
obj.difSelectorUse = (
|
|
2524
|
+
obj.difSelectorUse = (setBoolVal(_dosObj.difSelectorUse, obj.keyLabels.length > 5));
|
|
2604
2525
|
|
|
2605
2526
|
// 初期速度の設定
|
|
2606
2527
|
g_stateObj.speed = obj.initSpeeds[g_stateObj.scoreId];
|
|
@@ -2608,20 +2529,20 @@ const headerConvert = _dosObj => {
|
|
|
2608
2529
|
|
|
2609
2530
|
// グラデーションのデフォルト中間色を設定
|
|
2610
2531
|
divRoot.appendChild(createDivCss2Label(`dummyLabel`, ``, { pointerEvents: C_DIS_NONE }));
|
|
2611
|
-
obj.baseBrightFlg =
|
|
2532
|
+
obj.baseBrightFlg = setBoolVal(_dosObj.baseBright, checkLightOrDark(colorNameToCode(window.getComputedStyle(dummyLabel, ``).color)));
|
|
2612
2533
|
const intermediateColor = obj.baseBrightFlg ? `#111111` : `#eeeeee`;
|
|
2613
2534
|
|
|
2614
2535
|
// 矢印の色変化を常時グラデーションさせる設定
|
|
2615
2536
|
obj.defaultColorgrd = [false, intermediateColor];
|
|
2616
2537
|
if (hasVal(_dosObj.defaultColorgrd)) {
|
|
2617
2538
|
obj.defaultColorgrd = _dosObj.defaultColorgrd.split(`,`);
|
|
2618
|
-
obj.defaultColorgrd[0] =
|
|
2539
|
+
obj.defaultColorgrd[0] = setBoolVal(obj.defaultColorgrd[0]);
|
|
2619
2540
|
obj.defaultColorgrd[1] = obj.defaultColorgrd[1] ?? intermediateColor;
|
|
2620
2541
|
}
|
|
2621
2542
|
g_rankObj.rankColorAllPerfect = intermediateColor;
|
|
2622
2543
|
|
|
2623
2544
|
// カラーコードのゼロパディング有無設定
|
|
2624
|
-
obj.colorCdPaddingUse =
|
|
2545
|
+
obj.colorCdPaddingUse = setBoolVal(_dosObj.colorCdPaddingUse);
|
|
2625
2546
|
|
|
2626
2547
|
// 最大ライフ
|
|
2627
2548
|
obj.maxLifeVal = setVal(_dosObj.maxLifeVal, C_VAL_MAXLIFE, C_TYP_FLOAT);
|
|
@@ -2637,7 +2558,7 @@ const headerConvert = _dosObj => {
|
|
|
2637
2558
|
});
|
|
2638
2559
|
|
|
2639
2560
|
// フリーズアローのデフォルト色セットの利用有無 (true: 使用, false: 矢印色を優先してセット)
|
|
2640
|
-
obj.defaultFrzColorUse =
|
|
2561
|
+
obj.defaultFrzColorUse = setBoolVal(_dosObj.defaultFrzColorUse ?? g_presetObj.frzColors, true);
|
|
2641
2562
|
|
|
2642
2563
|
// 矢印色変化に対応してフリーズアロー色を追随する範囲の設定
|
|
2643
2564
|
// (defaultFrzColorUse=false時のみ)
|
|
@@ -2738,7 +2659,7 @@ const headerConvert = _dosObj => {
|
|
|
2738
2659
|
g_posObj.distY = g_sHeight - C_STEP_Y + g_posObj.stepYR;
|
|
2739
2660
|
g_posObj.reverseStepY = g_posObj.distY - g_posObj.stepY - g_posObj.stepDiffY - C_ARW_WIDTH;
|
|
2740
2661
|
g_posObj.arrowHeight = g_sHeight + g_posObj.stepYR - g_posObj.stepDiffY * 2;
|
|
2741
|
-
obj.bottomWordSetFlg =
|
|
2662
|
+
obj.bottomWordSetFlg = setBoolVal(_dosObj.bottomWordSet);
|
|
2742
2663
|
|
|
2743
2664
|
// 矢印・フリーズアロー判定位置補正
|
|
2744
2665
|
g_diffObj.arrowJdgY = (isNaN(parseFloat(_dosObj.arrowJdgY)) ? 0 : parseFloat(_dosObj.arrowJdgY));
|
|
@@ -2760,7 +2681,7 @@ const headerConvert = _dosObj => {
|
|
|
2760
2681
|
}
|
|
2761
2682
|
|
|
2762
2683
|
// 自動プリロードの設定
|
|
2763
|
-
obj.autoPreload =
|
|
2684
|
+
obj.autoPreload = setBoolVal(_dosObj.autoPreload, true);
|
|
2764
2685
|
g_headerObj.autoPreload = obj.autoPreload;
|
|
2765
2686
|
|
|
2766
2687
|
// 読込対象の画像を指定(rel:preload)と同じ
|
|
@@ -2777,11 +2698,11 @@ const headerConvert = _dosObj => {
|
|
|
2777
2698
|
|
|
2778
2699
|
// デフォルトReady/リザルト表示の遅延時間設定
|
|
2779
2700
|
[`ready`, `result`].forEach(objName => {
|
|
2780
|
-
obj[`${objName}DelayFrame`] =
|
|
2701
|
+
obj[`${objName}DelayFrame`] = setIntVal(_dosObj[`${objName}DelayFrame`]);
|
|
2781
2702
|
});
|
|
2782
2703
|
|
|
2783
2704
|
// デフォルトReady表示のアニメーション時間設定
|
|
2784
|
-
obj.readyAnimationFrame =
|
|
2705
|
+
obj.readyAnimationFrame = setIntVal(_dosObj.readyAnimationFrame, 150);
|
|
2785
2706
|
|
|
2786
2707
|
// デフォルトReady表示のアニメーション名
|
|
2787
2708
|
obj.readyAnimationName = _dosObj.readyAnimationName ?? `leftToRightFade`;
|
|
@@ -2800,7 +2721,7 @@ const headerConvert = _dosObj => {
|
|
|
2800
2721
|
obj.titlefonts = g_titleLists.defaultFonts.concat();
|
|
2801
2722
|
if (hasVal(_dosObj.titlefont)) {
|
|
2802
2723
|
_dosObj.titlefont.split(`$`).forEach((font, j) => {
|
|
2803
|
-
obj.titlefonts[j] = `'${(font.
|
|
2724
|
+
obj.titlefonts[j] = `'${(font.replaceAll(`,`, `', '`))}'`;
|
|
2804
2725
|
});
|
|
2805
2726
|
if (obj.titlefonts[1] === undefined) {
|
|
2806
2727
|
obj.titlefonts[1] = obj.titlefonts[0];
|
|
@@ -2811,7 +2732,7 @@ const headerConvert = _dosObj => {
|
|
|
2811
2732
|
g_titleLists.grdList.forEach(_name => {
|
|
2812
2733
|
obj[`${_name}s`] = [];
|
|
2813
2734
|
if (hasVal(_dosObj[_name])) {
|
|
2814
|
-
const tmpTitlegrd = _dosObj[_name].
|
|
2735
|
+
const tmpTitlegrd = _dosObj[_name].replaceAll(`,`, `:`);
|
|
2815
2736
|
obj[`${_name}s`] = tmpTitlegrd.split(`$`);
|
|
2816
2737
|
obj[`${_name}`] = obj[`${_name}s`][0] ?? ``;
|
|
2817
2738
|
}
|
|
@@ -2855,13 +2776,13 @@ const headerConvert = _dosObj => {
|
|
|
2855
2776
|
}
|
|
2856
2777
|
|
|
2857
2778
|
// デフォルト曲名表示の複数行時の縦間隔
|
|
2858
|
-
obj.titlelineheight =
|
|
2779
|
+
obj.titlelineheight = setIntVal(_dosObj.titlelineheight, ``);
|
|
2859
2780
|
|
|
2860
2781
|
// フリーズアローの始点で通常矢印の判定を行うか(dotさんソース方式)
|
|
2861
|
-
obj.frzStartjdgUse =
|
|
2782
|
+
obj.frzStartjdgUse = setBoolVal(_dosObj.frzStartjdgUse ?? g_presetObj.frzStartjdgUse);
|
|
2862
2783
|
|
|
2863
2784
|
// 譜面名に制作者名を付加するかどうかのフラグ
|
|
2864
|
-
obj.makerView =
|
|
2785
|
+
obj.makerView = setBoolVal(_dosObj.makerView);
|
|
2865
2786
|
|
|
2866
2787
|
// shuffleUse=group 時のみshuffle用配列を組み替える
|
|
2867
2788
|
if (_dosObj.shuffleUse === `group`) {
|
|
@@ -2871,7 +2792,7 @@ const headerConvert = _dosObj => {
|
|
|
2871
2792
|
|
|
2872
2793
|
// オプション利用可否設定
|
|
2873
2794
|
g_canDisabledSettings.forEach(option => {
|
|
2874
|
-
obj[`${option}Use`] =
|
|
2795
|
+
obj[`${option}Use`] = setBoolVal(_dosObj[`${option}Use`] ?? g_presetObj.settingUse?.[option], true);
|
|
2875
2796
|
});
|
|
2876
2797
|
|
|
2877
2798
|
let interlockingErrorFlg = false;
|
|
@@ -2882,7 +2803,7 @@ const headerConvert = _dosObj => {
|
|
|
2882
2803
|
const displayUse = (displayTempUse !== undefined ? displayTempUse.split(`,`) : [true, C_FLG_ON]);
|
|
2883
2804
|
|
|
2884
2805
|
// displayUse -> ボタンの有効/無効, displaySet -> ボタンの初期値(ON/OFF)
|
|
2885
|
-
obj[`${option}Use`] =
|
|
2806
|
+
obj[`${option}Use`] = setBoolVal(displayUse[0], true);
|
|
2886
2807
|
obj[`${option}Set`] = setVal(displayUse.length > 1 ? displayUse[1] :
|
|
2887
2808
|
(obj[`${option}Use`] ? C_FLG_ON : C_FLG_OFF), ``, C_TYP_SWITCH);
|
|
2888
2809
|
g_stateObj[`d_${option.toLowerCase()}`] = setVal(obj[`${option}Set`], C_FLG_ON, C_TYP_SWITCH);
|
|
@@ -2925,7 +2846,7 @@ const headerConvert = _dosObj => {
|
|
|
2925
2846
|
}
|
|
2926
2847
|
|
|
2927
2848
|
// 別キーパターンの使用有無
|
|
2928
|
-
obj.transKeyUse =
|
|
2849
|
+
obj.transKeyUse = setBoolVal(_dosObj.transKeyUse, true);
|
|
2929
2850
|
|
|
2930
2851
|
// タイトル画面用・背景/マスクデータの分解 (下記すべてで1セット、改行区切り)
|
|
2931
2852
|
// [フレーム数,階層,背景パス,class(CSSで別定義),X,Y,width,height,opacity,animationName,animationDuration]
|
|
@@ -2942,25 +2863,25 @@ const headerConvert = _dosObj => {
|
|
|
2942
2863
|
});
|
|
2943
2864
|
|
|
2944
2865
|
// 結果画面用のマスク透過設定
|
|
2945
|
-
obj.masktitleButton =
|
|
2866
|
+
obj.masktitleButton = setBoolVal(_dosObj.masktitleButton);
|
|
2946
2867
|
|
|
2947
2868
|
// 結果画面用のマスク透過設定
|
|
2948
|
-
obj.maskresultButton =
|
|
2869
|
+
obj.maskresultButton = setBoolVal(_dosObj.maskresultButton);
|
|
2949
2870
|
|
|
2950
2871
|
// color_dataの過去バージョン互換設定
|
|
2951
2872
|
obj.colorDataType = _dosObj.colorDataType ?? ``;
|
|
2952
2873
|
|
|
2953
2874
|
// リザルトモーションをDisplay:BackgroundのON/OFFと連動させるかどうかの設定
|
|
2954
|
-
obj.resultMotionSet =
|
|
2875
|
+
obj.resultMotionSet = setBoolVal(_dosObj.resultMotionSet, true);
|
|
2955
2876
|
|
|
2956
2877
|
// 譜面明細の使用可否
|
|
2957
|
-
obj.scoreDetailUse =
|
|
2878
|
+
obj.scoreDetailUse = setBoolVal(_dosObj.scoreDetailUse, true);
|
|
2958
2879
|
|
|
2959
2880
|
// 判定位置をBackgroundのON/OFFと連動してリセットする設定
|
|
2960
|
-
obj.jdgPosReset =
|
|
2881
|
+
obj.jdgPosReset = setBoolVal(_dosObj.jdgPosReset, true);
|
|
2961
2882
|
|
|
2962
2883
|
// タイトル表示用コメント
|
|
2963
|
-
const newlineTag =
|
|
2884
|
+
const newlineTag = setBoolVal(_dosObj.commentAutoBr, true) ? `<br>` : ``;
|
|
2964
2885
|
const tmpComment = (_dosObj[`commentVal${g_localeObj.val}`] ?? _dosObj.commentVal ?? ``).split(`\r\n`).join(`\n`);
|
|
2965
2886
|
obj.commentVal = tmpComment.split(`\n`).join(newlineTag);
|
|
2966
2887
|
|
|
@@ -2972,16 +2893,16 @@ const headerConvert = _dosObj => {
|
|
|
2972
2893
|
}
|
|
2973
2894
|
|
|
2974
2895
|
// コメントの外部化設定
|
|
2975
|
-
obj.commentExternal =
|
|
2896
|
+
obj.commentExternal = setBoolVal(_dosObj.commentExternal);
|
|
2976
2897
|
|
|
2977
2898
|
// Reverse時の歌詞の自動反転制御
|
|
2978
2899
|
obj.wordAutoReverse = _dosObj.wordAutoReverse ?? g_presetObj.wordAutoReverse ?? `auto`;
|
|
2979
2900
|
|
|
2980
2901
|
// プレイサイズ(X方向)
|
|
2981
|
-
obj.playingWidth =
|
|
2902
|
+
obj.playingWidth = setIntVal(_dosObj.playingWidth, g_sWidth);
|
|
2982
2903
|
|
|
2983
2904
|
// プレイ左上位置(X座標)
|
|
2984
|
-
obj.playingX =
|
|
2905
|
+
obj.playingX = setIntVal(_dosObj.playingX);
|
|
2985
2906
|
|
|
2986
2907
|
// プレイ中クレジットを表示しないエリアのサイズ(X方向)
|
|
2987
2908
|
obj.customViewWidth = setVal(_dosObj.customViewWidth, 0, C_TYP_FLOAT);
|
|
@@ -3017,16 +2938,14 @@ const headerConvert = _dosObj => {
|
|
|
3017
2938
|
* 曲名(1行)の取得
|
|
3018
2939
|
* @param {string} _musicName
|
|
3019
2940
|
*/
|
|
3020
|
-
const getMusicNameSimple = _musicName =>
|
|
3021
|
-
return _musicName.split(`<br>`).join(` `).split(`<nbr>`).join(``).split(`<dbr>`).join(` `);
|
|
3022
|
-
};
|
|
2941
|
+
const getMusicNameSimple = _musicName => replaceStr(_musicName, g_escapeStr.musicNameSimple);
|
|
3023
2942
|
|
|
3024
2943
|
/**
|
|
3025
2944
|
* 曲名(複数行)の取得
|
|
3026
2945
|
* @param {string} _musicName
|
|
3027
2946
|
*/
|
|
3028
2947
|
const getMusicNameMultiLine = _musicName => {
|
|
3029
|
-
const tmpName = _musicName.
|
|
2948
|
+
const tmpName = replaceStr(_musicName, g_escapeStr.musicNameMultiLine).split(`<br>`);
|
|
3030
2949
|
return tmpName.length === 1 ? [tmpName[0], ``] : tmpName;
|
|
3031
2950
|
};
|
|
3032
2951
|
|
|
@@ -3166,7 +3085,7 @@ const setColorList = (_data, _colorInit, _colorInitLength,
|
|
|
3166
3085
|
colorList = colorStr.concat();
|
|
3167
3086
|
|
|
3168
3087
|
for (let j = 0; j < colorList.length; j++) {
|
|
3169
|
-
const tmpSetColorOrg = colorStr[j].
|
|
3088
|
+
const tmpSetColorOrg = colorStr[j].replaceAll(`0x`, `#`).split(`:`);
|
|
3170
3089
|
const hasColor = tmpSetColorOrg.some(tmpColorOrg => {
|
|
3171
3090
|
if (hasVal(tmpColorOrg) && (isColorCd(tmpColorOrg) || !hasAnglePointInfo(tmpColorOrg) || tmpColorOrg === `Default`)) {
|
|
3172
3091
|
colorOrg[j] = colorCdPadding(_colorCdPaddingUse, colorToHex(tmpColorOrg));
|
|
@@ -3474,13 +3393,13 @@ const keysConvert = (_dosObj, { keyExtraList = _dosObj.keyExtraList.split(`,`) }
|
|
|
3474
3393
|
for (let k = 0; k < tmpDivs.length; k++) {
|
|
3475
3394
|
tmpDivPtn = tmpDivs[k].split(`,`);
|
|
3476
3395
|
|
|
3477
|
-
if (
|
|
3478
|
-
g_keyObj[`div${newKey}_${k}`] =
|
|
3396
|
+
if (setIntVal(tmpDivPtn[0], -1) !== -1) {
|
|
3397
|
+
g_keyObj[`div${newKey}_${k}`] = setIntVal(tmpDivPtn[0], g_keyObj[`chara${newKey}_0`].length);
|
|
3479
3398
|
} else if (g_keyObj[`div${tmpDivPtn[0]}`] !== undefined) {
|
|
3480
3399
|
// 既定キーパターンが指定された場合、存在すればその値を適用
|
|
3481
3400
|
g_keyObj[`div${newKey}_${k}`] = g_keyObj[`div${tmpDivPtn[0]}`];
|
|
3482
|
-
g_keyObj[`divMax${newKey}_${k}`] =
|
|
3483
|
-
} else if (
|
|
3401
|
+
g_keyObj[`divMax${newKey}_${k}`] = setIntVal(g_keyObj[`divMax${tmpDivPtn[0]}`], undefined);
|
|
3402
|
+
} else if (setIntVal(g_keyObj[`div${newKey}_${k}`], -1) !== -1) {
|
|
3484
3403
|
// すでに定義済みの場合はスキップ
|
|
3485
3404
|
continue;
|
|
3486
3405
|
} else if (g_keyObj[`chara${newKey}_0`] !== undefined) {
|
|
@@ -3630,8 +3549,8 @@ const titleInit = _ => {
|
|
|
3630
3549
|
|
|
3631
3550
|
// 変数 titlesize の定義 (使用例: |titlesize=40$20|)
|
|
3632
3551
|
const titlefontsizes = (g_headerObj.titlesize !== `` ? g_headerObj.titlesize.split(`$`).join(`,`).split(`,`) : [titlefontsize, titlefontsize]);
|
|
3633
|
-
const titlefontsize1 =
|
|
3634
|
-
const titlefontsize2 =
|
|
3552
|
+
const titlefontsize1 = setIntVal(titlefontsizes[0], titlefontsize);
|
|
3553
|
+
const titlefontsize2 = setIntVal(titlefontsizes[1], titlefontsize1);
|
|
3635
3554
|
|
|
3636
3555
|
// 変数 titlelineheight の定義 (使用例: |titlelineheight=50|)
|
|
3637
3556
|
const titlelineheight = (g_headerObj.titlelineheight !== `` ? g_headerObj.titlelineheight - (titlefontsize2 + 10) : 0);
|
|
@@ -3651,7 +3570,7 @@ const titleInit = _ => {
|
|
|
3651
3570
|
background: ${titlegrds[0]};
|
|
3652
3571
|
background-clip: text;
|
|
3653
3572
|
-webkit-background-clip: text;
|
|
3654
|
-
|
|
3573
|
+
color: rgba(255,255,255,0.0);
|
|
3655
3574
|
${txtAnimations[0]}
|
|
3656
3575
|
" class="${g_headerObj.titleAnimationClass[0]}">
|
|
3657
3576
|
${g_headerObj.musicTitleForView[0]}
|
|
@@ -3664,7 +3583,7 @@ const titleInit = _ => {
|
|
|
3664
3583
|
background: ${titlegrds[1]};
|
|
3665
3584
|
background-clip: text;
|
|
3666
3585
|
-webkit-background-clip: text;
|
|
3667
|
-
|
|
3586
|
+
color: rgba(255,255,255,0.0);
|
|
3668
3587
|
${txtAnimations[1]}
|
|
3669
3588
|
" class="${g_headerObj.titleAnimationClass[1]}">
|
|
3670
3589
|
${g_headerObj.musicTitleForView[1] ?? ``}
|
|
@@ -3903,9 +3822,7 @@ const makeInfoWindow = (_text, _animationName = ``, _backColor = `#ccccff`) => {
|
|
|
3903
3822
|
*/
|
|
3904
3823
|
const setWindowStyle = (_text, _bkColor, _textColor, _align = C_ALIGN_LEFT) => {
|
|
3905
3824
|
|
|
3906
|
-
|
|
3907
|
-
divRoot.removeChild(lblWarning);
|
|
3908
|
-
}
|
|
3825
|
+
deleteDiv(divRoot, `lblWarning`);
|
|
3909
3826
|
|
|
3910
3827
|
// ウィンドウ枠の行を取得するために一時的な枠を作成
|
|
3911
3828
|
const tmplbl = createDivCss2Label(`lblTmpWarning`, _text, {
|
|
@@ -4040,9 +3957,7 @@ const setSpriteList = _settingList => {
|
|
|
4040
3957
|
* @param {string} _sprite
|
|
4041
3958
|
* @returns
|
|
4042
3959
|
*/
|
|
4043
|
-
const createOptionSprite = _sprite => createEmptySprite(_sprite, `optionsprite`,
|
|
4044
|
-
x: (g_sWidth - 450) / 2, y: 65 + (g_sHeight - 500) / 2, w: 450, h: 325,
|
|
4045
|
-
});
|
|
3960
|
+
const createOptionSprite = _sprite => createEmptySprite(_sprite, `optionsprite`, g_windowObj.optionSprite);
|
|
4046
3961
|
|
|
4047
3962
|
/**
|
|
4048
3963
|
* スライダー共通処理
|
|
@@ -4164,10 +4079,8 @@ const createOptionWindow = _sprite => {
|
|
|
4164
4079
|
const createDifWindow = (_key = ``) => {
|
|
4165
4080
|
g_currentPage = `difSelector`;
|
|
4166
4081
|
setShortcutEvent(g_currentPage);
|
|
4167
|
-
const difList = createEmptySprite(optionsprite, `difList`,
|
|
4168
|
-
const difCover = createEmptySprite(optionsprite, `difCover`,
|
|
4169
|
-
x: 25, y: 65, w: 140, h: 255, overflow: `auto`, opacity: 0.95
|
|
4170
|
-
}, g_cssObj.settings_DifSelector);
|
|
4082
|
+
const difList = createEmptySprite(optionsprite, `difList`, g_windowObj.difList, g_cssObj.settings_DifSelector);
|
|
4083
|
+
const difCover = createEmptySprite(optionsprite, `difCover`, g_windowObj.difCover, g_cssObj.settings_DifSelector);
|
|
4171
4084
|
|
|
4172
4085
|
// リスト再作成
|
|
4173
4086
|
makeDifList(difList, _key);
|
|
@@ -4253,7 +4166,7 @@ const createOptionWindow = _sprite => {
|
|
|
4253
4166
|
* @param {boolean} _graphUseFlg
|
|
4254
4167
|
*/
|
|
4255
4168
|
const createScoreDetail = (_name, _graphUseFlg = true) => {
|
|
4256
|
-
const detailObj = createEmptySprite(scoreDetail, `detail${_name}`,
|
|
4169
|
+
const detailObj = createEmptySprite(scoreDetail, `detail${_name}`, g_windowObj.detailObj);
|
|
4257
4170
|
|
|
4258
4171
|
if (_graphUseFlg) {
|
|
4259
4172
|
const graphObj = document.createElement(`canvas`);
|
|
@@ -4283,10 +4196,7 @@ const createOptionWindow = _sprite => {
|
|
|
4283
4196
|
}, g_cssObj.button_Mini)
|
|
4284
4197
|
);
|
|
4285
4198
|
g_stateObj.scoreDetailViewFlg = false;
|
|
4286
|
-
|
|
4287
|
-
const scoreDetail = createEmptySprite(optionsprite, `scoreDetail`, {
|
|
4288
|
-
x: 20, y: 90, w: 420, h: 230, visibility: `hidden`,
|
|
4289
|
-
}, g_cssObj.settings_DifSelector);
|
|
4199
|
+
const scoreDetail = createEmptySprite(optionsprite, `scoreDetail`, g_windowObj.scoreDetail, g_cssObj.settings_DifSelector);
|
|
4290
4200
|
const viewScText = _ => createScText(lnkScoreDetail, `ScoreDetail`, { targetLabel: `lnkScoreDetail`, x: -10 });
|
|
4291
4201
|
|
|
4292
4202
|
/**
|
|
@@ -4910,7 +4820,7 @@ const createOptionWindow = _sprite => {
|
|
|
4910
4820
|
const isNotSameKey = (g_keyObj.prevKey !== g_keyObj.currentKey);
|
|
4911
4821
|
|
|
4912
4822
|
if (g_headerObj.dummyScoreNos !== undefined) {
|
|
4913
|
-
g_stateObj.dummyId =
|
|
4823
|
+
g_stateObj.dummyId = setIntVal(g_headerObj.dummyScoreNos[g_stateObj.scoreId], ``);
|
|
4914
4824
|
}
|
|
4915
4825
|
// 特殊キーフラグ
|
|
4916
4826
|
g_stateObj.extraKeyFlg = g_headerObj.keyExtraList.includes(g_keyObj.currentKey);
|
|
@@ -4967,10 +4877,10 @@ const createOptionWindow = _sprite => {
|
|
|
4967
4877
|
g_keyObj[`shuffle${keyCtrlPtn}`] = g_keyObj[`shuffle${keyCtrlPtn}_${g_keycons.shuffleGroupNum}`].concat();
|
|
4968
4878
|
}
|
|
4969
4879
|
if (g_headerObj.keyRetryDef === C_KEY_RETRY) {
|
|
4970
|
-
g_headerObj.keyRetry =
|
|
4880
|
+
g_headerObj.keyRetry = setIntVal(g_keyObj[`keyRetry${keyCtrlPtn}`], g_headerObj.keyRetryDef);
|
|
4971
4881
|
}
|
|
4972
4882
|
if (g_headerObj.keyTitleBackDef === C_KEY_TITLEBACK) {
|
|
4973
|
-
g_headerObj.keyTitleBack =
|
|
4883
|
+
g_headerObj.keyTitleBack = setIntVal(g_keyObj[`keyTitleBack${keyCtrlPtn}`], g_headerObj.keyTitleBackDef);
|
|
4974
4884
|
}
|
|
4975
4885
|
}
|
|
4976
4886
|
|
|
@@ -5423,9 +5333,7 @@ const createSettingsDisplayWindow = _sprite => {
|
|
|
5423
5333
|
];
|
|
5424
5334
|
|
|
5425
5335
|
// 設定毎に個別のスプライトを作成し、その中にラベル・ボタン類を配置
|
|
5426
|
-
const displaySprite = createEmptySprite(optionsprite, `displaySprite`,
|
|
5427
|
-
x: 25, y: 30, w: (g_sWidth - 450) / 2, h: C_LEN_SETLBL_HEIGHT * 5,
|
|
5428
|
-
});
|
|
5336
|
+
const displaySprite = createEmptySprite(optionsprite, `displaySprite`, g_windowObj.displaySprite);
|
|
5429
5337
|
const spriteList = setSpriteList(settingList);
|
|
5430
5338
|
|
|
5431
5339
|
_sprite.appendChild(
|
|
@@ -5565,7 +5473,7 @@ const keyConfigInit = (_kcType = g_kcType) => {
|
|
|
5565
5473
|
);
|
|
5566
5474
|
|
|
5567
5475
|
// キーの一覧を表示
|
|
5568
|
-
const keyconSprite = createEmptySprite(divRoot, `keyconSprite`,
|
|
5476
|
+
const keyconSprite = createEmptySprite(divRoot, `keyconSprite`, g_windowObj.keyconSprite);
|
|
5569
5477
|
const tkObj = getKeyInfo();
|
|
5570
5478
|
const [keyCtrlPtn, keyNum, posMax, divideCnt] =
|
|
5571
5479
|
[tkObj.keyCtrlPtn, tkObj.keyNum, tkObj.posMax, tkObj.divideCnt];
|
|
@@ -5709,8 +5617,8 @@ const keyConfigInit = (_kcType = g_kcType) => {
|
|
|
5709
5617
|
|
|
5710
5618
|
// 割り当て先のキー名を表示
|
|
5711
5619
|
for (let k = 0; k < g_keyObj[`keyCtrl${keyCtrlPtn}`][j].length; k++) {
|
|
5712
|
-
g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k] =
|
|
5713
|
-
g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k] =
|
|
5620
|
+
g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k] = setIntVal(g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k]);
|
|
5621
|
+
g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k] = setIntVal(g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k]);
|
|
5714
5622
|
|
|
5715
5623
|
keyconSprite.appendChild(
|
|
5716
5624
|
createCss2Button(`keycon${j}_${k}`, g_kCd[g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k]], _ => {
|
|
@@ -6077,7 +5985,7 @@ const keyConfigInit = (_kcType = g_kcType) => {
|
|
|
6077
5985
|
if (window.confirm(g_msgObj.keyResetConfirm)) {
|
|
6078
5986
|
for (let j = 0; j < keyNum; j++) {
|
|
6079
5987
|
for (let k = 0; k < g_keyObj[`keyCtrl${keyCtrlPtn}`][j].length; k++) {
|
|
6080
|
-
g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k] =
|
|
5988
|
+
g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k] = setIntVal(g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k]);
|
|
6081
5989
|
document.querySelector(`#keycon${j}_${k}`).textContent = g_kCd[g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k]];
|
|
6082
5990
|
changeKeyConfigColor(j, k, g_keyObj.currentPtn === -1 ? g_cssObj.keyconfig_Defaultkey : g_cssObj.title_base);
|
|
6083
5991
|
}
|
|
@@ -6254,7 +6162,7 @@ const loadMusic = _ => {
|
|
|
6254
6162
|
request.addEventListener(`load`, _ => {
|
|
6255
6163
|
if (request.status >= 200 && request.status < 300) {
|
|
6256
6164
|
const blobUrl = URL.createObjectURL(request.response);
|
|
6257
|
-
createEmptySprite(divRoot, `loader`,
|
|
6165
|
+
createEmptySprite(divRoot, `loader`, g_windowObj.loader);
|
|
6258
6166
|
lblLoading.textContent = g_lblNameObj.pleaseWait;
|
|
6259
6167
|
setAudio(blobUrl);
|
|
6260
6168
|
} else {
|
|
@@ -6722,24 +6630,9 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6722
6630
|
}
|
|
6723
6631
|
|
|
6724
6632
|
// 矢印名からフリーズアロー名への変換
|
|
6725
|
-
let frzName = g_keyObj[`chara${_keyCtrlPtn}`][j].
|
|
6726
|
-
frzName = frzName.replace(`rightdia`, `frzRdia`);
|
|
6727
|
-
frzName = frzName.replace(`left`, `frzLeft`);
|
|
6728
|
-
frzName = frzName.replace(`down`, `frzDown`);
|
|
6729
|
-
frzName = frzName.replace(`up`, `frzUp`);
|
|
6730
|
-
frzName = frzName.replace(`right`, `frzRight`);
|
|
6731
|
-
frzName = frzName.replace(`space`, `frzSpace`);
|
|
6732
|
-
frzName = frzName.replace(`iyo`, `frzIyo`);
|
|
6733
|
-
frzName = frzName.replace(`gor`, `frzGor`);
|
|
6734
|
-
frzName = frzName.replace(`oni`, `foni`);
|
|
6735
|
-
|
|
6633
|
+
let frzName = replaceStr(g_keyObj[`chara${_keyCtrlPtn}`][j], g_escapeStr.frzName);
|
|
6736
6634
|
if (frzName.indexOf(`frz`) === -1 && frzName.indexOf(`foni`) === -1) {
|
|
6737
|
-
|
|
6738
|
-
(frzName.startsWith(`a`) && !frzName.startsWith(`arrow`))) {
|
|
6739
|
-
frzName = frzName.replace(frzName.slice(1), `frz${toCapitalize(frzName.slice(1))}`);
|
|
6740
|
-
} else {
|
|
6741
|
-
frzName = frzName.replace(frzName, `frz${toCapitalize(frzName)}`);
|
|
6742
|
-
}
|
|
6635
|
+
frzName = frzName.replaceAll(frzName, `frz${toCapitalize(frzName)}`);
|
|
6743
6636
|
}
|
|
6744
6637
|
|
|
6745
6638
|
// フリーズアローデータの分解 (2つで1セット)
|
|
@@ -6853,6 +6746,20 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6853
6746
|
return [];
|
|
6854
6747
|
};
|
|
6855
6748
|
|
|
6749
|
+
/**
|
|
6750
|
+
* 譜面データの優先順配列の取得
|
|
6751
|
+
* @param {string} _header
|
|
6752
|
+
* @param {string} _type
|
|
6753
|
+
* @param {number} _scoreNo
|
|
6754
|
+
* @returns
|
|
6755
|
+
*/
|
|
6756
|
+
const getPriorityList = (_header, _type, _scoreNo) => [
|
|
6757
|
+
_dosObj[`${_header}${_type}${g_localeObj.val}${_scoreNo}_data`],
|
|
6758
|
+
_dosObj[`${_header}${_type}${g_localeObj.val}_data`],
|
|
6759
|
+
_dosObj[`${_header}${_type}${_scoreNo}_data`],
|
|
6760
|
+
_dosObj[`${_header}${_type}_data`]
|
|
6761
|
+
];
|
|
6762
|
+
|
|
6856
6763
|
/**
|
|
6857
6764
|
* 歌詞データの分解
|
|
6858
6765
|
* @param {string} _scoreNo
|
|
@@ -6861,14 +6768,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6861
6768
|
const wordDataList = [];
|
|
6862
6769
|
let wordReverseFlg = false;
|
|
6863
6770
|
const divideCnt = getKeyInfo().divideCnt;
|
|
6864
|
-
|
|
6865
|
-
const addDataList = (_type = ``) =>
|
|
6866
|
-
wordDataList.push(
|
|
6867
|
-
_dosObj[`word${_type}${g_localeObj.val}${_scoreNo}_data`],
|
|
6868
|
-
_dosObj[`word${_type}${g_localeObj.val}_data`],
|
|
6869
|
-
_dosObj[`word${_type}${_scoreNo}_data`],
|
|
6870
|
-
_dosObj[`word${_type}_data`]
|
|
6871
|
-
);
|
|
6771
|
+
const addDataList = (_type = ``) => wordDataList.push(...getPriorityList(`word`, _type, _scoreNo));
|
|
6872
6772
|
|
|
6873
6773
|
if (g_stateObj.scroll !== `---`) {
|
|
6874
6774
|
addDataList(`Alt`);
|
|
@@ -6933,7 +6833,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6933
6833
|
checkDuplicatedObjects(wordData[tmpWordData[k]]);
|
|
6934
6834
|
|
|
6935
6835
|
if (tmpWordData.length > 3 && tmpWordData.length < 6) {
|
|
6936
|
-
tmpWordData[3] =
|
|
6836
|
+
tmpWordData[3] = setIntVal(tmpWordData[3], C_WOD_FRAME);
|
|
6937
6837
|
wordData[tmpWordData[0]][addFrame].push(tmpWordData[1],
|
|
6938
6838
|
escapeHtmlForEnabledTag(tmpWordData[2]), tmpWordData[3]);
|
|
6939
6839
|
break;
|
|
@@ -6954,13 +6854,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6954
6854
|
*/
|
|
6955
6855
|
const makeBackgroundData = (_header, _scoreNo) => {
|
|
6956
6856
|
const dataList = [];
|
|
6957
|
-
const addDataList = (_type = ``) =>
|
|
6958
|
-
dataList.push(
|
|
6959
|
-
_dosObj[`${_header}${_type}${g_localeObj.val}${_scoreNo}_data`],
|
|
6960
|
-
_dosObj[`${_header}${_type}${g_localeObj.val}_data`],
|
|
6961
|
-
_dosObj[`${_header}${_type}${_scoreNo}_data`],
|
|
6962
|
-
_dosObj[`${_header}${_type}_data`]
|
|
6963
|
-
);
|
|
6857
|
+
const addDataList = (_type = ``) => dataList.push(...getPriorityList(_header, _type, _scoreNo));
|
|
6964
6858
|
|
|
6965
6859
|
if (g_stateObj.scroll !== `---`) {
|
|
6966
6860
|
addDataList(`Alt`);
|
|
@@ -6981,13 +6875,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6981
6875
|
*/
|
|
6982
6876
|
const makeBackgroundResultData = (_header, _scoreNo, _defaultHeader = ``) => {
|
|
6983
6877
|
const dataList = [];
|
|
6984
|
-
const addResultDataList = _headerType =>
|
|
6985
|
-
dataList.push(
|
|
6986
|
-
_dosObj[`${_headerType}${g_localeObj.val}${_scoreNo}_data`],
|
|
6987
|
-
_dosObj[`${_headerType}${g_localeObj.val}_data`],
|
|
6988
|
-
_dosObj[`${_headerType}${_scoreNo}_data`],
|
|
6989
|
-
_dosObj[`${_headerType}_data`],
|
|
6990
|
-
);
|
|
6878
|
+
const addResultDataList = _headerType => dataList.push(...getPriorityList(``, _headerType, _scoreNo));
|
|
6991
6879
|
addResultDataList(_header);
|
|
6992
6880
|
if (_defaultHeader !== ``) {
|
|
6993
6881
|
addResultDataList(_defaultHeader);
|
|
@@ -7774,6 +7662,7 @@ const getArrowSettings = _ => {
|
|
|
7774
7662
|
g_workObj.arrowRtn = copyArray2d(g_keyObj[`stepRtn${keyCtrlPtn}`]);
|
|
7775
7663
|
g_workObj.keyCtrl = copyArray2d(g_keyObj[`keyCtrl${keyCtrlPtn}`]);
|
|
7776
7664
|
g_workObj.diffList = [];
|
|
7665
|
+
g_workObj.mainEndTime = 0;
|
|
7777
7666
|
|
|
7778
7667
|
const keyCtrlLen = g_workObj.keyCtrl.length;
|
|
7779
7668
|
g_workObj.keyCtrlN = [...Array(keyCtrlLen)].map(_ => []);
|
|
@@ -8684,22 +8573,10 @@ const MainInit = _ => {
|
|
|
8684
8573
|
* @param _j 矢印の位置
|
|
8685
8574
|
*/
|
|
8686
8575
|
const checkKeyUpFunc = {
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
frzON: (_j) => {
|
|
8693
|
-
return true;
|
|
8694
|
-
},
|
|
8695
|
-
|
|
8696
|
-
dummyFrzOFF: (_j) => {
|
|
8697
|
-
return true;
|
|
8698
|
-
},
|
|
8699
|
-
|
|
8700
|
-
dummyFrzON: (_j) => {
|
|
8701
|
-
return true;
|
|
8702
|
-
},
|
|
8576
|
+
frzOFF: (_j) => g_workObj.keyHitFlg[_j].find(flg => flg),
|
|
8577
|
+
frzON: (_j) => true,
|
|
8578
|
+
dummyFrzOFF: (_j) => true,
|
|
8579
|
+
dummyFrzON: (_j) => true,
|
|
8703
8580
|
};
|
|
8704
8581
|
|
|
8705
8582
|
/**
|
|
@@ -9080,7 +8957,7 @@ const MainInit = _ => {
|
|
|
9080
8957
|
|
|
9081
8958
|
g_workObj.lastFadeFrame[wordDepth] = currentFrame;
|
|
9082
8959
|
g_workObj.wordFadeFrame[wordDepth] = (tmpObj.length > 2 ?
|
|
9083
|
-
|
|
8960
|
+
setIntVal(tmpObj[2], C_WOD_FRAME) : C_WOD_FRAME);
|
|
9084
8961
|
|
|
9085
8962
|
g_wordSprite.style.animationDuration = `${g_workObj.wordFadeFrame[wordDepth] / g_fps}s`;
|
|
9086
8963
|
g_wordSprite.style.animationTimingFunction = `linear`;
|
|
@@ -9094,7 +8971,7 @@ const MainInit = _ => {
|
|
|
9094
8971
|
} else if (/\[fontSize=\d+\]/.test(g_wordObj.wordDat)) {
|
|
9095
8972
|
|
|
9096
8973
|
// フォントサイズ変更
|
|
9097
|
-
const fontSize =
|
|
8974
|
+
const fontSize = setIntVal(g_wordObj.wordDat.match(/\d+/)[0], C_SIZ_MAIN);
|
|
9098
8975
|
g_wordSprite.style.fontSize = `${fontSize}px`;
|
|
9099
8976
|
|
|
9100
8977
|
} else {
|
|
@@ -9133,7 +9010,8 @@ const MainInit = _ => {
|
|
|
9133
9010
|
}
|
|
9134
9011
|
resetKeyControl();
|
|
9135
9012
|
clearTimeout(g_timeoutEvtId);
|
|
9136
|
-
|
|
9013
|
+
g_workObj.mainEndTime = thisTime;
|
|
9014
|
+
resultInit();
|
|
9137
9015
|
|
|
9138
9016
|
} else if (g_workObj.lifeVal === 0 && g_workObj.lifeBorder === 0) {
|
|
9139
9017
|
|
|
@@ -9571,7 +9449,7 @@ const judgeMatari = _difFrame => {
|
|
|
9571
9449
|
changeJudgeCharacter(`matari`, g_lblNameObj.j_matari);
|
|
9572
9450
|
comboJ.textContent = ``;
|
|
9573
9451
|
|
|
9574
|
-
displayDiff(
|
|
9452
|
+
displayDiff(_difFrame, g_headerObj.justFrames);
|
|
9575
9453
|
finishViewing();
|
|
9576
9454
|
|
|
9577
9455
|
g_customJsObj.judg_matari.forEach(func => func(_difFrame));
|
|
@@ -9685,7 +9563,7 @@ const resultInit = _ => {
|
|
|
9685
9563
|
// 曲時間制御変数
|
|
9686
9564
|
let thisTime;
|
|
9687
9565
|
let buffTime;
|
|
9688
|
-
let resultStartTime = performance.now();
|
|
9566
|
+
let resultStartTime = g_workObj.mainEndTime > 0 ? g_workObj.mainEndTime : performance.now();
|
|
9689
9567
|
|
|
9690
9568
|
if (g_stateObj.d_background === C_FLG_OFF && g_headerObj.resultMotionSet) {
|
|
9691
9569
|
} else {
|
|
@@ -9728,12 +9606,8 @@ const resultInit = _ => {
|
|
|
9728
9606
|
// タイトル文字描画
|
|
9729
9607
|
divRoot.appendChild(getTitleDivLabel(`lblTitle`, g_lblNameObj.result, 0, 15, `settings_Title`));
|
|
9730
9608
|
|
|
9731
|
-
const playDataWindow = createEmptySprite(divRoot, `playDataWindow`,
|
|
9732
|
-
|
|
9733
|
-
}, g_cssObj.result_PlayDataWindow);
|
|
9734
|
-
const resultWindow = createEmptySprite(divRoot, `resultWindow`, {
|
|
9735
|
-
x: g_sWidth / 2 - 200, y: 185 + (g_sHeight - 500) / 2, w: 400, h: 210,
|
|
9736
|
-
});
|
|
9609
|
+
const playDataWindow = createEmptySprite(divRoot, `playDataWindow`, g_windowObj.playDataWindow, g_cssObj.result_PlayDataWindow);
|
|
9610
|
+
const resultWindow = createEmptySprite(divRoot, `resultWindow`, g_windowObj.resultWindow);
|
|
9737
9611
|
|
|
9738
9612
|
const playingArrows = g_resultObj.ii + g_resultObj.shakin +
|
|
9739
9613
|
g_resultObj.matari + g_resultObj.shobon + g_resultObj.uwan +
|
|
@@ -9780,10 +9654,7 @@ const resultInit = _ => {
|
|
|
9780
9654
|
}
|
|
9781
9655
|
|
|
9782
9656
|
const keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`;
|
|
9783
|
-
|
|
9784
|
-
if (hasVal(g_keyObj[`transKey${keyCtrlPtn}`])) {
|
|
9785
|
-
transKeyData = `(` + g_keyObj[`transKey${keyCtrlPtn}`] + `)`;
|
|
9786
|
-
}
|
|
9657
|
+
const transKeyData = hasVal(g_keyObj[`transKey${keyCtrlPtn}`]) ? `(` + g_keyObj[`transKey${keyCtrlPtn}`] + `)` : ``;
|
|
9787
9658
|
|
|
9788
9659
|
/**
|
|
9789
9660
|
* プレイスタイルのカスタム有無
|
|
@@ -10027,18 +9898,19 @@ const resultInit = _ => {
|
|
|
10027
9898
|
tweetMaxCombo += `-${g_resultObj.fmaxCombo}`;
|
|
10028
9899
|
}
|
|
10029
9900
|
|
|
10030
|
-
let tweetResultTmp = g_headerObj.resultFormat
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
9901
|
+
let tweetResultTmp = replaceStr(g_headerObj.resultFormat, [
|
|
9902
|
+
[`[hashTag]`, hashTag],
|
|
9903
|
+
[`[musicTitle]`, musicTitle],
|
|
9904
|
+
[`[keyLabel]`, tweetDifData],
|
|
9905
|
+
[`[maker]`, g_headerObj.tuning],
|
|
9906
|
+
[`[rank]`, rankMark],
|
|
9907
|
+
[`[score]`, g_resultObj.score],
|
|
9908
|
+
[`[playStyle]`, playStyleData],
|
|
9909
|
+
[`[arrowJdg]`, `${g_resultObj.ii}-${g_resultObj.shakin}-${g_resultObj.matari}-${g_resultObj.shobon}-${g_resultObj.uwan}`],
|
|
9910
|
+
[`[frzJdg]`, tweetFrzJdg],
|
|
9911
|
+
[`[maxCombo]`, tweetMaxCombo],
|
|
9912
|
+
[`[url]`, g_isLocal ? `` : `${twiturl.toString()}`.replace(/[\t\n]/g, ``)]
|
|
9913
|
+
]);
|
|
10042
9914
|
if (g_presetObj.resultVals !== undefined) {
|
|
10043
9915
|
Object.keys(g_presetObj.resultVals).forEach(key => {
|
|
10044
9916
|
tweetResultTmp = tweetResultTmp.split(`[${key}]`).join(g_resultObj[g_presetObj.resultVals[key]]);
|
|
@@ -10151,8 +10023,7 @@ const resultInit = _ => {
|
|
|
10151
10023
|
g_scoreObj.maskResultFrameNum++;
|
|
10152
10024
|
g_timeoutEvtResultId = setTimeout(_ => flowResultTimeline(), 1000 / g_fps - buffTime);
|
|
10153
10025
|
};
|
|
10154
|
-
|
|
10155
|
-
g_timeoutEvtResultId = setTimeout(_ => flowResultTimeline(), 1000 / g_fps);
|
|
10026
|
+
flowResultTimeline();
|
|
10156
10027
|
|
|
10157
10028
|
// キー操作イベント(デフォルト)
|
|
10158
10029
|
setShortcutEvent(g_currentPage);
|