danoniplus 48.3.0 → 48.4.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.
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/05/31
7
+ * Revised : 2026/06/02
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 48.3.0`;
12
- const g_revisedDate = `2026/05/31`;
11
+ const g_version = `Ver 48.4.0`;
12
+ const g_revisedDate = `2026/06/02`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -9171,7 +9171,7 @@ const openDisplayPreview = () => {
9171
9171
  // オーバーレイ本体
9172
9172
  // ============================================================
9173
9173
  const overlay = createEmptySprite(divRoot, `displayPreviewOverlay`, {
9174
- w: g_sWidth, h: g_sHeight, background: g_headerObj.baseBrightFlg ? `#eeeeeedd` : `#111111dd`, pointerEvents: C_DIS_AUTO,
9174
+ w: g_sWidth, h: g_sHeight, background: g_headerObj.baseBrightFlg ? `#eeeeeeee` : `#111111dd`, pointerEvents: C_DIS_AUTO,
9175
9175
  });
9176
9176
  g_previewRoot = overlay;
9177
9177
  multiAppend(overlay,
@@ -9209,7 +9209,7 @@ const openDisplayPreview = () => {
9209
9209
 
9210
9210
  const frame = createEmptySprite(overlay, `previewFrame`, {
9211
9211
  x: frameX, y: frameY, w: playW, h: playH,
9212
- background: `#111111`,
9212
+ background: g_headerObj.baseBrightFlg ? `#eeeeee` : `#111111`,
9213
9213
  border: `1px solid #444444`,
9214
9214
  boxSizing: `border-box`,
9215
9215
  transform: `scale(${rate})`,
@@ -9266,6 +9266,13 @@ const buildPreviewUI = (_frame, _playW, _playH) => {
9266
9266
  // ============================================================
9267
9267
  const stepY = g_posObj.stepY ?? C_STEP_Y;
9268
9268
  const revStepY = g_posObj.reverseStepY;
9269
+ const hitPos = g_stateObj.hitPosition ?? 0;
9270
+
9271
+ // 簡易ステップゾーン(7レーン分)
9272
+ const laneCount = 7;
9273
+ const laneW = 50;
9274
+ const totalW = laneCount * laneW;
9275
+ const startX = Math.round((_playW - totalW) / 2);
9269
9276
 
9270
9277
  if (d.stepzone === C_FLG_OFF) {
9271
9278
  multiAppend(_frame,
@@ -9273,12 +9280,6 @@ const buildPreviewUI = (_frame, _playW, _playH) => {
9273
9280
  disableBox(`StepZone_Rev`, { x: Math.round(_playW / 2 - 200), y: C_STEP_Y + revStepY, w: 400, h: 50 }),
9274
9281
  );
9275
9282
  } else {
9276
- // 簡易ステップゾーン(7レーン分)
9277
- const laneCount = 7;
9278
- const laneW = 50;
9279
- const totalW = laneCount * laneW;
9280
- const startX = Math.round((_playW - totalW) / 2);
9281
-
9282
9283
  for (let j = 0; j < laneCount; j++) {
9283
9284
  createEmptySprite(_frame, `previewStep${j}`, {
9284
9285
  x: startX + j * laneW + 2, y: stepY + 2, w: laneW - 4, h: laneW - 4,
@@ -9293,6 +9294,45 @@ const buildPreviewUI = (_frame, _playW, _playH) => {
9293
9294
  }
9294
9295
  }
9295
9296
 
9297
+ // ============================================================
9298
+ // HitPosition を視覚化する判定基準ライン
9299
+ // ============================================================
9300
+ // 通常譜面用の判定ライン(赤または目立つ色で、レーン幅全体をカバー)
9301
+ // 上から下に流れる場合、hitPosがプラスなら「ステップゾーンより下」にラインが来る
9302
+ const lineNormal = createEmptySprite(_frame, `previewHitPosLine`, {
9303
+ x: startX,
9304
+ y: stepY + Math.round(laneW / 2) + hitPos, // ステップゾーンの中心 + hitPos
9305
+ w: totalW,
9306
+ h: 2, // 2pxの横線
9307
+ background: `#33aaff`,
9308
+ boxShadow: `0 0 4px #33aaff`, // ネオンっぽく光らせて目立たせる
9309
+ });
9310
+
9311
+ // 青いラインの右端(totalW から10pxほど外側)に数値を表示
9312
+ multiAppend(
9313
+ lineNormal,
9314
+ createDivCss2Label(`previewHitPosTitle`, `Hit`, {
9315
+ ...g_lblPosObj.previewHitPosText, x: -60, y: -14, align: C_ALIGN_RIGHT,
9316
+ }),
9317
+ createDivCss2Label(`previewHitPosTitle2`, `Position`, {
9318
+ ...g_lblPosObj.previewHitPosText, x: -60, y: -2, align: C_ALIGN_RIGHT,
9319
+ }),
9320
+ createDivCss2Label(`previewHitPosText`, `${hitPos > 0 ? '+' : ''}${hitPos}px↑↓`, {
9321
+ ...g_lblPosObj.previewHitPosText, x: totalW + 5, y: -8, align: C_ALIGN_LEFT,
9322
+ }),
9323
+ );
9324
+
9325
+ // リバース譜面用の判定ライン
9326
+ // 下から上に流れる場合、hitPosがプラスなら「ステップゾーンより上(座標としてはマイナス)」に来る
9327
+ createEmptySprite(_frame, `previewHitPosLineRev`, {
9328
+ x: startX,
9329
+ y: (C_STEP_Y + revStepY) + Math.round(laneW / 2) - hitPos, // ステップゾーンの中心 - hitPos
9330
+ w: totalW,
9331
+ h: 2,
9332
+ background: `#ffaa00`,
9333
+ boxShadow: `0 0 4px #ffaa00`,
9334
+ });
9335
+
9296
9336
  // ============================================================
9297
9337
  // 判定エリア(ドラッグ可能)
9298
9338
  // ============================================================
@@ -9335,9 +9375,9 @@ const buildPreviewUI = (_frame, _playW, _playH) => {
9335
9375
  _frame.appendChild(disableBox(`LifeGauge`, g_lblPosObj.previewLifeDisabled));
9336
9376
  } else {
9337
9377
  multiAppend(_frame,
9338
- createDivCss2Label(`previewLifeBack`, ``, g_lblPosObj.previewLifeBack),
9339
- createDivCss2Label(`previewLifeBar`, ``, g_lblPosObj.previewLifeBar),
9340
- createDivCss2Label(`previewLifeNum`, `700`, g_lblPosObj.previewLifeNum),
9378
+ createDivCss2Label(`previewLifeBack`, ``, g_lblPosObj.previewLifeBack, g_cssObj.life_Background),
9379
+ createDivCss2Label(`previewLifeBar`, ``, g_lblPosObj.previewLifeBar, g_cssObj.life_Cleared),
9380
+ createDivCss2Label(`previewLifeNum`, `700`, g_lblPosObj.previewLifeNum, g_cssObj.life_Cleared),
9341
9381
  );
9342
9382
  }
9343
9383
 
@@ -9352,31 +9392,31 @@ const buildPreviewUI = (_frame, _playW, _playH) => {
9352
9392
  }
9353
9393
  } else {
9354
9394
  const scoreItems = [
9355
- { color: `#66ffff`, cnt: `5` },
9356
- { color: `#99ff99`, cnt: `0` },
9357
- { color: `#ffcc66`, cnt: `0` },
9358
- { color: `#cc99ff`, cnt: `0` },
9359
- { color: `#ff9999`, cnt: `0` },
9360
- { color: `#ffffff`, cnt: `5` },
9395
+ { name: `ii`, cnt: `5` },
9396
+ { name: `shakin`, cnt: `0` },
9397
+ { name: `matari`, cnt: `0` },
9398
+ { name: `shobon`, cnt: `0` },
9399
+ { name: `uwan`, cnt: `0` },
9400
+ { name: `combo`, cnt: `5` },
9361
9401
  {},
9362
- { color: `#ffff99`, cnt: `5` },
9363
- { color: `#99ff66`, cnt: `0` },
9364
- { color: `#ffffff`, cnt: `5` },
9402
+ { name: `kita`, cnt: `5` },
9403
+ { name: `iknai`, cnt: `0` },
9404
+ { name: `combo`, cnt: `5` },
9365
9405
  ];
9366
9406
  const sx = _playW - 110 + g_headerObj.scAreaWidth;
9367
9407
  scoreItems.forEach((item, i) => {
9368
9408
  _frame.appendChild(
9369
9409
  createDivCss2Label(`previewScore${i}`, item.cnt || ``, {
9370
9410
  x: sx + 50, y: 20 * (i + 1), w: 50, h: 20,
9371
- siz: 16, color: item.color, align: `right`,
9372
- }),
9411
+ siz: 16, align: `right`,
9412
+ }, g_cssObj[`common_${item.name}`]),
9373
9413
  );
9374
9414
  });
9375
9415
 
9376
9416
  // FrzReturn用ゲージ
9377
9417
  if (g_stateObj.frzReturn !== C_FLG_OFF) {
9378
9418
  multiAppend(_frame,
9379
- createDivCss2Label(`previewFrzLifeBack`, ``, g_lblPosObj.previewFrzLifeBack),
9419
+ createDivCss2Label(`previewFrzLifeBack`, ``, g_lblPosObj.previewFrzLifeBack, g_cssObj.life_Background),
9380
9420
  createDivCss2Label(`previewFrzLifeBar`, ``, g_lblPosObj.previewFrzLifeBar, g_cssObj.life_frzNormal),
9381
9421
  );
9382
9422
  }
@@ -9436,6 +9476,41 @@ const buildPreviewUI = (_frame, _playW, _playH) => {
9436
9476
  safeExecuteCustomHooks(`g_customJsObj.displayPreview`, g_customJsObj.displayPreview, _frame, _playW, _playH);
9437
9477
  };
9438
9478
 
9479
+ /**
9480
+ * プレビューが表示されたまま、HitPositionのラインだけを動かす
9481
+ * @param {number} _newHitPos 新しい g_stateObj.hitPosition の値
9482
+ */
9483
+ const updatePreviewHitPositionLine = (_newHitPos) => {
9484
+
9485
+ // 表示用の文字列を作成(例: "+15px", "-8px", "0px")
9486
+ const sign = _newHitPos > 0 ? `+` : ``;
9487
+ const textValue = `${sign}${_newHitPos}px↑↓`;
9488
+
9489
+ // 1. 各種基準座標を再取得(buildPreviewUI 内の計算ロジックと同期)
9490
+ const stepY = g_posObj.stepY ?? C_STEP_Y;
9491
+ const revStepY = g_posObj.reverseStepY;
9492
+ const laneW = 50;
9493
+
9494
+ // 2. DOM要素を直接取得
9495
+ const lineNormal = document.getElementById(`previewHitPosLine`);
9496
+ const lineReverse = document.getElementById(`previewHitPosLineRev`);
9497
+ const textNormal = document.getElementById(`previewHitPosText`);
9498
+
9499
+ // 3. プレビューが表示されている場合のみ、style.top を直接書き換える
9500
+ if (lineNormal) {
9501
+ const newY = stepY + Math.round(laneW / 2) + _newHitPos;
9502
+ lineNormal.style.top = wUnit(newY);
9503
+ }
9504
+ if (textNormal) {
9505
+ textNormal.textContent = textValue;
9506
+ }
9507
+
9508
+ if (lineReverse) {
9509
+ const newY = (C_STEP_Y + revStepY) + Math.round(laneW / 2) - _newHitPos;
9510
+ lineReverse.style.top = wUnit(newY);
9511
+ }
9512
+ };
9513
+
9439
9514
  /**
9440
9515
  * 要素をドラッグ可能にする(汎用ユーティリティ)
9441
9516
  * @param {HTMLElement} _target ドラッグ対象の要素
@@ -9458,11 +9533,12 @@ const makeElementDraggable = (_target, _key, _playW, _playH, _bounds, _config) =
9458
9533
  const handleId = _target.id ? `handle_${_target.id}` : `dragHandle_${Math.random().toString(36).slice(2, 9)}`;
9459
9534
  _target.style.cursor = `grab`;
9460
9535
 
9536
+ const bgColor = g_headerObj.baseBrightFlg ? `0,0,0` : `255,255,255`;
9461
9537
  createEmptySprite(_target, handleId, {
9462
9538
  x: 0, y: 0, w: boundsW, h: boundsH,
9463
- border: `1px dashed rgba(255,255,255,0.3)`,
9539
+ border: `1px dashed rgba(${bgColor},0.3)`,
9464
9540
  boxSizing: `border-box`, borderRadius: `2px`,
9465
- background: `rgba(255,255,255,0.04)`,
9541
+ background: `rgba(${bgColor},0.04)`,
9466
9542
  });
9467
9543
 
9468
9544
  const keyDown = addPreviewListener(_target, `pointerdown`, _evt => {
@@ -9543,6 +9619,7 @@ const buildDraggableJudgGroup = (_parent, _groupId, _initX, _initY, _playW, _pla
9543
9619
  const group = createEmptySprite(_parent, `previewGrp_${_groupId}`, {
9544
9620
  x: _initX, y: _initY, w: groupW, h: groupH, pointerEvents: C_DIS_AUTO,
9545
9621
  });
9622
+ const opacity = g_stateObj.opacity / 100;
9546
9623
 
9547
9624
  // 内包要素の生成 (省略:元のコードの multiAppend 部分と同一)
9548
9625
  multiAppend(
@@ -9550,18 +9627,18 @@ const buildDraggableJudgGroup = (_parent, _groupId, _initX, _initY, _playW, _pla
9550
9627
  // キャラクタ
9551
9628
  createDivCss2Label(`previewChara_${_groupId}`, _opts.charaText, {
9552
9629
  x: 0, y: 0, w: g_limitObj.jdgCharaWidth, h: g_limitObj.jdgCharaHeight,
9553
- siz: g_limitObj.jdgCharaSiz, color: _opts.charaColor,
9554
- }),
9630
+ siz: g_limitObj.jdgCharaSiz, opacity,
9631
+ }, _groupId === `arrowJdg` ? g_cssObj.common_ii : g_cssObj.common_kita),
9555
9632
  // コンボ
9556
9633
  createDivCss2Label(`previewCombo_${_groupId}`, _opts.comboText, {
9557
9634
  x: 170, y: 0, w: g_limitObj.jdgCharaWidth, h: g_limitObj.jdgCharaHeight,
9558
- siz: g_limitObj.jdgCharaSiz, color: `#ffffff`,
9559
- }),
9635
+ siz: g_limitObj.jdgCharaSiz, opacity,
9636
+ }, _groupId === `arrowJdg` ? g_cssObj.common_kita : g_cssObj.common_ii),
9560
9637
  // Fast/Slow
9561
9638
  createDivCss2Label(`previewDiff_${_groupId}`, _opts.diffText, {
9562
9639
  x: 170, y: 25, w: g_limitObj.jdgCharaWidth, h: g_limitObj.jdgCharaHeight,
9563
- siz: g_limitObj.mainSiz, color: `#ff9966`,
9564
- }),
9640
+ siz: g_limitObj.mainSiz, color: `#ff9966`, opacity,
9641
+ }, g_cssObj.common_fast),
9565
9642
  );
9566
9643
 
9567
9644
  // ============================================================
@@ -9790,6 +9867,7 @@ const createSettingsDisplayWindow = _sprite => {
9790
9867
  createGeneralSetting(spriteList.hitPosition, `hitPosition`, {
9791
9868
  skipTerms: g_settings.hitPositionTerms, scLabel: g_lblNameObj.sc_hitPosition, roundNum: 5,
9792
9869
  unitName: g_lblNameObj.pixel,
9870
+ addRFunc: () => updatePreviewHitPositionLine(g_stateObj.hitPosition),
9793
9871
  });
9794
9872
  };
9795
9873
 
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2026/05/31 (v48.3.0)
8
+ * Revised : 2026/06/02 (v48.4.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -569,23 +569,25 @@ const updateWindowSiz = () => {
569
569
  },
570
570
  previewLifeBack: {
571
571
  x: 5, y: 50, w: 15, h: g_headerObj.playingHeight - 100,
572
- background: `#333333`, border: `1px solid #555555`,
573
572
  },
574
573
  previewLifeBar: {
575
574
  x: 5, y: 50 + (g_headerObj.playingHeight - 100) * 0.3,
576
- w: 15, h: (g_headerObj.playingHeight - 100) * 0.7, background: `#006666`,
575
+ w: 15, h: (g_headerObj.playingHeight - 100) * 0.7,
577
576
  },
578
577
  previewLifeNum: {
579
578
  x: 0, y: 30, w: 70, h: 20,
580
- siz: g_limitObj.jdgCntsSiz, color: `#ffffff`, background: `#006666`, align: C_ALIGN_CENTER,
579
+ siz: g_limitObj.jdgCntsSiz, align: C_ALIGN_CENTER,
581
580
  },
582
581
  previewFrzLifeBack: {
583
- x: 0, y: 50, w: 5, h: g_headerObj.playingHeight - 100,
584
- background: `#333333`, border: `1px solid #555555`,
582
+ x: 0, y: 50, w: 4, h: g_headerObj.playingHeight - 100,
585
583
  },
586
584
  previewFrzLifeBar: {
587
585
  x: 0, y: 50 + (g_headerObj.playingHeight - 100) * 0.7,
588
- w: 5, h: (g_headerObj.playingHeight - 100) * 0.3,
586
+ w: 4, h: (g_headerObj.playingHeight - 100) * 0.3,
587
+ },
588
+ previewHitPosText: {
589
+ w: 60, h: 16, siz: 14, color: `#33aaff`,
590
+ fontFamily: `monospace`, fontWeight: `bold`,
589
591
  },
590
592
 
591
593
  /** キーコンフィグ画面 */
@@ -3001,6 +3003,13 @@ const g_shortcutObj = {
3001
3003
  displayPreview: {
3002
3004
  KeyP: { id: `btnDisplayPreview2` },
3003
3005
  KeyR: { id: `btnDisplayReset` },
3006
+ ShiftLeft_ArrowDown: { id: `lnkHitPositionR` },
3007
+ ShiftRight_ArrowDown: { id: `lnkHitPositionR` },
3008
+ ArrowDown: { id: `lnkHitPositionRR` },
3009
+ ShiftLeft_ArrowUp: { id: `lnkHitPositionL` },
3010
+ ShiftRight_ArrowUp: { id: `lnkHitPositionL` },
3011
+ ArrowUp: { id: `lnkHitPositionLL` },
3012
+
3004
3013
  Escape: { id: `btnBack` },
3005
3014
  Space: { id: `btnKeyConfig` },
3006
3015
  Enter: { id: `btnPlay` },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "48.3.0",
3
+ "version": "48.4.0",
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",