danoniplus 26.7.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 CHANGED
@@ -8,8 +8,8 @@
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 26.7.0`;
12
- const g_revisedDate = `2022/03/12`;
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.split(pair[0]).join(pair[1]);
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.replace(`Right`, `Left`);
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(setVal(tmpColor[1], 255, C_TYP_NUMBER)) : '') +
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].replace(/0x/g, `#`)));
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 (!setVal(g_btnDeleteFlg[_id], false, C_TYP_BOOLEAN)) {
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 (!setVal(g_btnDeleteFlg[_id], false, C_TYP_BOOLEAN)) {
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 (!setVal(g_cxtDeleteFlg[_id], false, C_TYP_BOOLEAN)) {
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(C_MARGIN, C_MARGIN);
1296
- l1ctx.lineTo(g_sWidth - C_MARGIN, C_MARGIN);
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(C_MARGIN, g_sHeight - C_MARGIN);
1302
- l1ctx.lineTo(g_sWidth - C_MARGIN, g_sHeight - C_MARGIN);
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
- style="position:absolute;left:${_obj.left}px;top:${_obj.top}px`;
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 (_obj.height !== `` && setVal(_obj.height, 0, C_TYP_NUMBER) > 0) {
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 !== 0 && _obj.width > 0) {
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 (setVal(tmpSpriteData[0], 200, C_TYP_NUMBER) === 0) {
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), // 画像パス or テキスト
1448
- class: escapeHtml(tmpSpriteData[3] ?? ``), // CSSクラス
1449
- left: setVal(tmpSpriteData[4], 0, C_TYP_CALC), // X座標
1450
- top: setVal(tmpSpriteData[5], 0, C_TYP_CALC), // Y座標
1451
- width: setVal(tmpSpriteData[6], 0, C_TYP_NUMBER), // spanタグの場合は font-size
1452
- height: escapeHtml(tmpSpriteData[7] ?? ``), // spanタグの場合は color(文字列可)
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: setVal(tmpSpriteData[10], 0, C_TYP_NUMBER) / g_fps,
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 setVal(Number(jumpFrames[jumpCnt]) - 1, 0, C_TYP_NUMBER);
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
- const baseSprite = document.querySelector(`#${spriteName}Sprite${tmpObj.depth}`);
1517
- if (tmpObj.command !== ``) {
1518
- if (tmpObj.command === `[loop]`) {
1519
- // キーワード指定:ループ
1520
- // 指定フレーム(class)へ移動する
1521
- g_scoreObj[`${spriteName}LoopCount`]++;
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`, { margin: `auto`, letterSpacing: `normal` });
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`, { background: `linear-gradient(#000000, #222222)` });
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 = setVal(ampSplitInput.value, true, C_TYP_BOOLEAN);
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 = setVal(decodeUriInput.value, false, C_TYP_BOOLEAN);
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
- if (document.querySelector(`#lblLoading`) !== null) {
1807
- divRoot.removeChild(document.querySelector(`#lblLoading`));
1808
- }
1731
+ deleteDiv(divRoot, `lblLoading`);
1809
1732
 
1810
1733
  // クエリで譜面番号が指定されていればセット
1811
- g_stateObj.scoreId = setVal(getQueryParamVal(`scoreId`), 0, C_TYP_NUMBER);
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.removeChild(document.querySelector(`#divBack`));
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 = setVal(tmpPreloadImages[1], 1, C_TYP_NUMBER);
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 = setVal(termRoopCnts[0], 1, C_TYP_NUMBER);
1875
- lastCnt = setVal(termRoopCnts[1], 1, C_TYP_NUMBER);
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].replace(/\*/g, String(k).padStart(paddingLen, `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 = setVal(document.querySelector(`#externalDosDivide`)?.value ?? getQueryParamVal(`dosDivide`), false, C_TYP_BOOLEAN);
1901
- g_stateObj.scoreLockFlg = setVal(document.querySelector(`#externalDosLock`)?.value ?? getQueryParamVal(`dosLock`), false, C_TYP_BOOLEAN);
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
- if (document.querySelector(`#lblLoading`) !== null) {
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
- setVal(_dosObj[`custom${objUpper}Use`] ?? g_presetObj.customDesignUse?.[objName], false, C_TYP_BOOLEAN);
2328
+ setBoolVal(_dosObj[`custom${objUpper}Use`] ?? g_presetObj.customDesignUse?.[objName]);
2408
2329
  });
2409
2330
 
2410
2331
  // 背景・マスクモーションのパス指定方法を他の設定に合わせる設定
2411
- obj.syncBackPath = setVal(_dosObj.syncBackPath ?? g_presetObj.syncBackPath, false, C_TYP_BOOLEAN);
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: setVal(imgTypes[2], true, C_TYP_BOOLEAN),
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 = setVal(_dosObj.keyRetry, C_KEY_RETRY, C_TYP_NUMBER);
2445
+ obj.keyRetry = setIntVal(_dosObj.keyRetry, C_KEY_RETRY);
2525
2446
  obj.keyRetryDef = obj.keyRetry;
2526
- obj.keyTitleBack = setVal(_dosObj.keyTitleBack, C_KEY_TITLEBACK, C_TYP_NUMBER);
2447
+ obj.keyTitleBack = setIntVal(_dosObj.keyTitleBack, C_KEY_TITLEBACK);
2527
2448
  obj.keyTitleBackDef = obj.keyTitleBack;
2528
2449
 
2529
2450
  // フリーズアローの許容フレーム数設定
2530
- obj.frzAttempt = setVal(_dosObj.frzAttempt, C_FRM_FRZATTEMPT, C_TYP_NUMBER);
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 = (setVal(_dosObj.difSelectorUse, obj.keyLabels.length > 5, C_TYP_BOOLEAN));
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 = setVal(_dosObj.baseBright, checkLightOrDark(colorNameToCode(window.getComputedStyle(dummyLabel, ``).color)), C_TYP_BOOLEAN);
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] = setVal(obj.defaultColorgrd[0], false, C_TYP_BOOLEAN);
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 = setVal(_dosObj.colorCdPaddingUse, false, C_TYP_BOOLEAN);
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 = setVal(_dosObj.defaultFrzColorUse ?? g_presetObj.frzColors, true, C_TYP_BOOLEAN);
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 = setVal(_dosObj.bottomWordSet, false, C_TYP_BOOLEAN);
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 = setVal(_dosObj.autoPreload, true, C_TYP_BOOLEAN);
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`] = setVal(_dosObj[`${objName}DelayFrame`], 0, C_TYP_NUMBER);
2701
+ obj[`${objName}DelayFrame`] = setIntVal(_dosObj[`${objName}DelayFrame`]);
2781
2702
  });
2782
2703
 
2783
2704
  // デフォルトReady表示のアニメーション時間設定
2784
- obj.readyAnimationFrame = setVal(_dosObj.readyAnimationFrame, 150, C_TYP_NUMBER);
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.replace(/,/g, `', '`))}'`;
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].replace(/,/g, `:`);
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 = setVal(_dosObj.titlelineheight, ``, C_TYP_NUMBER);
2779
+ obj.titlelineheight = setIntVal(_dosObj.titlelineheight, ``);
2859
2780
 
2860
2781
  // フリーズアローの始点で通常矢印の判定を行うか(dotさんソース方式)
2861
- obj.frzStartjdgUse = setVal(_dosObj.frzStartjdgUse ?? g_presetObj.frzStartjdgUse, false, C_TYP_BOOLEAN);
2782
+ obj.frzStartjdgUse = setBoolVal(_dosObj.frzStartjdgUse ?? g_presetObj.frzStartjdgUse);
2862
2783
 
2863
2784
  // 譜面名に制作者名を付加するかどうかのフラグ
2864
- obj.makerView = setVal(_dosObj.makerView, false, C_TYP_BOOLEAN);
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`] = setVal(_dosObj[`${option}Use`] ?? g_presetObj.settingUse?.[option], true, C_TYP_BOOLEAN);
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`] = setVal(displayUse[0], true, C_TYP_BOOLEAN);
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 = setVal(_dosObj.transKeyUse, true, C_TYP_BOOLEAN);
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 = setVal(_dosObj.masktitleButton, false, C_TYP_BOOLEAN);
2866
+ obj.masktitleButton = setBoolVal(_dosObj.masktitleButton);
2946
2867
 
2947
2868
  // 結果画面用のマスク透過設定
2948
- obj.maskresultButton = setVal(_dosObj.maskresultButton, false, C_TYP_BOOLEAN);
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 = setVal(_dosObj.resultMotionSet, true, C_TYP_BOOLEAN);
2875
+ obj.resultMotionSet = setBoolVal(_dosObj.resultMotionSet, true);
2955
2876
 
2956
2877
  // 譜面明細の使用可否
2957
- obj.scoreDetailUse = setVal(_dosObj.scoreDetailUse, true, C_TYP_BOOLEAN);
2878
+ obj.scoreDetailUse = setBoolVal(_dosObj.scoreDetailUse, true);
2958
2879
 
2959
2880
  // 判定位置をBackgroundのON/OFFと連動してリセットする設定
2960
- obj.jdgPosReset = setVal(_dosObj.jdgPosReset, true, C_TYP_BOOLEAN);
2881
+ obj.jdgPosReset = setBoolVal(_dosObj.jdgPosReset, true);
2961
2882
 
2962
2883
  // タイトル表示用コメント
2963
- const newlineTag = setVal(_dosObj.commentAutoBr, true, C_TYP_BOOLEAN) ? `<br>` : ``;
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 = setVal(_dosObj.commentExternal, false, C_TYP_BOOLEAN);
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 = setVal(_dosObj.playingWidth, g_sWidth, C_TYP_NUMBER);
2902
+ obj.playingWidth = setIntVal(_dosObj.playingWidth, g_sWidth);
2982
2903
 
2983
2904
  // プレイ左上位置(X座標)
2984
- obj.playingX = setVal(_dosObj.playingX, 0, C_TYP_NUMBER);
2905
+ obj.playingX = setIntVal(_dosObj.playingX);
2985
2906
 
2986
2907
  // プレイ中クレジットを表示しないエリアのサイズ(X方向)
2987
2908
  obj.customViewWidth = setVal(_dosObj.customViewWidth, 0, C_TYP_FLOAT);
@@ -3164,7 +3085,7 @@ const setColorList = (_data, _colorInit, _colorInitLength,
3164
3085
  colorList = colorStr.concat();
3165
3086
 
3166
3087
  for (let j = 0; j < colorList.length; j++) {
3167
- const tmpSetColorOrg = colorStr[j].replace(/0x/g, `#`).split(`:`);
3088
+ const tmpSetColorOrg = colorStr[j].replaceAll(`0x`, `#`).split(`:`);
3168
3089
  const hasColor = tmpSetColorOrg.some(tmpColorOrg => {
3169
3090
  if (hasVal(tmpColorOrg) && (isColorCd(tmpColorOrg) || !hasAnglePointInfo(tmpColorOrg) || tmpColorOrg === `Default`)) {
3170
3091
  colorOrg[j] = colorCdPadding(_colorCdPaddingUse, colorToHex(tmpColorOrg));
@@ -3472,13 +3393,13 @@ const keysConvert = (_dosObj, { keyExtraList = _dosObj.keyExtraList.split(`,`) }
3472
3393
  for (let k = 0; k < tmpDivs.length; k++) {
3473
3394
  tmpDivPtn = tmpDivs[k].split(`,`);
3474
3395
 
3475
- if (setVal(tmpDivPtn[0], -1, C_TYP_NUMBER) !== -1) {
3476
- g_keyObj[`div${newKey}_${k}`] = setVal(tmpDivPtn[0], g_keyObj[`chara${newKey}_0`].length, C_TYP_NUMBER);
3396
+ if (setIntVal(tmpDivPtn[0], -1) !== -1) {
3397
+ g_keyObj[`div${newKey}_${k}`] = setIntVal(tmpDivPtn[0], g_keyObj[`chara${newKey}_0`].length);
3477
3398
  } else if (g_keyObj[`div${tmpDivPtn[0]}`] !== undefined) {
3478
3399
  // 既定キーパターンが指定された場合、存在すればその値を適用
3479
3400
  g_keyObj[`div${newKey}_${k}`] = g_keyObj[`div${tmpDivPtn[0]}`];
3480
- g_keyObj[`divMax${newKey}_${k}`] = setVal(g_keyObj[`divMax${tmpDivPtn[0]}`], undefined, C_TYP_NUMBER);
3481
- } else if (setVal(g_keyObj[`div${newKey}_${k}`], -1, C_TYP_NUMBER) !== -1) {
3401
+ g_keyObj[`divMax${newKey}_${k}`] = setIntVal(g_keyObj[`divMax${tmpDivPtn[0]}`], undefined);
3402
+ } else if (setIntVal(g_keyObj[`div${newKey}_${k}`], -1) !== -1) {
3482
3403
  // すでに定義済みの場合はスキップ
3483
3404
  continue;
3484
3405
  } else if (g_keyObj[`chara${newKey}_0`] !== undefined) {
@@ -3628,8 +3549,8 @@ const titleInit = _ => {
3628
3549
 
3629
3550
  // 変数 titlesize の定義 (使用例: |titlesize=40$20|)
3630
3551
  const titlefontsizes = (g_headerObj.titlesize !== `` ? g_headerObj.titlesize.split(`$`).join(`,`).split(`,`) : [titlefontsize, titlefontsize]);
3631
- const titlefontsize1 = setVal(titlefontsizes[0], titlefontsize, C_TYP_NUMBER);
3632
- const titlefontsize2 = setVal(titlefontsizes[1], titlefontsize1, C_TYP_NUMBER);
3552
+ const titlefontsize1 = setIntVal(titlefontsizes[0], titlefontsize);
3553
+ const titlefontsize2 = setIntVal(titlefontsizes[1], titlefontsize1);
3633
3554
 
3634
3555
  // 変数 titlelineheight の定義 (使用例: |titlelineheight=50|)
3635
3556
  const titlelineheight = (g_headerObj.titlelineheight !== `` ? g_headerObj.titlelineheight - (titlefontsize2 + 10) : 0);
@@ -3649,7 +3570,7 @@ const titleInit = _ => {
3649
3570
  background: ${titlegrds[0]};
3650
3571
  background-clip: text;
3651
3572
  -webkit-background-clip: text;
3652
- -webkit-text-fill-color: rgba(255,255,255,0.0);
3573
+ color: rgba(255,255,255,0.0);
3653
3574
  ${txtAnimations[0]}
3654
3575
  " class="${g_headerObj.titleAnimationClass[0]}">
3655
3576
  ${g_headerObj.musicTitleForView[0]}
@@ -3662,7 +3583,7 @@ const titleInit = _ => {
3662
3583
  background: ${titlegrds[1]};
3663
3584
  background-clip: text;
3664
3585
  -webkit-background-clip: text;
3665
- -webkit-text-fill-color: rgba(255,255,255,0.0);
3586
+ color: rgba(255,255,255,0.0);
3666
3587
  ${txtAnimations[1]}
3667
3588
  " class="${g_headerObj.titleAnimationClass[1]}">
3668
3589
  ${g_headerObj.musicTitleForView[1] ?? ``}
@@ -3901,9 +3822,7 @@ const makeInfoWindow = (_text, _animationName = ``, _backColor = `#ccccff`) => {
3901
3822
  */
3902
3823
  const setWindowStyle = (_text, _bkColor, _textColor, _align = C_ALIGN_LEFT) => {
3903
3824
 
3904
- if (document.querySelector(`#lblWarning`) !== null) {
3905
- divRoot.removeChild(lblWarning);
3906
- }
3825
+ deleteDiv(divRoot, `lblWarning`);
3907
3826
 
3908
3827
  // ウィンドウ枠の行を取得するために一時的な枠を作成
3909
3828
  const tmplbl = createDivCss2Label(`lblTmpWarning`, _text, {
@@ -4038,9 +3957,7 @@ const setSpriteList = _settingList => {
4038
3957
  * @param {string} _sprite
4039
3958
  * @returns
4040
3959
  */
4041
- const createOptionSprite = _sprite => createEmptySprite(_sprite, `optionsprite`, {
4042
- x: (g_sWidth - 450) / 2, y: 65 + (g_sHeight - 500) / 2, w: 450, h: 325,
4043
- });
3960
+ const createOptionSprite = _sprite => createEmptySprite(_sprite, `optionsprite`, g_windowObj.optionSprite);
4044
3961
 
4045
3962
  /**
4046
3963
  * スライダー共通処理
@@ -4162,10 +4079,8 @@ const createOptionWindow = _sprite => {
4162
4079
  const createDifWindow = (_key = ``) => {
4163
4080
  g_currentPage = `difSelector`;
4164
4081
  setShortcutEvent(g_currentPage);
4165
- const difList = createEmptySprite(optionsprite, `difList`, { x: 165, y: 65, w: 280, h: 255, overflow: `auto` }, g_cssObj.settings_DifSelector);
4166
- const difCover = createEmptySprite(optionsprite, `difCover`, {
4167
- x: 25, y: 65, w: 140, h: 255, overflow: `auto`, opacity: 0.95
4168
- }, 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);
4169
4084
 
4170
4085
  // リスト再作成
4171
4086
  makeDifList(difList, _key);
@@ -4251,7 +4166,7 @@ const createOptionWindow = _sprite => {
4251
4166
  * @param {boolean} _graphUseFlg
4252
4167
  */
4253
4168
  const createScoreDetail = (_name, _graphUseFlg = true) => {
4254
- const detailObj = createEmptySprite(scoreDetail, `detail${_name}`, { w: 420, h: 230, visibility: `hidden` });
4169
+ const detailObj = createEmptySprite(scoreDetail, `detail${_name}`, g_windowObj.detailObj);
4255
4170
 
4256
4171
  if (_graphUseFlg) {
4257
4172
  const graphObj = document.createElement(`canvas`);
@@ -4281,10 +4196,7 @@ const createOptionWindow = _sprite => {
4281
4196
  }, g_cssObj.button_Mini)
4282
4197
  );
4283
4198
  g_stateObj.scoreDetailViewFlg = false;
4284
-
4285
- const scoreDetail = createEmptySprite(optionsprite, `scoreDetail`, {
4286
- x: 20, y: 90, w: 420, h: 230, visibility: `hidden`,
4287
- }, g_cssObj.settings_DifSelector);
4199
+ const scoreDetail = createEmptySprite(optionsprite, `scoreDetail`, g_windowObj.scoreDetail, g_cssObj.settings_DifSelector);
4288
4200
  const viewScText = _ => createScText(lnkScoreDetail, `ScoreDetail`, { targetLabel: `lnkScoreDetail`, x: -10 });
4289
4201
 
4290
4202
  /**
@@ -4908,7 +4820,7 @@ const createOptionWindow = _sprite => {
4908
4820
  const isNotSameKey = (g_keyObj.prevKey !== g_keyObj.currentKey);
4909
4821
 
4910
4822
  if (g_headerObj.dummyScoreNos !== undefined) {
4911
- g_stateObj.dummyId = setVal(g_headerObj.dummyScoreNos[g_stateObj.scoreId], ``, C_TYP_NUMBER);
4823
+ g_stateObj.dummyId = setIntVal(g_headerObj.dummyScoreNos[g_stateObj.scoreId], ``);
4912
4824
  }
4913
4825
  // 特殊キーフラグ
4914
4826
  g_stateObj.extraKeyFlg = g_headerObj.keyExtraList.includes(g_keyObj.currentKey);
@@ -4965,10 +4877,10 @@ const createOptionWindow = _sprite => {
4965
4877
  g_keyObj[`shuffle${keyCtrlPtn}`] = g_keyObj[`shuffle${keyCtrlPtn}_${g_keycons.shuffleGroupNum}`].concat();
4966
4878
  }
4967
4879
  if (g_headerObj.keyRetryDef === C_KEY_RETRY) {
4968
- g_headerObj.keyRetry = setVal(g_keyObj[`keyRetry${keyCtrlPtn}`], g_headerObj.keyRetryDef, C_TYP_NUMBER);
4880
+ g_headerObj.keyRetry = setIntVal(g_keyObj[`keyRetry${keyCtrlPtn}`], g_headerObj.keyRetryDef);
4969
4881
  }
4970
4882
  if (g_headerObj.keyTitleBackDef === C_KEY_TITLEBACK) {
4971
- g_headerObj.keyTitleBack = setVal(g_keyObj[`keyTitleBack${keyCtrlPtn}`], g_headerObj.keyTitleBackDef, C_TYP_NUMBER);
4883
+ g_headerObj.keyTitleBack = setIntVal(g_keyObj[`keyTitleBack${keyCtrlPtn}`], g_headerObj.keyTitleBackDef);
4972
4884
  }
4973
4885
  }
4974
4886
 
@@ -5421,9 +5333,7 @@ const createSettingsDisplayWindow = _sprite => {
5421
5333
  ];
5422
5334
 
5423
5335
  // 設定毎に個別のスプライトを作成し、その中にラベル・ボタン類を配置
5424
- const displaySprite = createEmptySprite(optionsprite, `displaySprite`, {
5425
- x: 25, y: 30, w: (g_sWidth - 450) / 2, h: C_LEN_SETLBL_HEIGHT * 5,
5426
- });
5336
+ const displaySprite = createEmptySprite(optionsprite, `displaySprite`, g_windowObj.displaySprite);
5427
5337
  const spriteList = setSpriteList(settingList);
5428
5338
 
5429
5339
  _sprite.appendChild(
@@ -5563,7 +5473,7 @@ const keyConfigInit = (_kcType = g_kcType) => {
5563
5473
  );
5564
5474
 
5565
5475
  // キーの一覧を表示
5566
- const keyconSprite = createEmptySprite(divRoot, `keyconSprite`, { y: 88 + (g_sHeight - 500) / 2, h: g_sHeight, overflow: `auto` });
5476
+ const keyconSprite = createEmptySprite(divRoot, `keyconSprite`, g_windowObj.keyconSprite);
5567
5477
  const tkObj = getKeyInfo();
5568
5478
  const [keyCtrlPtn, keyNum, posMax, divideCnt] =
5569
5479
  [tkObj.keyCtrlPtn, tkObj.keyNum, tkObj.posMax, tkObj.divideCnt];
@@ -5707,8 +5617,8 @@ const keyConfigInit = (_kcType = g_kcType) => {
5707
5617
 
5708
5618
  // 割り当て先のキー名を表示
5709
5619
  for (let k = 0; k < g_keyObj[`keyCtrl${keyCtrlPtn}`][j].length; k++) {
5710
- g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k] = setVal(g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k], 0, C_TYP_NUMBER);
5711
- g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k] = setVal(g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k], 0, C_TYP_NUMBER);
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]);
5712
5622
 
5713
5623
  keyconSprite.appendChild(
5714
5624
  createCss2Button(`keycon${j}_${k}`, g_kCd[g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k]], _ => {
@@ -6075,7 +5985,7 @@ const keyConfigInit = (_kcType = g_kcType) => {
6075
5985
  if (window.confirm(g_msgObj.keyResetConfirm)) {
6076
5986
  for (let j = 0; j < keyNum; j++) {
6077
5987
  for (let k = 0; k < g_keyObj[`keyCtrl${keyCtrlPtn}`][j].length; k++) {
6078
- g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k] = setVal(g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k], 0, C_TYP_NUMBER);
5988
+ g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k] = setIntVal(g_keyObj[`keyCtrl${keyCtrlPtn}d`][j][k]);
6079
5989
  document.querySelector(`#keycon${j}_${k}`).textContent = g_kCd[g_keyObj[`keyCtrl${keyCtrlPtn}`][j][k]];
6080
5990
  changeKeyConfigColor(j, k, g_keyObj.currentPtn === -1 ? g_cssObj.keyconfig_Defaultkey : g_cssObj.title_base);
6081
5991
  }
@@ -6252,7 +6162,7 @@ const loadMusic = _ => {
6252
6162
  request.addEventListener(`load`, _ => {
6253
6163
  if (request.status >= 200 && request.status < 300) {
6254
6164
  const blobUrl = URL.createObjectURL(request.response);
6255
- createEmptySprite(divRoot, `loader`, { y: g_sHeight - 10, h: 10, backgroundColor: `#333333` });
6165
+ createEmptySprite(divRoot, `loader`, g_windowObj.loader);
6256
6166
  lblLoading.textContent = g_lblNameObj.pleaseWait;
6257
6167
  setAudio(blobUrl);
6258
6168
  } else {
@@ -6722,12 +6632,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
6722
6632
  // 矢印名からフリーズアロー名への変換
6723
6633
  let frzName = replaceStr(g_keyObj[`chara${_keyCtrlPtn}`][j], g_escapeStr.frzName);
6724
6634
  if (frzName.indexOf(`frz`) === -1 && frzName.indexOf(`foni`) === -1) {
6725
- if ((frzName.startsWith(`s`)) || frzName.startsWith(`t`) ||
6726
- (frzName.startsWith(`a`) && !frzName.startsWith(`arrow`))) {
6727
- frzName = frzName.replace(frzName.slice(1), `frz${toCapitalize(frzName.slice(1))}`);
6728
- } else {
6729
- frzName = frzName.replace(frzName, `frz${toCapitalize(frzName)}`);
6730
- }
6635
+ frzName = frzName.replaceAll(frzName, `frz${toCapitalize(frzName)}`);
6731
6636
  }
6732
6637
 
6733
6638
  // フリーズアローデータの分解 (2つで1セット)
@@ -6841,6 +6746,20 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
6841
6746
  return [];
6842
6747
  };
6843
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
+
6844
6763
  /**
6845
6764
  * 歌詞データの分解
6846
6765
  * @param {string} _scoreNo
@@ -6849,14 +6768,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
6849
6768
  const wordDataList = [];
6850
6769
  let wordReverseFlg = false;
6851
6770
  const divideCnt = getKeyInfo().divideCnt;
6852
-
6853
- const addDataList = (_type = ``) =>
6854
- wordDataList.push(
6855
- _dosObj[`word${_type}${g_localeObj.val}${_scoreNo}_data`],
6856
- _dosObj[`word${_type}${g_localeObj.val}_data`],
6857
- _dosObj[`word${_type}${_scoreNo}_data`],
6858
- _dosObj[`word${_type}_data`]
6859
- );
6771
+ const addDataList = (_type = ``) => wordDataList.push(...getPriorityList(`word`, _type, _scoreNo));
6860
6772
 
6861
6773
  if (g_stateObj.scroll !== `---`) {
6862
6774
  addDataList(`Alt`);
@@ -6921,7 +6833,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
6921
6833
  checkDuplicatedObjects(wordData[tmpWordData[k]]);
6922
6834
 
6923
6835
  if (tmpWordData.length > 3 && tmpWordData.length < 6) {
6924
- tmpWordData[3] = setVal(tmpWordData[3], C_WOD_FRAME, C_TYP_NUMBER);
6836
+ tmpWordData[3] = setIntVal(tmpWordData[3], C_WOD_FRAME);
6925
6837
  wordData[tmpWordData[0]][addFrame].push(tmpWordData[1],
6926
6838
  escapeHtmlForEnabledTag(tmpWordData[2]), tmpWordData[3]);
6927
6839
  break;
@@ -6942,13 +6854,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
6942
6854
  */
6943
6855
  const makeBackgroundData = (_header, _scoreNo) => {
6944
6856
  const dataList = [];
6945
- const addDataList = (_type = ``) =>
6946
- dataList.push(
6947
- _dosObj[`${_header}${_type}${g_localeObj.val}${_scoreNo}_data`],
6948
- _dosObj[`${_header}${_type}${g_localeObj.val}_data`],
6949
- _dosObj[`${_header}${_type}${_scoreNo}_data`],
6950
- _dosObj[`${_header}${_type}_data`]
6951
- );
6857
+ const addDataList = (_type = ``) => dataList.push(...getPriorityList(_header, _type, _scoreNo));
6952
6858
 
6953
6859
  if (g_stateObj.scroll !== `---`) {
6954
6860
  addDataList(`Alt`);
@@ -6969,13 +6875,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
6969
6875
  */
6970
6876
  const makeBackgroundResultData = (_header, _scoreNo, _defaultHeader = ``) => {
6971
6877
  const dataList = [];
6972
- const addResultDataList = _headerType =>
6973
- dataList.push(
6974
- _dosObj[`${_headerType}${g_localeObj.val}${_scoreNo}_data`],
6975
- _dosObj[`${_headerType}${g_localeObj.val}_data`],
6976
- _dosObj[`${_headerType}${_scoreNo}_data`],
6977
- _dosObj[`${_headerType}_data`],
6978
- );
6878
+ const addResultDataList = _headerType => dataList.push(...getPriorityList(``, _headerType, _scoreNo));
6979
6879
  addResultDataList(_header);
6980
6880
  if (_defaultHeader !== ``) {
6981
6881
  addResultDataList(_defaultHeader);
@@ -7762,6 +7662,7 @@ const getArrowSettings = _ => {
7762
7662
  g_workObj.arrowRtn = copyArray2d(g_keyObj[`stepRtn${keyCtrlPtn}`]);
7763
7663
  g_workObj.keyCtrl = copyArray2d(g_keyObj[`keyCtrl${keyCtrlPtn}`]);
7764
7664
  g_workObj.diffList = [];
7665
+ g_workObj.mainEndTime = 0;
7765
7666
 
7766
7667
  const keyCtrlLen = g_workObj.keyCtrl.length;
7767
7668
  g_workObj.keyCtrlN = [...Array(keyCtrlLen)].map(_ => []);
@@ -9056,7 +8957,7 @@ const MainInit = _ => {
9056
8957
 
9057
8958
  g_workObj.lastFadeFrame[wordDepth] = currentFrame;
9058
8959
  g_workObj.wordFadeFrame[wordDepth] = (tmpObj.length > 2 ?
9059
- setVal(tmpObj[2], C_WOD_FRAME, C_TYP_NUMBER) : C_WOD_FRAME);
8960
+ setIntVal(tmpObj[2], C_WOD_FRAME) : C_WOD_FRAME);
9060
8961
 
9061
8962
  g_wordSprite.style.animationDuration = `${g_workObj.wordFadeFrame[wordDepth] / g_fps}s`;
9062
8963
  g_wordSprite.style.animationTimingFunction = `linear`;
@@ -9070,7 +8971,7 @@ const MainInit = _ => {
9070
8971
  } else if (/\[fontSize=\d+\]/.test(g_wordObj.wordDat)) {
9071
8972
 
9072
8973
  // フォントサイズ変更
9073
- const fontSize = setVal(g_wordObj.wordDat.match(/\d+/)[0], C_SIZ_MAIN, C_TYP_NUMBER);
8974
+ const fontSize = setIntVal(g_wordObj.wordDat.match(/\d+/)[0], C_SIZ_MAIN);
9074
8975
  g_wordSprite.style.fontSize = `${fontSize}px`;
9075
8976
 
9076
8977
  } else {
@@ -9109,7 +9010,8 @@ const MainInit = _ => {
9109
9010
  }
9110
9011
  resetKeyControl();
9111
9012
  clearTimeout(g_timeoutEvtId);
9112
- setTimeout(_ => resultInit(), 100);
9013
+ g_workObj.mainEndTime = thisTime;
9014
+ resultInit();
9113
9015
 
9114
9016
  } else if (g_workObj.lifeVal === 0 && g_workObj.lifeBorder === 0) {
9115
9017
 
@@ -9661,7 +9563,7 @@ const resultInit = _ => {
9661
9563
  // 曲時間制御変数
9662
9564
  let thisTime;
9663
9565
  let buffTime;
9664
- let resultStartTime = performance.now();
9566
+ let resultStartTime = g_workObj.mainEndTime > 0 ? g_workObj.mainEndTime : performance.now();
9665
9567
 
9666
9568
  if (g_stateObj.d_background === C_FLG_OFF && g_headerObj.resultMotionSet) {
9667
9569
  } else {
@@ -9704,12 +9606,8 @@ const resultInit = _ => {
9704
9606
  // タイトル文字描画
9705
9607
  divRoot.appendChild(getTitleDivLabel(`lblTitle`, g_lblNameObj.result, 0, 15, `settings_Title`));
9706
9608
 
9707
- const playDataWindow = createEmptySprite(divRoot, `playDataWindow`, {
9708
- x: g_sWidth / 2 - 225, y: 70 + (g_sHeight - 500) / 2, w: 450, h: 110,
9709
- }, g_cssObj.result_PlayDataWindow);
9710
- const resultWindow = createEmptySprite(divRoot, `resultWindow`, {
9711
- x: g_sWidth / 2 - 200, y: 185 + (g_sHeight - 500) / 2, w: 400, h: 210,
9712
- });
9609
+ const playDataWindow = createEmptySprite(divRoot, `playDataWindow`, g_windowObj.playDataWindow, g_cssObj.result_PlayDataWindow);
9610
+ const resultWindow = createEmptySprite(divRoot, `resultWindow`, g_windowObj.resultWindow);
9713
9611
 
9714
9612
  const playingArrows = g_resultObj.ii + g_resultObj.shakin +
9715
9613
  g_resultObj.matari + g_resultObj.shobon + g_resultObj.uwan +
@@ -10125,8 +10023,7 @@ const resultInit = _ => {
10125
10023
  g_scoreObj.maskResultFrameNum++;
10126
10024
  g_timeoutEvtResultId = setTimeout(_ => flowResultTimeline(), 1000 / g_fps - buffTime);
10127
10025
  };
10128
-
10129
- g_timeoutEvtResultId = setTimeout(_ => flowResultTimeline(), 1000 / g_fps);
10026
+ flowResultTimeline();
10130
10027
 
10131
10028
  // キー操作イベント(デフォルト)
10132
10029
  setShortcutEvent(g_currentPage);
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2022/03/12 (v26.7.0)
8
+ * Revised : 2022/03/18 (v27.0.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -28,6 +28,19 @@ const C_LBL_BASICFONT = `"Meiryo UI", sans-serif`;
28
28
 
29
29
  const C_BTN_HEIGHT = 50;
30
30
  const C_LNK_HEIGHT = 30;
31
+ const C_LEN_SETLBL_LEFT = 160;
32
+ const C_LEN_SETLBL_WIDTH = 210;
33
+ const C_LEN_DIFSELECTOR_WIDTH = 250;
34
+ const C_LEN_DIFCOVER_WIDTH = 110;
35
+ const C_LEN_SETLBL_HEIGHT = 23;
36
+ const C_SIZ_SETLBL = 17;
37
+ const C_LEN_SETDIFLBL_HEIGHT = 25;
38
+ const C_SIZ_SETDIFLBL = 17;
39
+ const C_LEN_SETMINI_WIDTH = 40;
40
+ const C_SIZ_SETMINI = 18;
41
+ const C_SIZ_DIFSELECTOR = 14;
42
+ const C_SIZ_MAIN = 14;
43
+ const C_SIZ_MUSIC_TITLE = 13;
31
44
 
32
45
  // スプライト(ムービークリップ相当)のルート
33
46
  const C_SPRITE_ROOT = `divRoot`;
@@ -58,6 +71,32 @@ const C_TYP_FUNCTION = `function`;
58
71
  const C_TYP_SWITCH = `switch`;
59
72
  const C_TYP_CALC = `calc`;
60
73
 
74
+ // ウィンドウサイズ
75
+ let [g_sWidth, g_sHeight] = [
76
+ setVal($id(`canvas-frame`).width, 600, C_TYP_FLOAT), setVal($id(`canvas-frame`).height, 500, C_TYP_FLOAT)
77
+ ];
78
+
79
+ // 固定ウィンドウサイズ
80
+ const g_windowObj = {
81
+ divRoot: { margin: `auto`, letterSpacing: `normal` },
82
+ divBack: { background: `linear-gradient(#000000, #222222)` },
83
+
84
+ optionSprite: { x: (g_sWidth - 450) / 2, y: 65 + (g_sHeight - 500) / 2, w: 450, h: 325 },
85
+ difList: { x: 165, y: 65, w: 280, h: 255, overflow: `auto` },
86
+ difCover: { x: 25, y: 65, w: 140, h: 255, overflow: `auto`, opacity: 0.95 },
87
+
88
+ scoreDetail: { x: 20, y: 90, w: 420, h: 230, visibility: `hidden` },
89
+ detailObj: { w: 420, h: 230, visibility: `hidden` },
90
+
91
+ displaySprite: { x: 25, y: 30, w: (g_sWidth - 450) / 2, h: C_LEN_SETLBL_HEIGHT * 5 },
92
+ keyconSprite: { y: 88 + (g_sHeight - 500) / 2, h: g_sHeight, overflow: `auto` },
93
+
94
+ loader: { y: g_sHeight - 10, h: 10, backgroundColor: `#333333` },
95
+
96
+ playDataWindow: { x: g_sWidth / 2 - 225, y: 70 + (g_sHeight - 500) / 2, w: 450, h: 110 },
97
+ resultWindow: { x: g_sWidth / 2 - 200, y: 185 + (g_sHeight - 500) / 2, w: 400, h: 210 },
98
+ };
99
+
61
100
  const g_imgObj = {};
62
101
 
63
102
  // 画像ファイル
@@ -223,20 +262,6 @@ const C_BLOCK_KEYS = [
223
262
  ];
224
263
 
225
264
  /** 設定・オプション画面用共通 */
226
- const C_LEN_SETLBL_LEFT = 160;
227
- const C_LEN_SETLBL_WIDTH = 210;
228
- const C_LEN_DIFSELECTOR_WIDTH = 250;
229
- const C_LEN_DIFCOVER_WIDTH = 110;
230
- const C_LEN_SETLBL_HEIGHT = 23;
231
- const C_SIZ_SETLBL = 17;
232
- const C_LEN_SETDIFLBL_HEIGHT = 25;
233
- const C_SIZ_SETDIFLBL = 17;
234
- const C_LEN_SETMINI_WIDTH = 40;
235
- const C_SIZ_SETMINI = 18;
236
- const C_SIZ_DIFSELECTOR = 14;
237
- const C_SIZ_MAIN = 14;
238
- const C_SIZ_MUSIC_TITLE = 13;
239
-
240
265
  const C_LEN_GRAPH_WIDTH = 286;
241
266
  const C_LEN_GRAPH_HEIGHT = 226;
242
267
  const C_CLR_SPEEDGRAPH_SPEED = `#cc3333`;
@@ -563,10 +588,6 @@ let g_storeSettings = [`appearance`, `opacity`, `d_stepzone`, `d_judgment`, `d_f
563
588
 
564
589
  let g_canDisabledSettings = [`motion`, `scroll`, `shuffle`, `autoPlay`, `gauge`, `appearance`];
565
590
 
566
- // サイズ(後で指定)
567
- let g_sWidth;
568
- let g_sHeight;
569
-
570
591
  const g_hidSudObj = {
571
592
  filterPos: 10,
572
593
 
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2021/04/28 (v22.0.0)
8
+ * Revised : 2022/03/18 (v27.0.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -609,3 +609,86 @@ function createDivCustomLabel(_id, _x, _y, _width, _height, _fontsize, _color, _
609
609
 
610
610
  return div;
611
611
  }
612
+
613
+ /**
614
+ * 外部jsファイルの読込 (callback)
615
+ * 読込可否を g_loadObj[ファイル名] で管理 (true: 読込成功, false: 読込失敗)
616
+ * @deprecated v27以降非推奨
617
+ * @param {string} _url
618
+ * @param {function} _callback
619
+ * @param {boolean} _requiredFlg (default : true / 読込必須)
620
+ * @param {string} _charset (default : UTF-8)
621
+ */
622
+ function loadScript(_url, _callback, _requiredFlg = true, _charset = `UTF-8`) {
623
+ const baseUrl = _url.split(`?`)[0];
624
+ g_loadObj[baseUrl] = false;
625
+ const script = document.createElement(`script`);
626
+ script.type = `text/javascript`;
627
+ script.src = _url;
628
+ script.charset = _charset;
629
+ script.onload = _ => {
630
+ g_loadObj[baseUrl] = true;
631
+ _callback();
632
+ };
633
+ script.onerror = _ => {
634
+ if (_requiredFlg) {
635
+ makeWarningWindow(g_msgInfoObj.E_0041.split(`{0}`).join(_url.split(`?`)[0]));
636
+ } else {
637
+ _callback();
638
+ }
639
+ };
640
+ document.querySelector(`head`).appendChild(script);
641
+ }
642
+
643
+ /**
644
+ * CSSファイルの読み込み (callback)
645
+ * デフォルトは danoni_skin_default.css を読み込む
646
+ * @deprecated v27以降非推奨
647
+ * @param {url} _href
648
+ * @param {function} _func
649
+ */
650
+ function importCssFile(_href, _func) {
651
+ const baseUrl = _href.split(`?`)[0];
652
+ g_loadObj[baseUrl] = false;
653
+ const link = document.createElement(`link`);
654
+ link.rel = `stylesheet`;
655
+ link.href = _href;
656
+ link.onload = _ => {
657
+ g_loadObj[baseUrl] = true;
658
+ _func();
659
+ };
660
+ link.onerror = _ => {
661
+ makeWarningWindow(g_msgInfoObj.E_0041.split(`{0}`).join(baseUrl), { resetFlg: `title` });
662
+ _func();
663
+ };
664
+ document.head.appendChild(link);
665
+ }
666
+
667
+ /**
668
+ * js, cssファイルの連続読込 (callback)
669
+ * @deprecated v27以降非推奨
670
+ * @param {number} _j
671
+ * @param {array} _fileData
672
+ * @param {string} _loadType
673
+ * @param {function} _afterFunc
674
+ */
675
+ function loadMultipleFiles(_j, _fileData, _loadType, _afterFunc = _ => true) {
676
+ if (_j < _fileData.length) {
677
+ const filePath = `${_fileData[_j][1]}${_fileData[_j][0]}?${new Date().getTime()}`;
678
+ if (_fileData[_j][0].endsWith(`.css`)) {
679
+ _loadType = `css`;
680
+ }
681
+
682
+ // jsファイル、cssファイルにより呼び出す関数を切替
683
+ if (_loadType === `js`) {
684
+ loadScript(filePath, _ =>
685
+ loadMultipleFiles(_j + 1, _fileData, _loadType, _afterFunc), false);
686
+ } else if (_loadType === `css`) {
687
+ const cssPath = filePath.split(`.js`).join(`.css`);
688
+ importCssFile(cssPath, _ =>
689
+ loadMultipleFiles(_j + 1, _fileData, _loadType, _afterFunc));
690
+ }
691
+ } else {
692
+ _afterFunc();
693
+ }
694
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "26.7.0",
3
+ "version": "27.0.0",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {