danoniplus 40.5.4 → 40.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 +26 -11
- package/js/template/danoni_setting.js +4 -2
- package/package.json +2 -2
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 : 2025/03/
|
|
7
|
+
* Revised : 2025/03/16
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 40.
|
|
12
|
-
const g_revisedDate = `2025/03/
|
|
11
|
+
const g_version = `Ver 40.6.0`;
|
|
12
|
+
const g_revisedDate = `2025/03/16`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -58,7 +58,7 @@ Object.freeze(g_reservedDomains);
|
|
|
58
58
|
// 外部参照を許可するドメイン
|
|
59
59
|
const g_referenceDomains = [
|
|
60
60
|
`cwtickle.github.io/danoniplus`,
|
|
61
|
-
`cdn.jsdelivr.net
|
|
61
|
+
`cdn.jsdelivr.net`,
|
|
62
62
|
`unpkg.com`,
|
|
63
63
|
`support-v\\d+--danoniplus.netlify.app`,
|
|
64
64
|
];
|
|
@@ -66,7 +66,8 @@ Object.freeze(g_referenceDomains);
|
|
|
66
66
|
|
|
67
67
|
const g_rootPath = current().match(/(^.*\/)/)[0];
|
|
68
68
|
const g_workPath = new URL(location.href).href.match(/(^.*\/)/)[0];
|
|
69
|
-
const
|
|
69
|
+
const hasRemoteDomain = _path => g_referenceDomains.some(domain => _path.match(`^https://${domain}/`) !== null);
|
|
70
|
+
const g_remoteFlg = hasRemoteDomain(g_rootPath);
|
|
70
71
|
|
|
71
72
|
const g_randTime = Date.now();
|
|
72
73
|
const g_isFile = location.href.match(/^file/);
|
|
@@ -524,7 +525,9 @@ const formatObject = (_obj, _indent = 0, { colorFmt = true, rootKey = `` } = {})
|
|
|
524
525
|
// カラーコードの色付け処理
|
|
525
526
|
_value = escapeHtml(_value).replaceAll(`\n`, `<br>`);
|
|
526
527
|
const colorCodePattern = /(#|0x)(?:[A-Fa-f0-9]{6}(?:[A-Fa-f0-9]{2})?|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})/g;
|
|
527
|
-
if (
|
|
528
|
+
if (_value === C_FLG_ON) {
|
|
529
|
+
return `<span style="color:#66ff66">✔ ON</span>`;
|
|
530
|
+
} else if (colorCodePattern.test(_value)) {
|
|
528
531
|
return _value.replace(colorCodePattern, (match) =>
|
|
529
532
|
`<span style="color:${match.replace(`0x`, `#`)}">◆</span>${match.replace(`0x`, `#`)}`);
|
|
530
533
|
}
|
|
@@ -540,8 +543,9 @@ const formatObject = (_obj, _indent = 0, { colorFmt = true, rootKey = `` } = {})
|
|
|
540
543
|
// scrollDirXのスクロール方向表示処理
|
|
541
544
|
return _value === 1 ? `1|<span style="color:#ff9999">↑</span>` : `-1|<span style="color:#66ff66">↓</span>`;
|
|
542
545
|
|
|
543
|
-
} else if (_rootKey
|
|
544
|
-
|
|
546
|
+
} else if (listMatching(_rootKey, [`keyCtrl`, `keyRetry`, `keyTitleBack`], { prefix: `^` })
|
|
547
|
+
&& !_rootKey.startsWith(`keyCtrlPtn`)) {
|
|
548
|
+
// keyCtrlX, keyRetryX, keyTitleBackX の対応キー表示処理
|
|
545
549
|
return (g_kCd[_value] && _value !== 0) ? `${_value}|<span style="color:#ffff66">${g_kCd[_value]}</span>` : `----`;
|
|
546
550
|
}
|
|
547
551
|
} else if (isObj(_value)) {
|
|
@@ -1101,6 +1105,9 @@ const loadMultipleFiles2 = async (_fileData, _loadType) => {
|
|
|
1101
1105
|
* @returns {string[]} [ファイルキーワード, ルートディレクトリ]
|
|
1102
1106
|
*/
|
|
1103
1107
|
const getFilePath = (_fileName, _directory = ``) => {
|
|
1108
|
+
if (_fileName.startsWith(`https://`)) {
|
|
1109
|
+
return [_fileName, ``];
|
|
1110
|
+
}
|
|
1104
1111
|
let fullPath;
|
|
1105
1112
|
if (_fileName.startsWith(C_MRK_CURRENT_DIRECTORY)) {
|
|
1106
1113
|
fullPath = `${g_workPath}${_fileName.slice(C_MRK_CURRENT_DIRECTORY.length)}`;
|
|
@@ -3136,7 +3143,9 @@ const preheaderConvert = _dosObj => {
|
|
|
3136
3143
|
});
|
|
3137
3144
|
|
|
3138
3145
|
const convLocalPath = (_file, _type) =>
|
|
3139
|
-
g_remoteFlg && hasVal(_file) && !_file.includes(`(..)`)
|
|
3146
|
+
g_remoteFlg && hasVal(_file) && !_file.includes(`(..)`) && !hasRemoteDomain(_file)
|
|
3147
|
+
? `(..)../${_type}/${_file}`
|
|
3148
|
+
: _file;
|
|
3140
3149
|
|
|
3141
3150
|
// 外部スキンファイルの指定
|
|
3142
3151
|
const tmpSkinType = _dosObj.skinType ?? g_presetObj.skinType ?? `default`;
|
|
@@ -3219,6 +3228,7 @@ const headerConvert = _dosObj => {
|
|
|
3219
3228
|
extension: imgTypes[1] || `svg`,
|
|
3220
3229
|
rotateEnabled: setBoolVal(imgTypes[2], true),
|
|
3221
3230
|
flatStepHeight: setVal(imgTypes[3], C_ARW_WIDTH, C_TYP_FLOAT),
|
|
3231
|
+
remoteDir: imgTypes[4] || ``,
|
|
3222
3232
|
};
|
|
3223
3233
|
g_keycons.imgTypes[j] = (imgTypes[0] === `` ? `Original` : imgTypes[0]);
|
|
3224
3234
|
});
|
|
@@ -3226,7 +3236,7 @@ const headerConvert = _dosObj => {
|
|
|
3226
3236
|
|
|
3227
3237
|
// 末尾にデフォルト画像セットが入るよう追加
|
|
3228
3238
|
if (obj.imgType.findIndex(imgSets => imgSets.name === ``) === -1) {
|
|
3229
|
-
obj.imgType.push({ name: ``, extension: `svg`, rotateEnabled: true, flatStepHeight: C_ARW_WIDTH });
|
|
3239
|
+
obj.imgType.push({ name: ``, extension: `svg`, rotateEnabled: true, flatStepHeight: C_ARW_WIDTH, remoteDir: `` });
|
|
3230
3240
|
g_keycons.imgTypes.push(`Original`);
|
|
3231
3241
|
}
|
|
3232
3242
|
g_imgType = g_keycons.imgTypes[0];
|
|
@@ -3898,6 +3908,7 @@ const getMusicNameMultiLine = _musicName => {
|
|
|
3898
3908
|
* @param {object} _imgType
|
|
3899
3909
|
* @param {string} _imgType.name
|
|
3900
3910
|
* @param {string} _imgType.extension
|
|
3911
|
+
* @param {string} _imgType.remoteDir
|
|
3901
3912
|
* @param {boolean} _initFlg
|
|
3902
3913
|
*/
|
|
3903
3914
|
const updateImgType = (_imgType, _initFlg = false) => {
|
|
@@ -3911,9 +3922,13 @@ const updateImgType = (_imgType, _initFlg = false) => {
|
|
|
3911
3922
|
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_rootPath}${orgImgObj[key]}`);
|
|
3912
3923
|
|
|
3913
3924
|
// リモート時は作品ページ側にある画像を優先し、リモートに存在するもののみリモートから取得する
|
|
3925
|
+
// titleArrowについては他のImgTypeから取得するため、remoteDir属性には依存させない
|
|
3914
3926
|
if (g_remoteFlg) {
|
|
3915
3927
|
Object.keys(g_imgObj).forEach(key => g_imgObj[key] = `${g_workPath}${orgImgObj[key]}`);
|
|
3916
|
-
if (
|
|
3928
|
+
if (_imgType.remoteDir !== `` && hasRemoteDomain(_imgType.remoteDir)) {
|
|
3929
|
+
g_defaultSets.imgList.filter(val => val !== `titleArrow`)
|
|
3930
|
+
.forEach(key => g_imgObj[key] = `${_imgType.remoteDir}img/${orgImgObj[key]}`);
|
|
3931
|
+
} else if (g_defaultSets.imgType.findIndex(val => val === _imgType.name) >= 0) {
|
|
3917
3932
|
g_defaultSets.imgList.forEach(key => g_imgObj[key] = `${g_rootPath}${orgImgObj[key]}`);
|
|
3918
3933
|
}
|
|
3919
3934
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
3
|
* Dancing☆Onigiri 設定用jsファイル
|
|
4
|
-
* Template Update: 2025/03/
|
|
4
|
+
* Template Update: 2025/03/16 (v40.6.0)
|
|
5
5
|
*
|
|
6
6
|
* このファイルでは、作品全体に対しての初期設定を行うことができます。
|
|
7
7
|
* 譜面データ側で個別に同様の項目が設定されている場合は、譜面データ側の設定が優先されます。
|
|
@@ -172,16 +172,18 @@ g_presetObj.customDesignUse = {
|
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
デフォルト画像セットの設定
|
|
175
|
-
(セット対象のフォルダ名, 拡張子, 画像回転有無(true or false), Flat
|
|
175
|
+
(セット対象のフォルダ名, 拡張子, 画像回転有無(true or false), Flat時ステップ間隔, リモート時のディレクトリの順に指定)
|
|
176
176
|
|
|
177
177
|
事前に、[img]フォルダ配下にセット対象のサブフォルダを作成し、その中に一式を入れておく必要あり
|
|
178
178
|
下記の場合は[classic]フォルダに[png]形式の画像一式をデフォルト画像セットとして使用する
|
|
179
|
+
なお、リモート時のディレクトリ(jsdelivr)を指定した場合はサブフォルダの作成及び格納は不要
|
|
179
180
|
|
|
180
181
|
未指定の場合のデフォルト値は以下の通り
|
|
181
182
|
セット対象のフォルダ名:`` (imgフォルダ直下)
|
|
182
183
|
拡張子:`svg`形式
|
|
183
184
|
画像回転有無:true(回転有り)
|
|
184
185
|
Flat時ステップ間隔:50(px) ※矢印サイズ
|
|
186
|
+
リモート時のディレクトリ:`` (指定なし。自サーバーの画像を使用する)
|
|
185
187
|
*/
|
|
186
188
|
//g_presetObj.imageSets = [``, `classic,png`, `classic-thin,png`, `note,svg,false,0`];
|
|
187
189
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "danoniplus",
|
|
3
|
-
"version": "40.
|
|
3
|
+
"version": "40.6.0",
|
|
4
4
|
"description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "./js/danoni_main.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|