danoniplus 26.6.0 → 27.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/danoni_main.js +214 -343
- package/js/lib/danoni_constants.js +55 -19
- package/js/lib/danoni_legacy_function.js +84 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised : 2022/
|
|
8
|
+
* Revised : 2022/03/18 (v27.0.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -28,6 +28,19 @@ const C_LBL_BASICFONT = `"Meiryo UI", sans-serif`;
|
|
|
28
28
|
|
|
29
29
|
const C_BTN_HEIGHT = 50;
|
|
30
30
|
const C_LNK_HEIGHT = 30;
|
|
31
|
+
const C_LEN_SETLBL_LEFT = 160;
|
|
32
|
+
const C_LEN_SETLBL_WIDTH = 210;
|
|
33
|
+
const C_LEN_DIFSELECTOR_WIDTH = 250;
|
|
34
|
+
const C_LEN_DIFCOVER_WIDTH = 110;
|
|
35
|
+
const C_LEN_SETLBL_HEIGHT = 23;
|
|
36
|
+
const C_SIZ_SETLBL = 17;
|
|
37
|
+
const C_LEN_SETDIFLBL_HEIGHT = 25;
|
|
38
|
+
const C_SIZ_SETDIFLBL = 17;
|
|
39
|
+
const C_LEN_SETMINI_WIDTH = 40;
|
|
40
|
+
const C_SIZ_SETMINI = 18;
|
|
41
|
+
const C_SIZ_DIFSELECTOR = 14;
|
|
42
|
+
const C_SIZ_MAIN = 14;
|
|
43
|
+
const C_SIZ_MUSIC_TITLE = 13;
|
|
31
44
|
|
|
32
45
|
// スプライト(ムービークリップ相当)のルート
|
|
33
46
|
const C_SPRITE_ROOT = `divRoot`;
|
|
@@ -58,6 +71,32 @@ const C_TYP_FUNCTION = `function`;
|
|
|
58
71
|
const C_TYP_SWITCH = `switch`;
|
|
59
72
|
const C_TYP_CALC = `calc`;
|
|
60
73
|
|
|
74
|
+
// ウィンドウサイズ
|
|
75
|
+
let [g_sWidth, g_sHeight] = [
|
|
76
|
+
setVal($id(`canvas-frame`).width, 600, C_TYP_FLOAT), setVal($id(`canvas-frame`).height, 500, C_TYP_FLOAT)
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// 固定ウィンドウサイズ
|
|
80
|
+
const g_windowObj = {
|
|
81
|
+
divRoot: { margin: `auto`, letterSpacing: `normal` },
|
|
82
|
+
divBack: { background: `linear-gradient(#000000, #222222)` },
|
|
83
|
+
|
|
84
|
+
optionSprite: { x: (g_sWidth - 450) / 2, y: 65 + (g_sHeight - 500) / 2, w: 450, h: 325 },
|
|
85
|
+
difList: { x: 165, y: 65, w: 280, h: 255, overflow: `auto` },
|
|
86
|
+
difCover: { x: 25, y: 65, w: 140, h: 255, overflow: `auto`, opacity: 0.95 },
|
|
87
|
+
|
|
88
|
+
scoreDetail: { x: 20, y: 90, w: 420, h: 230, visibility: `hidden` },
|
|
89
|
+
detailObj: { w: 420, h: 230, visibility: `hidden` },
|
|
90
|
+
|
|
91
|
+
displaySprite: { x: 25, y: 30, w: (g_sWidth - 450) / 2, h: C_LEN_SETLBL_HEIGHT * 5 },
|
|
92
|
+
keyconSprite: { y: 88 + (g_sHeight - 500) / 2, h: g_sHeight, overflow: `auto` },
|
|
93
|
+
|
|
94
|
+
loader: { y: g_sHeight - 10, h: 10, backgroundColor: `#333333` },
|
|
95
|
+
|
|
96
|
+
playDataWindow: { x: g_sWidth / 2 - 225, y: 70 + (g_sHeight - 500) / 2, w: 450, h: 110 },
|
|
97
|
+
resultWindow: { x: g_sWidth / 2 - 200, y: 185 + (g_sHeight - 500) / 2, w: 400, h: 210 },
|
|
98
|
+
};
|
|
99
|
+
|
|
61
100
|
const g_imgObj = {};
|
|
62
101
|
|
|
63
102
|
// 画像ファイル
|
|
@@ -223,20 +262,6 @@ const C_BLOCK_KEYS = [
|
|
|
223
262
|
];
|
|
224
263
|
|
|
225
264
|
/** 設定・オプション画面用共通 */
|
|
226
|
-
const C_LEN_SETLBL_LEFT = 160;
|
|
227
|
-
const C_LEN_SETLBL_WIDTH = 210;
|
|
228
|
-
const C_LEN_DIFSELECTOR_WIDTH = 250;
|
|
229
|
-
const C_LEN_DIFCOVER_WIDTH = 110;
|
|
230
|
-
const C_LEN_SETLBL_HEIGHT = 23;
|
|
231
|
-
const C_SIZ_SETLBL = 17;
|
|
232
|
-
const C_LEN_SETDIFLBL_HEIGHT = 25;
|
|
233
|
-
const C_SIZ_SETDIFLBL = 17;
|
|
234
|
-
const C_LEN_SETMINI_WIDTH = 40;
|
|
235
|
-
const C_SIZ_SETMINI = 18;
|
|
236
|
-
const C_SIZ_DIFSELECTOR = 14;
|
|
237
|
-
const C_SIZ_MAIN = 14;
|
|
238
|
-
const C_SIZ_MUSIC_TITLE = 13;
|
|
239
|
-
|
|
240
265
|
const C_LEN_GRAPH_WIDTH = 286;
|
|
241
266
|
const C_LEN_GRAPH_HEIGHT = 226;
|
|
242
267
|
const C_CLR_SPEEDGRAPH_SPEED = `#cc3333`;
|
|
@@ -563,10 +588,6 @@ let g_storeSettings = [`appearance`, `opacity`, `d_stepzone`, `d_judgment`, `d_f
|
|
|
563
588
|
|
|
564
589
|
let g_canDisabledSettings = [`motion`, `scroll`, `shuffle`, `autoPlay`, `gauge`, `appearance`];
|
|
565
590
|
|
|
566
|
-
// サイズ(後で指定)
|
|
567
|
-
let g_sWidth;
|
|
568
|
-
let g_sHeight;
|
|
569
|
-
|
|
570
591
|
const g_hidSudObj = {
|
|
571
592
|
filterPos: 10,
|
|
572
593
|
|
|
@@ -2393,6 +2414,10 @@ const g_dfColorLightObj = {
|
|
|
2393
2414
|
],
|
|
2394
2415
|
};
|
|
2395
2416
|
|
|
2417
|
+
/**
|
|
2418
|
+
* 特殊文字列の置き換えリスト
|
|
2419
|
+
* (置き換え元、置き換え先の組で二次元配列として定義。主にreplaceStr関数で使用)
|
|
2420
|
+
*/
|
|
2396
2421
|
const g_escapeStr = {
|
|
2397
2422
|
escape: [[`&`, `&`], [`<`, `<`], [`>`, `>`], [`"`, `"`]],
|
|
2398
2423
|
escapeTag: [
|
|
@@ -2407,6 +2432,17 @@ const g_escapeStr = {
|
|
|
2407
2432
|
escapeCode: [
|
|
2408
2433
|
[`<script>`, ``], [`</script>`, ``],
|
|
2409
2434
|
],
|
|
2435
|
+
musicNameSimple: [
|
|
2436
|
+
[`<br>`, ` `], [`<nbr>`, ``], [`<dbr>`, ` `],
|
|
2437
|
+
],
|
|
2438
|
+
musicNameMultiLine: [
|
|
2439
|
+
[`<nbr>`, `<br>`], [`<dbr>`, `<br>`],
|
|
2440
|
+
],
|
|
2441
|
+
frzName: [
|
|
2442
|
+
[`leftdia`, `frzLdia`], [`rightdia`, `frzRdia`],
|
|
2443
|
+
[`left`, `frzLeft`], [`down`, `frzDown`], [`up`, `frzUp`], [`right`, `frzRight`],
|
|
2444
|
+
[`space`, `frzSpace`], [`iyo`, `frzIyo`], [`gor`, `frzGor`], [`oni`, `foni`],
|
|
2445
|
+
],
|
|
2410
2446
|
};
|
|
2411
2447
|
|
|
2412
2448
|
/**
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised :
|
|
8
|
+
* Revised : 2022/03/18 (v27.0.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -609,3 +609,86 @@ function createDivCustomLabel(_id, _x, _y, _width, _height, _fontsize, _color, _
|
|
|
609
609
|
|
|
610
610
|
return div;
|
|
611
611
|
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* 外部jsファイルの読込 (callback)
|
|
615
|
+
* 読込可否を g_loadObj[ファイル名] で管理 (true: 読込成功, false: 読込失敗)
|
|
616
|
+
* @deprecated v27以降非推奨
|
|
617
|
+
* @param {string} _url
|
|
618
|
+
* @param {function} _callback
|
|
619
|
+
* @param {boolean} _requiredFlg (default : true / 読込必須)
|
|
620
|
+
* @param {string} _charset (default : UTF-8)
|
|
621
|
+
*/
|
|
622
|
+
function loadScript(_url, _callback, _requiredFlg = true, _charset = `UTF-8`) {
|
|
623
|
+
const baseUrl = _url.split(`?`)[0];
|
|
624
|
+
g_loadObj[baseUrl] = false;
|
|
625
|
+
const script = document.createElement(`script`);
|
|
626
|
+
script.type = `text/javascript`;
|
|
627
|
+
script.src = _url;
|
|
628
|
+
script.charset = _charset;
|
|
629
|
+
script.onload = _ => {
|
|
630
|
+
g_loadObj[baseUrl] = true;
|
|
631
|
+
_callback();
|
|
632
|
+
};
|
|
633
|
+
script.onerror = _ => {
|
|
634
|
+
if (_requiredFlg) {
|
|
635
|
+
makeWarningWindow(g_msgInfoObj.E_0041.split(`{0}`).join(_url.split(`?`)[0]));
|
|
636
|
+
} else {
|
|
637
|
+
_callback();
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
document.querySelector(`head`).appendChild(script);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* CSSファイルの読み込み (callback)
|
|
645
|
+
* デフォルトは danoni_skin_default.css を読み込む
|
|
646
|
+
* @deprecated v27以降非推奨
|
|
647
|
+
* @param {url} _href
|
|
648
|
+
* @param {function} _func
|
|
649
|
+
*/
|
|
650
|
+
function importCssFile(_href, _func) {
|
|
651
|
+
const baseUrl = _href.split(`?`)[0];
|
|
652
|
+
g_loadObj[baseUrl] = false;
|
|
653
|
+
const link = document.createElement(`link`);
|
|
654
|
+
link.rel = `stylesheet`;
|
|
655
|
+
link.href = _href;
|
|
656
|
+
link.onload = _ => {
|
|
657
|
+
g_loadObj[baseUrl] = true;
|
|
658
|
+
_func();
|
|
659
|
+
};
|
|
660
|
+
link.onerror = _ => {
|
|
661
|
+
makeWarningWindow(g_msgInfoObj.E_0041.split(`{0}`).join(baseUrl), { resetFlg: `title` });
|
|
662
|
+
_func();
|
|
663
|
+
};
|
|
664
|
+
document.head.appendChild(link);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* js, cssファイルの連続読込 (callback)
|
|
669
|
+
* @deprecated v27以降非推奨
|
|
670
|
+
* @param {number} _j
|
|
671
|
+
* @param {array} _fileData
|
|
672
|
+
* @param {string} _loadType
|
|
673
|
+
* @param {function} _afterFunc
|
|
674
|
+
*/
|
|
675
|
+
function loadMultipleFiles(_j, _fileData, _loadType, _afterFunc = _ => true) {
|
|
676
|
+
if (_j < _fileData.length) {
|
|
677
|
+
const filePath = `${_fileData[_j][1]}${_fileData[_j][0]}?${new Date().getTime()}`;
|
|
678
|
+
if (_fileData[_j][0].endsWith(`.css`)) {
|
|
679
|
+
_loadType = `css`;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// jsファイル、cssファイルにより呼び出す関数を切替
|
|
683
|
+
if (_loadType === `js`) {
|
|
684
|
+
loadScript(filePath, _ =>
|
|
685
|
+
loadMultipleFiles(_j + 1, _fileData, _loadType, _afterFunc), false);
|
|
686
|
+
} else if (_loadType === `css`) {
|
|
687
|
+
const cssPath = filePath.split(`.js`).join(`.css`);
|
|
688
|
+
importCssFile(cssPath, _ =>
|
|
689
|
+
loadMultipleFiles(_j + 1, _fileData, _loadType, _afterFunc));
|
|
690
|
+
}
|
|
691
|
+
} else {
|
|
692
|
+
_afterFunc();
|
|
693
|
+
}
|
|
694
|
+
}
|