danoniplus 42.5.9 → 42.5.11

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 42.5.9`;
12
- const g_revisedDate = `2026/01/26`;
11
+ const g_version = `Ver 42.5.11`;
12
+ const g_revisedDate = `2026/02/18`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -5725,7 +5725,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5725
5725
 
5726
5726
  /**
5727
5727
  * BGMのループ処理 (base64エンコード時用)
5728
- * - base64エンコード時はtimeupdateイベントが発火しないため、setIntervalで時間を取得する
5728
+ * - base64エンコード時はtimeupdateイベントが発火しないため、監視しながらループ処理を行う
5729
5729
  */
5730
5730
  const repeatBGM = () => {
5731
5731
  const numAtStart = g_settings.musicIdxNum;
@@ -5754,22 +5754,36 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5754
5754
  );
5755
5755
  };
5756
5756
 
5757
+ /**
5758
+ * 既存のAudio/AudioPlayerをクローズ
5759
+ */
5760
+ const closeExistingAudio = () => {
5761
+ if (g_stateObj.bgmTimeupdateEvtId !== null && g_stateObj.bgmTimeupdateEvtId !== undefined) {
5762
+ g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5763
+ g_stateObj.bgmTimeupdateEvtId = null;
5764
+ }
5765
+ if (g_audioForMS instanceof AudioPlayer) {
5766
+ g_musicdata = ``;
5767
+ g_audioForMS.close();
5768
+ }
5769
+ };
5770
+
5757
5771
  if (encodeFlg) {
5758
5772
  try {
5759
5773
  // base64エンコードは読込に時間が掛かるため、曲変更時のみ読込
5760
5774
  if (!hasVal(g_musicdata) || Math.abs(_num) % g_headerObj.musicIdxList.length !== 0) {
5761
- if (g_audioForMS instanceof AudioPlayer) {
5762
- g_audioForMS.close();
5763
- }
5775
+ closeExistingAudio();
5764
5776
  await loadScript2(url);
5765
5777
  musicInit();
5766
5778
  if (!isTitle()) {
5779
+ g_musicdata = ``;
5767
5780
  return;
5768
5781
  }
5769
5782
  const tmpAudio = new AudioPlayer();
5770
5783
  const array = Uint8Array.from(atob(g_musicdata), v => v.charCodeAt(0));
5771
5784
  await tmpAudio.init(array.buffer);
5772
5785
  if (!isTitle()) {
5786
+ g_musicdata = ``;
5773
5787
  tmpAudio.close();
5774
5788
  return;
5775
5789
  }
@@ -5788,13 +5802,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5788
5802
 
5789
5803
  } else {
5790
5804
  // 既存の監視を解除し、AudioPlayer を確実にクローズ
5791
- if (g_stateObj.bgmTimeupdateEvtId) {
5792
- g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5793
- g_stateObj.bgmTimeupdateEvtId = null;
5794
- }
5795
- if (g_audioForMS instanceof AudioPlayer) {
5796
- g_audioForMS.close();
5797
- }
5805
+ closeExistingAudio();
5798
5806
  g_audioForMS = new Audio();
5799
5807
  g_audioForMS.src = url;
5800
5808
  g_audioForMS.autoplay = false;
@@ -8217,7 +8225,7 @@ const createSettingsDisplayWindow = _sprite => {
8217
8225
  const prevDisp = g_settings.displayNum[_name];
8218
8226
  const [prevBarColor, prevBgColor] = [cssBarList[prevDisp], cssBgList[prevDisp]];
8219
8227
 
8220
- g_settings.displayNum[_name] = (prevDisp + _scrollNum) % (_filterFlg ? 2 : list.length);
8228
+ g_settings.displayNum[_name] = nextPos(prevDisp, _scrollNum, _filterFlg ? 2 : list.length);
8221
8229
  const nextDisp = g_settings.displayNum[_name];
8222
8230
  const [nextBarColor, nextBgColor] = [cssBarList[nextDisp], cssBgList[nextDisp]];
8223
8231
 
@@ -13943,6 +13951,10 @@ const resultInit = () => {
13943
13951
  const withOptions = (_flg, _defaultSet, _displayText = _flg) =>
13944
13952
  (_flg !== _defaultSet ? getStgDetailName(_displayText) : ``);
13945
13953
 
13954
+ const withDisplays = (_flg, _defaultSet, _displayText = _flg) =>
13955
+ (_flg !== _defaultSet
13956
+ ? getStgDetailName(_displayText) + (_flg === C_FLG_OFF ? `` : ` : ${getStgDetailName(_flg)}`) : ``);
13957
+
13946
13958
  // 譜面名の組み立て処理 (Ex: 9Akey / Normal-Leftless (maker) [X-Mirror])
13947
13959
  const keyUnitName = getStgDetailName(getKeyUnitName(g_keyObj.currentKey));
13948
13960
  const difDatas = [
@@ -13974,34 +13986,40 @@ const resultInit = () => {
13974
13986
 
13975
13987
  // Display設定の組み立て処理 (Ex: Step : FlatBar, Judge, Life : OFF)
13976
13988
  let displayData = [
13977
- withOptions(g_stateObj.d_stepzone, C_FLG_ON, g_lblNameObj.rd_StepZone +
13978
- `${g_stateObj.d_stepzone === C_FLG_OFF ? `` : ` : ${g_stateObj.d_stepzone}`}`),
13979
- withOptions(g_stateObj.d_judgment, C_FLG_ON, g_lblNameObj.rd_Judgment),
13980
- withOptions(g_stateObj.d_fastslow, C_FLG_ON, g_lblNameObj.rd_FastSlow),
13981
- withOptions(g_stateObj.d_lifegauge, C_FLG_ON, g_lblNameObj.rd_LifeGauge),
13982
- withOptions(g_stateObj.d_score, C_FLG_ON, g_lblNameObj.rd_Score),
13983
- withOptions(g_stateObj.d_musicinfo, C_FLG_ON, g_lblNameObj.rd_MusicInfo),
13984
- withOptions(g_stateObj.d_filterline, C_FLG_ON, g_lblNameObj.rd_FilterLine),
13989
+ withDisplays(g_stateObj.d_stepzone, C_FLG_ON, g_lblNameObj.rd_StepZone),
13990
+ withDisplays(g_stateObj.d_judgment, C_FLG_ON, g_lblNameObj.rd_Judgment),
13991
+ withDisplays(g_stateObj.d_fastslow, C_FLG_ON, g_lblNameObj.rd_FastSlow),
13992
+ withDisplays(g_stateObj.d_lifegauge, C_FLG_ON, g_lblNameObj.rd_LifeGauge),
13993
+ withDisplays(g_stateObj.d_score, C_FLG_ON, g_lblNameObj.rd_Score),
13994
+ withDisplays(g_stateObj.d_musicinfo, C_FLG_ON, g_lblNameObj.rd_MusicInfo),
13995
+ withDisplays(g_stateObj.d_filterline, C_FLG_ON, g_lblNameObj.rd_FilterLine),
13985
13996
  ].filter(value => value !== ``).join(`, `);
13986
13997
  if (displayData === ``) {
13987
13998
  displayData = `All Visible`;
13988
13999
  } else {
13989
- if (!displayData.includes(`,`) && g_stateObj.d_stepzone !== C_FLG_OFF) {
13990
- } else {
13991
- displayData += ` : OFF`;
14000
+ // 表示設定のOFF項目を末尾にまとめる
14001
+ const displayList = displayData.split(`, `).sort((a, b) => b.includes(`:`) - a.includes(`:`));
14002
+ displayData = displayList.join(`, `);
14003
+ if (!displayList.at(-1).includes(`:`)) {
14004
+ displayData += ` : ${getStgDetailName(C_FLG_OFF)}`;
13992
14005
  }
13993
14006
  }
13994
14007
 
13995
14008
  let display2Data = [
13996
- withOptions(g_stateObj.d_speed, C_FLG_ON, g_lblNameObj.rd_Speed),
13997
- withOptions(g_stateObj.d_color, C_FLG_ON, g_lblNameObj.rd_Color),
13998
- withOptions(g_stateObj.d_lyrics, C_FLG_ON, g_lblNameObj.rd_Lyrics),
13999
- withOptions(g_stateObj.d_background, C_FLG_ON, g_lblNameObj.rd_Background),
14000
- withOptions(g_stateObj.d_arroweffect, C_FLG_ON, g_lblNameObj.rd_ArrowEffect),
14001
- withOptions(g_stateObj.d_special, C_FLG_ON, g_lblNameObj.rd_Special),
14009
+ withDisplays(g_stateObj.d_speed, C_FLG_ON, g_lblNameObj.rd_Speed),
14010
+ withDisplays(g_stateObj.d_color, C_FLG_ON, g_lblNameObj.rd_Color),
14011
+ withDisplays(g_stateObj.d_lyrics, C_FLG_ON, g_lblNameObj.rd_Lyrics),
14012
+ withDisplays(g_stateObj.d_background, C_FLG_ON, g_lblNameObj.rd_Background),
14013
+ withDisplays(g_stateObj.d_arroweffect, C_FLG_ON, g_lblNameObj.rd_ArrowEffect),
14014
+ withDisplays(g_stateObj.d_special, C_FLG_ON, g_lblNameObj.rd_Special),
14002
14015
  ].filter(value => value !== ``).join(`, `);
14003
14016
  if (display2Data !== ``) {
14004
- display2Data += ` : OFF`;
14017
+ // 表示設定のOFF項目を末尾にまとめる
14018
+ const display2List = display2Data.split(`, `).sort((a, b) => b.includes(`:`) - a.includes(`:`));
14019
+ display2Data = display2List.join(`, `);
14020
+ if (!display2List.at(-1).includes(`:`)) {
14021
+ display2Data += ` : ${getStgDetailName(C_FLG_OFF)}`;
14022
+ }
14005
14023
  }
14006
14024
 
14007
14025
  const [lblRX, dataRX] = [20, 60];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "42.5.9",
3
+ "version": "42.5.11",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {