danoniplus 43.6.3 → 43.6.5

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.
Files changed (2) hide show
  1. package/js/danoni_main.js +51 -33
  2. 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 : 2026/01/26
7
+ * Revised : 2026/02/18
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 43.6.3`;
12
- const g_revisedDate = `2026/01/26`;
11
+ const g_version = `Ver 43.6.5`;
12
+ const g_revisedDate = `2026/02/18`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -5760,7 +5760,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5760
5760
 
5761
5761
  /**
5762
5762
  * BGMのループ処理 (base64エンコード時用)
5763
- * - base64エンコード時はtimeupdateイベントが発火しないため、setIntervalで時間を取得する
5763
+ * - base64エンコード時はtimeupdateイベントが発火しないため、監視しながらループ処理を行う
5764
5764
  */
5765
5765
  const repeatBGM = () => {
5766
5766
  const numAtStart = g_settings.musicIdxNum;
@@ -5789,22 +5789,36 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5789
5789
  );
5790
5790
  };
5791
5791
 
5792
+ /**
5793
+ * 既存のAudio/AudioPlayerをクローズ
5794
+ */
5795
+ const closeExistingAudio = () => {
5796
+ if (g_stateObj.bgmTimeupdateEvtId !== null && g_stateObj.bgmTimeupdateEvtId !== undefined) {
5797
+ g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5798
+ g_stateObj.bgmTimeupdateEvtId = null;
5799
+ }
5800
+ if (g_audioForMS instanceof AudioPlayer) {
5801
+ g_musicdata = ``;
5802
+ g_audioForMS.close();
5803
+ }
5804
+ };
5805
+
5792
5806
  if (encodeFlg) {
5793
5807
  try {
5794
5808
  // base64エンコードは読込に時間が掛かるため、曲変更時のみ読込
5795
5809
  if (!hasVal(g_musicdata) || Math.abs(_num) % g_headerObj.musicIdxList.length !== 0) {
5796
- if (g_audioForMS instanceof AudioPlayer) {
5797
- g_audioForMS.close();
5798
- }
5810
+ closeExistingAudio();
5799
5811
  await loadScript2(url);
5800
5812
  musicInit();
5801
5813
  if (!isTitle()) {
5814
+ g_musicdata = ``;
5802
5815
  return;
5803
5816
  }
5804
5817
  const tmpAudio = new AudioPlayer();
5805
5818
  const array = Uint8Array.from(atob(g_musicdata), v => v.charCodeAt(0));
5806
5819
  await tmpAudio.init(array.buffer);
5807
5820
  if (!isTitle()) {
5821
+ g_musicdata = ``;
5808
5822
  tmpAudio.close();
5809
5823
  return;
5810
5824
  }
@@ -5823,13 +5837,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5823
5837
 
5824
5838
  } else {
5825
5839
  // 既存の監視を解除し、AudioPlayer を確実にクローズ
5826
- if (g_stateObj.bgmTimeupdateEvtId) {
5827
- g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5828
- g_stateObj.bgmTimeupdateEvtId = null;
5829
- }
5830
- if (g_audioForMS instanceof AudioPlayer) {
5831
- g_audioForMS.close();
5832
- }
5840
+ closeExistingAudio();
5833
5841
  g_audioForMS = new Audio();
5834
5842
  g_audioForMS.src = url;
5835
5843
  g_audioForMS.autoplay = false;
@@ -8379,7 +8387,7 @@ const createSettingsDisplayWindow = _sprite => {
8379
8387
  const prevDisp = g_settings.displayNum[_name];
8380
8388
  const [prevBarColor, prevBgColor] = [cssBarList[prevDisp], cssBgList[prevDisp]];
8381
8389
 
8382
- g_settings.displayNum[_name] = (prevDisp + _scrollNum) % (_filterFlg ? 2 : list.length);
8390
+ g_settings.displayNum[_name] = nextPos(prevDisp, _scrollNum, _filterFlg ? 2 : list.length);
8383
8391
  const nextDisp = g_settings.displayNum[_name];
8384
8392
  const [nextBarColor, nextBgColor] = [cssBarList[nextDisp], cssBgList[nextDisp]];
8385
8393
 
@@ -14140,6 +14148,10 @@ const resultInit = () => {
14140
14148
  const withOptions = (_flg, _defaultSet, _displayText = _flg) =>
14141
14149
  (_flg !== _defaultSet ? getStgDetailName(_displayText) : ``);
14142
14150
 
14151
+ const withDisplays = (_flg, _defaultSet, _displayText = _flg) =>
14152
+ (_flg !== _defaultSet
14153
+ ? getStgDetailName(_displayText) + (_flg === C_FLG_OFF ? `` : ` : ${getStgDetailName(_flg)}`) : ``);
14154
+
14143
14155
  // 譜面名の組み立て処理 (Ex: 9Akey / Normal-Leftless (maker) [X-Mirror])
14144
14156
  const keyUnitName = getStgDetailName(getKeyUnitName(g_keyObj.currentKey));
14145
14157
  const difDatas = [
@@ -14171,34 +14183,40 @@ const resultInit = () => {
14171
14183
 
14172
14184
  // Display設定の組み立て処理 (Ex: Step : FlatBar, Judge, Life : OFF)
14173
14185
  let displayData = [
14174
- withOptions(g_stateObj.d_stepzone, C_FLG_ON, g_lblNameObj.rd_StepZone +
14175
- `${g_stateObj.d_stepzone === C_FLG_OFF ? `` : ` : ${g_stateObj.d_stepzone}`}`),
14176
- withOptions(g_stateObj.d_judgment, C_FLG_ON, g_lblNameObj.rd_Judgment),
14177
- withOptions(g_stateObj.d_fastslow, C_FLG_ON, g_lblNameObj.rd_FastSlow),
14178
- withOptions(g_stateObj.d_lifegauge, C_FLG_ON, g_lblNameObj.rd_LifeGauge),
14179
- withOptions(g_stateObj.d_score, C_FLG_ON, g_lblNameObj.rd_Score),
14180
- withOptions(g_stateObj.d_musicinfo, C_FLG_ON, g_lblNameObj.rd_MusicInfo),
14181
- withOptions(g_stateObj.d_filterline, C_FLG_ON, g_lblNameObj.rd_FilterLine),
14186
+ withDisplays(g_stateObj.d_stepzone, C_FLG_ON, g_lblNameObj.rd_StepZone),
14187
+ withDisplays(g_stateObj.d_judgment, C_FLG_ON, g_lblNameObj.rd_Judgment),
14188
+ withDisplays(g_stateObj.d_fastslow, C_FLG_ON, g_lblNameObj.rd_FastSlow),
14189
+ withDisplays(g_stateObj.d_lifegauge, C_FLG_ON, g_lblNameObj.rd_LifeGauge),
14190
+ withDisplays(g_stateObj.d_score, C_FLG_ON, g_lblNameObj.rd_Score),
14191
+ withDisplays(g_stateObj.d_musicinfo, C_FLG_ON, g_lblNameObj.rd_MusicInfo),
14192
+ withDisplays(g_stateObj.d_filterline, C_FLG_ON, g_lblNameObj.rd_FilterLine),
14182
14193
  ].filter(value => value !== ``).join(`, `);
14183
14194
  if (displayData === ``) {
14184
14195
  displayData = `All Visible`;
14185
14196
  } else {
14186
- if (!displayData.includes(`,`) && g_stateObj.d_stepzone !== C_FLG_OFF) {
14187
- } else {
14188
- displayData += ` : OFF`;
14197
+ // 表示設定のOFF項目を末尾にまとめる
14198
+ const displayList = displayData.split(`, `).sort((a, b) => b.includes(`:`) - a.includes(`:`));
14199
+ displayData = displayList.join(`, `);
14200
+ if (!displayList.at(-1).includes(`:`)) {
14201
+ displayData += ` : ${getStgDetailName(C_FLG_OFF)}`;
14189
14202
  }
14190
14203
  }
14191
14204
 
14192
14205
  let display2Data = [
14193
- withOptions(g_stateObj.d_speed, C_FLG_ON, g_lblNameObj.rd_Speed),
14194
- withOptions(g_stateObj.d_color, C_FLG_ON, g_lblNameObj.rd_Color),
14195
- withOptions(g_stateObj.d_lyrics, C_FLG_ON, g_lblNameObj.rd_Lyrics),
14196
- withOptions(g_stateObj.d_background, C_FLG_ON, g_lblNameObj.rd_Background),
14197
- withOptions(g_stateObj.d_arroweffect, C_FLG_ON, g_lblNameObj.rd_ArrowEffect),
14198
- withOptions(g_stateObj.d_special, C_FLG_ON, g_lblNameObj.rd_Special),
14206
+ withDisplays(g_stateObj.d_speed, C_FLG_ON, g_lblNameObj.rd_Speed),
14207
+ withDisplays(g_stateObj.d_color, C_FLG_ON, g_lblNameObj.rd_Color),
14208
+ withDisplays(g_stateObj.d_lyrics, C_FLG_ON, g_lblNameObj.rd_Lyrics),
14209
+ withDisplays(g_stateObj.d_background, C_FLG_ON, g_lblNameObj.rd_Background),
14210
+ withDisplays(g_stateObj.d_arroweffect, C_FLG_ON, g_lblNameObj.rd_ArrowEffect),
14211
+ withDisplays(g_stateObj.d_special, C_FLG_ON, g_lblNameObj.rd_Special),
14199
14212
  ].filter(value => value !== ``).join(`, `);
14200
14213
  if (display2Data !== ``) {
14201
- display2Data += ` : OFF`;
14214
+ // 表示設定のOFF項目を末尾にまとめる
14215
+ const display2List = display2Data.split(`, `).sort((a, b) => b.includes(`:`) - a.includes(`:`));
14216
+ display2Data = display2List.join(`, `);
14217
+ if (!display2List.at(-1).includes(`:`)) {
14218
+ display2Data += ` : ${getStgDetailName(C_FLG_OFF)}`;
14219
+ }
14202
14220
  }
14203
14221
 
14204
14222
  const [lblRX, dataRX] = [20, 60];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "43.6.3",
3
+ "version": "43.6.5",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {