danoniplus 43.6.1 → 43.6.3

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 +168 -117
  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/24
7
+ * Revised : 2026/01/26
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 43.6.1`;
12
- const g_revisedDate = `2026/01/24`;
11
+ const g_version = `Ver 43.6.3`;
12
+ const g_revisedDate = `2026/01/26`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -223,6 +223,7 @@ const g_wordObj = {
223
223
 
224
224
  // オーディオ設定・タイマー管理
225
225
  let g_audio = new Audio();
226
+ let g_audioForMS = null;
226
227
  let g_timeoutEvtId = 0;
227
228
  let g_timeoutEvtTitleId = 0;
228
229
  let g_timeoutEvtResultId = 0;
@@ -2342,6 +2343,8 @@ class AudioPlayer {
2342
2343
  this._fadeinPosition = 0;
2343
2344
  this._eventListeners = {};
2344
2345
  this.playbackRate = 1;
2346
+ this._muted = false;
2347
+ this._savedVolume = 1;
2345
2348
  }
2346
2349
 
2347
2350
  async init(_arrayBuffer) {
@@ -2404,11 +2407,17 @@ class AudioPlayer {
2404
2407
  }
2405
2408
 
2406
2409
  get volume() {
2407
- return this._gain.gain.value;
2410
+ // ミュート中でも設定されている音量を返す
2411
+ return this._muted ? this._savedVolume : this._gain.gain.value;
2408
2412
  }
2409
2413
 
2410
2414
  set volume(_volume) {
2411
- this._gain.gain.value = _volume;
2415
+ if (this._muted) {
2416
+ // ミュート中でも音量設定は保存
2417
+ this._savedVolume = _volume;
2418
+ } else {
2419
+ this._gain.gain.value = _volume;
2420
+ }
2412
2421
  }
2413
2422
 
2414
2423
  get duration() {
@@ -2423,6 +2432,26 @@ class AudioPlayer {
2423
2432
  }
2424
2433
  }
2425
2434
 
2435
+ get muted() {
2436
+ return this._muted;
2437
+ }
2438
+
2439
+ set muted(_muted) {
2440
+ if (this._muted === _muted) {
2441
+ return;
2442
+ }
2443
+ this._muted = _muted;
2444
+
2445
+ if (_muted) {
2446
+ // ミュート時:現在の音量を保存してゲインを0に
2447
+ this._savedVolume = this._gain.gain.value;
2448
+ this._gain.gain.value = 0;
2449
+ } else {
2450
+ // ミュート解除時:保存した音量を復元
2451
+ this._gain.gain.value = this._savedVolume;
2452
+ }
2453
+ }
2454
+
2426
2455
  addEventListener(_type, _listener) {
2427
2456
  this._eventListeners[_type]?.push(_listener) || (this._eventListeners[_type] = [_listener]);
2428
2457
  }
@@ -5148,7 +5177,9 @@ const titleInit = (_initFlg = false) => {
5148
5177
  const setBGMVolume = (_num = 1) => {
5149
5178
  g_settings.bgmVolumeNum = nextPos(g_settings.bgmVolumeNum, _num, g_settings.volumes.length);
5150
5179
  g_stateObj.bgmVolume = g_settings.volumes[g_settings.bgmVolumeNum];
5151
- g_audio.volume = g_stateObj.bgmVolume / 100;
5180
+ if (g_audioForMS) {
5181
+ g_audioForMS.volume = g_stateObj.bgmVolume / 100;
5182
+ }
5152
5183
  btnBgmVolume.textContent = `${g_stateObj.bgmVolume}${g_lblNameObj.percent}`;
5153
5184
  };
5154
5185
 
@@ -5164,7 +5195,6 @@ const titleInit = (_initFlg = false) => {
5164
5195
  createCss2Button(`btnStart`,
5165
5196
  `>`, () => {
5166
5197
  clearTimeout(g_timeoutEvtTitleId);
5167
- pauseBGM();
5168
5198
  g_handler.removeListener(wheelHandler);
5169
5199
  g_keyObj.prevKey = `Dummy${g_settings.musicIdxNum}`;
5170
5200
  g_langStorage.bgmVolume = g_stateObj.bgmVolume;
@@ -5228,7 +5258,9 @@ const titleInit = (_initFlg = false) => {
5228
5258
 
5229
5259
  // 初期表示用 (2秒後に選曲画面を表示)
5230
5260
  if (_initFlg && !g_headerObj.customTitleUse) {
5231
- g_audio.muted = true;
5261
+ if (g_audioForMS) {
5262
+ g_audioForMS.muted = true;
5263
+ }
5232
5264
  const mSelectTitleSprite = createEmptySprite(divRoot, `mSelectTitleSprite`,
5233
5265
  g_windowObj.mSelectTitleSprite, g_cssObj.settings_DifSelector);
5234
5266
  multiAppend(mSelectTitleSprite,
@@ -5247,8 +5279,15 @@ const titleInit = (_initFlg = false) => {
5247
5279
  if (_opacity <= 0) {
5248
5280
  clearTimeout(fadeOpacity);
5249
5281
  mSelectTitleSprite.style.display = C_DIS_NONE;
5250
- g_audio.muted = false;
5251
- g_audio.currentTime = g_headerObj.musicStarts[g_headerObj.musicIdxList[g_settings.musicIdxNum]] ?? 0;
5282
+ if (!g_stateObj.bgmMuteFlg && g_audioForMS) {
5283
+ g_audioForMS.muted = false;
5284
+ g_audioForMS.currentTime = g_headerObj.musicStarts[g_headerObj.musicIdxList[g_settings.musicIdxNum]] ?? 0;
5285
+ if (g_audioForMS instanceof AudioPlayer) {
5286
+ // AudioPlayerはシークを適用するために再起動が必要
5287
+ g_audioForMS.pause();
5288
+ g_audioForMS.play();
5289
+ }
5290
+ }
5252
5291
  } else {
5253
5292
  mSelectTitleSprite.style.opacity = _opacity;
5254
5293
  fadeOpacity = setTimeout(() => {
@@ -5543,12 +5582,12 @@ const getCreatorInfo = (_creatorList) => {
5543
5582
  * BGMの停止
5544
5583
  */
5545
5584
  const pauseBGM = () => {
5546
- if (g_audio) {
5585
+ if (g_audioForMS) {
5547
5586
  g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
5548
- g_audio.pause();
5549
- if (!(g_audio instanceof AudioPlayer)) {
5550
- g_audio.removeAttribute('src');
5551
- g_audio.load();
5587
+ g_audioForMS.pause();
5588
+ if (!(g_audioForMS instanceof AudioPlayer)) {
5589
+ g_audioForMS.removeAttribute('src');
5590
+ g_audioForMS.load();
5552
5591
  }
5553
5592
  }
5554
5593
  [`bgmLooped`, `bgmFadeIn`, `bgmFadeOut`].forEach(id => {
@@ -5590,13 +5629,13 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5590
5629
 
5591
5630
  // 開始時点で終了音量とイコールの場合は終了
5592
5631
  if (startVolume === endVolume || step === 0) {
5593
- g_audio.volume = endVolume;
5632
+ g_audioForMS.volume = endVolume;
5594
5633
  onEnd(true);
5595
5634
  return null;
5596
5635
  }
5597
5636
 
5598
5637
  let volume = startVolume;
5599
- g_audio.volume = startVolume;
5638
+ g_audioForMS.volume = startVolume;
5600
5639
 
5601
5640
  const stepFunc = () => {
5602
5641
  // 継続条件チェック
@@ -5611,14 +5650,14 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5611
5650
  (startVolume > endVolume && volume <= endVolume);
5612
5651
 
5613
5652
  if (reached) {
5614
- g_audio.volume = endVolume;
5653
+ g_audioForMS.volume = endVolume;
5615
5654
  onEnd(true); // 正常終了
5616
5655
  return;
5617
5656
  }
5618
5657
 
5619
5658
  // 音量更新
5620
5659
  volume += step;
5621
- g_audio.volume = Math.min(Math.max(volume, 0), 1);
5660
+ g_audioForMS.volume = Math.min(Math.max(volume, 0), 1);
5622
5661
 
5623
5662
  // 次のステップへ
5624
5663
  setTimeout(stepFunc, FADE_INTERVAL_MS);
@@ -5659,7 +5698,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5659
5698
  * BGMのフェードアウトとシーク
5660
5699
  */
5661
5700
  const fadeOutAndSeek = () => {
5662
- const start = g_audio.volume;
5701
+ const start = g_audioForMS.volume;
5663
5702
  const end = 0;
5664
5703
 
5665
5704
  g_stateObj.bgmFadeOut = fadeVolume(
@@ -5672,8 +5711,8 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5672
5711
 
5673
5712
  if (!finished) return; // 中断された
5674
5713
 
5675
- g_audio.pause();
5676
- g_audio.currentTime = musicStart;
5714
+ g_audioForMS.pause();
5715
+ g_audioForMS.currentTime = musicStart;
5677
5716
 
5678
5717
  if (isTitle()) {
5679
5718
  setTimeout(() => {
@@ -5695,13 +5734,13 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5695
5734
  * BGMのフェードイン
5696
5735
  */
5697
5736
  const fadeIn = () => {
5698
- if (!(g_audio instanceof AudioPlayer) && !g_audio.src) return;
5737
+ if (!(g_audioForMS instanceof AudioPlayer) && !g_audioForMS.src) return;
5699
5738
 
5700
5739
  const start = 0;
5701
5740
  const end = g_stateObj.bgmVolume / 100;
5702
5741
 
5703
- g_audio.volume = 0;
5704
- g_audio.play();
5742
+ g_audioForMS.volume = 0;
5743
+ g_audioForMS.play();
5705
5744
 
5706
5745
  g_stateObj.bgmFadeIn = fadeVolume(
5707
5746
  start,
@@ -5731,7 +5770,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5731
5770
  () => {
5732
5771
  try {
5733
5772
  return (
5734
- g_audio.elapsedTime >= musicEnd ||
5773
+ g_audioForMS.elapsedTime >= musicEnd ||
5735
5774
  numAtStart !== g_settings.musicIdxNum
5736
5775
  );
5737
5776
  } catch {
@@ -5754,6 +5793,9 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5754
5793
  try {
5755
5794
  // base64エンコードは読込に時間が掛かるため、曲変更時のみ読込
5756
5795
  if (!hasVal(g_musicdata) || Math.abs(_num) % g_headerObj.musicIdxList.length !== 0) {
5796
+ if (g_audioForMS instanceof AudioPlayer) {
5797
+ g_audioForMS.close();
5798
+ }
5757
5799
  await loadScript2(url);
5758
5800
  musicInit();
5759
5801
  if (!isTitle()) {
@@ -5766,12 +5808,12 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5766
5808
  tmpAudio.close();
5767
5809
  return;
5768
5810
  }
5769
- g_audio = tmpAudio;
5811
+ g_audioForMS = tmpAudio;
5770
5812
  }
5771
- g_audio.volume = g_stateObj.bgmVolume / 100;
5813
+ g_audioForMS.volume = g_stateObj.bgmVolume / 100;
5772
5814
  if (g_currentPage === `title` && musicEnd > 0) {
5773
- g_audio.currentTime = musicStart;
5774
- g_audio.play();
5815
+ g_audioForMS.currentTime = musicStart;
5816
+ g_audioForMS.play();
5775
5817
  repeatBGM();
5776
5818
  }
5777
5819
  } catch (e) {
@@ -5780,22 +5822,30 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
5780
5822
  }
5781
5823
 
5782
5824
  } else {
5783
- g_audio = new Audio();
5784
- g_audio.src = url;
5785
- g_audio.autoplay = false;
5786
- g_audio.volume = g_stateObj.bgmVolume / 100;
5787
- const loadedMeta = g_handler.addListener(g_audio, `loadedmetadata`, () => {
5825
+ // 既存の監視を解除し、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
+ }
5833
+ g_audioForMS = new Audio();
5834
+ g_audioForMS.src = url;
5835
+ g_audioForMS.autoplay = false;
5836
+ g_audioForMS.volume = g_stateObj.bgmVolume / 100;
5837
+ const loadedMeta = g_handler.addListener(g_audioForMS, `loadedmetadata`, () => {
5788
5838
  g_handler.removeListener(loadedMeta);
5789
5839
  if (!isTitle()) {
5790
5840
  return;
5791
5841
  }
5792
- g_audio.currentTime = musicStart;
5793
- g_audio.play();
5842
+ g_audioForMS.currentTime = musicStart;
5843
+ g_audioForMS.play();
5794
5844
  }, { once: true });
5795
5845
 
5796
5846
  if (musicEnd > 0) {
5797
- g_stateObj.bgmTimeupdateEvtId = g_handler.addListener(g_audio, "timeupdate", () => {
5798
- if (g_audio.currentTime >= musicEnd) {
5847
+ g_stateObj.bgmTimeupdateEvtId = g_handler.addListener(g_audioForMS, "timeupdate", () => {
5848
+ if (g_audioForMS.currentTime >= musicEnd) {
5799
5849
  fadeOutAndSeek();
5800
5850
  }
5801
5851
  });
@@ -6000,6 +6050,7 @@ const setWindowStyle = (_text, _bkColor, _textColor, _align = C_ALIGN_LEFT, { _x
6000
6050
 
6001
6051
  const dataMgtInit = () => {
6002
6052
  clearWindow(true);
6053
+ pauseBGM();
6003
6054
  const prevPage = g_currentPage;
6004
6055
  g_currentPage = `dataMgt`;
6005
6056
  let selectedKey = g_keyObj.currentKey;
@@ -6231,6 +6282,7 @@ const dataMgtInit = () => {
6231
6282
 
6232
6283
  const preconditionInit = () => {
6233
6284
  clearWindow(true);
6285
+ pauseBGM();
6234
6286
  const prevPage = g_currentPage;
6235
6287
  g_currentPage = `precondition`;
6236
6288
 
@@ -6398,6 +6450,7 @@ const makePlayButton = _func => createCss2Button(`btnPlay`, g_lblNameObj.b_play,
6398
6450
  const optionInit = () => {
6399
6451
 
6400
6452
  clearWindow(true);
6453
+ pauseBGM();
6401
6454
  const divRoot = document.getElementById(`divRoot`);
6402
6455
  g_currentPage = `option`;
6403
6456
  g_stateObj.filterKeys = ``;
@@ -6771,22 +6824,19 @@ const drawSpeedGraph = _scoreId => {
6771
6824
  };
6772
6825
 
6773
6826
  // 速度計算用ラベルの再作成
6774
- deleteDiv(detailSpeed, `lblSpdHeader`);
6775
- deleteDiv(detailSpeed, `lblSpdBase`);
6776
- deleteDiv(detailSpeed, `lblSpdOverall`);
6777
- deleteDiv(detailSpeed, `lblSpdBoost`);
6778
- deleteDiv(detailSpeed, `lblSpdTotal`);
6779
- deleteDiv(detailSpeed, `lblSpdFrame`);
6780
6827
  deleteDiv(detailSpeed, `btnSpdCursorL`);
6781
6828
  deleteDiv(detailSpeed, `btnSpdCursorR`);
6782
-
6829
+ if (document.getElementById(`lblSpdHeader`) === null) {
6830
+ multiAppend(detailSpeed,
6831
+ createDivCss2Label(`lblSpdHeader`, `TotalSpeed`, g_lblPosObj.lblSpdHeader),
6832
+ createDivCss2Label(`lblSpdBase`, ``, g_lblPosObj.lblSpdBase),
6833
+ createDivCss2Label(`lblSpdOverall`, ``, g_lblPosObj.lblSpdOverall),
6834
+ createDivCss2Label(`lblSpdBoost`, ``, g_lblPosObj.lblSpdBoost),
6835
+ createDivCss2Label(`lblSpdTotal`, ``, g_lblPosObj.lblSpdTotal),
6836
+ createDivCss2Label(`lblSpdFrame`, ``, g_lblPosObj.lblSpdFrame),
6837
+ );
6838
+ }
6783
6839
  multiAppend(detailSpeed,
6784
- createDivCss2Label(`lblSpdHeader`, `TotalSpeed`, g_lblPosObj.lblSpdHeader),
6785
- createDivCss2Label(`lblSpdBase`, ``, g_lblPosObj.lblSpdBase),
6786
- createDivCss2Label(`lblSpdOverall`, ``, g_lblPosObj.lblSpdOverall),
6787
- createDivCss2Label(`lblSpdBoost`, ``, g_lblPosObj.lblSpdBoost),
6788
- createDivCss2Label(`lblSpdTotal`, ``, g_lblPosObj.lblSpdTotal),
6789
- createDivCss2Label(`lblSpdFrame`, ``, g_lblPosObj.lblSpdFrame),
6790
6840
  createCss2Button(`btnSpdCursorL`, `<`, () => changeSpdCursor(-1),
6791
6841
  g_lblPosObj.btnSpdCursorL, g_cssObj.button_Mini),
6792
6842
  createCss2Button(`btnSpdCursorR`, `>`, () => changeSpdCursor(),
@@ -6802,7 +6852,7 @@ const drawSpeedGraph = _scoreId => {
6802
6852
  * @param {number} _frame
6803
6853
  */
6804
6854
  const calculateTotalSpeed = (_speed = null, _boost = null, _frame = 0) => {
6805
- if (document.getElementById(`lblSpdOverall`) === null) {
6855
+ if (document.getElementById(`lblSpdHeader`) === null) {
6806
6856
  return;
6807
6857
  }
6808
6858
  let speed, boost;
@@ -9550,6 +9600,7 @@ const changeShuffleConfigColor = (_keyCtrlPtn, _vals, _j = -1) => {
9550
9600
  const loadMusic = () => {
9551
9601
 
9552
9602
  clearWindow(true);
9603
+ pauseBGM();
9553
9604
  g_currentPage = `loading`;
9554
9605
 
9555
9606
  const musicUrl = getMusicUrl(g_stateObj.scoreId);
@@ -14291,12 +14342,20 @@ const resultInit = () => {
14291
14342
  }
14292
14343
 
14293
14344
  // ゲージ推移グラフの描画
14294
- const gaugeTransitionCanvas = document.createElement(`canvas`);
14295
- gaugeTransitionCanvas.id = `graphGaugeTransition`;
14296
- gaugeTransitionCanvas.width = g_limitObj.gaugeTransitionWidth;
14297
- gaugeTransitionCanvas.height = g_limitObj.gaugeTransitionHeight;
14298
-
14299
- createEmptySprite(divRoot, `gaugeTransitionWindow`, g_windowObj.gaugeTransition, g_cssObj.result_PlayDataWindow).appendChild(gaugeTransitionCanvas);
14345
+ const gaugeTransitionWindow = createEmptySprite(divRoot, `gaugeTransitionWindow`, g_windowObj.gaugeTransition, g_cssObj.result_PlayDataWindow);
14346
+ for (let j = 0; j < 2; j++) {
14347
+ const canvas = document.createElement(`canvas`);
14348
+ canvas.id = `graphGaugeTransition${j > 0 ? j + 1 : ``}`;
14349
+ canvas.width = g_limitObj.gaugeTransitionWidth;
14350
+ canvas.height = g_limitObj.gaugeTransitionHeight;
14351
+ canvas.style.left = wUnit(0);
14352
+ canvas.style.top = wUnit(0);
14353
+ canvas.style.position = `absolute`;
14354
+ if (j > 0) {
14355
+ canvas.style.pointerEvents = C_DIS_NONE;
14356
+ }
14357
+ gaugeTransitionWindow.appendChild(canvas);
14358
+ }
14300
14359
 
14301
14360
  multiAppend(divRoot,
14302
14361
  createCss2Button(`btnGaugeTransition`, `i`, () => true, {
@@ -14347,64 +14406,60 @@ const resultInit = () => {
14347
14406
  frame.push(playingFrame);
14348
14407
  life.push(life.at(-1));
14349
14408
 
14350
- const context = gaugeTransitionCanvas.getContext(`2d`);
14409
+ // グラフ本体の描画
14410
+ const context = document.getElementById(`graphGaugeTransition`).getContext(`2d`);
14351
14411
  context.lineWidth = 2;
14352
14412
 
14353
- const drawGaugeGraph = () => {
14354
- context.clearRect(0, 0, gaugeTransitionCanvas.width, gaugeTransitionCanvas.height);
14413
+ let preX, preY;
14414
+ const borderY = g_limitObj.gaugeTransitionHeight - g_workObj.lifeBorder * g_limitObj.gaugeTransitionHeight / g_headerObj.maxLifeVal;
14355
14415
 
14356
- let preX, preY;
14357
- const borderY = g_limitObj.gaugeTransitionHeight - g_workObj.lifeBorder * g_limitObj.gaugeTransitionHeight / g_headerObj.maxLifeVal;
14416
+ for (let i = 0; i < frame.length; i++) {
14417
+ const x = frame[i] * g_limitObj.gaugeTransitionWidth / playingFrame;
14418
+ const y = g_limitObj.gaugeTransitionHeight - life[i] * g_limitObj.gaugeTransitionHeight / g_headerObj.maxLifeVal;
14358
14419
 
14359
- for (let i = 0; i < frame.length; i++) {
14360
- const x = frame[i] * g_limitObj.gaugeTransitionWidth / playingFrame;
14361
- const y = g_limitObj.gaugeTransitionHeight - life[i] * g_limitObj.gaugeTransitionHeight / g_headerObj.maxLifeVal;
14420
+ if (i === 0) {
14421
+ context.beginPath();
14422
+ context.moveTo(x, y);
14423
+ } else {
14424
+ context.moveTo(preX, preY);
14425
+ context.lineTo(x, preY);
14362
14426
 
14363
- if (i === 0) {
14364
- context.beginPath();
14365
- context.moveTo(x, y);
14366
- } else {
14367
- context.moveTo(preX, preY);
14368
- context.lineTo(x, preY);
14369
-
14370
- if (life[i - 1] === 0 && life[i] === 0) {
14371
- context.strokeStyle = g_graphColorObj.failed;
14372
-
14373
- } else if (life[i - 1] >= g_workObj.lifeBorder && life[i] >= g_workObj.lifeBorder) {
14374
- context.lineTo(x, y);
14375
- context.strokeStyle = g_graphColorObj.clear;
14376
-
14377
- } else if (life[i - 1] < g_workObj.lifeBorder && life[i] >= g_workObj.lifeBorder) {
14378
- context.lineTo(x, borderY);
14379
- context.strokeStyle = g_graphColorObj.failed;
14380
- context.stroke();
14381
- context.beginPath();
14382
- context.moveTo(x, borderY);
14383
- context.lineTo(x, y);
14384
- context.strokeStyle = g_graphColorObj.clear;
14385
-
14386
- } else if (life[i - 1] >= g_workObj.lifeBorder && life[i] < g_workObj.lifeBorder) {
14387
- context.lineTo(x, borderY);
14388
- context.strokeStyle = g_graphColorObj.clear;
14389
- context.stroke();
14390
- context.beginPath();
14391
- context.moveTo(x, borderY);
14392
- context.lineTo(x, y);
14393
- context.strokeStyle = g_graphColorObj.failed;
14427
+ if (life[i - 1] === 0 && life[i] === 0) {
14428
+ context.strokeStyle = g_graphColorObj.failed;
14394
14429
 
14395
- } else {
14396
- context.lineTo(x, y);
14397
- context.strokeStyle = g_graphColorObj.failed;
14398
- }
14430
+ } else if (life[i - 1] >= g_workObj.lifeBorder && life[i] >= g_workObj.lifeBorder) {
14431
+ context.lineTo(x, y);
14432
+ context.strokeStyle = g_graphColorObj.clear;
14433
+
14434
+ } else if (life[i - 1] < g_workObj.lifeBorder && life[i] >= g_workObj.lifeBorder) {
14435
+ context.lineTo(x, borderY);
14436
+ context.strokeStyle = g_graphColorObj.failed;
14437
+ context.stroke();
14438
+ context.beginPath();
14439
+ context.moveTo(x, borderY);
14440
+ context.lineTo(x, y);
14441
+ context.strokeStyle = g_graphColorObj.clear;
14399
14442
 
14443
+ } else if (life[i - 1] >= g_workObj.lifeBorder && life[i] < g_workObj.lifeBorder) {
14444
+ context.lineTo(x, borderY);
14445
+ context.strokeStyle = g_graphColorObj.clear;
14400
14446
  context.stroke();
14401
14447
  context.beginPath();
14448
+ context.moveTo(x, borderY);
14449
+ context.lineTo(x, y);
14450
+ context.strokeStyle = g_graphColorObj.failed;
14451
+
14452
+ } else {
14453
+ context.lineTo(x, y);
14454
+ context.strokeStyle = g_graphColorObj.failed;
14402
14455
  }
14403
- preX = x;
14404
- preY = y;
14456
+
14457
+ context.stroke();
14458
+ context.beginPath();
14405
14459
  }
14460
+ preX = x;
14461
+ preY = y;
14406
14462
  }
14407
- drawGaugeGraph();
14408
14463
 
14409
14464
  let cursorFrame = 0; // 現在のカーソル位置(frame)
14410
14465
  const moveCursor = (sec = 1) => {
@@ -14412,22 +14467,18 @@ const resultInit = () => {
14412
14467
  drawOverlay();
14413
14468
  };
14414
14469
 
14415
- const frameToX = (_frame) => {
14416
- return _frame / playingFrame * gaugeTransitionCanvas.width;
14417
- };
14418
-
14419
- // 既存のグラフを再描画しつつ縦線と時間を重ねる
14470
+ // 既存のグラフの上から縦線と時間を重ねる
14420
14471
  const drawOverlay = () => {
14421
- // 既存のグラフを再描画
14422
- drawGaugeGraph();
14423
14472
 
14424
- const ctx = context;
14425
- const x = frameToX(cursorFrame);
14473
+ const canvas = document.getElementById(`graphGaugeTransition2`);
14474
+ const ctx = canvas.getContext(`2d`);
14475
+ const x = cursorFrame / playingFrame * canvas.width;
14476
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
14426
14477
 
14427
14478
  // 縦線
14428
14479
  ctx.beginPath();
14429
14480
  ctx.moveTo(x, 0);
14430
- ctx.lineTo(x, gaugeTransitionCanvas.height);
14481
+ ctx.lineTo(x, canvas.height);
14431
14482
  ctx.strokeStyle = "#009999";
14432
14483
  ctx.lineWidth = 1.5;
14433
14484
  ctx.stroke();
@@ -14436,10 +14487,10 @@ const resultInit = () => {
14436
14487
  const timer = transFrameToTimer(cursorFrame + startFrame);
14437
14488
  ctx.font = `14px ${getBasicFont()}`;
14438
14489
  ctx.fillStyle = "#009999";
14439
- ctx.textAlign = x > gaugeTransitionCanvas.width * 0.8 ? C_ALIGN_RIGHT : C_ALIGN_LEFT;
14490
+ ctx.textAlign = x > canvas.width * 0.8 ? C_ALIGN_RIGHT : C_ALIGN_LEFT;
14440
14491
  ctx.fillText(
14441
14492
  `${timer}`,
14442
- x > gaugeTransitionCanvas.width * 0.8 ? x - 5 : x + 5,
14493
+ x > canvas.width * 0.8 ? x - 5 : x + 5,
14443
14494
  g_limitObj.gaugeTransitionHeight - 35
14444
14495
  );
14445
14496
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "43.6.1",
3
+ "version": "43.6.3",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "./js/danoni_main.js",
6
6
  "scripts": {