danoniplus 41.2.1 → 41.3.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.
Files changed (2) hide show
  1. package/js/danoni_main.js +14 -6
  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 : 2025/05/09
7
+ * Revised : 2025/05/10
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 41.2.1`;
12
- const g_revisedDate = `2025/05/09`;
11
+ const g_version = `Ver 41.3.0`;
12
+ const g_revisedDate = `2025/05/10`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -2824,6 +2824,11 @@ const loadLocalStorage = (_musicId = ``) => {
2824
2824
  if (g_langStorage.safeMode === undefined) {
2825
2825
  g_langStorage.safeMode = C_FLG_OFF;
2826
2826
  }
2827
+ if (g_langStorage.bgmVolume === undefined) {
2828
+ g_langStorage.bgmVolume = 50;
2829
+ }
2830
+ g_stateObj.bgmVolume = g_langStorage.bgmVolume;
2831
+ g_settings.bgmVolumeNum = g_settings.volumes.findIndex(val => val === g_stateObj.bgmVolume);
2827
2832
  Object.assign(g_msgInfoObj, g_lang_msgInfoObj[g_localeObj.val]);
2828
2833
  Object.assign(g_kCd, g_lang_kCd[g_localeObj.val]);
2829
2834
 
@@ -4997,6 +5002,8 @@ const titleInit = (_initFlg = false) => {
4997
5002
  pauseBGM();
4998
5003
  g_handler.removeListener(wheelHandler);
4999
5004
  g_keyObj.prevKey = `Dummy${g_settings.musicIdxNum}`;
5005
+ g_langStorage.bgmVolume = g_stateObj.bgmVolume;
5006
+ localStorage.setItem(`danoni-locale`, JSON.stringify(g_langStorage));
5000
5007
  }, Object.assign({
5001
5008
  resetFunc: () => optionInit(),
5002
5009
  }, g_lblPosObj.btnStart_music), g_cssObj.button_Tweet),
@@ -5478,19 +5485,20 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5478
5485
  }
5479
5486
  };
5480
5487
 
5488
+ const musicPlayCheck = () => _currentLoopNum !== g_settings.musicLoopNum || g_currentPage !== `title`;
5481
5489
  if (encodeFlg) {
5482
5490
  try {
5483
5491
  // base64エンコードは読込に時間が掛かるため、曲変更時のみ読込
5484
5492
  if (!hasVal(g_musicdata) || Math.abs(_num) % g_headerObj.musicIdxList.length !== 0) {
5485
5493
  await loadScript2(url);
5486
5494
  musicInit();
5487
- if (_currentLoopNum !== g_settings.musicLoopNum) {
5495
+ if (musicPlayCheck()) {
5488
5496
  return;
5489
5497
  }
5490
5498
  const tmpAudio = new AudioPlayer();
5491
5499
  const array = Uint8Array.from(atob(g_musicdata), v => v.charCodeAt(0));
5492
5500
  await tmpAudio.init(array.buffer);
5493
- if (_currentLoopNum !== g_settings.musicLoopNum) {
5501
+ if (musicPlayCheck()) {
5494
5502
  tmpAudio.close();
5495
5503
  return;
5496
5504
  }
@@ -5513,7 +5521,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5513
5521
  g_audio.volume = g_stateObj.bgmVolume / 100;
5514
5522
  const loadedMeta = g_handler.addListener(g_audio, `loadedmetadata`, () => {
5515
5523
  g_handler.removeListener(loadedMeta);
5516
- if (_currentLoopNum !== g_settings.musicLoopNum) {
5524
+ if (musicPlayCheck()) {
5517
5525
  return;
5518
5526
  }
5519
5527
  g_audio.currentTime = musicStart;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "41.2.1",
3
+ "version": "41.3.0",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {