danoniplus 26.5.0 → 26.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/danoni_main.js +617 -654
- 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/
|
|
7
|
+
* Revised : 2022/03/05
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 26.
|
|
12
|
-
const g_revisedDate = `2022/
|
|
11
|
+
const g_version = `Ver 26.6.0`;
|
|
12
|
+
const g_revisedDate = `2022/03/05`;
|
|
13
13
|
const g_alphaVersion = ``;
|
|
14
14
|
|
|
15
15
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
@@ -25,12 +25,13 @@ let g_localVersion2 = ``;
|
|
|
25
25
|
* https://github.com/cwtickle/danoniplus/blob/develop/.github/CONTRIBUTING.md
|
|
26
26
|
*
|
|
27
27
|
* - 定数・変数名
|
|
28
|
-
* --
|
|
29
|
-
* -- グローバル変数: 変数の頭に`g_`をつける。
|
|
28
|
+
* -- グローバル変数: 変数の頭に`g_`をつける。基本はオブジェクトプロパティとして定義。
|
|
30
29
|
* -- 関数の引数 : アンダースコア始まりのキャメル表記。
|
|
30
|
+
* -- 定数 : `C_(カテゴリ)_(名前)`の形式。全て英大文字、数字、アンダースコアのみを使用。
|
|
31
|
+
* ※この定義方法は今後使用しない方針。
|
|
31
32
|
*
|
|
32
33
|
* ▽ 画面の構成
|
|
33
|
-
* [タイトル]-[
|
|
34
|
+
* [タイトル]-[設定]-[ディスプレイ]-[キーコンフィグ]-[譜面読込]-[メイン]-[リザルト]
|
|
34
35
|
* ⇒ 各画面に Init がついたものが画面の基本構成(ルート)を表す。
|
|
35
36
|
*
|
|
36
37
|
* ▽ スプライトの親子関係
|
|
@@ -195,27 +196,22 @@ let g_canLoadDifInfoFlg = false;
|
|
|
195
196
|
* div要素のstyleを取得
|
|
196
197
|
* @param {string} _id
|
|
197
198
|
*/
|
|
198
|
-
|
|
199
|
-
return document.getElementById(`${_id}`).style;
|
|
200
|
-
}
|
|
199
|
+
const $id = _id => document.getElementById(`${_id}`).style;
|
|
201
200
|
|
|
202
201
|
/**
|
|
203
202
|
* 複数のdiv子要素を親要素へ接続
|
|
204
203
|
* @param {object} _baseObj
|
|
205
204
|
* @param {...any} rest
|
|
206
205
|
*/
|
|
207
|
-
const multiAppend = (_baseObj, ...rest) =>
|
|
208
|
-
_baseObj.append(...rest);
|
|
209
|
-
};
|
|
206
|
+
const multiAppend = (_baseObj, ...rest) => _baseObj.append(...rest);
|
|
210
207
|
|
|
211
208
|
/**
|
|
212
209
|
* 複数の属性をまとめて設定
|
|
213
210
|
* @param {object} _baseObj
|
|
214
211
|
* @param {object} rest
|
|
215
212
|
*/
|
|
216
|
-
const setAttrs = (_baseObj, { ...rest } = {}) =>
|
|
213
|
+
const setAttrs = (_baseObj, { ...rest } = {}) =>
|
|
217
214
|
Object.keys(rest).forEach(property => _baseObj.setAttribute(property, rest[property]));
|
|
218
|
-
};
|
|
219
215
|
|
|
220
216
|
/**
|
|
221
217
|
* 属性値を数値に変換して取得
|
|
@@ -244,7 +240,7 @@ const hasVal = _data => _data !== undefined && _data !== ``;
|
|
|
244
240
|
* @param {string} _default
|
|
245
241
|
* @param {string} _type
|
|
246
242
|
*/
|
|
247
|
-
|
|
243
|
+
const setVal = (_checkStr, _default, _type) => {
|
|
248
244
|
|
|
249
245
|
let convertStr = _checkStr;
|
|
250
246
|
|
|
@@ -283,25 +279,23 @@ function setVal(_checkStr, _default, _type) {
|
|
|
283
279
|
|
|
284
280
|
// 文字列型の場合 (最初でチェック済みのためそのまま値を返却)
|
|
285
281
|
return convertStr;
|
|
286
|
-
}
|
|
282
|
+
};
|
|
287
283
|
|
|
288
284
|
/**
|
|
289
285
|
* 先頭のみ大文字に変換(それ以降はそのまま)
|
|
290
286
|
* @param {string} _str
|
|
291
287
|
*/
|
|
292
|
-
|
|
288
|
+
const toCapitalize = _str => {
|
|
293
289
|
if (!_str || typeof _str !== `string`) return _str;
|
|
294
290
|
return `${_str.charAt(0).toUpperCase()}${_str.slice(1)}`;
|
|
295
|
-
}
|
|
291
|
+
};
|
|
296
292
|
|
|
297
293
|
/**
|
|
298
294
|
* 0以上の数字に変換
|
|
299
295
|
* @param {number} _num
|
|
300
296
|
* @param {number} _init 0未満の場合に設定する値
|
|
301
297
|
*/
|
|
302
|
-
|
|
303
|
-
return _num < 0 ? _init : _num;
|
|
304
|
-
}
|
|
298
|
+
const roundZero = (_num, _init = 0) => _num < 0 ? _init : _num;
|
|
305
299
|
|
|
306
300
|
/**
|
|
307
301
|
* 配列内に存在するかどうかをチェック
|
|
@@ -369,46 +363,38 @@ const fuzzyListMatching = (_str, _headerList, _footerList) =>
|
|
|
369
363
|
* @param {string} _str
|
|
370
364
|
* @param {array} _pairs
|
|
371
365
|
*/
|
|
372
|
-
|
|
366
|
+
const replaceStr = (_str, _pairs) => {
|
|
373
367
|
let tmpStr = _str;
|
|
374
368
|
_pairs.forEach(pair => {
|
|
375
369
|
tmpStr = tmpStr.split(pair[0]).join(pair[1]);
|
|
376
370
|
});
|
|
377
371
|
return tmpStr;
|
|
378
|
-
}
|
|
372
|
+
};
|
|
379
373
|
|
|
380
374
|
/**
|
|
381
375
|
* 文字列のエスケープ処理
|
|
382
376
|
* @param {string} _str
|
|
383
377
|
* @param {array} _escapeList
|
|
384
378
|
*/
|
|
385
|
-
|
|
386
|
-
return escapeHtmlForEnabledTag(replaceStr(_str, _escapeList));
|
|
387
|
-
}
|
|
379
|
+
const escapeHtml = (_str, _escapeList = g_escapeStr.escape) => escapeHtmlForEnabledTag(replaceStr(_str, _escapeList));
|
|
388
380
|
|
|
389
381
|
/**
|
|
390
382
|
* 文字列のエスケープ処理(htmlタグ許容版)
|
|
391
383
|
* @param {string} _str
|
|
392
384
|
*/
|
|
393
|
-
|
|
394
|
-
return replaceStr(_str, g_escapeStr.escapeTag);
|
|
395
|
-
}
|
|
385
|
+
const escapeHtmlForEnabledTag = _str => replaceStr(_str, g_escapeStr.escapeTag);
|
|
396
386
|
|
|
397
387
|
/**
|
|
398
388
|
* エスケープ文字を元の文字に戻す
|
|
399
389
|
* @param {string} _str
|
|
400
390
|
*/
|
|
401
|
-
|
|
402
|
-
return replaceStr(_str, g_escapeStr.unEscapeTag);
|
|
403
|
-
}
|
|
391
|
+
const unEscapeHtml = _str => replaceStr(_str, g_escapeStr.unEscapeTag);
|
|
404
392
|
|
|
405
393
|
/**
|
|
406
394
|
* 配列の中身を全てエスケープ処理
|
|
407
395
|
* @param {array} _array
|
|
408
396
|
*/
|
|
409
|
-
|
|
410
|
-
return _array.map(str => escapeHtml(str));
|
|
411
|
-
}
|
|
397
|
+
const escapeHtmlForArray = _array => _array.map(str => escapeHtml(str));
|
|
412
398
|
|
|
413
399
|
/**
|
|
414
400
|
* 次のカーソルへ移動
|
|
@@ -432,7 +418,7 @@ const transCode = _setCode => {
|
|
|
432
418
|
return _setCode.replace(`Right`, `Left`);
|
|
433
419
|
}
|
|
434
420
|
return _setCode;
|
|
435
|
-
}
|
|
421
|
+
};
|
|
436
422
|
|
|
437
423
|
/**
|
|
438
424
|
* 特定キーをブロックする処理
|
|
@@ -506,7 +492,7 @@ const createScText = (_obj, _settingLabel, { displayName = `option`, dfLabel = `
|
|
|
506
492
|
})
|
|
507
493
|
);
|
|
508
494
|
}
|
|
509
|
-
}
|
|
495
|
+
};
|
|
510
496
|
|
|
511
497
|
/**
|
|
512
498
|
* 各画面の汎用ショートカットキー表示
|
|
@@ -520,7 +506,7 @@ const createScTextCommon = _displayName => {
|
|
|
520
506
|
dfLabel: g_lblNameObj[`sc_${_displayName}${target}`] ?? ``,
|
|
521
507
|
x: g_btnPatterns[_displayName][target],
|
|
522
508
|
}));
|
|
523
|
-
}
|
|
509
|
+
};
|
|
524
510
|
|
|
525
511
|
/**
|
|
526
512
|
* ショートカットキー有効化
|
|
@@ -534,7 +520,7 @@ const setShortcutEvent = (_displayName, _func = _ => true, _displayFlg = true) =
|
|
|
534
520
|
const evList = _ => {
|
|
535
521
|
document.onkeydown = evt => commonKeyDown(evt, _displayName, _func);
|
|
536
522
|
document.onkeyup = evt => commonKeyUp(evt);
|
|
537
|
-
}
|
|
523
|
+
};
|
|
538
524
|
if (g_initialFlg && g_btnWaitFrame[_displayName].initial) {
|
|
539
525
|
evList();
|
|
540
526
|
} else {
|
|
@@ -544,7 +530,7 @@ const setShortcutEvent = (_displayName, _func = _ => true, _displayFlg = true) =
|
|
|
544
530
|
}
|
|
545
531
|
}, g_btnWaitFrame[_displayName].s_frame * 1000 / g_fps);
|
|
546
532
|
}
|
|
547
|
-
}
|
|
533
|
+
};
|
|
548
534
|
|
|
549
535
|
|
|
550
536
|
/*-----------------------------------------------------------*/
|
|
@@ -559,7 +545,7 @@ const openLink = _url => {
|
|
|
559
545
|
if (_url.match(`^(http|https):/`)) {
|
|
560
546
|
window.open(_url, `_blank`, `noopener`);
|
|
561
547
|
}
|
|
562
|
-
}
|
|
548
|
+
};
|
|
563
549
|
|
|
564
550
|
/**
|
|
565
551
|
* プリロードするファイルの設定
|
|
@@ -568,7 +554,7 @@ const openLink = _url => {
|
|
|
568
554
|
* @param {string} _type
|
|
569
555
|
* @param {string} _crossOrigin
|
|
570
556
|
*/
|
|
571
|
-
|
|
557
|
+
const preloadFile = (_as, _href, _type = ``, _crossOrigin = `anonymous`) => {
|
|
572
558
|
|
|
573
559
|
const preloadFlg = g_preloadFiles.all.find(v => v === _href);
|
|
574
560
|
|
|
@@ -602,7 +588,7 @@ function preloadFile(_as, _href, _type = ``, _crossOrigin = `anonymous`) {
|
|
|
602
588
|
document.head.appendChild(link);
|
|
603
589
|
}
|
|
604
590
|
}
|
|
605
|
-
}
|
|
591
|
+
};
|
|
606
592
|
|
|
607
593
|
/**
|
|
608
594
|
* 外部jsファイルの読込 (callback)
|
|
@@ -641,7 +627,7 @@ function loadScript(_url, _callback, _requiredFlg = true, _charset = `UTF-8`) {
|
|
|
641
627
|
* @param {boolean} _requiredFlg (default : true / 読込必須)
|
|
642
628
|
* @param {string} _charset (default : UTF-8)
|
|
643
629
|
*/
|
|
644
|
-
|
|
630
|
+
const loadScript2 = (_url, _requiredFlg = true, _charset = `UTF-8`) => {
|
|
645
631
|
const baseUrl = _url.split(`?`)[0];
|
|
646
632
|
g_loadObj[baseUrl] = false;
|
|
647
633
|
|
|
@@ -664,7 +650,7 @@ function loadScript2(_url, _requiredFlg = true, _charset = `UTF-8`) {
|
|
|
664
650
|
};
|
|
665
651
|
document.querySelector(`head`).appendChild(script);
|
|
666
652
|
});
|
|
667
|
-
}
|
|
653
|
+
};
|
|
668
654
|
|
|
669
655
|
/**
|
|
670
656
|
* CSSファイルの読み込み (callback)
|
|
@@ -695,7 +681,7 @@ function importCssFile(_href, _func) {
|
|
|
695
681
|
* デフォルトは danoni_skin_default.css を読み込む
|
|
696
682
|
* @param {url} _href
|
|
697
683
|
*/
|
|
698
|
-
|
|
684
|
+
const importCssFile2 = _href => {
|
|
699
685
|
const baseUrl = _href.split(`?`)[0];
|
|
700
686
|
g_loadObj[baseUrl] = false;
|
|
701
687
|
|
|
@@ -713,7 +699,7 @@ function importCssFile2(_href) {
|
|
|
713
699
|
};
|
|
714
700
|
document.head.appendChild(link);
|
|
715
701
|
});
|
|
716
|
-
}
|
|
702
|
+
};
|
|
717
703
|
|
|
718
704
|
/**
|
|
719
705
|
* js, cssファイルの連続読込 (callback)
|
|
@@ -749,7 +735,7 @@ function loadMultipleFiles(_j, _fileData, _loadType, _afterFunc = _ => true) {
|
|
|
749
735
|
* @param {array} _fileData
|
|
750
736
|
* @param {string} _loadType
|
|
751
737
|
*/
|
|
752
|
-
async
|
|
738
|
+
const loadMultipleFiles2 = async (_fileData, _loadType) => {
|
|
753
739
|
await Promise.all(_fileData.map(async filePart => {
|
|
754
740
|
const filePath = `${filePart[1]}${filePart[0]}?${g_randTime}`;
|
|
755
741
|
if (filePart[0].endsWith(`.css`)) {
|
|
@@ -764,7 +750,7 @@ async function loadMultipleFiles2(_fileData, _loadType) {
|
|
|
764
750
|
await importCssFile2(cssPath);
|
|
765
751
|
}
|
|
766
752
|
}));
|
|
767
|
-
}
|
|
753
|
+
};
|
|
768
754
|
|
|
769
755
|
/**
|
|
770
756
|
* 入力されたパスを、ディレクトリとそれ以外に分割
|
|
@@ -818,7 +804,7 @@ const colorNameToCode = _color => {
|
|
|
818
804
|
const cxt = document.createElement(`canvas`).getContext(`2d`);
|
|
819
805
|
cxt.fillStyle = _color;
|
|
820
806
|
return cxt.fillStyle;
|
|
821
|
-
}
|
|
807
|
+
};
|
|
822
808
|
|
|
823
809
|
/**
|
|
824
810
|
* 10進 -> 16進数変換 (カラーコード形式になるよう0埋め)
|
|
@@ -858,7 +844,7 @@ const colorToHex = (_color) => {
|
|
|
858
844
|
return colorNameToCode(colorSet[0]) +
|
|
859
845
|
(tmpColor.length > 1 ? byteToHex(setVal(tmpColor[1], 255, C_TYP_NUMBER)) : '') +
|
|
860
846
|
(colorSet[1] !== undefined ? ` ${colorSet.slice(1).join(' ')}` : '');
|
|
861
|
-
}
|
|
847
|
+
};
|
|
862
848
|
|
|
863
849
|
/**
|
|
864
850
|
* カラーコードの前パディング (旧Option Editor対応)
|
|
@@ -876,8 +862,8 @@ const colorCdPadding = (_useFlg, _colorStr) => _useFlg ? `#${_colorStr.slice(1).
|
|
|
876
862
|
* objType (normal: 汎用, titleMusic: タイトル曲名, titleArrow: タイトル矢印)
|
|
877
863
|
* shadowFlg
|
|
878
864
|
*/
|
|
879
|
-
|
|
880
|
-
_colorCdPaddingUse = false, _objType = `normal`, _shadowFlg = false } = {}) {
|
|
865
|
+
const makeColorGradation = (_colorStr, { _defaultColorgrd = g_headerObj.defaultColorgrd,
|
|
866
|
+
_colorCdPaddingUse = false, _objType = `normal`, _shadowFlg = false } = {}) => {
|
|
881
867
|
|
|
882
868
|
// |color_data=300,20,45deg:#ffff99:#ffffff:#9999ff@linear-gradient|
|
|
883
869
|
// |color_data=300,20,#ffff99:#ffffff:#9999ff@radial-gradient|
|
|
@@ -920,7 +906,7 @@ function makeColorGradation(_colorStr, { _defaultColorgrd = g_headerObj.defaultC
|
|
|
920
906
|
}
|
|
921
907
|
|
|
922
908
|
return `${gradationType}(${convertColorStr})`;
|
|
923
|
-
}
|
|
909
|
+
};
|
|
924
910
|
|
|
925
911
|
/*-----------------------------------------------------------*/
|
|
926
912
|
/* フォント設定 */
|
|
@@ -930,9 +916,8 @@ function makeColorGradation(_colorStr, { _defaultColorgrd = g_headerObj.defaultC
|
|
|
930
916
|
* 画面共通のフォント設定
|
|
931
917
|
* @param {string} _priorityFont
|
|
932
918
|
*/
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
919
|
+
const getBasicFont = (_priorityFont = ``) =>
|
|
920
|
+
[_priorityFont, g_headerObj.customFont, C_LBL_BASICFONT].filter(value => value !== ``).join(`,`);
|
|
936
921
|
|
|
937
922
|
/**
|
|
938
923
|
* フォントサイズに応じた横幅を取得
|
|
@@ -940,11 +925,11 @@ function getBasicFont(_priorityFont = ``) {
|
|
|
940
925
|
* @param {number} _fontsize
|
|
941
926
|
* @param {string} _font
|
|
942
927
|
*/
|
|
943
|
-
|
|
928
|
+
const getStrWidth = (_str, _fontsize, _font) => {
|
|
944
929
|
const ctx = document.createElement(`canvas`).getContext(`2d`);
|
|
945
930
|
ctx.font = `${_fontsize}px ${_font}`;
|
|
946
931
|
return ctx.measureText(unEscapeHtml(_str)).width;
|
|
947
|
-
}
|
|
932
|
+
};
|
|
948
933
|
|
|
949
934
|
/**
|
|
950
935
|
* 指定した横幅に合ったフォントサイズを取得
|
|
@@ -954,14 +939,14 @@ function getStrWidth(_str, _fontsize, _font) {
|
|
|
954
939
|
* @param {number} _maxFontsize
|
|
955
940
|
* @param {number} _minFontsize
|
|
956
941
|
*/
|
|
957
|
-
|
|
942
|
+
const getFontSize = (_str, _maxWidth, _font = getBasicFont(), _maxFontsize = 64, _minFontsize = 5) => {
|
|
958
943
|
for (let siz = _maxFontsize; siz >= _minFontsize; siz--) {
|
|
959
944
|
if (_maxWidth >= getStrWidth(_str, siz, _font)) {
|
|
960
945
|
return siz;
|
|
961
946
|
}
|
|
962
947
|
}
|
|
963
948
|
return _minFontsize;
|
|
964
|
-
}
|
|
949
|
+
};
|
|
965
950
|
|
|
966
951
|
/*-----------------------------------------------------------*/
|
|
967
952
|
/* ラベル・ボタン・オブジェクトの作成 */
|
|
@@ -977,7 +962,7 @@ function getFontSize(_str, _maxWidth, _font = getBasicFont(), _maxFontsize = 64,
|
|
|
977
962
|
* @param {number} _width
|
|
978
963
|
* @param {number} _height
|
|
979
964
|
*/
|
|
980
|
-
|
|
965
|
+
const createDiv = (_id, _x, _y, _width, _height) => {
|
|
981
966
|
const div = document.createElement(`div`);
|
|
982
967
|
|
|
983
968
|
div.id = _id;
|
|
@@ -990,20 +975,20 @@ function createDiv(_id, _x, _y, _width, _height) {
|
|
|
990
975
|
setUserSelect(style);
|
|
991
976
|
|
|
992
977
|
return div;
|
|
993
|
-
}
|
|
978
|
+
};
|
|
994
979
|
|
|
995
980
|
/**
|
|
996
981
|
* user-select属性の値変更
|
|
997
982
|
* @param {object} _style
|
|
998
983
|
* @param {string} _value
|
|
999
984
|
*/
|
|
1000
|
-
|
|
985
|
+
const setUserSelect = (_style, _value = C_DIS_NONE) => {
|
|
1001
986
|
_style.userSelect = _value;
|
|
1002
987
|
_style.webkitUserSelect = _value;
|
|
1003
988
|
_style.msUserSelect = _value;
|
|
1004
989
|
_style.mozUserSelect = _value;
|
|
1005
990
|
_style.webkitTouchCallout = _value;
|
|
1006
|
-
}
|
|
991
|
+
};
|
|
1007
992
|
|
|
1008
993
|
/**
|
|
1009
994
|
* 子div要素のラベル文字作成 (CSS版・拡張属性対応)
|
|
@@ -1012,8 +997,8 @@ function setUserSelect(_style, _value = C_DIS_NONE) {
|
|
|
1012
997
|
* @param {object} _obj (x, y, w, h, siz, align, ...rest)
|
|
1013
998
|
* @param {...any} _classes
|
|
1014
999
|
*/
|
|
1015
|
-
|
|
1016
|
-
siz = C_SIZ_SETLBL, align = C_ALIGN_CENTER, ...rest } = {}, ..._classes) {
|
|
1000
|
+
const createDivCss2Label = (_id, _text, { x = 0, y = 0, w = C_LEN_SETLBL_WIDTH, h = C_LEN_SETLBL_HEIGHT,
|
|
1001
|
+
siz = C_SIZ_SETLBL, align = C_ALIGN_CENTER, ...rest } = {}, ..._classes) => {
|
|
1017
1002
|
const div = createDiv(_id, x, y, w, h);
|
|
1018
1003
|
div.classList.add(g_cssObj.title_base, ..._classes);
|
|
1019
1004
|
|
|
@@ -1025,7 +1010,7 @@ function createDivCss2Label(_id, _text, { x = 0, y = 0, w = C_LEN_SETLBL_WIDTH,
|
|
|
1025
1010
|
Object.keys(rest).forEach(property => style[property] = rest[property]);
|
|
1026
1011
|
|
|
1027
1012
|
return div;
|
|
1028
|
-
}
|
|
1013
|
+
};
|
|
1029
1014
|
|
|
1030
1015
|
/**
|
|
1031
1016
|
* 画像表示
|
|
@@ -1036,12 +1021,12 @@ function createDivCss2Label(_id, _text, { x = 0, y = 0, w = C_LEN_SETLBL_WIDTH,
|
|
|
1036
1021
|
* @param {number} _width
|
|
1037
1022
|
* @param {number} _height
|
|
1038
1023
|
*/
|
|
1039
|
-
|
|
1024
|
+
const createImg = (_id, _imgPath, _x, _y, _width, _height) => {
|
|
1040
1025
|
const div = createDiv(_id, _x, _y, _width, _height);
|
|
1041
1026
|
div.innerHTML = `<img id="${_id}img" src="${_imgPath}" style="width:${_width}px;height:${_height}px"${g_isFile ? `` : ` crossOrigin="anonimous"`}>`;
|
|
1042
1027
|
|
|
1043
1028
|
return div;
|
|
1044
|
-
}
|
|
1029
|
+
};
|
|
1045
1030
|
|
|
1046
1031
|
/**
|
|
1047
1032
|
* 色付きオブジェクトの作成 (拡張属性対応)
|
|
@@ -1049,8 +1034,8 @@ function createImg(_id, _imgPath, _x, _y, _width, _height) {
|
|
|
1049
1034
|
* @param {object} _obj (x, y, w, h, color, rotate, styleName, ...rest)
|
|
1050
1035
|
* @param {...any} _classes
|
|
1051
1036
|
*/
|
|
1052
|
-
|
|
1053
|
-
{ x = 0, y = 0, w = C_ARW_WIDTH, h = C_ARW_WIDTH, rotate = ``, styleName = ``, ...rest } = {}, ..._classes) {
|
|
1037
|
+
const createColorObject2 = (_id,
|
|
1038
|
+
{ x = 0, y = 0, w = C_ARW_WIDTH, h = C_ARW_WIDTH, rotate = ``, styleName = ``, ...rest } = {}, ..._classes) => {
|
|
1054
1039
|
|
|
1055
1040
|
const div = createDiv(_id, x, y, w, h);
|
|
1056
1041
|
div.classList.add(..._classes);
|
|
@@ -1075,7 +1060,7 @@ function createColorObject2(_id,
|
|
|
1075
1060
|
setAttrs(div, { color: rest.background ?? ``, type: charaStyle, cnt: 0, });
|
|
1076
1061
|
|
|
1077
1062
|
return div;
|
|
1078
|
-
}
|
|
1063
|
+
};
|
|
1079
1064
|
|
|
1080
1065
|
/**
|
|
1081
1066
|
* 空スプライト(ムービークリップ相当)の作成
|
|
@@ -1086,7 +1071,7 @@ function createColorObject2(_id,
|
|
|
1086
1071
|
* @param {...any} _classes
|
|
1087
1072
|
* @returns
|
|
1088
1073
|
*/
|
|
1089
|
-
|
|
1074
|
+
const createEmptySprite = (_parentObj, _newObjId, { x = 0, y = 0, w = g_sWidth, h = g_sHeight, title = ``, ...rest } = {}, ..._classes) => {
|
|
1090
1075
|
if (document.getElementById(_newObjId) !== null) {
|
|
1091
1076
|
changeStyle(_newObjId, { x, y, w, h, title, ...rest });
|
|
1092
1077
|
return document.getElementById(_newObjId);
|
|
@@ -1100,20 +1085,20 @@ function createEmptySprite(_parentObj, _newObjId, { x = 0, y = 0, w = g_sWidth,
|
|
|
1100
1085
|
_parentObj.appendChild(div);
|
|
1101
1086
|
|
|
1102
1087
|
return div;
|
|
1103
|
-
}
|
|
1088
|
+
};
|
|
1104
1089
|
|
|
1105
1090
|
/**
|
|
1106
1091
|
* 階層スプライト(全体)の作成
|
|
1107
1092
|
* @param {string} _baseName
|
|
1108
1093
|
* @param {number} _num
|
|
1109
1094
|
*/
|
|
1110
|
-
|
|
1095
|
+
const createMultipleSprite = (_baseName, _num) => {
|
|
1111
1096
|
const sprite = createEmptySprite(divRoot, `${_baseName}`);
|
|
1112
1097
|
for (let j = 0; j <= _num; j++) {
|
|
1113
1098
|
createEmptySprite(sprite, `${_baseName}${j}`);
|
|
1114
1099
|
}
|
|
1115
1100
|
return sprite;
|
|
1116
|
-
}
|
|
1101
|
+
};
|
|
1117
1102
|
|
|
1118
1103
|
/**
|
|
1119
1104
|
* イベントハンドラ用オブジェクト
|
|
@@ -1143,14 +1128,14 @@ const g_handler = (_ => {
|
|
|
1143
1128
|
e.target.removeEventListener(e.type, e.listener, e.capture);
|
|
1144
1129
|
}
|
|
1145
1130
|
}
|
|
1146
|
-
}
|
|
1131
|
+
};
|
|
1147
1132
|
})();
|
|
1148
1133
|
|
|
1149
1134
|
/**
|
|
1150
1135
|
* 親スプライト配下の子スプライトを全削除
|
|
1151
1136
|
* @param {object} _parentObjName 親スプライト名
|
|
1152
1137
|
*/
|
|
1153
|
-
|
|
1138
|
+
const deleteChildspriteAll = _parentObjName => {
|
|
1154
1139
|
|
|
1155
1140
|
const parentsprite = document.querySelector(`#${_parentObjName}`);
|
|
1156
1141
|
while (parentsprite.hasChildNodes()) {
|
|
@@ -1159,7 +1144,7 @@ function deleteChildspriteAll(_parentObjName) {
|
|
|
1159
1144
|
g_handler.removeListener(parentsprite.firstChild.getAttribute(`lsnrkeyTE`));
|
|
1160
1145
|
parentsprite.removeChild(parentsprite.firstChild);
|
|
1161
1146
|
}
|
|
1162
|
-
}
|
|
1147
|
+
};
|
|
1163
1148
|
|
|
1164
1149
|
/**
|
|
1165
1150
|
* ボタンの作成 (CSS版・拡張属性対応)
|
|
@@ -1169,9 +1154,9 @@ function deleteChildspriteAll(_parentObjName) {
|
|
|
1169
1154
|
* @param {object} _obj (x, y, w, h, siz, align, title, groupName, initDisabledFlg, ...rest)
|
|
1170
1155
|
* @param {...any} _classes
|
|
1171
1156
|
*/
|
|
1172
|
-
|
|
1157
|
+
const createCss2Button = (_id, _text, _func = _ => true, { x = 0, y = g_sHeight - 100, w = g_sWidth / 3, h = C_BTN_HEIGHT,
|
|
1173
1158
|
siz = C_LBL_BTNSIZE, align = C_ALIGN_CENTER, title = ``, groupName = g_currentPage, initDisabledFlg = true,
|
|
1174
|
-
resetFunc = _ => true, cxtFunc = _ => true, ...rest } = {}, ..._classes) {
|
|
1159
|
+
resetFunc = _ => true, cxtFunc = _ => true, ...rest } = {}, ..._classes) => {
|
|
1175
1160
|
|
|
1176
1161
|
const div = createDiv(_id, x, y, w, h);
|
|
1177
1162
|
div.classList.add(`button_common`, ..._classes);
|
|
@@ -1224,20 +1209,20 @@ function createCss2Button(_id, _text, _func = _ => true, { x = 0, y = g_sHeight
|
|
|
1224
1209
|
g_cxtAddFunc[_id](evt);
|
|
1225
1210
|
}
|
|
1226
1211
|
return false;
|
|
1227
|
-
}
|
|
1212
|
+
};
|
|
1228
1213
|
|
|
1229
1214
|
// イベントリスナー用のキーをセット
|
|
1230
1215
|
div.setAttribute(`lsnrkey`, lsnrkey);
|
|
1231
1216
|
|
|
1232
1217
|
return div;
|
|
1233
|
-
}
|
|
1218
|
+
};
|
|
1234
1219
|
|
|
1235
1220
|
/**
|
|
1236
1221
|
* オブジェクトのスタイル一括変更
|
|
1237
1222
|
* @param {string} _id
|
|
1238
1223
|
* @param {object} _obj (x, y, w, h, siz, align, title, ...rest)
|
|
1239
1224
|
*/
|
|
1240
|
-
|
|
1225
|
+
const changeStyle = (_id, { x, y, w, h, siz, align, title, ...rest } = {}) => {
|
|
1241
1226
|
const div = document.querySelector(`#${_id}`);
|
|
1242
1227
|
const style = div.style;
|
|
1243
1228
|
|
|
@@ -1258,7 +1243,7 @@ function changeStyle(_id, { x, y, w, h, siz, align, title, ...rest } = {}) {
|
|
|
1258
1243
|
div.title = title;
|
|
1259
1244
|
}
|
|
1260
1245
|
Object.keys(rest).forEach(property => style[property] = rest[property]);
|
|
1261
|
-
}
|
|
1246
|
+
};
|
|
1262
1247
|
|
|
1263
1248
|
/**
|
|
1264
1249
|
* タイトル文字描画
|
|
@@ -1267,18 +1252,17 @@ function changeStyle(_id, { x, y, w, h, siz, align, title, ...rest } = {}) {
|
|
|
1267
1252
|
* @param {number} _x
|
|
1268
1253
|
* @param {number} _y
|
|
1269
1254
|
*/
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
}
|
|
1255
|
+
const getTitleDivLabel = (_id, _titlename, _x, _y, ..._classes) =>
|
|
1256
|
+
createDivCss2Label(_id, _titlename, { x: _x, y: _y, w: g_sWidth, h: 50, siz: C_LBL_BTNSIZE }, ..._classes);
|
|
1273
1257
|
|
|
1274
1258
|
/**
|
|
1275
1259
|
* キーコントロールの初期化
|
|
1276
1260
|
*/
|
|
1277
|
-
|
|
1261
|
+
const resetKeyControl = _ => {
|
|
1278
1262
|
document.onkeyup = _ => { };
|
|
1279
1263
|
document.onkeydown = evt => blockCode(transCode(evt.code));
|
|
1280
1264
|
g_inputKeyBuffer = {};
|
|
1281
|
-
}
|
|
1265
|
+
};
|
|
1282
1266
|
|
|
1283
1267
|
/**
|
|
1284
1268
|
* 画面上の描画・オブジェクトを全てクリアし、背景を再描画
|
|
@@ -1286,7 +1270,7 @@ function resetKeyControl() {
|
|
|
1286
1270
|
* - dicRoot自体を削除しないよう注意すること。
|
|
1287
1271
|
* - 再描画時に共通で表示する箇所はここで指定している。
|
|
1288
1272
|
*/
|
|
1289
|
-
|
|
1273
|
+
const clearWindow = (_redrawFlg = false, _customDisplayName = ``) => {
|
|
1290
1274
|
resetKeyControl();
|
|
1291
1275
|
|
|
1292
1276
|
if (document.querySelector(`#layer0`) !== null) {
|
|
@@ -1332,13 +1316,13 @@ function clearWindow(_redrawFlg = false, _customDisplayName = ``) {
|
|
|
1332
1316
|
if (_redrawFlg) {
|
|
1333
1317
|
drawDefaultBackImage(_customDisplayName);
|
|
1334
1318
|
}
|
|
1335
|
-
}
|
|
1319
|
+
};
|
|
1336
1320
|
|
|
1337
1321
|
/**
|
|
1338
1322
|
* デフォルト背景画像の描画処理
|
|
1339
1323
|
* @param {string} _key メイン画面かどうか。Main:メイン画面、(空白):それ以外
|
|
1340
1324
|
*/
|
|
1341
|
-
|
|
1325
|
+
const drawDefaultBackImage = _key => {
|
|
1342
1326
|
|
|
1343
1327
|
g_btnAddFunc = {};
|
|
1344
1328
|
g_btnDeleteFlg = {};
|
|
@@ -1365,13 +1349,13 @@ function drawDefaultBackImage(_key) {
|
|
|
1365
1349
|
} else {
|
|
1366
1350
|
createEmptySprite(divRoot, `divBack`);
|
|
1367
1351
|
}
|
|
1368
|
-
}
|
|
1352
|
+
};
|
|
1369
1353
|
|
|
1370
1354
|
/**
|
|
1371
1355
|
* 背景・マスク用画像の描画
|
|
1372
1356
|
* @param {object} _obj
|
|
1373
1357
|
*/
|
|
1374
|
-
|
|
1358
|
+
const makeSpriteImage = _obj => {
|
|
1375
1359
|
let tmpInnerHTML = `<img src=${_obj.path} class="${_obj.class}"
|
|
1376
1360
|
style="position:absolute;left:${_obj.left}px;top:${_obj.top}px`;
|
|
1377
1361
|
if (_obj.width !== 0 && _obj.width > 0) {
|
|
@@ -1384,13 +1368,13 @@ function makeSpriteImage(_obj) {
|
|
|
1384
1368
|
;animation-duration:${_obj.animationDuration}s
|
|
1385
1369
|
;opacity:${_obj.opacity}">`;
|
|
1386
1370
|
return tmpInnerHTML;
|
|
1387
|
-
}
|
|
1371
|
+
};
|
|
1388
1372
|
|
|
1389
1373
|
/**
|
|
1390
1374
|
* 背景・マスク用テキストの描画
|
|
1391
1375
|
* @param {object} _obj
|
|
1392
1376
|
*/
|
|
1393
|
-
|
|
1377
|
+
const makeSpriteText = _obj => {
|
|
1394
1378
|
let tmpInnerHTML = `<span class="${_obj.class}"
|
|
1395
1379
|
style="display:inline-block;position:absolute;left:${_obj.left}px;top:${_obj.top}px`;
|
|
1396
1380
|
|
|
@@ -1407,14 +1391,14 @@ function makeSpriteText(_obj) {
|
|
|
1407
1391
|
;animation-duration:${_obj.animationDuration}s
|
|
1408
1392
|
;opacity:${_obj.opacity}">${_obj.path}</span>`;
|
|
1409
1393
|
return tmpInnerHTML;
|
|
1410
|
-
}
|
|
1394
|
+
};
|
|
1411
1395
|
|
|
1412
1396
|
/**
|
|
1413
1397
|
* 多重配列の存在をチェックし、
|
|
1414
1398
|
* 存在しない場合は作成、存在する場合は重複を避けて配列を新規作成
|
|
1415
1399
|
* @param {object, array} _obj
|
|
1416
1400
|
*/
|
|
1417
|
-
|
|
1401
|
+
const checkDuplicatedObjects = _obj => {
|
|
1418
1402
|
let addFrame = 0;
|
|
1419
1403
|
if (_obj === undefined) {
|
|
1420
1404
|
_obj = [];
|
|
@@ -1429,14 +1413,14 @@ function checkDuplicatedObjects(_obj) {
|
|
|
1429
1413
|
}
|
|
1430
1414
|
}
|
|
1431
1415
|
return [_obj, addFrame];
|
|
1432
|
-
}
|
|
1416
|
+
};
|
|
1433
1417
|
|
|
1434
1418
|
/**
|
|
1435
1419
|
* 多層スプライトデータの作成処理
|
|
1436
1420
|
* @param {array} _data
|
|
1437
1421
|
* @param {function} _calcFrame
|
|
1438
1422
|
*/
|
|
1439
|
-
|
|
1423
|
+
const makeSpriteData = (_data, _calcFrame = _frame => _frame) => {
|
|
1440
1424
|
|
|
1441
1425
|
const spriteData = [];
|
|
1442
1426
|
let maxDepth = -1;
|
|
@@ -1498,25 +1482,23 @@ function makeSpriteData(_data, _calcFrame = _frame => _frame) {
|
|
|
1498
1482
|
});
|
|
1499
1483
|
|
|
1500
1484
|
return [spriteData, maxDepth];
|
|
1501
|
-
}
|
|
1485
|
+
};
|
|
1502
1486
|
|
|
1503
1487
|
/**
|
|
1504
1488
|
* 画像ファイルかどうかをチェック
|
|
1505
1489
|
* @param {string} _str
|
|
1506
1490
|
*/
|
|
1507
|
-
|
|
1508
|
-
return listMatching(_str, g_imgExtensions, { prefix: `[.]`, suffix: `$` });
|
|
1509
|
-
}
|
|
1491
|
+
const checkImage = _str => listMatching(_str, g_imgExtensions, { prefix: `[.]`, suffix: `$` });
|
|
1510
1492
|
|
|
1511
1493
|
/**
|
|
1512
1494
|
* back/masktitle(result)において、ジャンプ先のフレーム数を取得
|
|
1513
1495
|
* @param {string} _frames
|
|
1514
1496
|
*/
|
|
1515
|
-
|
|
1497
|
+
const getSpriteJumpFrame = _frames => {
|
|
1516
1498
|
const jumpFrames = _frames.split(`:`);
|
|
1517
1499
|
const jumpCnt = Math.floor(Math.random() * jumpFrames.length);
|
|
1518
1500
|
return setVal(Number(jumpFrames[jumpCnt]) - 1, 0, C_TYP_NUMBER);
|
|
1519
|
-
}
|
|
1501
|
+
};
|
|
1520
1502
|
|
|
1521
1503
|
/**
|
|
1522
1504
|
* 背景・マスクモーションの表示(タイトル・リザルト用)
|
|
@@ -1524,7 +1506,7 @@ function getSpriteJumpFrame(_frames) {
|
|
|
1524
1506
|
* @param {string} _displayName title / result
|
|
1525
1507
|
* @param {string} _depthName back / mask
|
|
1526
1508
|
*/
|
|
1527
|
-
|
|
1509
|
+
const drawSpriteData = (_frame, _displayName, _depthName) => {
|
|
1528
1510
|
|
|
1529
1511
|
const spriteName = `${_depthName}${toCapitalize(_displayName)}`;
|
|
1530
1512
|
const tmpObjs = g_headerObj[`${spriteName}Data`][_frame];
|
|
@@ -1560,14 +1542,14 @@ function drawSpriteData(_frame, _displayName, _depthName) {
|
|
|
1560
1542
|
}
|
|
1561
1543
|
}
|
|
1562
1544
|
return _frame;
|
|
1563
|
-
}
|
|
1545
|
+
};
|
|
1564
1546
|
|
|
1565
1547
|
/**
|
|
1566
1548
|
* 背景・マスクモーションの表示
|
|
1567
1549
|
* @param {number} _frame
|
|
1568
1550
|
* @param {string} _depthName
|
|
1569
1551
|
*/
|
|
1570
|
-
|
|
1552
|
+
const drawMainSpriteData = (_frame, _depthName) => {
|
|
1571
1553
|
|
|
1572
1554
|
const tmpObjs = g_scoreObj[`${_depthName}Data`][_frame];
|
|
1573
1555
|
|
|
@@ -1585,20 +1567,20 @@ function drawMainSpriteData(_frame, _depthName) {
|
|
|
1585
1567
|
}
|
|
1586
1568
|
}
|
|
1587
1569
|
});
|
|
1588
|
-
}
|
|
1570
|
+
};
|
|
1589
1571
|
|
|
1590
1572
|
/**
|
|
1591
1573
|
* タイトル・リザルトモーションの描画
|
|
1592
1574
|
* @param {string} _displayName
|
|
1593
1575
|
*/
|
|
1594
|
-
|
|
1576
|
+
const drawTitleResultMotion = _displayName => {
|
|
1595
1577
|
g_animationData.forEach(sprite => {
|
|
1596
1578
|
const spriteName = `${sprite}${toCapitalize(_displayName)}`;
|
|
1597
1579
|
if (g_headerObj[`${spriteName}Data`][g_scoreObj[`${spriteName}FrameNum`]] !== undefined) {
|
|
1598
1580
|
g_scoreObj[`${spriteName}FrameNum`] = drawSpriteData(g_scoreObj[`${spriteName}FrameNum`], _displayName, sprite);
|
|
1599
1581
|
}
|
|
1600
1582
|
});
|
|
1601
|
-
}
|
|
1583
|
+
};
|
|
1602
1584
|
|
|
1603
1585
|
/*-----------------------------------------------------------*/
|
|
1604
1586
|
/* その他の共通設定 */
|
|
@@ -1692,7 +1674,7 @@ class AudioPlayer {
|
|
|
1692
1674
|
* @param {string} _textVal 入力値
|
|
1693
1675
|
* @param {string} _msg
|
|
1694
1676
|
*/
|
|
1695
|
-
async
|
|
1677
|
+
const copyTextToClipboard = async (_textVal, _msg) => {
|
|
1696
1678
|
try {
|
|
1697
1679
|
await navigator.clipboard.writeText(_textVal);
|
|
1698
1680
|
|
|
@@ -1716,26 +1698,24 @@ async function copyTextToClipboard(_textVal, _msg) {
|
|
|
1716
1698
|
} finally {
|
|
1717
1699
|
makeInfoWindow(_msg, `leftToRightFade`);
|
|
1718
1700
|
}
|
|
1719
|
-
}
|
|
1701
|
+
};
|
|
1720
1702
|
|
|
1721
1703
|
/**
|
|
1722
1704
|
* 現在URLのクエリパラメータから指定した値を取得
|
|
1723
1705
|
* @param {string} _name
|
|
1724
1706
|
*/
|
|
1725
|
-
|
|
1707
|
+
const getQueryParamVal = _name => {
|
|
1726
1708
|
const param = new URL(location.href).searchParams.get(_name);
|
|
1727
1709
|
return param !== null ? decodeURIComponent(param.replace(/\+/g, ` `)) : null;
|
|
1728
|
-
}
|
|
1710
|
+
};
|
|
1729
1711
|
|
|
1730
1712
|
/**
|
|
1731
1713
|
* ローディング文字用ラベルの作成
|
|
1732
1714
|
*/
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
});
|
|
1738
|
-
}
|
|
1715
|
+
const getLoadingLabel = _ => createDivCss2Label(`lblLoading`, g_lblNameObj.nowLoading, {
|
|
1716
|
+
x: 0, y: g_sHeight - 40, w: g_sWidth, h: C_LEN_SETLBL_HEIGHT,
|
|
1717
|
+
siz: C_SIZ_SETLBL, align: C_ALIGN_RIGHT,
|
|
1718
|
+
});
|
|
1739
1719
|
|
|
1740
1720
|
/**
|
|
1741
1721
|
* フレーム数を時間表示へ変換
|
|
@@ -1745,7 +1725,7 @@ const transFrameToTimer = _frame => {
|
|
|
1745
1725
|
const minutes = Math.floor(_frame / g_fps / 60);
|
|
1746
1726
|
const seconds = `${Math.floor((_frame / g_fps) % 60)}`.padStart(2, `0`);
|
|
1747
1727
|
return `${minutes}:${seconds}`;
|
|
1748
|
-
}
|
|
1728
|
+
};
|
|
1749
1729
|
|
|
1750
1730
|
/**
|
|
1751
1731
|
* 疑似タイマー表記をフレーム数へ変換
|
|
@@ -1769,7 +1749,7 @@ const transTimerToFrame = _str => {
|
|
|
1769
1749
|
/* Scene : INITIALIZE [peach] */
|
|
1770
1750
|
/*-----------------------------------------------------------*/
|
|
1771
1751
|
|
|
1772
|
-
async
|
|
1752
|
+
const initialControl = async () => {
|
|
1773
1753
|
|
|
1774
1754
|
[g_sWidth, g_sHeight] = [
|
|
1775
1755
|
setVal($id(`canvas-frame`).width, 600, C_TYP_FLOAT), setVal($id(`canvas-frame`).height, 500, C_TYP_FLOAT)
|
|
@@ -1931,12 +1911,12 @@ async function initialControl() {
|
|
|
1931
1911
|
}
|
|
1932
1912
|
}
|
|
1933
1913
|
titleInit();
|
|
1934
|
-
}
|
|
1914
|
+
};
|
|
1935
1915
|
|
|
1936
1916
|
/**
|
|
1937
1917
|
* 作品別ローカルストレージの読み込み・初期設定
|
|
1938
1918
|
*/
|
|
1939
|
-
|
|
1919
|
+
const loadLocalStorage = _ => {
|
|
1940
1920
|
// URLからscoreIdを削除
|
|
1941
1921
|
const url = new URL(location.href);
|
|
1942
1922
|
url.searchParams.delete('scoreId');
|
|
@@ -1990,13 +1970,13 @@ function loadLocalStorage() {
|
|
|
1990
1970
|
highscores: {},
|
|
1991
1971
|
};
|
|
1992
1972
|
}
|
|
1993
|
-
}
|
|
1973
|
+
};
|
|
1994
1974
|
|
|
1995
1975
|
/**
|
|
1996
1976
|
* 譜面データを分割して値を取得
|
|
1997
1977
|
* @param {string} _dos 譜面データ
|
|
1998
1978
|
*/
|
|
1999
|
-
|
|
1979
|
+
const dosConvert = _dos => {
|
|
2000
1980
|
|
|
2001
1981
|
const obj = {};
|
|
2002
1982
|
const paramsTmp = g_enableAmpersandSplit ? _dos.split(`&`).join(`|`) : _dos;
|
|
@@ -2013,13 +1993,13 @@ function dosConvert(_dos) {
|
|
|
2013
1993
|
}
|
|
2014
1994
|
}
|
|
2015
1995
|
return obj;
|
|
2016
|
-
}
|
|
1996
|
+
};
|
|
2017
1997
|
|
|
2018
1998
|
/**
|
|
2019
1999
|
* 譜面読込
|
|
2020
2000
|
* @param {number} _scoreId 譜面番号
|
|
2021
2001
|
*/
|
|
2022
|
-
async
|
|
2002
|
+
const loadChartFile = async (_scoreId = g_stateObj.scoreId) => {
|
|
2023
2003
|
|
|
2024
2004
|
const dosInput = document.querySelector(`#dos`);
|
|
2025
2005
|
const divRoot = document.querySelector(`#divRoot`);
|
|
@@ -2068,13 +2048,13 @@ async function loadChartFile(_scoreId = g_stateObj.scoreId) {
|
|
|
2068
2048
|
makeWarningWindow(g_msgInfoObj.E_0022);
|
|
2069
2049
|
}
|
|
2070
2050
|
}
|
|
2071
|
-
}
|
|
2051
|
+
};
|
|
2072
2052
|
|
|
2073
2053
|
/**
|
|
2074
2054
|
* 譜面をファイルで分割している場合に初期色やゲージ情報を追加取得
|
|
2075
2055
|
* @param {string} _scoreId
|
|
2076
2056
|
*/
|
|
2077
|
-
|
|
2057
|
+
const resetColorAndGauge = _scoreId => {
|
|
2078
2058
|
// 初期矢印・フリーズアロー色の再定義
|
|
2079
2059
|
if (g_stateObj.scoreLockFlg) {
|
|
2080
2060
|
Object.assign(g_rootObj, copySetColor(g_rootObj, _scoreId));
|
|
@@ -2084,7 +2064,7 @@ function resetColorAndGauge(_scoreId) {
|
|
|
2084
2064
|
// ライフ設定のカスタム部分再取得(譜面ヘッダー加味)
|
|
2085
2065
|
Object.assign(g_gaugeOptionObj, resetCustomGauge(g_rootObj, { scoreId: _scoreId }));
|
|
2086
2066
|
Object.keys(g_gaugeOptionObj.customFulls).forEach(gaugePtn => getGaugeSetting(g_rootObj, gaugePtn, g_headerObj.difLabels.length, { scoreId: _scoreId }));
|
|
2087
|
-
}
|
|
2067
|
+
};
|
|
2088
2068
|
|
|
2089
2069
|
/**
|
|
2090
2070
|
* 譜面番号固定かつ譜面ファイル分割時に初期色情報を他譜面へコピー
|
|
@@ -2092,7 +2072,7 @@ function resetColorAndGauge(_scoreId) {
|
|
|
2092
2072
|
* @param {number} _scoreId
|
|
2093
2073
|
* @returns
|
|
2094
2074
|
*/
|
|
2095
|
-
|
|
2075
|
+
const copySetColor = (_baseObj, _scoreId) => {
|
|
2096
2076
|
const obj = {};
|
|
2097
2077
|
const scoreIdHeader = setScoreIdHeader(_scoreId);
|
|
2098
2078
|
[``, `Shadow`].forEach(pattern => {
|
|
@@ -2103,27 +2083,27 @@ function copySetColor(_baseObj, _scoreId) {
|
|
|
2103
2083
|
});
|
|
2104
2084
|
});
|
|
2105
2085
|
return obj;
|
|
2106
|
-
}
|
|
2086
|
+
};
|
|
2107
2087
|
|
|
2108
2088
|
/**
|
|
2109
2089
|
* MusicUrlの基本情報を取得
|
|
2110
2090
|
* @param {number} _scoreId
|
|
2111
2091
|
* @returns
|
|
2112
2092
|
*/
|
|
2113
|
-
|
|
2093
|
+
const getMusicUrl = _scoreId => {
|
|
2114
2094
|
return g_headerObj.musicUrls !== undefined ?
|
|
2115
2095
|
g_headerObj.musicUrls[g_headerObj.musicNos[_scoreId]] ??
|
|
2116
2096
|
g_headerObj.musicUrls[0] : `nosound.mp3`;
|
|
2117
|
-
}
|
|
2097
|
+
};
|
|
2118
2098
|
|
|
2119
2099
|
/**
|
|
2120
2100
|
* 譜面ファイル読込後処理(譜面詳細情報取得用)
|
|
2121
2101
|
* @param {number} _scoreId
|
|
2122
2102
|
*/
|
|
2123
|
-
|
|
2103
|
+
const getScoreDetailData = _scoreId => {
|
|
2124
2104
|
const keyCtrlPtn = `${g_headerObj.keyLabels[_scoreId]}_0`;
|
|
2125
2105
|
storeBaseData(_scoreId, scoreConvert(g_rootObj, _scoreId, 0, ``, keyCtrlPtn, true), keyCtrlPtn);
|
|
2126
|
-
}
|
|
2106
|
+
};
|
|
2127
2107
|
|
|
2128
2108
|
/**
|
|
2129
2109
|
* 譜面詳細データの格納
|
|
@@ -2131,7 +2111,7 @@ function getScoreDetailData(_scoreId) {
|
|
|
2131
2111
|
* @param {object} _scoreObj
|
|
2132
2112
|
* @param {number} _keyCtrlPtn
|
|
2133
2113
|
*/
|
|
2134
|
-
|
|
2114
|
+
const storeBaseData = (_scoreId, _scoreObj, _keyCtrlPtn) => {
|
|
2135
2115
|
const lastFrame = getLastFrame(_scoreObj, _keyCtrlPtn) + 1;
|
|
2136
2116
|
const startFrame = getStartFrame(lastFrame, 0, _scoreId);
|
|
2137
2117
|
const firstArrowFrame = getFirstArrowFrame(_scoreObj, _keyCtrlPtn);
|
|
@@ -2161,7 +2141,7 @@ function storeBaseData(_scoreId, _scoreObj, _keyCtrlPtn) {
|
|
|
2161
2141
|
noteCnt[types[m]][j]++;
|
|
2162
2142
|
allData++;
|
|
2163
2143
|
}
|
|
2164
|
-
})
|
|
2144
|
+
});
|
|
2165
2145
|
});
|
|
2166
2146
|
fullData = fullData.concat(..._scoreObj.arrowData[j], ...tmpFrzData);
|
|
2167
2147
|
}
|
|
@@ -2197,7 +2177,7 @@ function storeBaseData(_scoreId, _scoreObj, _keyCtrlPtn) {
|
|
|
2197
2177
|
dataList.push(allData === 0 ? 0 : Math.round(_densityData[j] / allData * C_LEN_DENSITY_DIVISION * 10000) / 100);
|
|
2198
2178
|
}
|
|
2199
2179
|
return dataList;
|
|
2200
|
-
}
|
|
2180
|
+
};
|
|
2201
2181
|
const diffArray = (_array1, _array2) => {
|
|
2202
2182
|
const list = [];
|
|
2203
2183
|
_array1.forEach((val, j) => list.push(_array1[j] - _array2[j]));
|
|
@@ -2218,13 +2198,13 @@ function storeBaseData(_scoreId, _scoreObj, _keyCtrlPtn) {
|
|
|
2218
2198
|
g_detailObj.startFrame[_scoreId] = startFrame;
|
|
2219
2199
|
g_detailObj.playingFrame[_scoreId] = playingFrame;
|
|
2220
2200
|
g_detailObj.playingFrameWithBlank[_scoreId] = lastFrame - startFrame;
|
|
2221
|
-
}
|
|
2201
|
+
};
|
|
2222
2202
|
|
|
2223
2203
|
/**
|
|
2224
2204
|
* ツール計算
|
|
2225
2205
|
* @param {object} _scoreObj
|
|
2226
2206
|
*/
|
|
2227
|
-
|
|
2207
|
+
const calcLevel = _scoreObj => {
|
|
2228
2208
|
//--------------------------------------------------------------
|
|
2229
2209
|
//<フリーズデータ分解>
|
|
2230
2210
|
// フリーズデータを分解し、矢印データに組み込む
|
|
@@ -2383,14 +2363,14 @@ function calcLevel(_scoreObj) {
|
|
|
2383
2363
|
// 3つ押しリスト
|
|
2384
2364
|
push3: push3List,
|
|
2385
2365
|
};
|
|
2386
|
-
}
|
|
2366
|
+
};
|
|
2387
2367
|
|
|
2388
2368
|
/**
|
|
2389
2369
|
* 譜面ヘッダーの分解(スキン、jsファイルなどの設定)
|
|
2390
2370
|
* @param {object} _dosObj
|
|
2391
2371
|
* @returns
|
|
2392
2372
|
*/
|
|
2393
|
-
|
|
2373
|
+
const preheaderConvert = _dosObj => {
|
|
2394
2374
|
|
|
2395
2375
|
// ヘッダー群の格納先
|
|
2396
2376
|
const obj = {};
|
|
@@ -2431,13 +2411,13 @@ function preheaderConvert(_dosObj) {
|
|
|
2431
2411
|
obj.syncBackPath = setVal(_dosObj.syncBackPath ?? g_presetObj.syncBackPath, false, C_TYP_BOOLEAN);
|
|
2432
2412
|
|
|
2433
2413
|
return obj;
|
|
2434
|
-
}
|
|
2414
|
+
};
|
|
2435
2415
|
|
|
2436
2416
|
/**
|
|
2437
2417
|
* 譜面ヘッダーの分解(その他の設定)
|
|
2438
2418
|
* @param {object} _dosObj 譜面データオブジェクト
|
|
2439
2419
|
*/
|
|
2440
|
-
|
|
2420
|
+
const headerConvert = _dosObj => {
|
|
2441
2421
|
|
|
2442
2422
|
// ヘッダー群の格納先
|
|
2443
2423
|
const obj = {};
|
|
@@ -3031,30 +3011,30 @@ function headerConvert(_dosObj) {
|
|
|
3031
3011
|
});
|
|
3032
3012
|
|
|
3033
3013
|
return obj;
|
|
3034
|
-
}
|
|
3014
|
+
};
|
|
3035
3015
|
|
|
3036
3016
|
/**
|
|
3037
3017
|
* 曲名(1行)の取得
|
|
3038
3018
|
* @param {string} _musicName
|
|
3039
3019
|
*/
|
|
3040
|
-
|
|
3020
|
+
const getMusicNameSimple = _musicName => {
|
|
3041
3021
|
return _musicName.split(`<br>`).join(` `).split(`<nbr>`).join(``).split(`<dbr>`).join(` `);
|
|
3042
|
-
}
|
|
3022
|
+
};
|
|
3043
3023
|
|
|
3044
3024
|
/**
|
|
3045
3025
|
* 曲名(複数行)の取得
|
|
3046
3026
|
* @param {string} _musicName
|
|
3047
3027
|
*/
|
|
3048
|
-
|
|
3028
|
+
const getMusicNameMultiLine = _musicName => {
|
|
3049
3029
|
const tmpName = _musicName.split(`<nbr>`).join(`<br>`).split(`<dbr>`).join(`<br>`).split(`<br>`);
|
|
3050
3030
|
return tmpName.length === 1 ? [tmpName[0], ``] : tmpName;
|
|
3051
|
-
}
|
|
3031
|
+
};
|
|
3052
3032
|
|
|
3053
3033
|
/**
|
|
3054
3034
|
* 画像セットの入れ替え処理
|
|
3055
3035
|
* @param {array} _imgType
|
|
3056
3036
|
*/
|
|
3057
|
-
|
|
3037
|
+
const updateImgType = _imgType => {
|
|
3058
3038
|
resetImgs(_imgType.name, _imgType.extension);
|
|
3059
3039
|
reloadImgObj();
|
|
3060
3040
|
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_rootPath}${g_imgObj[key]}`);
|
|
@@ -3064,15 +3044,15 @@ function updateImgType(_imgType) {
|
|
|
3064
3044
|
if (!g_isFile) {
|
|
3065
3045
|
g_imgInitList.forEach(img => preloadFile(`image`, g_imgObj[img]));
|
|
3066
3046
|
}
|
|
3067
|
-
}
|
|
3047
|
+
};
|
|
3068
3048
|
|
|
3069
3049
|
/**
|
|
3070
3050
|
* ゲージ設定リストへの追加
|
|
3071
3051
|
* @param {object} _obj
|
|
3072
3052
|
*/
|
|
3073
|
-
|
|
3053
|
+
const addGaugeFulls = _obj => {
|
|
3074
3054
|
_obj.map(key => g_gaugeOptionObj.customFulls[key] = false);
|
|
3075
|
-
}
|
|
3055
|
+
};
|
|
3076
3056
|
|
|
3077
3057
|
/**
|
|
3078
3058
|
* 矢印・フリーズアロー色のデータ変換
|
|
@@ -3081,7 +3061,7 @@ function addGaugeFulls(_obj) {
|
|
|
3081
3061
|
* @param {object} objectList
|
|
3082
3062
|
* @returns オブジェクト ※Object.assign(obj, resetBaseColorList(...))の形で呼び出しが必要
|
|
3083
3063
|
*/
|
|
3084
|
-
|
|
3064
|
+
const resetBaseColorList = (_baseObj, _dosObj, { scoreId = `` } = {}) => {
|
|
3085
3065
|
|
|
3086
3066
|
const obj = {};
|
|
3087
3067
|
const scoreIdHeader = setScoreIdHeader(scoreId);
|
|
@@ -3141,7 +3121,7 @@ function resetBaseColorList(_baseObj, _dosObj, { scoreId = `` } = {}) {
|
|
|
3141
3121
|
});
|
|
3142
3122
|
|
|
3143
3123
|
return obj;
|
|
3144
|
-
}
|
|
3124
|
+
};
|
|
3145
3125
|
|
|
3146
3126
|
/**
|
|
3147
3127
|
* 矢印・フリーズアロー色のデータ展開
|
|
@@ -3150,9 +3130,9 @@ function resetBaseColorList(_baseObj, _dosObj, { scoreId = `` } = {}) {
|
|
|
3150
3130
|
* @param {number} _colorInitLength
|
|
3151
3131
|
* @param {object} objectList
|
|
3152
3132
|
*/
|
|
3153
|
-
|
|
3133
|
+
const setColorList = (_data, _colorInit, _colorInitLength,
|
|
3154
3134
|
{ _defaultColorgrd = g_headerObj.defaultColorgrd, _colorCdPaddingUse = false,
|
|
3155
|
-
_defaultFrzColorUse = true, _objType = `normal`, _shadowFlg = false } = {}) {
|
|
3135
|
+
_defaultFrzColorUse = true, _objType = `normal`, _shadowFlg = false } = {}) => {
|
|
3156
3136
|
|
|
3157
3137
|
// グラデーション文字列 #ffff99:#9999ff@linear-gradient
|
|
3158
3138
|
let colorStr = [];
|
|
@@ -3212,7 +3192,7 @@ function setColorList(_data, _colorInit, _colorInitLength,
|
|
|
3212
3192
|
}
|
|
3213
3193
|
|
|
3214
3194
|
return [colorList, colorStr, colorOrg];
|
|
3215
|
-
}
|
|
3195
|
+
};
|
|
3216
3196
|
|
|
3217
3197
|
/**
|
|
3218
3198
|
* 複合カスタムゲージの定義設定
|
|
@@ -3221,7 +3201,7 @@ function setColorList(_data, _colorInit, _colorInitLength,
|
|
|
3221
3201
|
* @param {object} objectList
|
|
3222
3202
|
* @returns オブジェクト ※Object.assign(obj, resetCustomGauge(...))の形で呼び出しが必要
|
|
3223
3203
|
*/
|
|
3224
|
-
|
|
3204
|
+
const resetCustomGauge = (_dosObj, { scoreId = 0 } = {}) => {
|
|
3225
3205
|
|
|
3226
3206
|
const obj = {};
|
|
3227
3207
|
const scoreIdHeader = setScoreIdHeader(scoreId, g_stateObj.scoreLockFlg);
|
|
@@ -3253,7 +3233,7 @@ function resetCustomGauge(_dosObj, { scoreId = 0 } = {}) {
|
|
|
3253
3233
|
}
|
|
3254
3234
|
}
|
|
3255
3235
|
return obj;
|
|
3256
|
-
}
|
|
3236
|
+
};
|
|
3257
3237
|
|
|
3258
3238
|
/**
|
|
3259
3239
|
* ゲージ別個別設定の取得
|
|
@@ -3262,7 +3242,7 @@ function resetCustomGauge(_dosObj, { scoreId = 0 } = {}) {
|
|
|
3262
3242
|
* @param {number} _difLength
|
|
3263
3243
|
* @param {object} objectList
|
|
3264
3244
|
*/
|
|
3265
|
-
|
|
3245
|
+
const getGaugeSetting = (_dosObj, _name, _difLength, { scoreId = 0 } = {}) => {
|
|
3266
3246
|
|
|
3267
3247
|
const obj = {
|
|
3268
3248
|
lifeBorders: [],
|
|
@@ -3349,7 +3329,7 @@ function getGaugeSetting(_dosObj, _name, _difLength, { scoreId = 0 } = {}) {
|
|
|
3349
3329
|
if (gaugeCreateFlg) {
|
|
3350
3330
|
g_gaugeOptionObj[`gauge${_name}s`] = obj;
|
|
3351
3331
|
}
|
|
3352
|
-
}
|
|
3332
|
+
};
|
|
3353
3333
|
|
|
3354
3334
|
/**
|
|
3355
3335
|
* キー名の取得
|
|
@@ -3362,7 +3342,7 @@ const getKeyName = _key => hasVal(g_keyObj[`keyName${_key}`]) ? g_keyObj[`keyNam
|
|
|
3362
3342
|
* 一時的な追加キーの設定
|
|
3363
3343
|
* @param {object} _dosObj
|
|
3364
3344
|
*/
|
|
3365
|
-
|
|
3345
|
+
const keysConvert = (_dosObj, { keyExtraList = _dosObj.keyExtraList.split(`,`) } = {}) => {
|
|
3366
3346
|
|
|
3367
3347
|
if (keyExtraList === undefined) {
|
|
3368
3348
|
return [];
|
|
@@ -3441,7 +3421,7 @@ function keysConvert(_dosObj, { keyExtraList = _dosObj.keyExtraList.split(`,`) }
|
|
|
3441
3421
|
if (!hasVal(tmpParams[k])) {
|
|
3442
3422
|
continue;
|
|
3443
3423
|
}
|
|
3444
|
-
g_keyObj[pairName] = {}
|
|
3424
|
+
g_keyObj[pairName] = {}
|
|
3445
3425
|
if (g_keyObj[`${_pairName}${tmpParams[k]}`] !== undefined) {
|
|
3446
3426
|
Object.assign(g_keyObj[pairName], g_keyObj[`${_pairName}${tmpParams[k]}`]);
|
|
3447
3427
|
} else {
|
|
@@ -3562,7 +3542,7 @@ function keysConvert(_dosObj, { keyExtraList = _dosObj.keyExtraList.split(`,`) }
|
|
|
3562
3542
|
});
|
|
3563
3543
|
|
|
3564
3544
|
return keyExtraList;
|
|
3565
|
-
}
|
|
3545
|
+
};
|
|
3566
3546
|
|
|
3567
3547
|
/*-----------------------------------------------------------*/
|
|
3568
3548
|
/* Scene : TITLE [melon] */
|
|
@@ -3571,7 +3551,7 @@ function keysConvert(_dosObj, { keyExtraList = _dosObj.keyExtraList.split(`,`) }
|
|
|
3571
3551
|
/**
|
|
3572
3552
|
* タイトル画面初期化
|
|
3573
3553
|
*/
|
|
3574
|
-
|
|
3554
|
+
const titleInit = _ => {
|
|
3575
3555
|
|
|
3576
3556
|
clearWindow(true);
|
|
3577
3557
|
g_currentPage = `title`;
|
|
@@ -3843,7 +3823,7 @@ function titleInit() {
|
|
|
3843
3823
|
/**
|
|
3844
3824
|
* タイトルのモーション設定
|
|
3845
3825
|
*/
|
|
3846
|
-
|
|
3826
|
+
const flowTitleTimeline = _ => {
|
|
3847
3827
|
|
|
3848
3828
|
// ユーザカスタムイベント(フレーム毎)
|
|
3849
3829
|
g_customJsObj.titleEnterFrame.forEach(func => func());
|
|
@@ -3858,7 +3838,7 @@ function titleInit() {
|
|
|
3858
3838
|
g_scoreObj.backTitleFrameNum++;
|
|
3859
3839
|
g_scoreObj.maskTitleFrameNum++;
|
|
3860
3840
|
g_timeoutEvtTitleId = setTimeout(_ => flowTitleTimeline(), 1000 / g_fps - buffTime);
|
|
3861
|
-
}
|
|
3841
|
+
};
|
|
3862
3842
|
|
|
3863
3843
|
g_timeoutEvtTitleId = setTimeout(_ => flowTitleTimeline(), 1000 / g_fps);
|
|
3864
3844
|
|
|
@@ -3869,14 +3849,14 @@ function titleInit() {
|
|
|
3869
3849
|
divRoot.oncontextmenu = _ => false;
|
|
3870
3850
|
|
|
3871
3851
|
g_skinJsObj.title.forEach(func => func());
|
|
3872
|
-
}
|
|
3852
|
+
};
|
|
3873
3853
|
|
|
3874
3854
|
/**
|
|
3875
3855
|
* 警告用ウィンドウ(汎用)を表示
|
|
3876
3856
|
* @param {string} _text
|
|
3877
3857
|
* @param {object} _options resetFlg: 警告リストをクリアして再作成, backBtnUse: Backボタンを付与
|
|
3878
3858
|
*/
|
|
3879
|
-
|
|
3859
|
+
const makeWarningWindow = (_text = ``, { resetFlg = false, backBtnUse = false } = {}) => {
|
|
3880
3860
|
const displayName = (g_currentPage === `initial` ? `title` : g_currentPage);
|
|
3881
3861
|
if (_text !== ``) {
|
|
3882
3862
|
if (resetFlg) {
|
|
@@ -3895,13 +3875,13 @@ function makeWarningWindow(_text = ``, { resetFlg = false, backBtnUse = false }
|
|
|
3895
3875
|
resetFunc: _ => titleInit(),
|
|
3896
3876
|
}, g_cssObj.button_Back));
|
|
3897
3877
|
}
|
|
3898
|
-
}
|
|
3878
|
+
};
|
|
3899
3879
|
|
|
3900
3880
|
/**
|
|
3901
3881
|
* お知らせウィンドウ(汎用)を表示
|
|
3902
3882
|
* @param {string} _text
|
|
3903
3883
|
*/
|
|
3904
|
-
|
|
3884
|
+
const makeInfoWindow = (_text, _animationName = ``, _backColor = `#ccccff`) => {
|
|
3905
3885
|
const lblWarning = setWindowStyle(`<p>${_text}</p>`, _backColor, `#000066`, C_ALIGN_CENTER);
|
|
3906
3886
|
lblWarning.style.pointerEvents = C_DIS_NONE;
|
|
3907
3887
|
|
|
@@ -3912,7 +3892,7 @@ function makeInfoWindow(_text, _animationName = ``, _backColor = `#ccccff`) {
|
|
|
3912
3892
|
lblWarning.style.animationTimingFunction = `cubic-bezier(1.000, 0.000, 0.000, 1.000)`;
|
|
3913
3893
|
}
|
|
3914
3894
|
divRoot.appendChild(lblWarning);
|
|
3915
|
-
}
|
|
3895
|
+
};
|
|
3916
3896
|
|
|
3917
3897
|
/**
|
|
3918
3898
|
* 警告ウィンドウのスタイル設定
|
|
@@ -3921,7 +3901,7 @@ function makeInfoWindow(_text, _animationName = ``, _backColor = `#ccccff`) {
|
|
|
3921
3901
|
* @param {string} _textColor
|
|
3922
3902
|
* @param {string} _align
|
|
3923
3903
|
*/
|
|
3924
|
-
|
|
3904
|
+
const setWindowStyle = (_text, _bkColor, _textColor, _align = C_ALIGN_LEFT) => {
|
|
3925
3905
|
|
|
3926
3906
|
if (document.querySelector(`#lblWarning`) !== null) {
|
|
3927
3907
|
divRoot.removeChild(lblWarning);
|
|
@@ -3950,7 +3930,7 @@ function setWindowStyle(_text, _bkColor, _textColor, _align = C_ALIGN_LEFT) {
|
|
|
3950
3930
|
divRoot.removeChild(tmplbl);
|
|
3951
3931
|
|
|
3952
3932
|
return lbl;
|
|
3953
|
-
}
|
|
3933
|
+
};
|
|
3954
3934
|
|
|
3955
3935
|
|
|
3956
3936
|
/*-----------------------------------------------------------*/
|
|
@@ -4011,7 +3991,7 @@ const makePlayButton = _func => {
|
|
|
4011
3991
|
/**
|
|
4012
3992
|
* 設定・オプション画面初期化
|
|
4013
3993
|
*/
|
|
4014
|
-
|
|
3994
|
+
const optionInit = _ => {
|
|
4015
3995
|
|
|
4016
3996
|
clearWindow(true);
|
|
4017
3997
|
const divRoot = document.querySelector(`#divRoot`);
|
|
@@ -4037,13 +4017,13 @@ function optionInit() {
|
|
|
4037
4017
|
g_initialFlg = true;
|
|
4038
4018
|
|
|
4039
4019
|
g_skinJsObj.option.forEach(func => func());
|
|
4040
|
-
}
|
|
4020
|
+
};
|
|
4041
4021
|
|
|
4042
4022
|
/**
|
|
4043
4023
|
* 設定画面用スプライトリストの作成
|
|
4044
4024
|
* @param {array} _settingList (設定名、縦位置、縦位置差分、幅差分、高さ差分)を設定別にリスト化
|
|
4045
4025
|
*/
|
|
4046
|
-
|
|
4026
|
+
const setSpriteList = _settingList => {
|
|
4047
4027
|
const optionWidth = (g_sWidth - 450) / 2;
|
|
4048
4028
|
const spriteList = [];
|
|
4049
4029
|
_settingList.forEach(setting => {
|
|
@@ -4053,7 +4033,7 @@ function setSpriteList(_settingList) {
|
|
|
4053
4033
|
});
|
|
4054
4034
|
});
|
|
4055
4035
|
return spriteList;
|
|
4056
|
-
}
|
|
4036
|
+
};
|
|
4057
4037
|
|
|
4058
4038
|
/**
|
|
4059
4039
|
* 設定ウィンドウの作成
|
|
@@ -4074,13 +4054,13 @@ const inputSlider = (_slider, _link) => {
|
|
|
4074
4054
|
const value = parseInt(_slider.value);
|
|
4075
4055
|
_link.textContent = `${value}${g_lblNameObj.percent}`;
|
|
4076
4056
|
return value;
|
|
4077
|
-
}
|
|
4057
|
+
};
|
|
4078
4058
|
|
|
4079
4059
|
/**
|
|
4080
4060
|
* 設定・オプション画面のラベル・ボタン処理の描画
|
|
4081
4061
|
* @param {Object} _sprite 基準とするスプライト(ここで指定する座標は、そのスプライトからの相対位置)
|
|
4082
4062
|
*/
|
|
4083
|
-
|
|
4063
|
+
const createOptionWindow = _sprite => {
|
|
4084
4064
|
|
|
4085
4065
|
// 各ボタン用のスプライトを作成
|
|
4086
4066
|
const optionsprite = createOptionSprite(_sprite);
|
|
@@ -4267,6 +4247,34 @@ function createOptionWindow(_sprite) {
|
|
|
4267
4247
|
unitName: ` ${g_lblNameObj.multi}`,
|
|
4268
4248
|
});
|
|
4269
4249
|
|
|
4250
|
+
/**
|
|
4251
|
+
* 譜面明細子画面・グラフの作成
|
|
4252
|
+
* @param {string} _name
|
|
4253
|
+
* @param {boolean} _graphUseFlg
|
|
4254
|
+
*/
|
|
4255
|
+
const createScoreDetail = (_name, _graphUseFlg = true) => {
|
|
4256
|
+
const detailObj = createEmptySprite(scoreDetail, `detail${_name}`, { w: 420, h: 230, visibility: `hidden` });
|
|
4257
|
+
|
|
4258
|
+
if (_graphUseFlg) {
|
|
4259
|
+
const graphObj = document.createElement(`canvas`);
|
|
4260
|
+
const textBaseObj = document.querySelector(`#lnkDifficulty`);
|
|
4261
|
+
const bkColor = window.getComputedStyle(textBaseObj, ``).backgroundColor;
|
|
4262
|
+
|
|
4263
|
+
graphObj.id = `graph${_name}`;
|
|
4264
|
+
graphObj.width = C_LEN_GRAPH_WIDTH;
|
|
4265
|
+
graphObj.height = C_LEN_GRAPH_HEIGHT;
|
|
4266
|
+
graphObj.style.left = `125px`;
|
|
4267
|
+
graphObj.style.top = `0px`;
|
|
4268
|
+
graphObj.style.position = `absolute`;
|
|
4269
|
+
graphObj.style.background = bkColor;
|
|
4270
|
+
graphObj.style.border = `dotted 2px`;
|
|
4271
|
+
|
|
4272
|
+
detailObj.appendChild(graphObj);
|
|
4273
|
+
}
|
|
4274
|
+
|
|
4275
|
+
return detailObj;
|
|
4276
|
+
};
|
|
4277
|
+
|
|
4270
4278
|
if (g_headerObj.scoreDetailUse) {
|
|
4271
4279
|
spriteList.speed.appendChild(
|
|
4272
4280
|
createCss2Button(`btnGraph`, `i`, _ => true, {
|
|
@@ -4292,7 +4300,7 @@ function createOptionWindow(_sprite) {
|
|
|
4292
4300
|
setSetting(_val, `scoreDetail`);
|
|
4293
4301
|
viewScText();
|
|
4294
4302
|
$id(`detail${g_stateObj.scoreDetail}`).visibility = `visible`;
|
|
4295
|
-
}
|
|
4303
|
+
}
|
|
4296
4304
|
|
|
4297
4305
|
multiAppend(scoreDetail,
|
|
4298
4306
|
createScoreDetail(`Speed`),
|
|
@@ -4309,38 +4317,10 @@ function createOptionWindow(_sprite) {
|
|
|
4309
4317
|
viewScText();
|
|
4310
4318
|
}
|
|
4311
4319
|
|
|
4312
|
-
/**
|
|
4313
|
-
* 譜面明細子画面・グラフの作成
|
|
4314
|
-
* @param {string} _name
|
|
4315
|
-
* @param {boolean} _graphUseFlg
|
|
4316
|
-
*/
|
|
4317
|
-
function createScoreDetail(_name, _graphUseFlg = true) {
|
|
4318
|
-
const detailObj = createEmptySprite(scoreDetail, `detail${_name}`, { w: 420, h: 230, visibility: `hidden` });
|
|
4319
|
-
|
|
4320
|
-
if (_graphUseFlg) {
|
|
4321
|
-
const graphObj = document.createElement(`canvas`);
|
|
4322
|
-
const textBaseObj = document.querySelector(`#lnkDifficulty`);
|
|
4323
|
-
const bkColor = window.getComputedStyle(textBaseObj, ``).backgroundColor;
|
|
4324
|
-
|
|
4325
|
-
graphObj.id = `graph${_name}`;
|
|
4326
|
-
graphObj.width = C_LEN_GRAPH_WIDTH;
|
|
4327
|
-
graphObj.height = C_LEN_GRAPH_HEIGHT;
|
|
4328
|
-
graphObj.style.left = `125px`;
|
|
4329
|
-
graphObj.style.top = `0px`;
|
|
4330
|
-
graphObj.style.position = `absolute`;
|
|
4331
|
-
graphObj.style.background = bkColor;
|
|
4332
|
-
graphObj.style.border = `dotted 2px`;
|
|
4333
|
-
|
|
4334
|
-
detailObj.appendChild(graphObj);
|
|
4335
|
-
}
|
|
4336
|
-
|
|
4337
|
-
return detailObj;
|
|
4338
|
-
}
|
|
4339
|
-
|
|
4340
4320
|
/**
|
|
4341
4321
|
* 譜面明細表示/非表示ボタンの処理
|
|
4342
4322
|
*/
|
|
4343
|
-
|
|
4323
|
+
const setScoreDetail = _ => {
|
|
4344
4324
|
const scoreDetail = document.querySelector(`#scoreDetail`);
|
|
4345
4325
|
const detailObj = document.querySelector(`#detail${g_stateObj.scoreDetail}`);
|
|
4346
4326
|
const visibles = [`hidden`, `visible`];
|
|
@@ -4348,13 +4328,13 @@ function createOptionWindow(_sprite) {
|
|
|
4348
4328
|
g_stateObj.scoreDetailViewFlg = !g_stateObj.scoreDetailViewFlg;
|
|
4349
4329
|
scoreDetail.style.visibility = visibles[Number(g_stateObj.scoreDetailViewFlg)];
|
|
4350
4330
|
detailObj.style.visibility = visibles[Number(g_stateObj.scoreDetailViewFlg)];
|
|
4351
|
-
}
|
|
4331
|
+
};
|
|
4352
4332
|
|
|
4353
4333
|
/**
|
|
4354
4334
|
* 譜面基礎データの取得
|
|
4355
4335
|
* @param {number} _scoreId
|
|
4356
4336
|
*/
|
|
4357
|
-
|
|
4337
|
+
const getScoreBaseData = _scoreId => {
|
|
4358
4338
|
const arrowCnts = sumData(g_detailObj.arrowCnt[_scoreId]);
|
|
4359
4339
|
const frzCnts = sumData(g_detailObj.frzCnt[_scoreId]);
|
|
4360
4340
|
return {
|
|
@@ -4363,13 +4343,13 @@ function createOptionWindow(_sprite) {
|
|
|
4363
4343
|
apm: Math.round((arrowCnts + frzCnts) / (g_detailObj.playingFrame[_scoreId] / g_fps / 60)),
|
|
4364
4344
|
playingTime: transFrameToTimer(g_detailObj.playingFrame[_scoreId]),
|
|
4365
4345
|
};
|
|
4366
|
-
}
|
|
4346
|
+
};
|
|
4367
4347
|
|
|
4368
4348
|
/**
|
|
4369
4349
|
* 速度変化グラフの描画
|
|
4370
4350
|
* @param {number} _scoreId
|
|
4371
4351
|
*/
|
|
4372
|
-
|
|
4352
|
+
const drawSpeedGraph = _scoreId => {
|
|
4373
4353
|
const startFrame = g_detailObj.startFrame[_scoreId];
|
|
4374
4354
|
const playingFrame = g_detailObj.playingFrameWithBlank[_scoreId];
|
|
4375
4355
|
const speedObj = {
|
|
@@ -4426,13 +4406,13 @@ function createOptionWindow(_sprite) {
|
|
|
4426
4406
|
|
|
4427
4407
|
updateScoreDetailLabel(`Speed`, g_lblNameObj[`s_${speedType}`], speedObj[speedType].cnt, j);
|
|
4428
4408
|
});
|
|
4429
|
-
}
|
|
4409
|
+
};
|
|
4430
4410
|
|
|
4431
4411
|
/**
|
|
4432
4412
|
* 譜面密度グラフの描画
|
|
4433
4413
|
* @param {number} _scoreId
|
|
4434
4414
|
*/
|
|
4435
|
-
|
|
4415
|
+
const drawDensityGraph = _scoreId => {
|
|
4436
4416
|
|
|
4437
4417
|
const canvas = document.querySelector(`#graphDensity`);
|
|
4438
4418
|
const context = canvas.getContext(`2d`);
|
|
@@ -4468,7 +4448,7 @@ function createOptionWindow(_sprite) {
|
|
|
4468
4448
|
updateScoreDetailLabel(`Density`, g_lblNameObj.s_time, obj.playingTime, 1);
|
|
4469
4449
|
updateScoreDetailLabel(`Density`, g_lblNameObj.s_arrow, obj.arrowCnts, 3);
|
|
4470
4450
|
updateScoreDetailLabel(`Density`, g_lblNameObj.s_frz, obj.frzCnts, 4);
|
|
4471
|
-
}
|
|
4451
|
+
};
|
|
4472
4452
|
|
|
4473
4453
|
/**
|
|
4474
4454
|
* 譜面明細内の補足情報の登録・更新
|
|
@@ -4478,28 +4458,27 @@ function createOptionWindow(_sprite) {
|
|
|
4478
4458
|
* @param {number} _pos 表示位置
|
|
4479
4459
|
* @param {string} _labelname
|
|
4480
4460
|
*/
|
|
4481
|
-
|
|
4482
|
-
const baseLabel = (_bLabel, _bLabelname, _bAlign) =>
|
|
4461
|
+
const updateScoreDetailLabel = (_name, _label, _value, _pos = 0, _labelname = _label) => {
|
|
4462
|
+
const baseLabel = (_bLabel, _bLabelname, _bAlign) =>
|
|
4483
4463
|
document.querySelector(`#detail${_name}`).appendChild(
|
|
4484
4464
|
createDivCss2Label(`${_bLabel}`, `${_bLabelname}`, {
|
|
4485
4465
|
x: 10, y: 65 + _pos * 20, w: 100, h: 20, siz: C_SIZ_DIFSELECTOR, align: _bAlign,
|
|
4486
4466
|
})
|
|
4487
4467
|
);
|
|
4488
|
-
};
|
|
4489
4468
|
if (document.querySelector(`#data${_label}`) === null) {
|
|
4490
4469
|
baseLabel(`lbl${_label}`, `${_labelname}`, C_ALIGN_LEFT);
|
|
4491
4470
|
baseLabel(`data${_label}`, `${_value}`, C_ALIGN_RIGHT);
|
|
4492
4471
|
} else {
|
|
4493
4472
|
document.querySelector(`#data${_label}`).textContent = `${_value}`;
|
|
4494
4473
|
}
|
|
4495
|
-
}
|
|
4474
|
+
};
|
|
4496
4475
|
|
|
4497
4476
|
/**
|
|
4498
4477
|
* グラフの縦軸を描画
|
|
4499
4478
|
* @param {object} _context
|
|
4500
4479
|
* @param {number} _resolution
|
|
4501
4480
|
*/
|
|
4502
|
-
|
|
4481
|
+
const drawBaseLine = (_context, _resolution = 10) => {
|
|
4503
4482
|
_context.clearRect(0, 0, C_LEN_GRAPH_WIDTH, C_LEN_GRAPH_HEIGHT);
|
|
4504
4483
|
|
|
4505
4484
|
for (let j = 0; j <= 2 * _resolution; j += 5) {
|
|
@@ -4508,7 +4487,7 @@ function createOptionWindow(_sprite) {
|
|
|
4508
4487
|
drawLine(_context, (j + k) / _resolution, `sub`, 2);
|
|
4509
4488
|
}
|
|
4510
4489
|
}
|
|
4511
|
-
}
|
|
4490
|
+
};
|
|
4512
4491
|
|
|
4513
4492
|
/**
|
|
4514
4493
|
* グラフ上に目盛を表示
|
|
@@ -4517,7 +4496,7 @@ function createOptionWindow(_sprite) {
|
|
|
4517
4496
|
* @param {string} _lineType
|
|
4518
4497
|
* @param {number} _fixed
|
|
4519
4498
|
*/
|
|
4520
|
-
|
|
4499
|
+
const drawLine = (_context, _y, _lineType, _fixed = 0) => {
|
|
4521
4500
|
const lineY = (_y - 1) * -90 + 105;
|
|
4522
4501
|
_context.beginPath();
|
|
4523
4502
|
_context.moveTo(30, lineY);
|
|
@@ -4535,13 +4514,13 @@ function createOptionWindow(_sprite) {
|
|
|
4535
4514
|
_context.strokeStyle = `#646464`;
|
|
4536
4515
|
}
|
|
4537
4516
|
_context.stroke();
|
|
4538
|
-
}
|
|
4517
|
+
};
|
|
4539
4518
|
|
|
4540
4519
|
/**
|
|
4541
4520
|
* 譜面の難易度情報用ラベル作成
|
|
4542
4521
|
* @param {number} _scoreId
|
|
4543
4522
|
*/
|
|
4544
|
-
|
|
4523
|
+
const makeDifInfoLabels = _scoreId => {
|
|
4545
4524
|
|
|
4546
4525
|
// ツール難易度
|
|
4547
4526
|
const detailToolDif = document.querySelector(`#detailToolDif`);
|
|
@@ -4599,13 +4578,13 @@ function createOptionWindow(_sprite) {
|
|
|
4599
4578
|
}, g_cssObj.button_RevON),
|
|
4600
4579
|
);
|
|
4601
4580
|
createScText(lnkDifInfo, `DifInfo`, { targetLabel: `lnkDifInfo`, x: -10 });
|
|
4602
|
-
}
|
|
4581
|
+
};
|
|
4603
4582
|
|
|
4604
4583
|
/**
|
|
4605
4584
|
* 譜面の難易度情報更新
|
|
4606
4585
|
* @param {number} _scoreId
|
|
4607
4586
|
*/
|
|
4608
|
-
|
|
4587
|
+
const makeDifInfo = _scoreId => {
|
|
4609
4588
|
|
|
4610
4589
|
const arrowCnts = sumData(g_detailObj.arrowCnt[_scoreId]);
|
|
4611
4590
|
const frzCnts = sumData(g_detailObj.frzCnt[_scoreId]);
|
|
@@ -4622,7 +4601,7 @@ function createOptionWindow(_sprite) {
|
|
|
4622
4601
|
dataArrowInfo2.innerHTML = `<br>(${g_detailObj.arrowCnt[_scoreId]})<br><br>
|
|
4623
4602
|
(${g_detailObj.frzCnt[_scoreId]})<br><br>
|
|
4624
4603
|
${push3CntStr}`.split(`,`).join(`/`);
|
|
4625
|
-
}
|
|
4604
|
+
};
|
|
4626
4605
|
|
|
4627
4606
|
// ---------------------------------------------------
|
|
4628
4607
|
// 速度モーション (Motion)
|
|
@@ -4658,17 +4637,17 @@ function createOptionWindow(_sprite) {
|
|
|
4658
4637
|
spriteList.scroll.style.pointerEvents = C_DIS_NONE;
|
|
4659
4638
|
}
|
|
4660
4639
|
|
|
4661
|
-
|
|
4640
|
+
const setReverse = _btn => {
|
|
4662
4641
|
g_settings.reverseNum = (g_settings.reverseNum + 1) % 2;
|
|
4663
4642
|
g_stateObj.reverse = g_settings.reverses[g_settings.reverseNum];
|
|
4664
4643
|
setReverseView(_btn);
|
|
4665
|
-
}
|
|
4644
|
+
};
|
|
4666
4645
|
|
|
4667
|
-
|
|
4646
|
+
const setReverseView = _btn => {
|
|
4668
4647
|
_btn.classList.replace(g_cssObj[`button_Rev${g_settings.reverses[(g_settings.reverseNum + 1) % 2]}`],
|
|
4669
4648
|
g_cssObj[`button_Rev${g_settings.reverses[g_settings.reverseNum]}`]);
|
|
4670
4649
|
_btn.textContent = `${g_lblNameObj.Reverse}:${getStgDetailName(g_stateObj.reverse)}`;
|
|
4671
|
-
}
|
|
4650
|
+
};
|
|
4672
4651
|
|
|
4673
4652
|
// ---------------------------------------------------
|
|
4674
4653
|
// ミラー・ランダム (Shuffle)
|
|
@@ -4693,23 +4672,11 @@ function createOptionWindow(_sprite) {
|
|
|
4693
4672
|
})
|
|
4694
4673
|
);
|
|
4695
4674
|
|
|
4696
|
-
if (g_headerObj.gaugeUse) {
|
|
4697
|
-
multiAppend(spriteList.gauge,
|
|
4698
|
-
makeSettingLblCssButton(`lnkGauge`, ``, 0, _ => setGauge(1), { cxtFunc: _ => setGauge(-1) }),
|
|
4699
|
-
makeMiniCssButton(`lnkGauge`, `R`, 0, _ => setGauge(1)),
|
|
4700
|
-
makeMiniCssButton(`lnkGauge`, `L`, 0, _ => setGauge(-1)),
|
|
4701
|
-
);
|
|
4702
|
-
createScText(spriteList.gauge, `Gauge`);
|
|
4703
|
-
} else {
|
|
4704
|
-
lblGauge.classList.add(g_cssObj.settings_Disabled);
|
|
4705
|
-
spriteList.gauge.appendChild(makeDisabledLabel(`lnkGauge`, 0, getStgDetailName(g_stateObj.gauge)));
|
|
4706
|
-
}
|
|
4707
|
-
|
|
4708
4675
|
/**
|
|
4709
4676
|
* ゲージ設定メイン
|
|
4710
4677
|
* @param {number} _scrollNum
|
|
4711
4678
|
*/
|
|
4712
|
-
|
|
4679
|
+
const setGauge = _scrollNum => {
|
|
4713
4680
|
|
|
4714
4681
|
// カーソルを動かさない場合は先にゲージ設定をリロード
|
|
4715
4682
|
if (_scrollNum === 0) {
|
|
@@ -4723,13 +4690,13 @@ function createOptionWindow(_sprite) {
|
|
|
4723
4690
|
}
|
|
4724
4691
|
lblGauge2.innerHTML = gaugeFormat(g_stateObj.lifeMode,
|
|
4725
4692
|
g_stateObj.lifeBorder, g_stateObj.lifeRcv, g_stateObj.lifeDmg, g_stateObj.lifeInit, g_stateObj.lifeVariable);
|
|
4726
|
-
}
|
|
4693
|
+
};
|
|
4727
4694
|
|
|
4728
4695
|
/**
|
|
4729
4696
|
* ゲージ設定の切替処理
|
|
4730
4697
|
* @param {number} _gaugeNum
|
|
4731
4698
|
*/
|
|
4732
|
-
|
|
4699
|
+
const gaugeChange = _gaugeNum => {
|
|
4733
4700
|
const tmpScoreId = g_stateObj.scoreId;
|
|
4734
4701
|
|
|
4735
4702
|
/**
|
|
@@ -4810,12 +4777,12 @@ function createOptionWindow(_sprite) {
|
|
|
4810
4777
|
}
|
|
4811
4778
|
setLifeCategory(tmpGaugeObj);
|
|
4812
4779
|
}
|
|
4813
|
-
}
|
|
4780
|
+
};
|
|
4814
4781
|
|
|
4815
4782
|
/**
|
|
4816
4783
|
* ゲージ設定の詳細表示を整形
|
|
4817
4784
|
*/
|
|
4818
|
-
|
|
4785
|
+
const gaugeFormat = (_mode, _border, _rcv, _dmg, _init, _lifeValFlg) => {
|
|
4819
4786
|
const initVal = g_headerObj.maxLifeVal * _init / 100;
|
|
4820
4787
|
const borderVal = (_mode === C_LFE_BORDER && _border !== 0 ?
|
|
4821
4788
|
Math.round(g_headerObj.maxLifeVal * _border / 100) : `-`);
|
|
@@ -4862,6 +4829,18 @@ function createOptionWindow(_sprite) {
|
|
|
4862
4829
|
</div>
|
|
4863
4830
|
</div>
|
|
4864
4831
|
`;
|
|
4832
|
+
};
|
|
4833
|
+
|
|
4834
|
+
if (g_headerObj.gaugeUse) {
|
|
4835
|
+
multiAppend(spriteList.gauge,
|
|
4836
|
+
makeSettingLblCssButton(`lnkGauge`, ``, 0, _ => setGauge(1), { cxtFunc: _ => setGauge(-1) }),
|
|
4837
|
+
makeMiniCssButton(`lnkGauge`, `R`, 0, _ => setGauge(1)),
|
|
4838
|
+
makeMiniCssButton(`lnkGauge`, `L`, 0, _ => setGauge(-1)),
|
|
4839
|
+
);
|
|
4840
|
+
createScText(spriteList.gauge, `Gauge`);
|
|
4841
|
+
} else {
|
|
4842
|
+
lblGauge.classList.add(g_cssObj.settings_Disabled);
|
|
4843
|
+
spriteList.gauge.appendChild(makeDisabledLabel(`lnkGauge`, 0, getStgDetailName(g_stateObj.gauge)));
|
|
4865
4844
|
}
|
|
4866
4845
|
|
|
4867
4846
|
// ---------------------------------------------------
|
|
@@ -4919,7 +4898,7 @@ function createOptionWindow(_sprite) {
|
|
|
4919
4898
|
* - [キーコン]->[初期化]->[名称設定]の順に配置する。
|
|
4920
4899
|
* 初期化処理にてキー数関連の設定を行っているため、この順序で無いとデータが正しく格納されない
|
|
4921
4900
|
*/
|
|
4922
|
-
|
|
4901
|
+
const setDifficulty = (_initFlg) => {
|
|
4923
4902
|
|
|
4924
4903
|
const getCurrentNo = (_list, _target) => roundZero(_list.findIndex(item => item === _target));
|
|
4925
4904
|
|
|
@@ -5073,12 +5052,12 @@ function createOptionWindow(_sprite) {
|
|
|
5073
5052
|
// ---------------------------------------------------
|
|
5074
5053
|
// 4. 譜面初期情報ロード許可フラグの設定
|
|
5075
5054
|
g_canLoadDifInfoFlg = true;
|
|
5076
|
-
}
|
|
5055
|
+
};
|
|
5077
5056
|
|
|
5078
5057
|
// 設定画面の一通りのオブジェクトを作成後に譜面・速度・ゲージ設定をまとめて行う
|
|
5079
5058
|
setDifficulty(false);
|
|
5080
5059
|
optionsprite.oncontextmenu = _ => false;
|
|
5081
|
-
}
|
|
5060
|
+
};
|
|
5082
5061
|
|
|
5083
5062
|
/**
|
|
5084
5063
|
* 汎用設定
|
|
@@ -5086,9 +5065,9 @@ function createOptionWindow(_sprite) {
|
|
|
5086
5065
|
* @param {string} _settingName
|
|
5087
5066
|
* @param {object} _options
|
|
5088
5067
|
*/
|
|
5089
|
-
|
|
5068
|
+
const createGeneralSetting = (_obj, _settingName, { unitName = ``,
|
|
5090
5069
|
skipTerms = [...Array(3)].fill(1), hiddenBtn = false, addRFunc = _ => { }, addLFunc = _ => { },
|
|
5091
|
-
settingLabel = _settingName, displayName = `option`, scLabel = ``, roundNum = 0 } = {}) {
|
|
5070
|
+
settingLabel = _settingName, displayName = `option`, scLabel = ``, roundNum = 0 } = {}) => {
|
|
5092
5071
|
|
|
5093
5072
|
const settingUpper = toCapitalize(_settingName);
|
|
5094
5073
|
const linkId = `lnk${settingUpper}`;
|
|
@@ -5151,7 +5130,7 @@ function createGeneralSetting(_obj, _settingName, { unitName = ``,
|
|
|
5151
5130
|
document.querySelector(`#lbl${settingUpper}`).classList.add(g_cssObj.settings_Disabled);
|
|
5152
5131
|
_obj.appendChild(makeDisabledLabel(linkId, 0, initName));
|
|
5153
5132
|
}
|
|
5154
|
-
}
|
|
5133
|
+
};
|
|
5155
5134
|
|
|
5156
5135
|
/**
|
|
5157
5136
|
* 設定画面用ラベルの作成
|
|
@@ -5159,22 +5138,22 @@ function createGeneralSetting(_obj, _settingName, { unitName = ``,
|
|
|
5159
5138
|
* @param {number} _adjY
|
|
5160
5139
|
* @param {string} _settingLabel
|
|
5161
5140
|
*/
|
|
5162
|
-
|
|
5141
|
+
const createLblSetting = (_settingName, _adjY = 0, _settingLabel = _settingName) => {
|
|
5163
5142
|
const lbl = createDivCss2Label(`lbl${_settingName}`, g_lblNameObj[_settingLabel], {
|
|
5164
5143
|
x: 0, y: _adjY, w: 100,
|
|
5165
5144
|
}, `settings_${_settingName}`);
|
|
5166
5145
|
lbl.title = g_msgObj[`${_settingName.charAt(0).toLowerCase()}${_settingName.slice(1)}`];
|
|
5167
5146
|
return lbl;
|
|
5168
|
-
}
|
|
5147
|
+
};
|
|
5169
5148
|
|
|
5170
5149
|
/**
|
|
5171
5150
|
* 設定名の置き換え処理
|
|
5172
5151
|
* @param {string} _name
|
|
5173
5152
|
*/
|
|
5174
|
-
|
|
5153
|
+
const getStgDetailName = _name => {
|
|
5175
5154
|
return g_lblNameObj[`u_${_name}`] !== undefined &&
|
|
5176
5155
|
(g_presetObj.lblRenames === undefined || g_presetObj.lblRenames[g_currentPage]) ? g_lblNameObj[`u_${_name}`] : _name;
|
|
5177
|
-
}
|
|
5156
|
+
};
|
|
5178
5157
|
|
|
5179
5158
|
/**
|
|
5180
5159
|
* 設定メイン・汎用
|
|
@@ -5183,7 +5162,7 @@ function getStgDetailName(_name) {
|
|
|
5183
5162
|
* @param {string} _unitName
|
|
5184
5163
|
* @param {number} _roundNum
|
|
5185
5164
|
*/
|
|
5186
|
-
|
|
5165
|
+
const setSetting = (_scrollNum, _settingName, _unitName = ``, _roundNum = 0) => {
|
|
5187
5166
|
let settingNum = g_settings[`${_settingName}Num`];
|
|
5188
5167
|
const settingList = g_settings[`${_settingName}s`];
|
|
5189
5168
|
const settingMax = settingList.length - 1;
|
|
@@ -5206,7 +5185,7 @@ function setSetting(_scrollNum, _settingName, _unitName = ``, _roundNum = 0) {
|
|
|
5206
5185
|
g_settings[`${_settingName}Num`] = settingNum;
|
|
5207
5186
|
document.querySelector(`#lnk${toCapitalize(_settingName)}`).textContent =
|
|
5208
5187
|
`${getStgDetailName(g_stateObj[_settingName])}${_unitName}${g_localStorage[_settingName] === g_stateObj[_settingName] ? ' *' : ''}`;
|
|
5209
|
-
}
|
|
5188
|
+
};
|
|
5210
5189
|
|
|
5211
5190
|
/**
|
|
5212
5191
|
* 無効化用ラベル作成
|
|
@@ -5214,18 +5193,18 @@ function setSetting(_scrollNum, _settingName, _unitName = ``, _roundNum = 0) {
|
|
|
5214
5193
|
* @param {number} _heightPos
|
|
5215
5194
|
* @param {string} _defaultStr
|
|
5216
5195
|
*/
|
|
5217
|
-
|
|
5196
|
+
const makeDisabledLabel = (_id, _heightPos, _defaultStr) => {
|
|
5218
5197
|
return createDivCss2Label(_id, _defaultStr, {
|
|
5219
5198
|
x: C_LEN_SETLBL_LEFT, y: C_LEN_SETLBL_HEIGHT * _heightPos,
|
|
5220
5199
|
}, g_cssObj.settings_Disabled);
|
|
5221
|
-
}
|
|
5200
|
+
};
|
|
5222
5201
|
|
|
5223
5202
|
/**
|
|
5224
5203
|
* 保存済みリバース取得処理
|
|
5225
5204
|
* @param {object} _localStorage 保存先のローカルストレージ名
|
|
5226
5205
|
* @param {string} _extraKeyName 特殊キー名(通常キーは省略)
|
|
5227
5206
|
*/
|
|
5228
|
-
|
|
5207
|
+
const getKeyReverse = (_localStorage, _extraKeyName = ``) => {
|
|
5229
5208
|
if (_localStorage[`reverse${_extraKeyName}`] !== undefined) {
|
|
5230
5209
|
g_stateObj.reverse = _localStorage[`reverse${_extraKeyName}`] ?? C_FLG_OFF;
|
|
5231
5210
|
g_settings.reverseNum = roundZero(g_settings.reverses.findIndex(reverse => reverse === g_stateObj.reverse));
|
|
@@ -5233,14 +5212,14 @@ function getKeyReverse(_localStorage, _extraKeyName = ``) {
|
|
|
5233
5212
|
g_stateObj.reverse = C_FLG_OFF;
|
|
5234
5213
|
g_settings.reverseNum = 0;
|
|
5235
5214
|
}
|
|
5236
|
-
}
|
|
5215
|
+
};
|
|
5237
5216
|
|
|
5238
5217
|
/**
|
|
5239
5218
|
* 保存済みキーコンフィグ取得処理
|
|
5240
5219
|
* @param {object} _localStorage 保存先のローカルストレージ名
|
|
5241
5220
|
* @param {string} _extraKeyName 特殊キー名(通常キーは省略)
|
|
5242
5221
|
*/
|
|
5243
|
-
|
|
5222
|
+
const getKeyCtrl = (_localStorage, _extraKeyName = ``) => {
|
|
5244
5223
|
const baseKeyCtrlPtn = _localStorage[`keyCtrlPtn${_extraKeyName}`];
|
|
5245
5224
|
const basePtn = `${g_keyObj.currentKey}_${baseKeyCtrlPtn}`;
|
|
5246
5225
|
const baseKeyNum = g_keyObj[`chara${basePtn}`].length;
|
|
@@ -5280,7 +5259,7 @@ function getKeyCtrl(_localStorage, _extraKeyName = ``) {
|
|
|
5280
5259
|
}
|
|
5281
5260
|
});
|
|
5282
5261
|
}
|
|
5283
|
-
}
|
|
5262
|
+
};
|
|
5284
5263
|
|
|
5285
5264
|
/**
|
|
5286
5265
|
* 設定・オプション表示用ボタン
|
|
@@ -5291,7 +5270,7 @@ function getKeyCtrl(_localStorage, _extraKeyName = ``) {
|
|
|
5291
5270
|
* @param {object} objectList 座標設定(既定を上書き)
|
|
5292
5271
|
* @param {...any} _classes 追加するクラス
|
|
5293
5272
|
*/
|
|
5294
|
-
|
|
5273
|
+
const makeSettingLblCssButton = (_id, _name, _heightPos, _func, { x, y, w, h, siz, cxtFunc = _ => true, ...rest } = {}, ..._classes) => {
|
|
5295
5274
|
const tmpObj = {
|
|
5296
5275
|
x: x !== undefined ? x : C_LEN_SETLBL_LEFT,
|
|
5297
5276
|
y: y !== undefined ? y : C_LEN_SETLBL_HEIGHT * _heightPos,
|
|
@@ -5301,7 +5280,7 @@ function makeSettingLblCssButton(_id, _name, _heightPos, _func, { x, y, w, h, si
|
|
|
5301
5280
|
cxtFunc: cxtFunc !== undefined ? cxtFunc : _ => true,
|
|
5302
5281
|
};
|
|
5303
5282
|
return createCss2Button(_id, _name, _func, { ...tmpObj, ...rest }, g_cssObj.button_Default, ..._classes);
|
|
5304
|
-
}
|
|
5283
|
+
};
|
|
5305
5284
|
|
|
5306
5285
|
/**
|
|
5307
5286
|
* 譜面変更セレクター用ボタン
|
|
@@ -5310,14 +5289,14 @@ function makeSettingLblCssButton(_id, _name, _heightPos, _func, { x, y, w, h, si
|
|
|
5310
5289
|
* @param {number} _heightPos 上からの配置順
|
|
5311
5290
|
* @param {function} _func
|
|
5312
5291
|
*/
|
|
5313
|
-
|
|
5292
|
+
const makeDifLblCssButton = (_id, _name, _heightPos, _func, { x = 0, w = C_LEN_DIFSELECTOR_WIDTH, btnStyle = `Default` } = {}) => {
|
|
5314
5293
|
return createCss2Button(_id, _name, _func, {
|
|
5315
5294
|
x: x, y: C_LEN_SETLBL_HEIGHT * _heightPos,
|
|
5316
5295
|
w: w, h: C_LEN_SETLBL_HEIGHT,
|
|
5317
5296
|
siz: C_SIZ_DIFSELECTOR,
|
|
5318
5297
|
borderStyle: `solid`,
|
|
5319
5298
|
}, g_cssObj[`button_${btnStyle}`], g_cssObj.button_ON);
|
|
5320
|
-
}
|
|
5299
|
+
};
|
|
5321
5300
|
|
|
5322
5301
|
/**
|
|
5323
5302
|
* 設定・オプション用の設定変更ミニボタン
|
|
@@ -5326,20 +5305,20 @@ function makeDifLblCssButton(_id, _name, _heightPos, _func, { x = 0, w = C_LEN_D
|
|
|
5326
5305
|
* @param {number} _heightPos 上からの配置順
|
|
5327
5306
|
* @param {function} _func
|
|
5328
5307
|
*/
|
|
5329
|
-
|
|
5308
|
+
const makeMiniCssButton = (_id, _directionFlg, _heightPos, _func, { dx = 0, dy = 0, dw = 0, dh = 0, dsiz = 0, visibility = `visible` } = {}) => {
|
|
5330
5309
|
return createCss2Button(`${_id}${_directionFlg}`, g_settingBtnObj.chara[_directionFlg], _func, {
|
|
5331
5310
|
x: g_settingBtnObj.pos[_directionFlg] + dx,
|
|
5332
5311
|
y: C_LEN_SETLBL_HEIGHT * _heightPos + dy,
|
|
5333
5312
|
w: C_LEN_SETMINI_WIDTH + dw, h: C_LEN_SETLBL_HEIGHT + dh, siz: C_SIZ_SETLBL + dsiz,
|
|
5334
5313
|
visibility: visibility
|
|
5335
5314
|
}, g_cssObj.button_Mini);
|
|
5336
|
-
}
|
|
5315
|
+
};
|
|
5337
5316
|
|
|
5338
5317
|
/*-----------------------------------------------------------*/
|
|
5339
5318
|
/* Scene : SETTINGS-DISPLAY [lemon] */
|
|
5340
5319
|
/*-----------------------------------------------------------*/
|
|
5341
5320
|
|
|
5342
|
-
|
|
5321
|
+
const settingsDisplayInit = _ => {
|
|
5343
5322
|
|
|
5344
5323
|
clearWindow(true);
|
|
5345
5324
|
const divRoot = document.querySelector(`#divRoot`);
|
|
@@ -5374,13 +5353,65 @@ function settingsDisplayInit() {
|
|
|
5374
5353
|
document.oncontextmenu = _ => true;
|
|
5375
5354
|
|
|
5376
5355
|
g_skinJsObj.settingsDisplay.forEach(func => func());
|
|
5377
|
-
}
|
|
5356
|
+
};
|
|
5378
5357
|
|
|
5379
5358
|
/**
|
|
5380
5359
|
* 設定・オプション画面のラベル・ボタン処理の描画
|
|
5381
5360
|
* @param {Object} _sprite 基準とするスプライト(ここで指定する座標は、そのスプライトからの相対位置)
|
|
5382
5361
|
*/
|
|
5383
|
-
|
|
5362
|
+
const createSettingsDisplayWindow = _sprite => {
|
|
5363
|
+
|
|
5364
|
+
/**
|
|
5365
|
+
* Display表示/非表示ボタン
|
|
5366
|
+
* @param {*} _name
|
|
5367
|
+
* @param {*} _heightPos 縦位置
|
|
5368
|
+
* @param {*} _widthPos 横位置
|
|
5369
|
+
*/
|
|
5370
|
+
const makeDisplayButton = (_name, _heightPos, _widthPos) => {
|
|
5371
|
+
|
|
5372
|
+
const flg = g_stateObj[`d_${_name.toLowerCase()}`];
|
|
5373
|
+
const list = [C_FLG_OFF, C_FLG_ON];
|
|
5374
|
+
const linkId = `lnk${_name}`;
|
|
5375
|
+
|
|
5376
|
+
/**
|
|
5377
|
+
* 無効化用ラベル作成
|
|
5378
|
+
* @param {string} _id
|
|
5379
|
+
* @param {number} _heightPos
|
|
5380
|
+
* @param {number} _widthPos
|
|
5381
|
+
* @param {string} _defaultStr
|
|
5382
|
+
* @param {string} _flg
|
|
5383
|
+
*/
|
|
5384
|
+
const makeDisabledDisplayLabel = (_id, _heightPos, _widthPos, _defaultStr, _flg) => {
|
|
5385
|
+
return createDivCss2Label(_id, _defaultStr, {
|
|
5386
|
+
x: 30 + 180 * _widthPos, y: 3 + C_LEN_SETLBL_HEIGHT * _heightPos,
|
|
5387
|
+
w: 170, siz: C_SIZ_DIFSELECTOR,
|
|
5388
|
+
}, g_cssObj[`button_Disabled${flg}`]);
|
|
5389
|
+
};
|
|
5390
|
+
|
|
5391
|
+
if (g_headerObj[`${_name}Use`]) {
|
|
5392
|
+
const switchDisplay = evt => {
|
|
5393
|
+
const displayFlg = g_stateObj[`d_${_name.toLowerCase()}`];
|
|
5394
|
+
const displayNum = list.findIndex(flg => flg === displayFlg);
|
|
5395
|
+
const nextDisplayFlg = list[(displayNum + 1) % list.length];
|
|
5396
|
+
g_stateObj[`d_${_name.toLowerCase()}`] = nextDisplayFlg;
|
|
5397
|
+
evt.target.classList.replace(g_cssObj[`button_${displayFlg}`], g_cssObj[`button_${nextDisplayFlg}`]);
|
|
5398
|
+
|
|
5399
|
+
interlockingButton(g_headerObj, _name, nextDisplayFlg, displayFlg, true);
|
|
5400
|
+
}
|
|
5401
|
+
displaySprite.appendChild(
|
|
5402
|
+
makeSettingLblCssButton(linkId, g_lblNameObj[`d_${toCapitalize(_name)}`], _heightPos, evt => switchDisplay(evt), {
|
|
5403
|
+
x: 30 + 180 * _widthPos, w: 170,
|
|
5404
|
+
title: g_msgObj[`d_${_name.toLowerCase()}`], borderStyle: `solid`,
|
|
5405
|
+
cxtFunc: evt => switchDisplay(evt),
|
|
5406
|
+
}, `button_${flg}`)
|
|
5407
|
+
);
|
|
5408
|
+
createScText(document.getElementById(linkId), `${toCapitalize(_name)}`,
|
|
5409
|
+
{ displayName: g_currentPage, targetLabel: linkId, x: -5 });
|
|
5410
|
+
} else {
|
|
5411
|
+
displaySprite.appendChild(makeDisabledDisplayLabel(linkId, _heightPos, _widthPos,
|
|
5412
|
+
g_lblNameObj[`d_${toCapitalize(_name)}`] + `:${g_headerObj[`${_name}Set`]}`, g_headerObj[`${_name}Set`]));
|
|
5413
|
+
}
|
|
5414
|
+
};
|
|
5384
5415
|
|
|
5385
5416
|
// 各ボタン用のスプライトを作成
|
|
5386
5417
|
createOptionSprite(_sprite);
|
|
@@ -5434,7 +5465,7 @@ function createSettingsDisplayWindow(_sprite) {
|
|
|
5434
5465
|
|
|
5435
5466
|
_btn.classList.replace(g_cssObj[`button_Rev${prevLock}`],
|
|
5436
5467
|
g_cssObj[`button_Rev${g_stateObj.filterLock}`]);
|
|
5437
|
-
}
|
|
5468
|
+
};
|
|
5438
5469
|
|
|
5439
5470
|
const appearanceSlider = document.querySelector(`#appearanceSlider`);
|
|
5440
5471
|
appearanceSlider.addEventListener(`input`, _ =>
|
|
@@ -5452,59 +5483,7 @@ function createSettingsDisplayWindow(_sprite) {
|
|
|
5452
5483
|
// 判定表示系の不透明度 (Opacity)
|
|
5453
5484
|
// 縦位置: 9
|
|
5454
5485
|
createGeneralSetting(spriteList.opacity, `opacity`, { unitName: g_lblNameObj.percent, displayName: g_currentPage });
|
|
5455
|
-
|
|
5456
|
-
/**
|
|
5457
|
-
* Display表示/非表示ボタン
|
|
5458
|
-
* @param {*} _name
|
|
5459
|
-
* @param {*} _heightPos 縦位置
|
|
5460
|
-
* @param {*} _widthPos 横位置
|
|
5461
|
-
*/
|
|
5462
|
-
function makeDisplayButton(_name, _heightPos, _widthPos) {
|
|
5463
|
-
|
|
5464
|
-
const flg = g_stateObj[`d_${_name.toLowerCase()}`];
|
|
5465
|
-
const list = [C_FLG_OFF, C_FLG_ON];
|
|
5466
|
-
const linkId = `lnk${_name}`;
|
|
5467
|
-
|
|
5468
|
-
if (g_headerObj[`${_name}Use`]) {
|
|
5469
|
-
const switchDisplay = evt => {
|
|
5470
|
-
const displayFlg = g_stateObj[`d_${_name.toLowerCase()}`];
|
|
5471
|
-
const displayNum = list.findIndex(flg => flg === displayFlg);
|
|
5472
|
-
const nextDisplayFlg = list[(displayNum + 1) % list.length];
|
|
5473
|
-
g_stateObj[`d_${_name.toLowerCase()}`] = nextDisplayFlg;
|
|
5474
|
-
evt.target.classList.replace(g_cssObj[`button_${displayFlg}`], g_cssObj[`button_${nextDisplayFlg}`]);
|
|
5475
|
-
|
|
5476
|
-
interlockingButton(g_headerObj, _name, nextDisplayFlg, displayFlg, true);
|
|
5477
|
-
};
|
|
5478
|
-
displaySprite.appendChild(
|
|
5479
|
-
makeSettingLblCssButton(linkId, g_lblNameObj[`d_${toCapitalize(_name)}`], _heightPos, evt => switchDisplay(evt), {
|
|
5480
|
-
x: 30 + 180 * _widthPos, w: 170,
|
|
5481
|
-
title: g_msgObj[`d_${_name.toLowerCase()}`], borderStyle: `solid`,
|
|
5482
|
-
cxtFunc: evt => switchDisplay(evt),
|
|
5483
|
-
}, `button_${flg}`)
|
|
5484
|
-
);
|
|
5485
|
-
createScText(document.getElementById(linkId), `${toCapitalize(_name)}`,
|
|
5486
|
-
{ displayName: g_currentPage, targetLabel: linkId, x: -5 });
|
|
5487
|
-
} else {
|
|
5488
|
-
displaySprite.appendChild(makeDisabledDisplayLabel(linkId, _heightPos, _widthPos,
|
|
5489
|
-
g_lblNameObj[`d_${toCapitalize(_name)}`] + `:${g_headerObj[`${_name}Set`]}`, g_headerObj[`${_name}Set`]));
|
|
5490
|
-
}
|
|
5491
|
-
|
|
5492
|
-
/**
|
|
5493
|
-
* 無効化用ラベル作成
|
|
5494
|
-
* @param {string} _id
|
|
5495
|
-
* @param {number} _heightPos
|
|
5496
|
-
* @param {number} _widthPos
|
|
5497
|
-
* @param {string} _defaultStr
|
|
5498
|
-
* @param {string} _flg
|
|
5499
|
-
*/
|
|
5500
|
-
function makeDisabledDisplayLabel(_id, _heightPos, _widthPos, _defaultStr, _flg) {
|
|
5501
|
-
return createDivCss2Label(_id, _defaultStr, {
|
|
5502
|
-
x: 30 + 180 * _widthPos, y: 3 + C_LEN_SETLBL_HEIGHT * _heightPos,
|
|
5503
|
-
w: 170, siz: C_SIZ_DIFSELECTOR,
|
|
5504
|
-
}, g_cssObj[`button_Disabled${flg}`]);
|
|
5505
|
-
}
|
|
5506
|
-
}
|
|
5507
|
-
}
|
|
5486
|
+
};
|
|
5508
5487
|
|
|
5509
5488
|
/**
|
|
5510
5489
|
* Displayボタンを切り替えたときに連動して切り替えるボタンの設定
|
|
@@ -5514,7 +5493,7 @@ function createSettingsDisplayWindow(_sprite) {
|
|
|
5514
5493
|
* @param {string} _next 変更先
|
|
5515
5494
|
* @param {boolean} _buttonFlg ボタンフラグ (false: 初期, true: ボタン)
|
|
5516
5495
|
*/
|
|
5517
|
-
|
|
5496
|
+
const interlockingButton = (_headerObj, _name, _current, _next, _buttonFlg = false) => {
|
|
5518
5497
|
let includeDefaults = [];
|
|
5519
5498
|
if (g_stateObj[`d_${_name.toLowerCase()}`] === C_FLG_OFF) {
|
|
5520
5499
|
g_displays.forEach(option => {
|
|
@@ -5546,7 +5525,7 @@ function interlockingButton(_headerObj, _name, _current, _next, _buttonFlg = fal
|
|
|
5546
5525
|
}
|
|
5547
5526
|
});
|
|
5548
5527
|
}
|
|
5549
|
-
}
|
|
5528
|
+
};
|
|
5550
5529
|
|
|
5551
5530
|
/*-----------------------------------------------------------*/
|
|
5552
5531
|
/* Scene : KEYCONFIG [orange] */
|
|
@@ -5555,7 +5534,7 @@ function interlockingButton(_headerObj, _name, _current, _next, _buttonFlg = fal
|
|
|
5555
5534
|
/**
|
|
5556
5535
|
* キーコンフィグ画面初期化
|
|
5557
5536
|
*/
|
|
5558
|
-
|
|
5537
|
+
const keyConfigInit = (_kcType = g_kcType) => {
|
|
5559
5538
|
|
|
5560
5539
|
clearWindow(true);
|
|
5561
5540
|
const divRoot = document.querySelector(`#divRoot`);
|
|
@@ -5619,10 +5598,10 @@ function keyConfigInit(_kcType = g_kcType) {
|
|
|
5619
5598
|
!g_autoPlaysBase.includes(g_stateObj.autoPlay)) {
|
|
5620
5599
|
if (g_keyObj[`assistPos${keyCtrlPtn}`][g_stateObj.autoPlay][_j] === 1) {
|
|
5621
5600
|
arrowColor = g_headerObj.setDummyColor[_colorPos];
|
|
5622
|
-
}
|
|
5601
|
+
}
|
|
5623
5602
|
}
|
|
5624
5603
|
return arrowColor;
|
|
5625
|
-
}
|
|
5604
|
+
};
|
|
5626
5605
|
|
|
5627
5606
|
/**
|
|
5628
5607
|
* 対象割り当てキーの色変更
|
|
@@ -5779,7 +5758,7 @@ function keyConfigInit(_kcType = g_kcType) {
|
|
|
5779
5758
|
}
|
|
5780
5759
|
}
|
|
5781
5760
|
},
|
|
5782
|
-
}
|
|
5761
|
+
};
|
|
5783
5762
|
|
|
5784
5763
|
/**
|
|
5785
5764
|
* カラー・シャッフルグループ設定の表示
|
|
@@ -5793,7 +5772,7 @@ function keyConfigInit(_kcType = g_kcType) {
|
|
|
5793
5772
|
}
|
|
5794
5773
|
viewGroupObj[_type](`_${g_keycons[`${_type}GroupNum`]}`);
|
|
5795
5774
|
}
|
|
5796
|
-
}
|
|
5775
|
+
};
|
|
5797
5776
|
const setGroup = (_type, _scrollNum = 1) => {
|
|
5798
5777
|
const tmpNum = g_keycons[`${_type}GroupNum`] + _scrollNum;
|
|
5799
5778
|
if (g_keyObj[`${_type}${keyCtrlPtn}_${tmpNum}`] !== undefined) {
|
|
@@ -5849,7 +5828,7 @@ function keyConfigInit(_kcType = g_kcType) {
|
|
|
5849
5828
|
const makeMiniKCButton = (_id, _directionFlg, _func, { x = g_sWidth * 5 / 6 - 30, y = 15, w = 15, h = 20, siz = C_SIZ_MAIN } = {}) => {
|
|
5850
5829
|
return createCss2Button(`${_id}${_directionFlg}`, g_settingBtnObj.chara[_directionFlg], _func,
|
|
5851
5830
|
{ x, y, w, h, siz }, g_cssObj.button_Mini);
|
|
5852
|
-
}
|
|
5831
|
+
};
|
|
5853
5832
|
|
|
5854
5833
|
/**
|
|
5855
5834
|
* キーコンフィグ用グループ設定ラベル・ボタンの作成
|
|
@@ -6022,7 +6001,7 @@ function keyConfigInit(_kcType = g_kcType) {
|
|
|
6022
6001
|
|
|
6023
6002
|
updateImgType(g_headerObj.imgType[nextNum]);
|
|
6024
6003
|
keyConfigInit(g_kcType);
|
|
6025
|
-
}
|
|
6004
|
+
};
|
|
6026
6005
|
|
|
6027
6006
|
// ConfigType, ColorTypeの初期設定
|
|
6028
6007
|
setConfigType(0);
|
|
@@ -6174,7 +6153,7 @@ function keyConfigInit(_kcType = g_kcType) {
|
|
|
6174
6153
|
g_skinJsObj.keyconfig.forEach(func => func());
|
|
6175
6154
|
document.onkeyup = evt => commonKeyUp(evt);
|
|
6176
6155
|
document.oncontextmenu = _ => false;
|
|
6177
|
-
}
|
|
6156
|
+
};
|
|
6178
6157
|
|
|
6179
6158
|
/**
|
|
6180
6159
|
* 影矢印色の取得
|
|
@@ -6212,7 +6191,7 @@ const updateKeyInfo = (_header, _keyCtrlPtn) => {
|
|
|
6212
6191
|
/**
|
|
6213
6192
|
* 初期矢印色・フリーズアロー色の変更
|
|
6214
6193
|
*/
|
|
6215
|
-
|
|
6194
|
+
const changeSetColor = _ => {
|
|
6216
6195
|
const isDefault = [`Default`, `Type0`].includes(g_colorType);
|
|
6217
6196
|
const scoreIdHeader = setScoreIdHeader(g_stateObj.scoreId);
|
|
6218
6197
|
const defaultType = scoreIdHeader + g_colorType;
|
|
@@ -6234,13 +6213,13 @@ function changeSetColor() {
|
|
|
6234
6213
|
if (!hasVal(g_headerObj[`setShadowColor${scoreIdHeader}Default`][0]) && [`Type1`, `Type2`].includes(g_colorType)) {
|
|
6235
6214
|
g_headerObj.setShadowColor = [...Array(g_headerObj.setColorInit.length)].fill(``);
|
|
6236
6215
|
}
|
|
6237
|
-
}
|
|
6216
|
+
};
|
|
6238
6217
|
|
|
6239
6218
|
/*-----------------------------------------------------------*/
|
|
6240
6219
|
/* Scene : LOADING [strawberry] */
|
|
6241
6220
|
/*-----------------------------------------------------------*/
|
|
6242
6221
|
|
|
6243
|
-
|
|
6222
|
+
const loadMusic = _ => {
|
|
6244
6223
|
|
|
6245
6224
|
clearWindow(true);
|
|
6246
6225
|
g_currentPage = `loading`;
|
|
@@ -6303,14 +6282,14 @@ function loadMusic() {
|
|
|
6303
6282
|
request.addEventListener(`error`, _ => makeWarningWindow(`${g_msgInfoObj.E_0034}`, { backBtnUse: true }));
|
|
6304
6283
|
|
|
6305
6284
|
request.send();
|
|
6306
|
-
}
|
|
6285
|
+
};
|
|
6307
6286
|
|
|
6308
6287
|
/**
|
|
6309
6288
|
* 音楽データの設定
|
|
6310
6289
|
* iOSの場合はAudioタグによる再生
|
|
6311
6290
|
* @param {string} _url
|
|
6312
6291
|
*/
|
|
6313
|
-
async
|
|
6292
|
+
const setAudio = async (_url) => {
|
|
6314
6293
|
|
|
6315
6294
|
const loadMp3 = _ => {
|
|
6316
6295
|
if (g_isFile) {
|
|
@@ -6349,26 +6328,26 @@ async function setAudio(_url) {
|
|
|
6349
6328
|
} else {
|
|
6350
6329
|
readyToStart(_ => loadMp3());
|
|
6351
6330
|
}
|
|
6352
|
-
}
|
|
6331
|
+
};
|
|
6353
6332
|
|
|
6354
6333
|
// Base64から音声データに変換してWebAudioAPIで再生する準備
|
|
6355
|
-
async
|
|
6334
|
+
const initWebAudioAPIfromBase64 = async (_base64) => {
|
|
6356
6335
|
g_audio = new AudioPlayer();
|
|
6357
6336
|
musicAfterLoaded();
|
|
6358
6337
|
const array = Uint8Array.from(atob(_base64), v => v.charCodeAt(0))
|
|
6359
6338
|
await g_audio.init(array.buffer);
|
|
6360
|
-
}
|
|
6339
|
+
};
|
|
6361
6340
|
|
|
6362
6341
|
// 音声ファイルを読み込んでWebAudioAPIで再生する準備
|
|
6363
|
-
async
|
|
6342
|
+
const initWebAudioAPIfromURL = async (_url) => {
|
|
6364
6343
|
g_audio = new AudioPlayer();
|
|
6365
6344
|
musicAfterLoaded();
|
|
6366
6345
|
const promise = await fetch(_url);
|
|
6367
6346
|
const arrayBuffer = await promise.arrayBuffer();
|
|
6368
6347
|
await g_audio.init(arrayBuffer);
|
|
6369
|
-
}
|
|
6348
|
+
};
|
|
6370
6349
|
|
|
6371
|
-
|
|
6350
|
+
const musicAfterLoaded = _ => {
|
|
6372
6351
|
g_audio.load();
|
|
6373
6352
|
|
|
6374
6353
|
if (g_audio.readyState === 4) {
|
|
@@ -6387,12 +6366,12 @@ function musicAfterLoaded() {
|
|
|
6387
6366
|
makeWarningWindow(g_msgInfoObj.E_0041.split(`{0}`).join(g_audio.src), { backBtnUse: true });
|
|
6388
6367
|
})(), false);
|
|
6389
6368
|
}
|
|
6390
|
-
}
|
|
6369
|
+
};
|
|
6391
6370
|
|
|
6392
6371
|
/**
|
|
6393
6372
|
* 読込画面初期化
|
|
6394
6373
|
*/
|
|
6395
|
-
async
|
|
6374
|
+
const loadingScoreInit = async () => {
|
|
6396
6375
|
|
|
6397
6376
|
// 譜面データの読み込み
|
|
6398
6377
|
await loadChartFile();
|
|
@@ -6440,7 +6419,7 @@ async function loadingScoreInit() {
|
|
|
6440
6419
|
|
|
6441
6420
|
const setData = (_data, _minLength = 1) => {
|
|
6442
6421
|
return (hasArrayList(_data, _minLength) ? _data.concat() : []);
|
|
6443
|
-
}
|
|
6422
|
+
};
|
|
6444
6423
|
|
|
6445
6424
|
// フレーム・曲開始位置調整
|
|
6446
6425
|
let preblankFrame = 0;
|
|
@@ -6487,7 +6466,7 @@ async function loadingScoreInit() {
|
|
|
6487
6466
|
g_keyObj[`shuffle${keyCtrlPtn}`].forEach((_val, _i) => {
|
|
6488
6467
|
if (shuffleGroupMap[_val] === undefined) {
|
|
6489
6468
|
shuffleGroupMap[_val] = [];
|
|
6490
|
-
}
|
|
6469
|
+
}
|
|
6491
6470
|
shuffleGroupMap[_val].push(_i);
|
|
6492
6471
|
});
|
|
6493
6472
|
|
|
@@ -6550,14 +6529,14 @@ async function loadingScoreInit() {
|
|
|
6550
6529
|
}
|
|
6551
6530
|
}
|
|
6552
6531
|
}, 100);
|
|
6553
|
-
}
|
|
6532
|
+
};
|
|
6554
6533
|
|
|
6555
|
-
|
|
6534
|
+
const setScoreIdHeader = (_scoreId = 0, _scoreLockFlg = false) => {
|
|
6556
6535
|
if (_scoreId > 0 && _scoreLockFlg === false) {
|
|
6557
6536
|
return Number(_scoreId) + 1;
|
|
6558
6537
|
}
|
|
6559
6538
|
return ``;
|
|
6560
|
-
}
|
|
6539
|
+
};
|
|
6561
6540
|
|
|
6562
6541
|
/**
|
|
6563
6542
|
* Mirror,Randomの適用
|
|
@@ -6565,7 +6544,7 @@ function setScoreIdHeader(_scoreId = 0, _scoreLockFlg = false) {
|
|
|
6565
6544
|
* @param {array} _shuffleGroup
|
|
6566
6545
|
* @param {array} _style
|
|
6567
6546
|
*/
|
|
6568
|
-
|
|
6547
|
+
const applyShuffle = (_keyNum, _shuffleGroup, _style) => {
|
|
6569
6548
|
// 並べ替え用の配列を作成
|
|
6570
6549
|
// index[i]番目のキーの譜面がi番目のキーに流れるようになります
|
|
6571
6550
|
const index = [...Array(_keyNum).keys()];
|
|
@@ -6582,14 +6561,14 @@ function applyShuffle(_keyNum, _shuffleGroup, _style) {
|
|
|
6582
6561
|
g_scoreObj[`${type}Data`][i] = tmpData[index[i]] || [];
|
|
6583
6562
|
}
|
|
6584
6563
|
});
|
|
6585
|
-
}
|
|
6564
|
+
};
|
|
6586
6565
|
|
|
6587
6566
|
/**
|
|
6588
6567
|
* Mirrorの適用
|
|
6589
6568
|
* @param {number} _keyNum
|
|
6590
6569
|
* @param {array} _shuffleGroup
|
|
6591
6570
|
*/
|
|
6592
|
-
|
|
6571
|
+
const applyMirror = (_keyNum, _shuffleGroup, _asymFlg = false) => {
|
|
6593
6572
|
// シャッフルグループごとにミラー
|
|
6594
6573
|
const style = copyArray2d(_shuffleGroup).map(_group => _group.reverse());
|
|
6595
6574
|
if (_asymFlg) {
|
|
@@ -6603,14 +6582,14 @@ function applyMirror(_keyNum, _shuffleGroup, _asymFlg = false) {
|
|
|
6603
6582
|
});
|
|
6604
6583
|
}
|
|
6605
6584
|
applyShuffle(_keyNum, _shuffleGroup, style);
|
|
6606
|
-
}
|
|
6585
|
+
};
|
|
6607
6586
|
|
|
6608
6587
|
/**
|
|
6609
6588
|
* Randomの適用
|
|
6610
6589
|
* @param {number} _keyNum
|
|
6611
6590
|
* @param {array} _shuffleGroup
|
|
6612
6591
|
*/
|
|
6613
|
-
|
|
6592
|
+
const applyRandom = (_keyNum, _shuffleGroup) => {
|
|
6614
6593
|
// シャッフルグループごとにシャッフル(Fisher-Yates)
|
|
6615
6594
|
const style = copyArray2d(_shuffleGroup).map(_group => {
|
|
6616
6595
|
for (let i = _group.length - 1; i > 0; i--) {
|
|
@@ -6622,14 +6601,14 @@ function applyRandom(_keyNum, _shuffleGroup) {
|
|
|
6622
6601
|
return _group;
|
|
6623
6602
|
});
|
|
6624
6603
|
applyShuffle(_keyNum, _shuffleGroup, style);
|
|
6625
|
-
}
|
|
6604
|
+
};
|
|
6626
6605
|
|
|
6627
6606
|
/**
|
|
6628
6607
|
* S-Randomの適用
|
|
6629
6608
|
* @param {number} _keyNum
|
|
6630
6609
|
* @param {array} _shuffleGroup
|
|
6631
6610
|
*/
|
|
6632
|
-
|
|
6611
|
+
const applySRandom = (_keyNum, _shuffleGroup, _arrowHeader, _frzHeader) => {
|
|
6633
6612
|
|
|
6634
6613
|
const tmpArrowData = [...Array(_keyNum)].map(_ => []);
|
|
6635
6614
|
const tmpFrzData = [...Array(_keyNum)].map(_ => []);
|
|
@@ -6678,7 +6657,7 @@ function applySRandom(_keyNum, _shuffleGroup, _arrowHeader, _frzHeader) {
|
|
|
6678
6657
|
g_scoreObj[`${_frzHeader}Data`] = tmpFrzData.map(_freezes =>
|
|
6679
6658
|
_freezes.map(_freeze => [_freeze.begin, _freeze.end]).flat()
|
|
6680
6659
|
);
|
|
6681
|
-
}
|
|
6660
|
+
};
|
|
6682
6661
|
|
|
6683
6662
|
/**
|
|
6684
6663
|
* 譜面データの分解
|
|
@@ -6689,8 +6668,8 @@ function applySRandom(_keyNum, _shuffleGroup, _arrowHeader, _frzHeader) {
|
|
|
6689
6668
|
* @param {string} _keyCtrlPtn 選択キー及びパターン
|
|
6690
6669
|
* @param {boolean} _scoreAnalyzeFlg (default : false)
|
|
6691
6670
|
*/
|
|
6692
|
-
|
|
6693
|
-
_keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`, _scoreAnalyzeFlg = false) {
|
|
6671
|
+
const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
6672
|
+
_keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`, _scoreAnalyzeFlg = false) => {
|
|
6694
6673
|
|
|
6695
6674
|
// 矢印群の格納先
|
|
6696
6675
|
const obj = {};
|
|
@@ -6711,6 +6690,27 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6711
6690
|
const blankFrame = g_headerObj.blankFrame;
|
|
6712
6691
|
const calcFrame = _frame => Math.round((parseFloat(_frame) - blankFrame) / g_headerObj.playbackRate + blankFrame + g_stateObj.intAdjustment);
|
|
6713
6692
|
|
|
6693
|
+
/**
|
|
6694
|
+
* 矢印データの格納
|
|
6695
|
+
* @param {string} _data
|
|
6696
|
+
*/
|
|
6697
|
+
const storeArrowData = _data => {
|
|
6698
|
+
let arrowData = [];
|
|
6699
|
+
|
|
6700
|
+
if (hasVal(_data)) {
|
|
6701
|
+
const tmpData = splitLF(_data).join(``);
|
|
6702
|
+
if (tmpData !== undefined) {
|
|
6703
|
+
arrowData = tmpData.split(`,`);
|
|
6704
|
+
if (isNaN(parseFloat(arrowData[0]))) {
|
|
6705
|
+
return [];
|
|
6706
|
+
} else {
|
|
6707
|
+
arrowData = arrowData.map(data => calcFrame(data)).sort((_a, _b) => _a - _b);
|
|
6708
|
+
}
|
|
6709
|
+
}
|
|
6710
|
+
}
|
|
6711
|
+
return arrowData;
|
|
6712
|
+
};
|
|
6713
|
+
|
|
6714
6714
|
for (let j = 0; j < keyNum; j++) {
|
|
6715
6715
|
|
|
6716
6716
|
// 矢印データの分解
|
|
@@ -6750,108 +6750,13 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6750
6750
|
}
|
|
6751
6751
|
}
|
|
6752
6752
|
|
|
6753
|
-
/**
|
|
6754
|
-
* 矢印データの格納
|
|
6755
|
-
* @param {string} _data
|
|
6756
|
-
*/
|
|
6757
|
-
function storeArrowData(_data) {
|
|
6758
|
-
let arrowData = [];
|
|
6759
|
-
|
|
6760
|
-
if (hasVal(_data)) {
|
|
6761
|
-
const tmpData = splitLF(_data).join(``);
|
|
6762
|
-
if (tmpData !== undefined) {
|
|
6763
|
-
arrowData = tmpData.split(`,`);
|
|
6764
|
-
if (isNaN(parseFloat(arrowData[0]))) {
|
|
6765
|
-
return [];
|
|
6766
|
-
} else {
|
|
6767
|
-
arrowData = arrowData.map(data => calcFrame(data)).sort((_a, _b) => _a - _b);
|
|
6768
|
-
}
|
|
6769
|
-
}
|
|
6770
|
-
}
|
|
6771
|
-
return arrowData;
|
|
6772
|
-
}
|
|
6773
|
-
|
|
6774
|
-
// 速度変化データの分解 (2つで1セット)
|
|
6775
|
-
let speedFooter = ``;
|
|
6776
|
-
if (hasVal(_dosObj[`speed${scoreIdHeader}_data`])) {
|
|
6777
|
-
speedFooter = `_data`;
|
|
6778
|
-
}
|
|
6779
|
-
if (hasVal(_dosObj[`speed${scoreIdHeader}_change`])) {
|
|
6780
|
-
speedFooter = `_change`;
|
|
6781
|
-
}
|
|
6782
|
-
|
|
6783
|
-
// 速度変化(個別・全体)の分解 (2つで1セット, セット毎の改行区切り可)
|
|
6784
|
-
obj.boostData = setSpeedData(`boost`, scoreIdHeader);
|
|
6785
|
-
obj.speedData = setSpeedData(`speed`, scoreIdHeader, speedFooter);
|
|
6786
|
-
|
|
6787
|
-
// 色変化(個別・全体)の分解 (3つで1セット, セット毎の改行区切り可)
|
|
6788
|
-
g_typeLists.color.forEach(sprite => {
|
|
6789
|
-
obj[`${sprite}Data`] = setColorData(sprite, scoreIdHeader);
|
|
6790
|
-
if (g_stateObj.dummyId !== ``) {
|
|
6791
|
-
obj[`${sprite}DummyData`] = setColorData(sprite, _dummyNo);
|
|
6792
|
-
}
|
|
6793
|
-
});
|
|
6794
|
-
|
|
6795
|
-
if (_scoreAnalyzeFlg) {
|
|
6796
|
-
return obj;
|
|
6797
|
-
}
|
|
6798
|
-
|
|
6799
|
-
obj.colorData = mergeColorData();
|
|
6800
|
-
obj.dummyColorData = mergeColorData(`Dummy`);
|
|
6801
|
-
|
|
6802
|
-
// 矢印モーション(個別)データの分解(3~4つで1セット, セット毎の改行区切り)
|
|
6803
|
-
obj.arrowCssMotionData = setCssMotionData(`arrow`, scoreIdHeader);
|
|
6804
|
-
obj.frzCssMotionData = setCssMotionData(`frz`, scoreIdHeader);
|
|
6805
|
-
if (g_stateObj.dummyId !== ``) {
|
|
6806
|
-
obj.dummyArrowCssMotionData = setCssMotionData(`arrow`, _dummyNo);
|
|
6807
|
-
obj.dummyFrzCssMotionData = setCssMotionData(`frz`, _dummyNo);
|
|
6808
|
-
}
|
|
6809
|
-
|
|
6810
|
-
// 歌詞データの分解 (3つで1セット, セット毎の改行区切り可)
|
|
6811
|
-
obj.wordData = [];
|
|
6812
|
-
obj.wordMaxDepth = -1;
|
|
6813
|
-
if (g_stateObj.d_lyrics === C_FLG_OFF) {
|
|
6814
|
-
} else {
|
|
6815
|
-
[obj.wordData, obj.wordMaxDepth] = makeWordData(scoreIdHeader);
|
|
6816
|
-
}
|
|
6817
|
-
|
|
6818
|
-
// 背景・マスクデータの分解 (下記すべてで1セット、改行区切り)
|
|
6819
|
-
// [フレーム数, 階層, 背景パス, class(CSSで別定義), X, Y, width, height, opacity, animationName, animationDuration]
|
|
6820
|
-
obj.maskData = [];
|
|
6821
|
-
obj.maskMaxDepth = -1;
|
|
6822
|
-
obj.backData = [];
|
|
6823
|
-
obj.backMaxDepth = -1;
|
|
6824
|
-
if (g_stateObj.d_background === C_FLG_OFF) {
|
|
6825
|
-
} else {
|
|
6826
|
-
g_animationData.forEach(sprite => {
|
|
6827
|
-
[obj[`${sprite}Data`], obj[`${sprite}MaxDepth`]] = makeBackgroundData(sprite, scoreIdHeader);
|
|
6828
|
-
});
|
|
6829
|
-
}
|
|
6830
|
-
|
|
6831
|
-
// 結果画面用・背景/マスクデータの分解 (下記すべてで1セット、改行区切り)
|
|
6832
|
-
// [フレーム数,階層,背景パス,class(CSSで別定義),X,Y,width,height,opacity,animationName,animationDuration]
|
|
6833
|
-
if (g_stateObj.d_background === C_FLG_OFF && g_headerObj.resultMotionSet) {
|
|
6834
|
-
const backgroundResults = [`backResult`, `maskResult`, `backFailed`, `maskFailed`];
|
|
6835
|
-
backgroundResults.forEach(backName => {
|
|
6836
|
-
g_headerObj[`${backName}Data`] = [];
|
|
6837
|
-
g_headerObj[`${backName}MaxDepth`] = -1;
|
|
6838
|
-
});
|
|
6839
|
-
} else {
|
|
6840
|
-
g_animationData.forEach(sprite => {
|
|
6841
|
-
[g_headerObj[`${sprite}ResultData`], g_headerObj[`${sprite}ResultMaxDepth`]] =
|
|
6842
|
-
makeBackgroundResultData(`${sprite}result`, scoreIdHeader);
|
|
6843
|
-
[g_headerObj[`${sprite}FailedData`], g_headerObj[`${sprite}FailedMaxDepth`]] =
|
|
6844
|
-
makeBackgroundResultData(`${sprite}failed${g_stateObj.lifeMode.slice(0, 1)}`, scoreIdHeader, `${sprite}result`);
|
|
6845
|
-
});
|
|
6846
|
-
}
|
|
6847
|
-
|
|
6848
6753
|
/**
|
|
6849
6754
|
* 速度変化データの分解・格納(フレーム数, 矢印番号)
|
|
6850
6755
|
* @param {string} _header
|
|
6851
6756
|
* @param {number} _scoreNo
|
|
6852
6757
|
* @param {string} _footer
|
|
6853
6758
|
*/
|
|
6854
|
-
|
|
6759
|
+
const setSpeedData = (_header, _scoreNo, _footer = `_data`) => {
|
|
6855
6760
|
const speedData = [];
|
|
6856
6761
|
|
|
6857
6762
|
if (hasVal(_dosObj[`${_header}${_scoreNo}${_footer}`]) && g_stateObj.d_speed === C_FLG_ON) {
|
|
@@ -6874,18 +6779,18 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6874
6779
|
return speedData.sort((_a, _b) => _a[0] - _b[0]).flat();
|
|
6875
6780
|
}
|
|
6876
6781
|
return [];
|
|
6877
|
-
}
|
|
6782
|
+
};
|
|
6878
6783
|
|
|
6879
6784
|
/**
|
|
6880
6785
|
* 個別・全体色変化データをマージして整列し、単純配列として返却
|
|
6881
6786
|
* @param {string} _header
|
|
6882
6787
|
* @returns
|
|
6883
6788
|
*/
|
|
6884
|
-
|
|
6789
|
+
const mergeColorData = (_header = ``) => {
|
|
6885
6790
|
if (obj[`color${_header}Data`] === undefined) return [];
|
|
6886
6791
|
const tmpArr = obj[`color${_header}Data`].concat(obj[`acolor${_header}Data`]);
|
|
6887
6792
|
return tmpArr.sort((_a, _b) => _a[0] - _b[0]).flat();
|
|
6888
|
-
}
|
|
6793
|
+
};
|
|
6889
6794
|
|
|
6890
6795
|
/**
|
|
6891
6796
|
* 色変化データの分解・格納(フレーム数, 矢印番号)
|
|
@@ -6893,7 +6798,7 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6893
6798
|
* @param {string} _header
|
|
6894
6799
|
* @param {number} _scoreNo
|
|
6895
6800
|
*/
|
|
6896
|
-
|
|
6801
|
+
const setColorData = (_header, _scoreNo) => {
|
|
6897
6802
|
const colorData = [];
|
|
6898
6803
|
const allFlg = (_header.charAt(0) === `a`);
|
|
6899
6804
|
|
|
@@ -6919,14 +6824,14 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6919
6824
|
return colorData.sort((_a, _b) => _a[0] - _b[0]);
|
|
6920
6825
|
}
|
|
6921
6826
|
return [];
|
|
6922
|
-
}
|
|
6827
|
+
};
|
|
6923
6828
|
|
|
6924
6829
|
/**
|
|
6925
6830
|
* 矢印モーションデータの分解・格納(フレーム数, 矢印番号)
|
|
6926
6831
|
* @param {string} _header
|
|
6927
6832
|
* @param {number} _scoreNo
|
|
6928
6833
|
*/
|
|
6929
|
-
|
|
6834
|
+
const setCssMotionData = (_header, _scoreNo) => {
|
|
6930
6835
|
const dosCssMotionData = _dosObj[`${_header}Motion${_scoreNo}_data`] || _dosObj[`${_header}Motion_data`];
|
|
6931
6836
|
const cssMotionData = [];
|
|
6932
6837
|
|
|
@@ -6946,13 +6851,13 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6946
6851
|
return cssMotionData.sort((_a, _b) => _a[0] - _b[0]).flat();
|
|
6947
6852
|
}
|
|
6948
6853
|
return [];
|
|
6949
|
-
}
|
|
6854
|
+
};
|
|
6950
6855
|
|
|
6951
6856
|
/**
|
|
6952
6857
|
* 歌詞データの分解
|
|
6953
6858
|
* @param {string} _scoreNo
|
|
6954
6859
|
*/
|
|
6955
|
-
|
|
6860
|
+
const makeWordData = _scoreNo => {
|
|
6956
6861
|
const wordDataList = [];
|
|
6957
6862
|
let wordReverseFlg = false;
|
|
6958
6863
|
const divideCnt = getKeyInfo().divideCnt;
|
|
@@ -6985,14 +6890,14 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
6985
6890
|
|
|
6986
6891
|
const inputWordData = wordDataList.find((v) => v !== undefined);
|
|
6987
6892
|
return (inputWordData !== undefined ? makeSpriteWordData(inputWordData, wordReverseFlg) : [[], -1]);
|
|
6988
|
-
}
|
|
6893
|
+
};
|
|
6989
6894
|
|
|
6990
6895
|
/**
|
|
6991
6896
|
* 多層歌詞データの格納処理
|
|
6992
6897
|
* @param {object} _data
|
|
6993
6898
|
* @param {boolean} _reverseFlg
|
|
6994
6899
|
*/
|
|
6995
|
-
|
|
6900
|
+
const makeSpriteWordData = (_data, _reverseFlg = false) => {
|
|
6996
6901
|
const wordData = [];
|
|
6997
6902
|
let wordMaxDepth = -1;
|
|
6998
6903
|
let wordReverseFlg = _reverseFlg;
|
|
@@ -7040,14 +6945,14 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
7040
6945
|
});
|
|
7041
6946
|
|
|
7042
6947
|
return [wordData, wordMaxDepth];
|
|
7043
|
-
}
|
|
6948
|
+
};
|
|
7044
6949
|
|
|
7045
6950
|
/**
|
|
7046
6951
|
* 背景・マスクデータの分解
|
|
7047
6952
|
* @param {string} _header
|
|
7048
6953
|
* @param {string} _scoreNo
|
|
7049
6954
|
*/
|
|
7050
|
-
|
|
6955
|
+
const makeBackgroundData = (_header, _scoreNo) => {
|
|
7051
6956
|
const dataList = [];
|
|
7052
6957
|
const addDataList = (_type = ``) =>
|
|
7053
6958
|
dataList.push(
|
|
@@ -7066,7 +6971,7 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
7066
6971
|
|
|
7067
6972
|
const data = dataList.find((v) => v !== undefined);
|
|
7068
6973
|
return (data !== undefined ? makeSpriteData(data, calcFrame) : [[], -1]);
|
|
7069
|
-
}
|
|
6974
|
+
};
|
|
7070
6975
|
|
|
7071
6976
|
/**
|
|
7072
6977
|
* リザルトモーションデータ(結果画面用背景・マスクデータ)の分解
|
|
@@ -7074,7 +6979,7 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
7074
6979
|
* @param {string} _scoreNo
|
|
7075
6980
|
* @param {string} _defaultHeader
|
|
7076
6981
|
*/
|
|
7077
|
-
|
|
6982
|
+
const makeBackgroundResultData = (_header, _scoreNo, _defaultHeader = ``) => {
|
|
7078
6983
|
const dataList = [];
|
|
7079
6984
|
const addResultDataList = _headerType =>
|
|
7080
6985
|
dataList.push(
|
|
@@ -7090,16 +6995,90 @@ function scoreConvert(_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
|
|
|
7090
6995
|
|
|
7091
6996
|
const data = dataList.find((v) => v !== undefined);
|
|
7092
6997
|
return (data !== undefined ? makeSpriteData(data) : [[], -1]);
|
|
6998
|
+
};
|
|
6999
|
+
|
|
7000
|
+
// 速度変化データの分解 (2つで1セット)
|
|
7001
|
+
let speedFooter = ``;
|
|
7002
|
+
if (hasVal(_dosObj[`speed${scoreIdHeader}_data`])) {
|
|
7003
|
+
speedFooter = `_data`;
|
|
7004
|
+
}
|
|
7005
|
+
if (hasVal(_dosObj[`speed${scoreIdHeader}_change`])) {
|
|
7006
|
+
speedFooter = `_change`;
|
|
7007
|
+
}
|
|
7008
|
+
|
|
7009
|
+
// 速度変化(個別・全体)の分解 (2つで1セット, セット毎の改行区切り可)
|
|
7010
|
+
obj.boostData = setSpeedData(`boost`, scoreIdHeader);
|
|
7011
|
+
obj.speedData = setSpeedData(`speed`, scoreIdHeader, speedFooter);
|
|
7012
|
+
|
|
7013
|
+
// 色変化(個別・全体)の分解 (3つで1セット, セット毎の改行区切り可)
|
|
7014
|
+
g_typeLists.color.forEach(sprite => {
|
|
7015
|
+
obj[`${sprite}Data`] = setColorData(sprite, scoreIdHeader);
|
|
7016
|
+
if (g_stateObj.dummyId !== ``) {
|
|
7017
|
+
obj[`${sprite}DummyData`] = setColorData(sprite, _dummyNo);
|
|
7018
|
+
}
|
|
7019
|
+
});
|
|
7020
|
+
|
|
7021
|
+
if (_scoreAnalyzeFlg) {
|
|
7022
|
+
return obj;
|
|
7023
|
+
}
|
|
7024
|
+
|
|
7025
|
+
obj.colorData = mergeColorData();
|
|
7026
|
+
obj.dummyColorData = mergeColorData(`Dummy`);
|
|
7027
|
+
|
|
7028
|
+
// 矢印モーション(個別)データの分解(3~4つで1セット, セット毎の改行区切り)
|
|
7029
|
+
obj.arrowCssMotionData = setCssMotionData(`arrow`, scoreIdHeader);
|
|
7030
|
+
obj.frzCssMotionData = setCssMotionData(`frz`, scoreIdHeader);
|
|
7031
|
+
if (g_stateObj.dummyId !== ``) {
|
|
7032
|
+
obj.dummyArrowCssMotionData = setCssMotionData(`arrow`, _dummyNo);
|
|
7033
|
+
obj.dummyFrzCssMotionData = setCssMotionData(`frz`, _dummyNo);
|
|
7034
|
+
}
|
|
7035
|
+
|
|
7036
|
+
// 歌詞データの分解 (3つで1セット, セット毎の改行区切り可)
|
|
7037
|
+
obj.wordData = [];
|
|
7038
|
+
obj.wordMaxDepth = -1;
|
|
7039
|
+
if (g_stateObj.d_lyrics === C_FLG_OFF) {
|
|
7040
|
+
} else {
|
|
7041
|
+
[obj.wordData, obj.wordMaxDepth] = makeWordData(scoreIdHeader);
|
|
7042
|
+
}
|
|
7043
|
+
|
|
7044
|
+
// 背景・マスクデータの分解 (下記すべてで1セット、改行区切り)
|
|
7045
|
+
// [フレーム数, 階層, 背景パス, class(CSSで別定義), X, Y, width, height, opacity, animationName, animationDuration]
|
|
7046
|
+
obj.maskData = [];
|
|
7047
|
+
obj.maskMaxDepth = -1;
|
|
7048
|
+
obj.backData = [];
|
|
7049
|
+
obj.backMaxDepth = -1;
|
|
7050
|
+
if (g_stateObj.d_background === C_FLG_OFF) {
|
|
7051
|
+
} else {
|
|
7052
|
+
g_animationData.forEach(sprite => {
|
|
7053
|
+
[obj[`${sprite}Data`], obj[`${sprite}MaxDepth`]] = makeBackgroundData(sprite, scoreIdHeader);
|
|
7054
|
+
});
|
|
7055
|
+
}
|
|
7056
|
+
|
|
7057
|
+
// 結果画面用・背景/マスクデータの分解 (下記すべてで1セット、改行区切り)
|
|
7058
|
+
// [フレーム数,階層,背景パス,class(CSSで別定義),X,Y,width,height,opacity,animationName,animationDuration]
|
|
7059
|
+
if (g_stateObj.d_background === C_FLG_OFF && g_headerObj.resultMotionSet) {
|
|
7060
|
+
const backgroundResults = [`backResult`, `maskResult`, `backFailed`, `maskFailed`];
|
|
7061
|
+
backgroundResults.forEach(backName => {
|
|
7062
|
+
g_headerObj[`${backName}Data`] = [];
|
|
7063
|
+
g_headerObj[`${backName}MaxDepth`] = -1;
|
|
7064
|
+
});
|
|
7065
|
+
} else {
|
|
7066
|
+
g_animationData.forEach(sprite => {
|
|
7067
|
+
[g_headerObj[`${sprite}ResultData`], g_headerObj[`${sprite}ResultMaxDepth`]] =
|
|
7068
|
+
makeBackgroundResultData(`${sprite}result`, scoreIdHeader);
|
|
7069
|
+
[g_headerObj[`${sprite}FailedData`], g_headerObj[`${sprite}FailedMaxDepth`]] =
|
|
7070
|
+
makeBackgroundResultData(`${sprite}failed${g_stateObj.lifeMode.slice(0, 1)}`, scoreIdHeader, `${sprite}result`);
|
|
7071
|
+
});
|
|
7093
7072
|
}
|
|
7094
7073
|
|
|
7095
7074
|
return obj;
|
|
7096
|
-
}
|
|
7075
|
+
};
|
|
7097
7076
|
|
|
7098
7077
|
/**
|
|
7099
7078
|
* ライフ回復量・ダメージ量の算出
|
|
7100
7079
|
* @param {number} _allArrows
|
|
7101
7080
|
*/
|
|
7102
|
-
|
|
7081
|
+
const calcLifeVals = _allArrows => {
|
|
7103
7082
|
|
|
7104
7083
|
if (g_stateObj.lifeVariable === C_FLG_ON) {
|
|
7105
7084
|
g_workObj.lifeRcv = calcLifeVal(g_stateObj.lifeRcv, _allArrows);
|
|
@@ -7110,23 +7089,21 @@ function calcLifeVals(_allArrows) {
|
|
|
7110
7089
|
}
|
|
7111
7090
|
g_workObj.lifeBorder = g_headerObj.maxLifeVal * g_stateObj.lifeBorder / 100;
|
|
7112
7091
|
g_workObj.lifeInit = g_headerObj.maxLifeVal * g_stateObj.lifeInit / 100;
|
|
7113
|
-
}
|
|
7092
|
+
};
|
|
7114
7093
|
|
|
7115
7094
|
/**
|
|
7116
7095
|
* ライフ回復量・ダメージ量の算出
|
|
7117
7096
|
* @param {number} _val
|
|
7118
7097
|
* @param {number} _allArrows
|
|
7119
7098
|
*/
|
|
7120
|
-
|
|
7121
|
-
return Math.round(_val * g_headerObj.maxLifeVal * 100 / _allArrows) / 100;
|
|
7122
|
-
}
|
|
7099
|
+
const calcLifeVal = (_val, _allArrows) => Math.round(_val * g_headerObj.maxLifeVal * 100 / _allArrows) / 100;
|
|
7123
7100
|
|
|
7124
7101
|
/**
|
|
7125
7102
|
* 最終フレーム数の取得
|
|
7126
7103
|
* @param {object} _dataObj
|
|
7127
7104
|
* @param {string} _keyCtrlPtn
|
|
7128
7105
|
*/
|
|
7129
|
-
|
|
7106
|
+
const getLastFrame = (_dataObj, _keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`) => {
|
|
7130
7107
|
|
|
7131
7108
|
let tmpLastNum = 0;
|
|
7132
7109
|
const keyNum = g_keyObj[`chara${_keyCtrlPtn}`].length;
|
|
@@ -7146,14 +7123,14 @@ function getLastFrame(_dataObj, _keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj
|
|
|
7146
7123
|
});
|
|
7147
7124
|
}
|
|
7148
7125
|
return tmpLastNum;
|
|
7149
|
-
}
|
|
7126
|
+
};
|
|
7150
7127
|
|
|
7151
7128
|
/**
|
|
7152
7129
|
* 最初の矢印フレームの取得
|
|
7153
7130
|
* @param {object} _dataObj
|
|
7154
7131
|
* @param {string} _keyCtrlPtn
|
|
7155
7132
|
*/
|
|
7156
|
-
|
|
7133
|
+
const getFirstArrowFrame = (_dataObj, _keyCtrlPtn = `${g_keyObj.currentKey}_${g_keyObj.currentPtn}`) => {
|
|
7157
7134
|
|
|
7158
7135
|
let tmpFirstNum = Infinity;
|
|
7159
7136
|
const keyNum = g_keyObj[`chara${_keyCtrlPtn}`].length;
|
|
@@ -7175,7 +7152,7 @@ function getFirstArrowFrame(_dataObj, _keyCtrlPtn = `${g_keyObj.currentKey}_${g_
|
|
|
7175
7152
|
});
|
|
7176
7153
|
}
|
|
7177
7154
|
return (tmpFirstNum === Infinity ? 0 : tmpFirstNum);
|
|
7178
|
-
}
|
|
7155
|
+
};
|
|
7179
7156
|
|
|
7180
7157
|
/**
|
|
7181
7158
|
* 開始フレームの取得
|
|
@@ -7183,7 +7160,7 @@ function getFirstArrowFrame(_dataObj, _keyCtrlPtn = `${g_keyObj.currentKey}_${g_
|
|
|
7183
7160
|
* @param {number} _fadein
|
|
7184
7161
|
* @param {number} _scoreId
|
|
7185
7162
|
*/
|
|
7186
|
-
|
|
7163
|
+
const getStartFrame = (_lastFrame, _fadein = 0, _scoreId = g_stateObj.scoreId) => {
|
|
7187
7164
|
let frameNum = 0;
|
|
7188
7165
|
if (g_headerObj.startFrame !== undefined) {
|
|
7189
7166
|
frameNum = parseInt(g_headerObj.startFrame[_scoreId] || g_headerObj.startFrame[0] || 0);
|
|
@@ -7192,14 +7169,14 @@ function getStartFrame(_lastFrame, _fadein = 0, _scoreId = g_stateObj.scoreId) {
|
|
|
7192
7169
|
frameNum = Math.round(_fadein / 100 * (_lastFrame - frameNum)) + frameNum;
|
|
7193
7170
|
}
|
|
7194
7171
|
return frameNum;
|
|
7195
|
-
}
|
|
7172
|
+
};
|
|
7196
7173
|
|
|
7197
7174
|
/**
|
|
7198
7175
|
* 各フレームごとの速度を格納
|
|
7199
7176
|
* @param {object} _speedData
|
|
7200
7177
|
* @param {number} _lastFrame
|
|
7201
7178
|
*/
|
|
7202
|
-
|
|
7179
|
+
const setSpeedOnFrame = (_speedData, _lastFrame) => {
|
|
7203
7180
|
|
|
7204
7181
|
const speedOnFrame = [];
|
|
7205
7182
|
let currentSpeed = g_stateObj.speed * 2;
|
|
@@ -7212,14 +7189,14 @@ function setSpeedOnFrame(_speedData, _lastFrame) {
|
|
|
7212
7189
|
speedOnFrame[frm] = currentSpeed;
|
|
7213
7190
|
}
|
|
7214
7191
|
return speedOnFrame;
|
|
7215
|
-
}
|
|
7192
|
+
};
|
|
7216
7193
|
|
|
7217
7194
|
/**
|
|
7218
7195
|
* Motionオプション適用時の矢印別の速度設定
|
|
7219
7196
|
* - 配列の数字は小さいほどステップゾーンに近いことを示す。
|
|
7220
7197
|
* - 15がステップゾーン上、0~14は矢印の枠外管理用
|
|
7221
7198
|
*/
|
|
7222
|
-
|
|
7199
|
+
const setMotionOnFrame = _ => {
|
|
7223
7200
|
|
|
7224
7201
|
// 矢印が表示される最大フレーム数
|
|
7225
7202
|
const motionLastFrame = g_sHeight * 20;
|
|
@@ -7244,7 +7221,7 @@ function setMotionOnFrame() {
|
|
|
7244
7221
|
}
|
|
7245
7222
|
|
|
7246
7223
|
return motionOnFrame;
|
|
7247
|
-
}
|
|
7224
|
+
};
|
|
7248
7225
|
|
|
7249
7226
|
/**
|
|
7250
7227
|
* 最初のフレームで出現する矢印が、ステップゾーンに到達するまでのフレーム数を取得
|
|
@@ -7252,7 +7229,7 @@ function setMotionOnFrame() {
|
|
|
7252
7229
|
* @param {object} _speedOnFrame
|
|
7253
7230
|
* @param {object} _motionOnFrame
|
|
7254
7231
|
*/
|
|
7255
|
-
|
|
7232
|
+
const getFirstArrivalFrame = (_startFrame, _speedOnFrame, _motionOnFrame) => {
|
|
7256
7233
|
let startY = 0;
|
|
7257
7234
|
let frm = _startFrame;
|
|
7258
7235
|
let motionFrm = C_MOTION_STD_POS;
|
|
@@ -7267,7 +7244,7 @@ function getFirstArrivalFrame(_startFrame, _speedOnFrame, _motionOnFrame) {
|
|
|
7267
7244
|
frm++;
|
|
7268
7245
|
}
|
|
7269
7246
|
return frm;
|
|
7270
|
-
}
|
|
7247
|
+
};
|
|
7271
7248
|
|
|
7272
7249
|
/**
|
|
7273
7250
|
* 矢印・フリーズアロー・速度/色変化格納処理
|
|
@@ -7276,7 +7253,7 @@ function getFirstArrivalFrame(_startFrame, _speedOnFrame, _motionOnFrame) {
|
|
|
7276
7253
|
* @param {object} _motionOnFrame
|
|
7277
7254
|
* @param {number} _firstArrivalFrame
|
|
7278
7255
|
*/
|
|
7279
|
-
|
|
7256
|
+
const pushArrows = (_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame) => {
|
|
7280
7257
|
|
|
7281
7258
|
// 矢印・フリーズアロー・速度/色変化用 フレーム別処理配列
|
|
7282
7259
|
[``, `Dummy`].forEach(header => {
|
|
@@ -7301,9 +7278,9 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7301
7278
|
spdPrev = 0;
|
|
7302
7279
|
}
|
|
7303
7280
|
return [spdk, spdPrev];
|
|
7304
|
-
}
|
|
7281
|
+
};
|
|
7305
7282
|
|
|
7306
|
-
|
|
7283
|
+
const setNotes = (_j, _k, _data, _startPoint, _header, _frzFlg = false) => {
|
|
7307
7284
|
if (_startPoint >= 0) {
|
|
7308
7285
|
if (g_workObj[`mk${_header}Arrow`][_startPoint] === undefined) {
|
|
7309
7286
|
g_workObj[`mk${_header}Arrow`][_startPoint] = [];
|
|
@@ -7316,9 +7293,9 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7316
7293
|
} else if (_frzFlg && g_workObj[`mk${_header}Length`][_j] !== undefined) {
|
|
7317
7294
|
g_workObj[`mk${_header}Length`][_j] = copyArray2d(g_workObj[`mk${_header}Length`][_j].slice(_k + 2));
|
|
7318
7295
|
}
|
|
7319
|
-
}
|
|
7296
|
+
};
|
|
7320
7297
|
|
|
7321
|
-
|
|
7298
|
+
const calcNotes = (_j, _data, _header = ``, _frzFlg = false) => {
|
|
7322
7299
|
if (_data === undefined) {
|
|
7323
7300
|
return;
|
|
7324
7301
|
}
|
|
@@ -7388,7 +7365,7 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7388
7365
|
// 出現タイミングを保存
|
|
7389
7366
|
setNotes(_j, k, _data, startPoint[k], camelHeader, _frzFlg);
|
|
7390
7367
|
}
|
|
7391
|
-
}
|
|
7368
|
+
};
|
|
7392
7369
|
|
|
7393
7370
|
for (let j = 0; j < getKeyInfo().keyNum; j++) {
|
|
7394
7371
|
|
|
@@ -7428,13 +7405,6 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7428
7405
|
g_workObj.boostData = copyArray2d(_dataObj.boostData);
|
|
7429
7406
|
}
|
|
7430
7407
|
|
|
7431
|
-
// 個別・全体色変化、モーションデータのタイミング更新
|
|
7432
|
-
[``, `dummy`].forEach(type =>
|
|
7433
|
-
calcDataTiming(`color`, type, pushColors, { _colorFlg: true }));
|
|
7434
|
-
|
|
7435
|
-
g_typeLists.arrow.forEach(header =>
|
|
7436
|
-
calcDataTiming(`cssMotion`, header, pushCssMotions, { _calcFrameFlg: true }));
|
|
7437
|
-
|
|
7438
7408
|
/**
|
|
7439
7409
|
* 色変化・モーションデータのタイミング更新
|
|
7440
7410
|
* @param {string} _type
|
|
@@ -7443,8 +7413,8 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7443
7413
|
* @param {object} obj _colorFlg: 個別色変化フラグ, _calcFrameFlg: 逆算を無条件で行うかどうかの可否
|
|
7444
7414
|
* @returns
|
|
7445
7415
|
*/
|
|
7446
|
-
|
|
7447
|
-
{ _term = 4, _colorFlg = false, _calcFrameFlg = false } = {}) {
|
|
7416
|
+
const calcDataTiming = (_type, _header, _setFunc = _ => true,
|
|
7417
|
+
{ _term = 4, _colorFlg = false, _calcFrameFlg = false } = {}) => {
|
|
7448
7418
|
|
|
7449
7419
|
const camelHeader = _header === `` ? _type : `${_header}${toCapitalize(_type)}`;
|
|
7450
7420
|
const baseData = _dataObj[`${camelHeader}Data`];
|
|
@@ -7475,10 +7445,7 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7475
7445
|
}
|
|
7476
7446
|
}
|
|
7477
7447
|
frontData.forEach(data => _setFunc(toCapitalize(_header), g_scoreObj.frameNum, ...data));
|
|
7478
|
-
}
|
|
7479
|
-
|
|
7480
|
-
g_fadeinStockList.forEach(type =>
|
|
7481
|
-
_dataObj[`${type}Data`] = calcAnimationData(type, _dataObj[`${type}Data`]));
|
|
7448
|
+
};
|
|
7482
7449
|
|
|
7483
7450
|
/**
|
|
7484
7451
|
* 歌詞表示、背景・マスク表示のフェードイン時調整処理
|
|
@@ -7486,7 +7453,7 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7486
7453
|
* @param {object} _data
|
|
7487
7454
|
* @returns
|
|
7488
7455
|
*/
|
|
7489
|
-
|
|
7456
|
+
const calcAnimationData = (_type, _data) => {
|
|
7490
7457
|
|
|
7491
7458
|
const startNum = g_scoreObj.frameNum;
|
|
7492
7459
|
const cgArrays = [`word`];
|
|
@@ -7543,7 +7510,18 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7543
7510
|
}
|
|
7544
7511
|
|
|
7545
7512
|
return _data;
|
|
7546
|
-
}
|
|
7513
|
+
};
|
|
7514
|
+
|
|
7515
|
+
// 個別・全体色変化、モーションデータのタイミング更新
|
|
7516
|
+
[``, `dummy`].forEach(type =>
|
|
7517
|
+
calcDataTiming(`color`, type, pushColors, { _colorFlg: true }));
|
|
7518
|
+
|
|
7519
|
+
g_typeLists.arrow.forEach(header =>
|
|
7520
|
+
calcDataTiming(`cssMotion`, header, pushCssMotions, { _calcFrameFlg: true }));
|
|
7521
|
+
|
|
7522
|
+
g_fadeinStockList.forEach(type =>
|
|
7523
|
+
_dataObj[`${type}Data`] = calcAnimationData(type, _dataObj[`${type}Data`]));
|
|
7524
|
+
|
|
7547
7525
|
|
|
7548
7526
|
// 実際に処理させる途中変速配列を作成
|
|
7549
7527
|
g_workObj.speedData = [];
|
|
@@ -7559,7 +7537,7 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7559
7537
|
}
|
|
7560
7538
|
}
|
|
7561
7539
|
}
|
|
7562
|
-
}
|
|
7540
|
+
};
|
|
7563
7541
|
|
|
7564
7542
|
/**
|
|
7565
7543
|
* ステップゾーン到達地点から逆算して開始フレームを取得
|
|
@@ -7567,7 +7545,7 @@ function pushArrows(_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
|
|
|
7567
7545
|
* @param {object} _speedOnFrame
|
|
7568
7546
|
* @param {object} _motionOnFrame
|
|
7569
7547
|
*/
|
|
7570
|
-
|
|
7548
|
+
const getArrowStartFrame = (_frame, _speedOnFrame, _motionOnFrame) => {
|
|
7571
7549
|
|
|
7572
7550
|
const obj = {
|
|
7573
7551
|
frm: _frame,
|
|
@@ -7588,15 +7566,13 @@ function getArrowStartFrame(_frame, _speedOnFrame, _motionOnFrame) {
|
|
|
7588
7566
|
}
|
|
7589
7567
|
|
|
7590
7568
|
return obj;
|
|
7591
|
-
}
|
|
7569
|
+
};
|
|
7592
7570
|
|
|
7593
7571
|
/**
|
|
7594
7572
|
* 個別色変化におけるフリーズアロー(ヒット時)判定
|
|
7595
7573
|
* @param {number} _val
|
|
7596
7574
|
*/
|
|
7597
|
-
|
|
7598
|
-
return (g_headerObj.colorDataType === `` && ((_val >= 40 && _val < 50) || (_val >= 55 && _val < 60) || _val === 61));
|
|
7599
|
-
}
|
|
7575
|
+
const isFrzHitColor = _val => (g_headerObj.colorDataType === `` && ((_val >= 40 && _val < 50) || (_val >= 55 && _val < 60) || _val === 61));
|
|
7600
7576
|
|
|
7601
7577
|
/**
|
|
7602
7578
|
* 速度を加味したフリーズアローの長さを取得
|
|
@@ -7604,19 +7580,19 @@ function isFrzHitColor(_val) {
|
|
|
7604
7580
|
* @param {number} _startFrame
|
|
7605
7581
|
* @param {number} _endFrame
|
|
7606
7582
|
*/
|
|
7607
|
-
|
|
7583
|
+
const getFrzLength = (_speedOnFrame, _startFrame, _endFrame) => {
|
|
7608
7584
|
let frzLength = 0;
|
|
7609
7585
|
|
|
7610
7586
|
for (let frm = _startFrame; frm < _endFrame; frm++) {
|
|
7611
7587
|
frzLength += _speedOnFrame[frm];
|
|
7612
7588
|
}
|
|
7613
7589
|
return frzLength;
|
|
7614
|
-
}
|
|
7590
|
+
};
|
|
7615
7591
|
|
|
7616
7592
|
/**
|
|
7617
7593
|
* キーパターン(デフォルト)に対応する矢印番号を格納
|
|
7618
7594
|
*/
|
|
7619
|
-
|
|
7595
|
+
const convertreplaceNums = _ => {
|
|
7620
7596
|
const tkObj = getKeyInfo();
|
|
7621
7597
|
const baseCharas = g_keyObj[`chara${g_keyObj.currentKey}_0`];
|
|
7622
7598
|
const convCharas = g_keyObj[`chara${tkObj.keyCtrlPtn}`];
|
|
@@ -7631,7 +7607,7 @@ function convertreplaceNums() {
|
|
|
7631
7607
|
}
|
|
7632
7608
|
}
|
|
7633
7609
|
}
|
|
7634
|
-
}
|
|
7610
|
+
};
|
|
7635
7611
|
|
|
7636
7612
|
/**
|
|
7637
7613
|
* 色情報の格納
|
|
@@ -7641,7 +7617,7 @@ function convertreplaceNums() {
|
|
|
7641
7617
|
* @param {string} _colorCd
|
|
7642
7618
|
* @param {string} _allFlg
|
|
7643
7619
|
*/
|
|
7644
|
-
|
|
7620
|
+
const pushColors = (_header, _frame, _val, _colorCd, _allFlg) => {
|
|
7645
7621
|
|
|
7646
7622
|
const tkObj = getKeyInfo();
|
|
7647
7623
|
const grdFlg = (g_colorType === `Type0` ? !g_headerObj.defaultColorgrd[0] : g_headerObj.defaultColorgrd[0])
|
|
@@ -7741,7 +7717,7 @@ function pushColors(_header, _frame, _val, _colorCd, _allFlg) {
|
|
|
7741
7717
|
}
|
|
7742
7718
|
|
|
7743
7719
|
enabledAll(...allUseTypes);
|
|
7744
|
-
}
|
|
7720
|
+
};
|
|
7745
7721
|
|
|
7746
7722
|
/**
|
|
7747
7723
|
* CSSモーション情報の格納
|
|
@@ -7751,7 +7727,7 @@ function pushColors(_header, _frame, _val, _colorCd, _allFlg) {
|
|
|
7751
7727
|
* @param {string} _styleName
|
|
7752
7728
|
* @param {string} _styleNameRev
|
|
7753
7729
|
*/
|
|
7754
|
-
|
|
7730
|
+
const pushCssMotions = (_header, _frame, _val, _styleName, _styleNameRev) => {
|
|
7755
7731
|
|
|
7756
7732
|
const camelHeader = toCapitalize(_header);
|
|
7757
7733
|
const tkObj = getKeyInfo();
|
|
@@ -7775,12 +7751,12 @@ function pushCssMotions(_header, _frame, _val, _styleName, _styleNameRev) {
|
|
|
7775
7751
|
}
|
|
7776
7752
|
}
|
|
7777
7753
|
}
|
|
7778
|
-
}
|
|
7754
|
+
};
|
|
7779
7755
|
|
|
7780
7756
|
/**
|
|
7781
7757
|
* メイン画面前の初期化処理
|
|
7782
7758
|
*/
|
|
7783
|
-
|
|
7759
|
+
const getArrowSettings = _ => {
|
|
7784
7760
|
|
|
7785
7761
|
g_attrObj = {};
|
|
7786
7762
|
const tkObj = getKeyInfo();
|
|
@@ -7910,7 +7886,7 @@ function getArrowSettings() {
|
|
|
7910
7886
|
g_keyObj.prevKey = g_keyObj.currentKey;
|
|
7911
7887
|
g_canLoadDifInfoFlg = false;
|
|
7912
7888
|
}
|
|
7913
|
-
}
|
|
7889
|
+
};
|
|
7914
7890
|
|
|
7915
7891
|
/**
|
|
7916
7892
|
* キーコンフィグ保存処理
|
|
@@ -7918,7 +7894,7 @@ function getArrowSettings() {
|
|
|
7918
7894
|
* @param {number} _keyNum
|
|
7919
7895
|
* @param {string} _keyCtrlPtn
|
|
7920
7896
|
*/
|
|
7921
|
-
|
|
7897
|
+
const setKeyCtrl = (_localStorage, _keyNum, _keyCtrlPtn) => {
|
|
7922
7898
|
const localPtn = `${g_keyObj.currentKey}_-1`;
|
|
7923
7899
|
const keyCtrl = [...Array(_keyNum)].map(_ => []);
|
|
7924
7900
|
for (let j = 0; j < _keyNum; j++) {
|
|
@@ -7934,7 +7910,7 @@ function setKeyCtrl(_localStorage, _keyNum, _keyCtrlPtn) {
|
|
|
7934
7910
|
}
|
|
7935
7911
|
}
|
|
7936
7912
|
return keyCtrl;
|
|
7937
|
-
}
|
|
7913
|
+
};
|
|
7938
7914
|
|
|
7939
7915
|
/*-----------------------------------------------------------*/
|
|
7940
7916
|
/* Scene : MAIN [banana] */
|
|
@@ -7943,7 +7919,7 @@ function setKeyCtrl(_localStorage, _keyNum, _keyCtrlPtn) {
|
|
|
7943
7919
|
/**
|
|
7944
7920
|
* メイン画面初期化
|
|
7945
7921
|
*/
|
|
7946
|
-
|
|
7922
|
+
const MainInit = _ => {
|
|
7947
7923
|
clearWindow(true, `Main`);
|
|
7948
7924
|
const divRoot = document.querySelector(`#divRoot`);
|
|
7949
7925
|
document.oncontextmenu = _ => false;
|
|
@@ -8394,7 +8370,7 @@ function MainInit() {
|
|
|
8394
8370
|
},
|
|
8395
8371
|
|
|
8396
8372
|
ON: (_keyCode) => { },
|
|
8397
|
-
}
|
|
8373
|
+
};
|
|
8398
8374
|
|
|
8399
8375
|
// キー操作イベント
|
|
8400
8376
|
document.onkeydown = evt => {
|
|
@@ -8446,7 +8422,7 @@ function MainInit() {
|
|
|
8446
8422
|
}
|
|
8447
8423
|
}
|
|
8448
8424
|
return blockCode(setCode);
|
|
8449
|
-
}
|
|
8425
|
+
};
|
|
8450
8426
|
|
|
8451
8427
|
/**
|
|
8452
8428
|
* キーを離したときの処理
|
|
@@ -8468,7 +8444,7 @@ function MainInit() {
|
|
|
8468
8444
|
const setCode = transCode(evt.code);
|
|
8469
8445
|
g_inputKeyBuffer[setCode] = false;
|
|
8470
8446
|
mainKeyUpActFunc[g_stateObj.autoAll]();
|
|
8471
|
-
}
|
|
8447
|
+
};
|
|
8472
8448
|
|
|
8473
8449
|
/**
|
|
8474
8450
|
* 全体色変化(矢印)
|
|
@@ -8733,7 +8709,7 @@ function MainInit() {
|
|
|
8733
8709
|
* @param {string} _name 矢印名
|
|
8734
8710
|
* @param {string} _color 矢印色
|
|
8735
8711
|
*/
|
|
8736
|
-
|
|
8712
|
+
const makeArrow = (_j, _arrowCnt, _name, _color) => {
|
|
8737
8713
|
const boostSpdDir = g_workObj.boostSpd * g_workObj.scrollDir[_j];
|
|
8738
8714
|
const dividePos = g_workObj.dividePos[_j];
|
|
8739
8715
|
const colorPos = g_keyObj[`color${keyCtrlPtn}`][_j];
|
|
@@ -8776,7 +8752,7 @@ function MainInit() {
|
|
|
8776
8752
|
stepRoot.appendChild(createColorObject2(`${_name}Top${_j}_${_arrowCnt}`, {
|
|
8777
8753
|
background: _color, rotate: g_workObj.arrowRtn[_j],
|
|
8778
8754
|
}));
|
|
8779
|
-
}
|
|
8755
|
+
};
|
|
8780
8756
|
|
|
8781
8757
|
/**
|
|
8782
8758
|
* 矢印移動メイン
|
|
@@ -8784,7 +8760,7 @@ function MainInit() {
|
|
|
8784
8760
|
* @param {number} _k
|
|
8785
8761
|
* @param {string} _name
|
|
8786
8762
|
*/
|
|
8787
|
-
|
|
8763
|
+
const movArrow = (_j, _k, _name) => {
|
|
8788
8764
|
const arrowName = `${_name}${_j}_${_k}`;
|
|
8789
8765
|
|
|
8790
8766
|
// 全体色変化 (移動時)
|
|
@@ -8799,7 +8775,7 @@ function MainInit() {
|
|
|
8799
8775
|
g_attrObj[arrowName].boostCnt--;
|
|
8800
8776
|
}
|
|
8801
8777
|
judgeMotionFunc[`${_name}${g_stateObj.autoAll}`](_j, arrowName, --g_attrObj[arrowName].cnt);
|
|
8802
|
-
}
|
|
8778
|
+
};
|
|
8803
8779
|
|
|
8804
8780
|
/**
|
|
8805
8781
|
* フリーズアロー生成
|
|
@@ -8809,7 +8785,7 @@ function MainInit() {
|
|
|
8809
8785
|
* @param {string} _normalColor
|
|
8810
8786
|
* @param {string} _barColor
|
|
8811
8787
|
*/
|
|
8812
|
-
|
|
8788
|
+
const makeFrzArrow = (_j, _arrowCnt, _name, _normalColor, _barColor) => {
|
|
8813
8789
|
const boostSpdDir = g_workObj.boostSpd * g_workObj.scrollDir[_j];
|
|
8814
8790
|
const dividePos = g_workObj.dividePos[_j];
|
|
8815
8791
|
const frzNo = `${_j}_${_arrowCnt}`;
|
|
@@ -8876,7 +8852,7 @@ function MainInit() {
|
|
|
8876
8852
|
}),
|
|
8877
8853
|
|
|
8878
8854
|
);
|
|
8879
|
-
}
|
|
8855
|
+
};
|
|
8880
8856
|
|
|
8881
8857
|
/**
|
|
8882
8858
|
* フリーズアロー処理メイン
|
|
@@ -8884,7 +8860,7 @@ function MainInit() {
|
|
|
8884
8860
|
* @param {number} _k
|
|
8885
8861
|
* @param {string} _name
|
|
8886
8862
|
*/
|
|
8887
|
-
|
|
8863
|
+
const movFrzArrow = (_j, _k, _name) => {
|
|
8888
8864
|
const frzNo = `${_j}_${_k}`;
|
|
8889
8865
|
const frzName = `${_name}${frzNo}`;
|
|
8890
8866
|
const movY = g_workObj.currentSpeed * g_attrObj[frzName].boostSpd;
|
|
@@ -8943,12 +8919,12 @@ function MainInit() {
|
|
|
8943
8919
|
judgeObjDelete[_name](_j, frzName);
|
|
8944
8920
|
}
|
|
8945
8921
|
}
|
|
8946
|
-
}
|
|
8922
|
+
};
|
|
8947
8923
|
|
|
8948
8924
|
/**
|
|
8949
8925
|
* フレーム処理(譜面台)
|
|
8950
8926
|
*/
|
|
8951
|
-
|
|
8927
|
+
const flowTimeline = _ => {
|
|
8952
8928
|
|
|
8953
8929
|
const currentFrame = g_scoreObj.frameNum;
|
|
8954
8930
|
lblframe.textContent = currentFrame;
|
|
@@ -9187,7 +9163,7 @@ function MainInit() {
|
|
|
9187
9163
|
g_scoreObj.nominalFrameNum++;
|
|
9188
9164
|
g_timeoutEvtId = setTimeout(_ => flowTimeline(), 1000 / g_fps - buffTime);
|
|
9189
9165
|
}
|
|
9190
|
-
}
|
|
9166
|
+
};
|
|
9191
9167
|
g_skinJsObj.main.forEach(func => func());
|
|
9192
9168
|
|
|
9193
9169
|
g_audio.currentTime = firstFrame / g_fps * g_headerObj.playbackRate;
|
|
@@ -9201,14 +9177,14 @@ function MainInit() {
|
|
|
9201
9177
|
}
|
|
9202
9178
|
|
|
9203
9179
|
g_timeoutEvtId = setTimeout(_ => flowTimeline(), 1000 / g_fps);
|
|
9204
|
-
}
|
|
9180
|
+
};
|
|
9205
9181
|
|
|
9206
9182
|
/**
|
|
9207
9183
|
* アルファマスクの再描画 (Appearance: Hidden+, Sudden+ 用)
|
|
9208
9184
|
* @param {string} _appearance
|
|
9209
9185
|
* @param {number} _num
|
|
9210
9186
|
*/
|
|
9211
|
-
|
|
9187
|
+
const changeAppearanceFilter = (_appearance, _num = 10) => {
|
|
9212
9188
|
const topNum = g_hidSudObj[g_stateObj.appearance];
|
|
9213
9189
|
const bottomNum = (g_hidSudObj[g_stateObj.appearance] + 1) % 2;
|
|
9214
9190
|
if (_appearance === `Hid&Sud+` && _num > 50) {
|
|
@@ -9237,7 +9213,7 @@ function changeAppearanceFilter(_appearance, _num = 10) {
|
|
|
9237
9213
|
}
|
|
9238
9214
|
g_hidSudObj.filterPos = _num;
|
|
9239
9215
|
}
|
|
9240
|
-
}
|
|
9216
|
+
};
|
|
9241
9217
|
|
|
9242
9218
|
/**
|
|
9243
9219
|
* 判定カウンタ表示作成
|
|
@@ -9247,13 +9223,13 @@ function changeAppearanceFilter(_appearance, _num = 10) {
|
|
|
9247
9223
|
* @param {number} _heightPos
|
|
9248
9224
|
* @param {string, number} _text
|
|
9249
9225
|
*/
|
|
9250
|
-
|
|
9226
|
+
const makeCounterSymbol = (_id, _x, _class, _heightPos, _text, _display = C_DIS_INHERIT) => {
|
|
9251
9227
|
return createDivCss2Label(_id, _text, {
|
|
9252
9228
|
x: _x, y: C_LEN_JDGCNTS_HEIGHT * _heightPos,
|
|
9253
9229
|
w: C_LEN_JDGCNTS_WIDTH, h: C_LEN_JDGCNTS_HEIGHT, siz: C_SIZ_JDGCNTS, align: C_ALIGN_RIGHT,
|
|
9254
9230
|
display: _display,
|
|
9255
9231
|
}, _class);
|
|
9256
|
-
}
|
|
9232
|
+
};
|
|
9257
9233
|
|
|
9258
9234
|
// TODO: この部分を矢印塗りつぶし部分についても適用できるように関数を見直し
|
|
9259
9235
|
|
|
@@ -9264,7 +9240,7 @@ function makeCounterSymbol(_id, _x, _class, _heightPos, _text, _display = C_DIS_
|
|
|
9264
9240
|
* @param {string} _header
|
|
9265
9241
|
* @param {string} _name
|
|
9266
9242
|
*/
|
|
9267
|
-
|
|
9243
|
+
const changeColors = (_mkColor, _mkColorCd, _header, _name) => {
|
|
9268
9244
|
|
|
9269
9245
|
if (_mkColor === undefined) {
|
|
9270
9246
|
return;
|
|
@@ -9280,7 +9256,7 @@ function changeColors(_mkColor, _mkColorCd, _header, _name) {
|
|
|
9280
9256
|
}
|
|
9281
9257
|
}
|
|
9282
9258
|
});
|
|
9283
|
-
}
|
|
9259
|
+
};
|
|
9284
9260
|
|
|
9285
9261
|
/**
|
|
9286
9262
|
* 個別モーション
|
|
@@ -9288,7 +9264,7 @@ function changeColors(_mkColor, _mkColorCd, _header, _name) {
|
|
|
9288
9264
|
* @param {string} _name
|
|
9289
9265
|
* @param {number} _frameNum
|
|
9290
9266
|
*/
|
|
9291
|
-
|
|
9267
|
+
const changeCssMotions = (_header, _name, _frameNum) => {
|
|
9292
9268
|
|
|
9293
9269
|
const camelHeader = _header === `` ? _name : `${_header}${toCapitalize(_name)}`;
|
|
9294
9270
|
const frameData = g_workObj[`mk${toCapitalize(camelHeader)}CssMotion`][_frameNum];
|
|
@@ -9300,14 +9276,14 @@ function changeCssMotions(_header, _name, _frameNum) {
|
|
|
9300
9276
|
g_workObj[`mk${toCapitalize(camelHeader)}CssMotionName`][_frameNum][2 * j + g_workObj.dividePos[targetj]];
|
|
9301
9277
|
}
|
|
9302
9278
|
}
|
|
9303
|
-
}
|
|
9279
|
+
};
|
|
9304
9280
|
|
|
9305
9281
|
/**
|
|
9306
9282
|
* フリーズアローヒット時の描画変更
|
|
9307
9283
|
* @param {number} _j
|
|
9308
9284
|
* @param {number} _k
|
|
9309
9285
|
*/
|
|
9310
|
-
|
|
9286
|
+
const changeHitFrz = (_j, _k, _name) => {
|
|
9311
9287
|
const frzNo = `${_j}_${_k}`;
|
|
9312
9288
|
const frzName = `${_name}${frzNo}`;
|
|
9313
9289
|
|
|
@@ -9353,14 +9329,14 @@ function changeHitFrz(_j, _k, _name) {
|
|
|
9353
9329
|
$id(`frzHitTop${_j}`).background = g_workObj.frzHitColors[_j];
|
|
9354
9330
|
}
|
|
9355
9331
|
}
|
|
9356
|
-
}
|
|
9332
|
+
};
|
|
9357
9333
|
|
|
9358
9334
|
/**
|
|
9359
9335
|
* フリーズアロー失敗時の描画変更
|
|
9360
9336
|
* @param {number} _j
|
|
9361
9337
|
* @param {number} _k
|
|
9362
9338
|
*/
|
|
9363
|
-
|
|
9339
|
+
const changeFailedFrz = (_j, _k) => {
|
|
9364
9340
|
const frzNo = `${_j}_${_k}`;
|
|
9365
9341
|
$id(`frzHit${_j}`).opacity = 0;
|
|
9366
9342
|
$id(`frzTop${frzNo}`).display = C_DIS_INHERIT;
|
|
@@ -9374,28 +9350,19 @@ function changeFailedFrz(_j, _k) {
|
|
|
9374
9350
|
$id(`frzTopShadow${frzNo}`).background = `#333333`;
|
|
9375
9351
|
$id(`frzBtmShadow${frzNo}`).background = `#333333`;
|
|
9376
9352
|
}
|
|
9377
|
-
}
|
|
9353
|
+
};
|
|
9378
9354
|
|
|
9379
9355
|
/**
|
|
9380
9356
|
* キーを押したかどうかを判定
|
|
9381
9357
|
* @param {number} _keyCode
|
|
9382
9358
|
*/
|
|
9383
|
-
|
|
9384
|
-
return g_inputKeyBuffer[_keyCode];
|
|
9385
|
-
}
|
|
9386
|
-
|
|
9387
|
-
const jdgList = [`ii`, `shakin`, `matari`, `shobon`].map(jdg => toCapitalize(jdg));
|
|
9388
|
-
const jdgFuncList = [judgeIi, judgeShakin, judgeMatari, judgeShobon];
|
|
9389
|
-
const checkJudgment = (_difCnt) => {
|
|
9390
|
-
const idx = g_judgObj.arrowJ.findIndex(jdgCnt => _difCnt <= jdgCnt);
|
|
9391
|
-
return [jdgFuncList[idx], jdgList[idx]];
|
|
9392
|
-
};
|
|
9359
|
+
const keyIsDown = _keyCode => g_inputKeyBuffer[_keyCode];
|
|
9393
9360
|
|
|
9394
9361
|
/**
|
|
9395
9362
|
* 矢印・フリーズアロー判定
|
|
9396
9363
|
* @param {number} _j 対象矢印・フリーズアロー
|
|
9397
9364
|
*/
|
|
9398
|
-
|
|
9365
|
+
const judgeArrow = _j => {
|
|
9399
9366
|
|
|
9400
9367
|
const currentNo = g_workObj.judgArrowCnt[_j];
|
|
9401
9368
|
const arrowName = `arrow${_j}_${currentNo}`;
|
|
@@ -9440,7 +9407,7 @@ function judgeArrow(_j) {
|
|
|
9440
9407
|
return true;
|
|
9441
9408
|
}
|
|
9442
9409
|
return false;
|
|
9443
|
-
}
|
|
9410
|
+
};
|
|
9444
9411
|
|
|
9445
9412
|
let judgeFlg = false;
|
|
9446
9413
|
const difFrame = (existJudgArrow ? g_attrObj[arrowName].cnt : Infinity);
|
|
@@ -9453,14 +9420,14 @@ function judgeArrow(_j) {
|
|
|
9453
9420
|
if (!judgeFlg) {
|
|
9454
9421
|
$id(`stepDiv${_j}`).display = C_DIS_INHERIT;
|
|
9455
9422
|
}
|
|
9456
|
-
}
|
|
9423
|
+
};
|
|
9457
9424
|
|
|
9458
9425
|
/**
|
|
9459
9426
|
* タイミングズレを表示
|
|
9460
9427
|
* @param {number} _difFrame
|
|
9461
9428
|
* @param {number} _justFrames
|
|
9462
9429
|
*/
|
|
9463
|
-
|
|
9430
|
+
const displayDiff = (_difFrame, _justFrames = 0) => {
|
|
9464
9431
|
let diffJDisp = ``;
|
|
9465
9432
|
g_workObj.diffList.push(_difFrame);
|
|
9466
9433
|
const difCnt = Math.abs(_difFrame);
|
|
@@ -9470,26 +9437,26 @@ function displayDiff(_difFrame, _justFrames = 0) {
|
|
|
9470
9437
|
diffJDisp = `<span class="common_shobon">Slow ${difCnt} Frames</span>`;
|
|
9471
9438
|
}
|
|
9472
9439
|
diffJ.innerHTML = diffJDisp;
|
|
9473
|
-
}
|
|
9440
|
+
};
|
|
9474
9441
|
|
|
9475
9442
|
/**
|
|
9476
9443
|
* Fast/Slowカウンタ
|
|
9477
9444
|
* @param {number} _difFrame
|
|
9478
9445
|
* @param {number} _justFrames
|
|
9479
9446
|
*/
|
|
9480
|
-
|
|
9447
|
+
const countFastSlow = (_difFrame, _justFrames = 0) => {
|
|
9481
9448
|
if (_difFrame > _justFrames) {
|
|
9482
9449
|
g_resultObj.fast++;
|
|
9483
9450
|
} else if (_difFrame < _justFrames * (-1)) {
|
|
9484
9451
|
g_resultObj.slow++;
|
|
9485
9452
|
}
|
|
9486
|
-
}
|
|
9453
|
+
};
|
|
9487
9454
|
|
|
9488
9455
|
/**
|
|
9489
9456
|
* ライフゲージバーの色、数値を変更
|
|
9490
9457
|
* @param {string} _state
|
|
9491
9458
|
*/
|
|
9492
|
-
|
|
9459
|
+
const changeLifeColor = (_state = ``) => {
|
|
9493
9460
|
const lblLife = document.querySelector(`#lblLife`);
|
|
9494
9461
|
const lifeBar = document.querySelector(`#lifeBar`);
|
|
9495
9462
|
if (_state !== ``) {
|
|
@@ -9504,9 +9471,9 @@ function changeLifeColor(_state = ``) {
|
|
|
9504
9471
|
lblLife.textContent = intLifeVal;
|
|
9505
9472
|
lifeBar.style.top = `${50 + (g_sHeight - 100) * (g_headerObj.maxLifeVal - intLifeVal) / g_headerObj.maxLifeVal}px`;
|
|
9506
9473
|
lifeBar.style.height = `${(g_sHeight - 100) * intLifeVal / g_headerObj.maxLifeVal}px`;
|
|
9507
|
-
}
|
|
9474
|
+
};
|
|
9508
9475
|
|
|
9509
|
-
|
|
9476
|
+
const lifeRecovery = _ => {
|
|
9510
9477
|
g_workObj.lifeVal += g_workObj.lifeRcv;
|
|
9511
9478
|
|
|
9512
9479
|
if (g_workObj.lifeVal >= g_headerObj.maxLifeVal) {
|
|
@@ -9515,9 +9482,9 @@ function lifeRecovery() {
|
|
|
9515
9482
|
} else {
|
|
9516
9483
|
changeLifeColor(g_workObj.lifeVal >= g_workObj.lifeBorder ? `Cleared` : ``);
|
|
9517
9484
|
}
|
|
9518
|
-
}
|
|
9485
|
+
};
|
|
9519
9486
|
|
|
9520
|
-
|
|
9487
|
+
const lifeDamage = _ => {
|
|
9521
9488
|
g_workObj.lifeVal -= g_workObj.lifeDmg;
|
|
9522
9489
|
|
|
9523
9490
|
if (g_workObj.lifeVal <= 0) {
|
|
@@ -9526,7 +9493,7 @@ function lifeDamage() {
|
|
|
9526
9493
|
} else {
|
|
9527
9494
|
changeLifeColor(g_workObj.lifeVal < g_workObj.lifeBorder ? `Failed` : `Cleared`);
|
|
9528
9495
|
}
|
|
9529
|
-
}
|
|
9496
|
+
};
|
|
9530
9497
|
|
|
9531
9498
|
/**
|
|
9532
9499
|
* 判定キャラクタの表示、判定済矢印数・判定数のカウンタ
|
|
@@ -9534,31 +9501,31 @@ function lifeDamage() {
|
|
|
9534
9501
|
* @param {string} _character
|
|
9535
9502
|
* @param {string} _freezeFlg
|
|
9536
9503
|
*/
|
|
9537
|
-
|
|
9504
|
+
const changeJudgeCharacter = (_name, _character, _freezeFlg = ``) => {
|
|
9538
9505
|
g_resultObj[_name]++;
|
|
9539
9506
|
g_currentArrows++;
|
|
9540
9507
|
document.querySelector(`#chara${_freezeFlg}J`).innerHTML = `<span class="common_${_name}">${_character}</span>`;
|
|
9541
9508
|
document.querySelector(`#chara${_freezeFlg}J`).setAttribute(`cnt`, C_FRM_JDGMOTION);
|
|
9542
9509
|
document.querySelector(`#lbl${toCapitalize(_name)}`).textContent = g_resultObj[_name];
|
|
9543
|
-
}
|
|
9510
|
+
};
|
|
9544
9511
|
|
|
9545
9512
|
/**
|
|
9546
9513
|
* コンボの更新
|
|
9547
9514
|
*/
|
|
9548
|
-
|
|
9515
|
+
const updateCombo = _ => {
|
|
9549
9516
|
if (++g_resultObj.combo > g_resultObj.maxCombo) {
|
|
9550
9517
|
g_resultObj.maxCombo = g_resultObj.combo;
|
|
9551
9518
|
lblMCombo.textContent = g_resultObj.maxCombo;
|
|
9552
9519
|
}
|
|
9553
9520
|
comboJ.textContent = `${g_resultObj.combo} Combo!!`;
|
|
9554
|
-
}
|
|
9521
|
+
};
|
|
9555
9522
|
|
|
9556
9523
|
/**
|
|
9557
9524
|
* 回復判定の共通処理
|
|
9558
9525
|
* @param {string} _name
|
|
9559
9526
|
* @param {number} _difFrame
|
|
9560
9527
|
*/
|
|
9561
|
-
|
|
9528
|
+
const judgeRecovery = (_name, _difFrame) => {
|
|
9562
9529
|
changeJudgeCharacter(_name, g_lblNameObj[`j_${_name}`]);
|
|
9563
9530
|
|
|
9564
9531
|
updateCombo();
|
|
@@ -9568,73 +9535,65 @@ function judgeRecovery(_name, _difFrame) {
|
|
|
9568
9535
|
finishViewing();
|
|
9569
9536
|
|
|
9570
9537
|
g_customJsObj[`judg_${_name}`].forEach(func => func(_difFrame));
|
|
9571
|
-
}
|
|
9538
|
+
};
|
|
9572
9539
|
|
|
9573
9540
|
/**
|
|
9574
9541
|
* ダメージ系共通処理
|
|
9575
9542
|
* @param {string} _name
|
|
9576
9543
|
* @param {number} _difFrame
|
|
9577
9544
|
*/
|
|
9578
|
-
|
|
9545
|
+
const judgeDamage = (_name, _difFrame) => {
|
|
9579
9546
|
changeJudgeCharacter(_name, g_lblNameObj[`j_${_name}`]);
|
|
9580
9547
|
g_resultObj.combo = 0;
|
|
9581
9548
|
comboJ.textContent = ``;
|
|
9582
9549
|
diffJ.textContent = ``;
|
|
9583
9550
|
lifeDamage();
|
|
9584
9551
|
g_customJsObj[`judg_${_name}`].forEach(func => func(_difFrame));
|
|
9585
|
-
}
|
|
9552
|
+
};
|
|
9586
9553
|
|
|
9587
9554
|
/**
|
|
9588
9555
|
* 判定処理:イイ
|
|
9589
|
-
* @param {number}
|
|
9556
|
+
* @param {number} _difFrame
|
|
9590
9557
|
*/
|
|
9591
|
-
|
|
9592
|
-
judgeRecovery(`ii`, difFrame);
|
|
9593
|
-
}
|
|
9558
|
+
const judgeIi = _difFrame => judgeRecovery(`ii`, _difFrame);
|
|
9594
9559
|
|
|
9595
9560
|
/**
|
|
9596
9561
|
* 判定処理:シャキン
|
|
9597
|
-
* @param {number}
|
|
9562
|
+
* @param {number} _difFrame
|
|
9598
9563
|
*/
|
|
9599
|
-
|
|
9600
|
-
judgeRecovery(`shakin`, difFrame);
|
|
9601
|
-
}
|
|
9564
|
+
const judgeShakin = _difFrame => judgeRecovery(`shakin`, _difFrame);
|
|
9602
9565
|
|
|
9603
9566
|
/**
|
|
9604
9567
|
* 判定処理:マターリ
|
|
9605
|
-
* @param {number}
|
|
9568
|
+
* @param {number} _difFrame
|
|
9606
9569
|
*/
|
|
9607
|
-
|
|
9570
|
+
const judgeMatari = _difFrame => {
|
|
9608
9571
|
changeJudgeCharacter(`matari`, g_lblNameObj.j_matari);
|
|
9609
9572
|
comboJ.textContent = ``;
|
|
9610
9573
|
|
|
9611
9574
|
displayDiff(difFrame, g_headerObj.justFrames);
|
|
9612
9575
|
finishViewing();
|
|
9613
9576
|
|
|
9614
|
-
g_customJsObj.judg_matari.forEach(func => func(
|
|
9615
|
-
}
|
|
9577
|
+
g_customJsObj.judg_matari.forEach(func => func(_difFrame));
|
|
9578
|
+
};
|
|
9616
9579
|
|
|
9617
9580
|
/**
|
|
9618
9581
|
* 判定処理:ショボーン
|
|
9619
|
-
* @param {number}
|
|
9582
|
+
* @param {number} _difFrame
|
|
9620
9583
|
*/
|
|
9621
|
-
|
|
9622
|
-
judgeDamage(`shobon`, difFrame);
|
|
9623
|
-
}
|
|
9584
|
+
const judgeShobon = _difFrame => judgeDamage(`shobon`, _difFrame);
|
|
9624
9585
|
|
|
9625
9586
|
/**
|
|
9626
9587
|
* 判定処理:ウワァン
|
|
9627
|
-
* @param {number}
|
|
9588
|
+
* @param {number} _difFrame
|
|
9628
9589
|
*/
|
|
9629
|
-
|
|
9630
|
-
judgeDamage(`uwan`, difFrame);
|
|
9631
|
-
}
|
|
9590
|
+
const judgeUwan = _difFrame => judgeDamage(`uwan`, _difFrame);
|
|
9632
9591
|
|
|
9633
9592
|
/**
|
|
9634
9593
|
* 判定処理:キター
|
|
9635
|
-
* @param {number}
|
|
9594
|
+
* @param {number} _difFrame
|
|
9636
9595
|
*/
|
|
9637
|
-
|
|
9596
|
+
const judgeKita = _difFrame => {
|
|
9638
9597
|
changeJudgeCharacter(`kita`, g_lblNameObj.j_kita, `F`);
|
|
9639
9598
|
|
|
9640
9599
|
if (++g_resultObj.fCombo > g_resultObj.fmaxCombo) {
|
|
@@ -9646,22 +9605,29 @@ function judgeKita(difFrame) {
|
|
|
9646
9605
|
lifeRecovery();
|
|
9647
9606
|
finishViewing();
|
|
9648
9607
|
|
|
9649
|
-
g_customJsObj.judg_kita.forEach(func => func(
|
|
9650
|
-
}
|
|
9608
|
+
g_customJsObj.judg_kita.forEach(func => func(_difFrame));
|
|
9609
|
+
};
|
|
9651
9610
|
|
|
9652
9611
|
/**
|
|
9653
9612
|
* 判定処理:イクナイ
|
|
9654
|
-
* @param {number}
|
|
9613
|
+
* @param {number} _difFrame
|
|
9655
9614
|
*/
|
|
9656
|
-
|
|
9615
|
+
const judgeIknai = _difFrame => {
|
|
9657
9616
|
changeJudgeCharacter(`iknai`, g_lblNameObj.j_iknai, `F`);
|
|
9658
9617
|
comboFJ.textContent = ``;
|
|
9659
9618
|
g_resultObj.fCombo = 0;
|
|
9660
9619
|
|
|
9661
9620
|
lifeDamage();
|
|
9662
9621
|
|
|
9663
|
-
g_customJsObj.judg_iknai.forEach(func => func(
|
|
9664
|
-
}
|
|
9622
|
+
g_customJsObj.judg_iknai.forEach(func => func(_difFrame));
|
|
9623
|
+
};
|
|
9624
|
+
|
|
9625
|
+
const jdgList = [`ii`, `shakin`, `matari`, `shobon`].map(jdg => toCapitalize(jdg));
|
|
9626
|
+
const jdgFuncList = [judgeIi, judgeShakin, judgeMatari, judgeShobon];
|
|
9627
|
+
const checkJudgment = (_difCnt) => {
|
|
9628
|
+
const idx = g_judgObj.arrowJ.findIndex(jdgCnt => _difCnt <= jdgCnt);
|
|
9629
|
+
return [jdgFuncList[idx], jdgList[idx]];
|
|
9630
|
+
};
|
|
9665
9631
|
|
|
9666
9632
|
// クリア表示
|
|
9667
9633
|
const resultViewText = _state => _state === `` ? `` :
|
|
@@ -9671,14 +9637,14 @@ const resultViewText = _state => _state === `` ? `` :
|
|
|
9671
9637
|
* フルコンボ・パーフェクト演出の作成
|
|
9672
9638
|
* @param {string} _text
|
|
9673
9639
|
*/
|
|
9674
|
-
|
|
9640
|
+
const makeFinishView = _text => {
|
|
9675
9641
|
finishView.innerHTML = _text;
|
|
9676
9642
|
finishView.style.opacity = 1;
|
|
9677
9643
|
[`charaJ`, `comboJ`, `diffJ`, `charaFJ`, `comboFJ`, `diffFJ`].forEach(label =>
|
|
9678
9644
|
document.querySelector(`#${label}`).textContent = ``);
|
|
9679
|
-
}
|
|
9645
|
+
};
|
|
9680
9646
|
|
|
9681
|
-
|
|
9647
|
+
const finishViewing = _ => {
|
|
9682
9648
|
if (g_currentArrows === g_fullArrows) {
|
|
9683
9649
|
if (g_resultObj.ii + g_resultObj.kita === g_fullArrows) {
|
|
9684
9650
|
g_resultObj.spState = `allPerfect`;
|
|
@@ -9691,7 +9657,7 @@ function finishViewing() {
|
|
|
9691
9657
|
makeFinishView(resultViewText(g_resultObj.spState));
|
|
9692
9658
|
}
|
|
9693
9659
|
}
|
|
9694
|
-
}
|
|
9660
|
+
};
|
|
9695
9661
|
|
|
9696
9662
|
/*-----------------------------------------------------------*/
|
|
9697
9663
|
/* Scene : RESULT [grape] */
|
|
@@ -9700,7 +9666,7 @@ function finishViewing() {
|
|
|
9700
9666
|
/**
|
|
9701
9667
|
* リザルト画面初期化
|
|
9702
9668
|
*/
|
|
9703
|
-
|
|
9669
|
+
const resultInit = _ => {
|
|
9704
9670
|
|
|
9705
9671
|
clearWindow(true);
|
|
9706
9672
|
g_currentPage = `result`;
|
|
@@ -9819,6 +9785,15 @@ function resultInit() {
|
|
|
9819
9785
|
transKeyData = `(` + g_keyObj[`transKey${keyCtrlPtn}`] + `)`;
|
|
9820
9786
|
}
|
|
9821
9787
|
|
|
9788
|
+
/**
|
|
9789
|
+
* プレイスタイルのカスタム有無
|
|
9790
|
+
* @param {string} _flg
|
|
9791
|
+
* @param {string, boolean} _defaultSet デフォルト値
|
|
9792
|
+
* @param {string} _displayText
|
|
9793
|
+
*/
|
|
9794
|
+
const withOptions = (_flg, _defaultSet, _displayText = _flg) =>
|
|
9795
|
+
(_flg !== _defaultSet ? getStgDetailName(_displayText) : ``);
|
|
9796
|
+
|
|
9822
9797
|
let difData = [
|
|
9823
9798
|
`${getKeyName(g_headerObj.keyLabels[g_stateObj.scoreId])}${transKeyData} ${getStgDetailName('key')} / ${g_headerObj.difLabels[g_stateObj.scoreId]}`,
|
|
9824
9799
|
`${withOptions(g_autoPlaysBase.includes(g_stateObj.autoPlay), true, `-${getStgDetailName(g_stateObj.autoPlay)}${getStgDetailName('less')}`)}`,
|
|
@@ -9875,16 +9850,6 @@ function resultInit() {
|
|
|
9875
9850
|
makeCssResultPlayData(`lblDisplay2Data`, 60, g_cssObj.result_style, 5, display2Data),
|
|
9876
9851
|
);
|
|
9877
9852
|
|
|
9878
|
-
/**
|
|
9879
|
-
* プレイスタイルのカスタム有無
|
|
9880
|
-
* @param {string} _flg
|
|
9881
|
-
* @param {string, boolean} _defaultSet デフォルト値
|
|
9882
|
-
* @param {string} _displayText
|
|
9883
|
-
*/
|
|
9884
|
-
function withOptions(_flg, _defaultSet, _displayText = _flg) {
|
|
9885
|
-
return (_flg !== _defaultSet ? getStgDetailName(_displayText) : ``);
|
|
9886
|
-
}
|
|
9887
|
-
|
|
9888
9853
|
// キャラクタ、スコア描画のID共通部、色CSS名、スコア変数名
|
|
9889
9854
|
const jdgScoreObj = {
|
|
9890
9855
|
ii: { pos: 0, id: `Ii`, color: `ii`, label: g_lblNameObj.j_ii, },
|
|
@@ -10154,7 +10119,7 @@ function resultInit() {
|
|
|
10154
10119
|
/**
|
|
10155
10120
|
* タイトルのモーション設定
|
|
10156
10121
|
*/
|
|
10157
|
-
|
|
10122
|
+
const flowResultTimeline = _ => {
|
|
10158
10123
|
|
|
10159
10124
|
// ユーザカスタムイベント(フレーム毎)
|
|
10160
10125
|
g_customJsObj.resultEnterFrame.forEach(func => func());
|
|
@@ -10185,7 +10150,7 @@ function resultInit() {
|
|
|
10185
10150
|
g_scoreObj.backResultFrameNum++;
|
|
10186
10151
|
g_scoreObj.maskResultFrameNum++;
|
|
10187
10152
|
g_timeoutEvtResultId = setTimeout(_ => flowResultTimeline(), 1000 / g_fps - buffTime);
|
|
10188
|
-
}
|
|
10153
|
+
};
|
|
10189
10154
|
|
|
10190
10155
|
g_timeoutEvtResultId = setTimeout(_ => flowResultTimeline(), 1000 / g_fps);
|
|
10191
10156
|
|
|
@@ -10194,7 +10159,7 @@ function resultInit() {
|
|
|
10194
10159
|
document.oncontextmenu = _ => true;
|
|
10195
10160
|
|
|
10196
10161
|
g_skinJsObj.result.forEach(func => func());
|
|
10197
|
-
}
|
|
10162
|
+
};
|
|
10198
10163
|
|
|
10199
10164
|
/**
|
|
10200
10165
|
* シャッフル名称の取得
|
|
@@ -10206,7 +10171,7 @@ const getShuffleName = _ => {
|
|
|
10206
10171
|
shuffleName += setScoreIdHeader(g_keycons.shuffleGroupNum);
|
|
10207
10172
|
}
|
|
10208
10173
|
return shuffleName;
|
|
10209
|
-
}
|
|
10174
|
+
};
|
|
10210
10175
|
|
|
10211
10176
|
/**
|
|
10212
10177
|
* 結果表示作成(曲名、オプション)
|
|
@@ -10217,11 +10182,10 @@ const getShuffleName = _ => {
|
|
|
10217
10182
|
* @param {string} _text
|
|
10218
10183
|
* @param {string} _align
|
|
10219
10184
|
*/
|
|
10220
|
-
|
|
10221
|
-
|
|
10185
|
+
const makeCssResultPlayData = (_id, _x, _class, _heightPos, _text, _align = C_ALIGN_CENTER, { w = 400, siz = C_SIZ_MAIN } = {}) =>
|
|
10186
|
+
createDivCss2Label(_id, _text, {
|
|
10222
10187
|
x: _x, y: C_SIZ_SETMINI * _heightPos, w, h: C_SIZ_SETMINI, siz, align: _align,
|
|
10223
10188
|
}, _class);
|
|
10224
|
-
}
|
|
10225
10189
|
|
|
10226
10190
|
/**
|
|
10227
10191
|
* 結果表示作成(キャラクタ)
|
|
@@ -10232,9 +10196,8 @@ function makeCssResultPlayData(_id, _x, _class, _heightPos, _text, _align = C_AL
|
|
|
10232
10196
|
* @param {string} _text
|
|
10233
10197
|
* @param {string} _align
|
|
10234
10198
|
*/
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
}
|
|
10199
|
+
const makeCssResultSymbol = (_id, _x, _class, _heightPos, _text, _align = C_ALIGN_LEFT) =>
|
|
10200
|
+
makeCssResultPlayData(_id, _x, _class, _heightPos, _text, _align, { w: 150, siz: C_SIZ_JDGCNTS });
|
|
10238
10201
|
|
|
10239
10202
|
// ライセンス原文、以下は削除しないでください
|
|
10240
10203
|
/*-----------------------------------------------------------*/
|