Skip to content

feat: [1094] 色変化(ncolor_data)の0フレーム時の色をキーコンフィグ画面に一部反映する仕様を追加#2117

Merged
cwtickle merged 2 commits into
developfrom
feature/1094-keycon-color
May 17, 2026
Merged

feat: [1094] 色変化(ncolor_data)の0フレーム時の色をキーコンフィグ画面に一部反映する仕様を追加#2117
cwtickle merged 2 commits into
developfrom
feature/1094-keycon-color

Conversation

@cwtickle
Copy link
Copy Markdown
Owner

@cwtickle cwtickle commented May 17, 2026

🔨 変更内容 / Details of Changes

1. 色変化(ncolor_data)の0フレーム時の色をキーコンフィグ画面に一部反映する仕様を追加

  • 色変化(ncolor_data)の0フレーム時の矢印枠の色をキーコンフィグ画面に優先して反映するようにしました。
  • ColorType: Default/Type0のときのみ有効です。譜面ヘッダーのsetColorより優先して表示します。
  • 塗りつぶし色は見ません。旧色変化仕様(color_data/acolor_data)も参照しません。
  • 矢印をクリックした場合に属するカラーグループを一時的に変更できますが、
    その場合はカラーグループに属する色に変わります(ncolor_dataの値を参照しません)。
    ⇒このため、一時的にカラーグループを変更した場合は実際の矢印色と異なる場合があります。

🔖 関連Issue, 変更理由 / Related Issues, Reason for Changes

  1. 譜面ヘッダーのsetColorで設定できないパターン(レーン別に色を変えている場合など)に対応して表示できるようにするため。Discordでの要望です。
    https://discord.com/channels/698460971231870977/944491021918683196/1505405885944434828

📷 スクリーンショット / Screenshot

image

📝 その他コメント / Other Comments

  • 色変化(ncolor_data)の0フレーム時の色について、
    同じレーンで複数色変化を指定した場合の順序保証はありません。

@cwtickle cwtickle added func11:KeyConfig キーコンフィグ、キー定義関係 Discord / Gitter Discord (Gitter)での議論あり labels May 17, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e11d99c8-a446-4bd7-9ff8-b25dcc23314c

📥 Commits

Reviewing files that changed from the base of the PR and between d1ad552 and 0f5dea3.

📒 Files selected for processing (1)
  • js/danoni_main.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • js/danoni_main.js

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved key configuration reset functionality to properly initialize arrow colors based on the current score's color data.
    • Arrow colors during key configuration now correctly reflect the score's predefined color settings when resetting.

Walkthrough

When the key-config button is pressed, it now passes an init flag to keyConfigInit. The function derives arrow colors from the current score's minimap ncolor data, caches the base key-configuration state, and uses that cached state to override color selection during rendering.

Changes

Key-config color initialization from minimap arrow data

Layer / File(s) Summary
Global color-group state declaration
js/lib/danoni_constants.js
New global variable g_baseColorGrs is initialized as an empty object to store base color-group configuration during key-config initialization.
Key-config initialization with color derivation
js/danoni_main.js
keyConfigInit function signature is extended with _initFlg boolean parameter. When _initFlg is enabled, the function computes initColors map from score minimap arrow ncolor data and captures current per-color key configuration into g_baseColorGrs. Key-config button is updated to pass _initFlg=true on initialization.
Color selection override based on init colors
js/danoni_main.js
getKeyConfigColor adds conditional logic to override arrow color when initColors is available and color-type/base-group conditions are met, using the derived initialization color for the matching key index.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main feature being added: reflecting ncolor_data frame 0 colors in the Key Config screen, which matches the core change in the changeset.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the feature implementation, limitations, and providing context from Discord.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/1094-keycon-color

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@js/danoni_main.js`:
- Around line 9538-9541: The code assumes g_localKeyStorage and
g_baseColorGrs[...] exist before indexing; add guards so baseGroupNum uses
g_localKeyStorage.keyCtrlPtn only when g_localKeyStorage is defined and ensure
g_baseColorGrs[`color${keyCtrlPtn}_${baseGroupNum}`] and
g_keyObj[`color${keyCtrlPtn}_${g_keycons.colorGroupNum}`] are defined before
comparing/indexing them; update the condition around baseGroupNum, the
g_keyObj[...] access and the g_baseColorGrs[...] lookup to short-circuit if
either object or the computed color key is missing to avoid runtime crashes in
self/custom-key paths.
- Around line 9496-9513: The code assumes
g_detailObj.miniMapParams[g_stateObj.scoreId]._scoreObj.ncolorData.Arrow exists
and that val[1] is always a string; to fix, first guard access to
ncolorData/Arrow by defaulting arrowColorTmp to an empty array if those objects
are missing (use a safe lookup of
g_detailObj.miniMapParams[g_stateObj.scoreId]._scoreObj.ncolorData?.Arrow ||
[]), then when iterating arrowColors normalize val[1] by checking its type: if
typeof val[1] === 'string' and val[1].startsWith('g') handle group lookup as
before, otherwise coerce numeric selectors to numbers (e.g. parseInt or Number)
before using them as indices; also ensure initColors is sized/initialized for
tkObj.keyNum and use those normalized indices when calling makeColorGradation so
lookups in g_keyObj[`color${tkObj.keyCtrlPtn}`] and assignments to initColors
are safe.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1b22d79c-1130-4b25-af5c-e82ba0ae05da

📥 Commits

Reviewing files that changed from the base of the PR and between 1eb63f2 and d1ad552.

📒 Files selected for processing (2)
  • js/danoni_main.js
  • js/lib/danoni_constants.js

Comment thread js/danoni_main.js
Comment thread js/danoni_main.js Outdated
@cwtickle
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cwtickle cwtickle merged commit fbebc32 into develop May 17, 2026
4 checks passed
@cwtickle cwtickle deleted the feature/1094-keycon-color branch May 17, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Discord / Gitter Discord (Gitter)での議論あり func11:KeyConfig キーコンフィグ、キー定義関係

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant