danoniplus 49.3.0 → 49.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js/danoni_main.js CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2026/07/12
7
+ * Revised : 2026/07/18
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 49.3.0`;
12
- const g_revisedDate = `2026/07/12`;
11
+ const g_version = `Ver 49.3.1`;
12
+ const g_revisedDate = `2026/07/18`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -10106,7 +10106,8 @@ const createGeneralSettingEx = (_spriteList, _name, { defaultList = [C_FLG_OFF],
10106
10106
  */
10107
10107
  const setExpandedBtnSiz = () => {
10108
10108
  const camelH = toCapitalize(_name);
10109
- if (defaultList.includes(g_stateObj[_name])) {
10109
+ const isDefault = defaultList.includes(g_stateObj[_name]);
10110
+ if (isDefault) {
10110
10111
  $id(`lnk${camelH}Type`).display = C_DIS_NONE;
10111
10112
  $id(`lnk${camelH}`).left = wUnit(g_limitObj.setLblLeft);
10112
10113
  $id(`lnk${camelH}`).width = wUnit(g_limitObj.setLblWidth);
@@ -10115,7 +10116,8 @@ const createGeneralSettingEx = (_spriteList, _name, { defaultList = [C_FLG_OFF],
10115
10116
  $id(`lnk${camelH}`).left = wUnit(g_limitObj.setLblLeftShort);
10116
10117
  $id(`lnk${camelH}`).width = wUnit(g_limitObj.setLblWidthShort);
10117
10118
  }
10118
- $id(`lnk${camelH}`).fontSize = wUnit(getFontSize2(getStgDetailName(g_stateObj[_name]), g_limitObj.setLblWidthShort, { maxSiz: g_limitObj.setLblSiz }));
10119
+ const labelWidth = isDefault ? g_limitObj.setLblWidth : g_limitObj.setLblWidthShort - 10;
10120
+ $id(`lnk${camelH}`).fontSize = wUnit(getFontSize2(getStgDetailName(g_stateObj[_name]), labelWidth, { maxSiz: g_limitObj.setLblSiz }));
10119
10121
  };
10120
10122
 
10121
10123
  /**
@@ -7,7 +7,7 @@
7
7
  * danoni_main.js の中身を変えることなく設定が可能です。
8
8
  *
9
9
  * 設定例:
10
- * |customjs=danoni_custom-003.js|
10
+ * |customjs=sample/danoni_custom-003.js|
11
11
  *
12
12
  * ・グローバル変数、div要素、関数は danoni_main.js のものがそのまま利用できます。
13
13
  * ・danoni_main.jsの変数を直接書き換えると、動かなくなることがあります。
@@ -16,6 +16,95 @@
16
16
  *  画面遷移したときにきれいに消してくれます。
17
17
  */
18
18
 
19
+ /*
20
+ * 独自の変数名や関数名は、"c_"などの接頭辞をつけると、
21
+ * danoni_main.jsの変数名と衝突しないのでおすすめです。
22
+ *
23
+ * このサンプルは横幅650px以上の動作を確認しています。
24
+ *
25
+ * 参考)主要変数の説明 (danoni_main.js側で定義)
26
+ * - g_btnX() : ボタンの初期X座標。引数でg_btnWidth()を足した効果。
27
+ * - g_btnWidth() : ボタンが配置できる最大横幅長。引数で比率を指定できる。
28
+ * - g_sWidth : 画面の横幅
29
+ * - g_sHeight : 画面の高さ
30
+ * - clearWindow : 画面の消去
31
+ */
32
+
33
+ /**
34
+ * 初期化
35
+ * - タイトル画面より前で定義するため、タイトル画面に戻ってもこの処理は通過しない
36
+ */
37
+ g_customJsObj.preTitle.push(() => {
38
+
39
+ // -----------------------------------
40
+ // 拡張設定(背景色変更)
41
+ // -----------------------------------
42
+
43
+ // 設定項目名
44
+ g_lblNameObj.BackColor = `BackColor`;
45
+
46
+ // 設定項目の選択肢に対応する背景色
47
+ // 0番目の色がdivBackの背景色、1番目の色がc_backSampleの背景色
48
+ g_settings.c_backColorset = {
49
+ Default: [``, ``],
50
+ Black: [`#000000`, `#222222`],
51
+ Gray: [`#202020`, `#404040`],
52
+ Red: [`#110000`, `#331111`],
53
+ Green: [`#001100`, `#114411`],
54
+ Blue: [`#000011`, `#111144`],
55
+ Yellow: [`#111100`, `#333311`],
56
+ };
57
+
58
+ // 設定項目の選択肢と初期カーソル位置
59
+ g_settings.backColors = Object.keys(g_settings.c_backColorset); // [`Default`, `Black`, ... , `Yellow`]
60
+ g_settings.backColorNum = 0;
61
+
62
+ // 設定項目の初期値
63
+ g_stateObj.backColor = g_settings.backColors[g_settings.backColorNum];
64
+
65
+ // カスタム画面のショートカット定義
66
+ g_shortcutObj.c_info = {
67
+ ShiftLeft_KeyC: { id: `lnkBackColorL` },
68
+ ShiftRight_KeyC: { id: `lnkBackColorL` },
69
+ KeyC: { id: `lnkBackColorR` },
70
+ Escape: { id: `c_btnBack` },
71
+ Enter: { id: `c_btnNext` },
72
+ KeyT: { id: `c_btnLink`, reset: true },
73
+ };
74
+ });
75
+
76
+ /**
77
+ * 背景色を変更するカスタム関数
78
+ */
79
+ const c_changeBackColor = () => {
80
+ if (document.getElementById(`divBack`) !== null) {
81
+ // divBackの背景色を変更する
82
+ $id(`divBack`).background = g_settings.c_backColorset[g_stateObj.backColor][0];
83
+
84
+ // divBackの下にc_backSampleL/Rがなければ作成して背景色を変更
85
+ if (document.getElementById(`c_backSampleL`) === null) {
86
+ createEmptySprite(divBack, `c_backSampleL`, {
87
+ x: g_btnX() + 50,
88
+ y: 0,
89
+ w: 50,
90
+ h: g_sHeight,
91
+ background: g_settings.c_backColorset[g_stateObj.backColor][1],
92
+ });
93
+ }
94
+ $id(`c_backSampleL`).background = g_settings.c_backColorset[g_stateObj.backColor][1];
95
+
96
+ if (document.getElementById(`c_backSampleR`) === null) {
97
+ createEmptySprite(divBack, `c_backSampleR`, {
98
+ x: g_btnX(1) - 100,
99
+ y: 0,
100
+ w: 50,
101
+ h: g_sHeight,
102
+ background: g_settings.c_backColorset[g_stateObj.backColor][1],
103
+ });
104
+ }
105
+ $id(`c_backSampleR`).background = g_settings.c_backColorset[g_stateObj.backColor][1];
106
+ }
107
+ };
19
108
 
20
109
  /**
21
110
  * タイトル画面
@@ -24,51 +113,209 @@ g_customJsObj.title.push(() => {
24
113
 
25
114
  multiAppend(divRoot,
26
115
  // 背景の矢印オブジェクトを表示
27
- createColorObject2(`lblC`, {
28
- x: g_sWidth / 2 - 300, y: 0, w: 100, h: 100, rotate: `onigiri`, opacity: 0.25,
116
+ createColorObject2(`c_lblC`, {
117
+ x: g_btnX(1 / 2) - 300,
118
+ y: 0,
119
+ w: 100,
120
+ h: 100,
121
+ rotate: `onigiri`,
122
+ opacity: 0.25,
29
123
  background: `#ffffff`,
30
124
  }),
31
125
 
32
126
  // Infoボタン描画
33
- createCss2Button(`btnTweet`, `Info`, _ => clearTimeout(g_timeoutEvtTitleId), {
34
- x: g_sWidth / 4 * 3, y: 340, w: g_sWidth / 4,
35
- resetFunc: _ => customCommentInit(),
127
+ createCss2Button(`c_btnInfo`, `Info`, _ => clearTimeout(g_timeoutEvtTitleId), {
128
+ x: g_btnX(3 / 4),
129
+ y: 340,
130
+ w: g_btnWidth(1 / 4),
131
+ resetFunc: _ => c_infoInit(),
36
132
  }, g_cssObj.button_Tweet)
37
133
  );
38
134
  });
39
135
 
40
136
  /**
41
- * カスタム画面(コメントとか)
137
+ * カスタム画面
42
138
  */
43
- function customCommentInit() {
139
+ const c_infoInit = () => {
44
140
 
45
- clearWindow(true);
141
+ clearWindow();
142
+ g_currentPage = `c_info`;
46
143
 
47
144
  // テキスト
48
- const comment = `これはカスタムページのテストです。<br>
49
- このように、作品別に特殊なページを作ることもできます。<br><br>
50
- 下記のような戻るボタンがあると良いですね。(・∀・)`;
145
+ const c_comment = `
146
+ これはカスタムページのテストです。
147
+ このように、作品別に特殊なページを作ることもできます。
148
+
149
+ 下記のような戻るボタンがあると良いですね。(・∀・)
150
+
151
+
152
+ このようなスクロールもできます。
153
+ `.trim().split(`\n`).join(`<br>`);
154
+
155
+ // 拡張設定表示用div要素を作成(divRootの中に作成)
156
+ // 親div, 子divのid, 子divのCSS設定を記述
157
+ const c_extraSet = createEmptySprite(divRoot, `c_extraSet`, {
158
+ x: g_sWidth / 2 - 305,
159
+ y: 250,
160
+ w: 610,
161
+ h: 140,
162
+ overflow: `auto`,
163
+ // border: `1px dashed #999999`, // 枠がわかるように表示
164
+ });
165
+
166
+ // ---------------------------------------------------------------
167
+ // ▽ BackColor設定
168
+ // ---------------------------------------------------------------
169
+ // 拡張設定ヘッダー表示
170
+ c_extraSet.appendChild(
171
+ createDivCss2Label(`c_lblExtraSet`, `Original Settings`, {
172
+ x: 5,
173
+ y: 0,
174
+ w: 600,
175
+ h: 22,
176
+ siz: 20,
177
+ color: `#ffffff`,
178
+ align: C_ALIGN_CENTER,
179
+ background: `#333333`,
180
+ border: `1px solid #666666`,
181
+ })
182
+ );
183
+
184
+ // 設定用項目のdiv要素を作成
185
+ const c_backColor = createEmptySprite(c_extraSet, `c_backColor`, {
186
+ x: 105,
187
+ y: 40,
188
+ w: 410,
189
+ h: 22,
190
+ overflow: `auto`,
191
+ // border: `1px dashed #999999`, // 枠がわかるように表示
192
+ });
193
+ createGeneralSetting(c_backColor, `backColor`, {
194
+ addRFunc: () => {
195
+ // 設定変更時に背景色を変更する
196
+ c_changeBackColor();
197
+ }
198
+ });
199
+ c_changeBackColor();
200
+
201
+ // ショートカットキー表示
202
+ createScText(c_backColor, `backColor`, { displayName: `c_info` });
203
+
204
+ // △ BackColor設定 ここまで
205
+ // ---------------------------------------------------------------
206
+
207
+ // AAオブジェクトをランダムに表示
208
+ const c_aaList = [`onigiri`, `giko`, `iyo`, `c`, `morara`, `monar`];
209
+ const c_randomidx = Math.floor(Math.random() * c_aaList.length);
51
210
 
52
211
  // 各種ラベル追加
53
212
  multiAppend(divRoot,
54
213
 
55
214
  // タイトル文字
56
- getTitleDivLabel(`lblTitle`,
57
- `<span style='color:#6666ff;font-size:40px;'>I</span>NFO`, 0, 15),
215
+ getTitleDivLabel(`c_lblTitle`,
216
+ `<span style='color:#6666ff;font-size:40px;'>I</span>NFO &amp; ` +
217
+ `<span style='color:#ff6666;font-size:40px;'>O</span>RIGINAL`, 0, 15),
58
218
 
59
219
  // コメント文
60
- createDivCss2Label(`lblComment`, comment, {
61
- x: g_sWidth / 2 - 200, y: 100, w: 400, h: 20, siz: 14, color: `#cccccc`,
220
+ createDivCss2Label(`c_lblComment`, c_comment, {
221
+ x: g_sWidth / 2 - 300,
222
+ y: 100,
223
+ w: 450,
224
+ h: 100,
225
+ siz: 14,
226
+ color: `#cccccc`,
62
227
  align: C_ALIGN_LEFT,
228
+ overflow: `auto`,
229
+ border: `1px solid #666666`,
230
+ padding: `5px`,
63
231
  }),
64
232
 
65
- // おにぎりオブジェクトの配置
66
- createColorObject2(`lblC`, {
67
- x: g_sWidth / 2 + 200, y: 350, w: 100, h: 100, rotate: `onigiri`,
233
+ // オブジェクトの配置(ページごとに切り替え、ランダム)
234
+ createColorObject2(`c_lblC`, {
235
+ x: g_sWidth / 2 + 200,
236
+ y: 100,
237
+ w: 100,
238
+ h: 100,
239
+ rotate: c_aaList[c_randomidx],
240
+ animationDuration: `3s`,
241
+ animationName: `spinY`,
242
+ animationIterationCount: `infinite`,
68
243
  background: `#ffffff`,
69
244
  }),
70
245
 
71
246
  // 戻るボタン描画
72
- createCss2Button(`btnBack`, g_lblNameObj.b_back, _ => true, { resetFunc: _ => titleInit() }, g_cssObj.button_Back),
73
- )
74
- }
247
+ createCss2Button(`c_btnBack`, g_lblNameObj.b_back, _ => true, {
248
+ x: g_btnX(),
249
+ y: g_sHeight - 50,
250
+ w: g_btnWidth(1 / 2),
251
+ h: 25,
252
+ siz: 20,
253
+ resetFunc: _ => titleInit(),
254
+ }, g_cssObj.button_Back),
255
+
256
+ // 次へボタン描画
257
+ createCss2Button(`c_btnNext`, `Setting`, _ => true, {
258
+ x: g_btnX(1 / 2),
259
+ y: g_sHeight - 50,
260
+ w: g_btnWidth(1 / 2),
261
+ h: 25,
262
+ siz: 20,
263
+ resetFunc: _ => g_moveSettingWindow(false)
264
+ }, g_cssObj.button_Setting),
265
+
266
+ // 外部リンク用ボタン描画
267
+ createCss2Button(`c_btnLink`, `Custom JSに関する情報はGitHub WikiのTipsへ`, _ => true, {
268
+ x: g_btnX(1 / 2) - 300,
269
+ y: g_sHeight - 100,
270
+ w: 600,
271
+ h: 25,
272
+ siz: 14,
273
+ border: `1px solid #999999`,
274
+ borderRadius: `10px`,
275
+ resetFunc: _ => openLink(
276
+ g_localeObj.val === `Ja`
277
+ ? `https://github.com/cwtickle/danoniplus/wiki/tips-index`
278
+ : `https://github.com/cwtickle/danoniplus-docs/wiki/tips-index`
279
+ ),
280
+ }, g_cssObj.button_Default),
281
+ );
282
+
283
+ // ショートカットキー表示
284
+ createScText(c_btnBack, `c_btnBack`, { displayName: `c_info`, targetLabel: `c_btnBack` });
285
+ createScText(c_btnNext, `c_btnNext`, { displayName: `c_info`, targetLabel: `c_btnNext` });
286
+ createScText(c_btnLink, `c_btnLink`, { displayName: `c_info`, targetLabel: `c_btnLink` });
287
+
288
+ // カスタム画面のショートカット表示
289
+ setShortcutEvent(g_currentPage);
290
+
291
+ document.oncontextmenu = () => true;
292
+ divRoot.oncontextmenu = () => false;
293
+ };
294
+
295
+ // 各種設定よりカスタム画面へのリンクを追加
296
+ const c_addButton = () => {
297
+ divRoot.appendChild(
298
+ createCss2Button(`c_btnInfo`, `Info &amp; Original`, _ => true, {
299
+ x: g_btnX(1 / 2),
300
+ y: g_sHeight - 20,
301
+ w: g_btnWidth(1 / 4),
302
+ h: 15,
303
+ siz: 12,
304
+ resetFunc: _ => c_infoInit(),
305
+ }, g_cssObj.button_Tweet)
306
+ );
307
+ };
308
+ g_customJsObj.option.push(() => c_addButton());
309
+ g_customJsObj.settingsDisplay.push(() => c_addButton());
310
+ g_customJsObj.exSetting.push(() => c_addButton());
311
+
312
+ // 各画面で背景色を変更する
313
+ g_skinJsObj.title.push(() => c_changeBackColor());
314
+ g_skinJsObj.dataMgt.push(() => c_changeBackColor());
315
+ g_skinJsObj.precondition.push(() => c_changeBackColor());
316
+ g_skinJsObj.option.push(() => c_changeBackColor());
317
+ g_skinJsObj.settingsDisplay.push(() => c_changeBackColor());
318
+ g_skinJsObj.exSetting.push(() => c_changeBackColor());
319
+ g_skinJsObj.keyconfig.push(() => c_changeBackColor());
320
+ g_skinJsObj.main.push(() => c_changeBackColor());
321
+ g_skinJsObj.result.push(() => c_changeBackColor());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "49.3.0",
3
+ "version": "49.3.1",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "jsdelivr": "./js/danoni_main.js",