Skip to content

Conversation

@Rmojarro1
Copy link
Contributor

@Rmojarro1 Rmojarro1 commented Feb 25, 2025

Summary by CodeRabbit

  • New Features

    • Launched a new control remapping interface accessible from the title screen, offering multiple input schemes for improved gameplay customization.
    • Enhanced input mapping with additional key assignments to refine control responsiveness.
  • Style

    • Revamped UI layouts and visual elements across battle, map, and note management scenes.
    • Updated the application icon and refined text, particle layers, and overall asset presentation for a more polished experience.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes update various project configurations, scene layouts, and import settings. The repository’s ignore patterns now include additional file types. The engine’s stage management is expanded with a new "Controls" value and a corresponding scene transition to a remap interface. Several UI scenes have adjusted node positions, textures, gradients, and key mappings. New classes and methods support control scheme selection and input reconfiguration. Multiple asset import configuration files have been added or updated across remapping and note management modules.

Changes

Files Summary
.gitignore Added ignore patterns for *.DotSettings.user and export_presets.cfg.
Globals/FunkEngineNameSpace.cs, Globals/StageProducer.cs Added new enum value Controls and corresponding case in TransitionStage to load the remap scene.
project.godot Updated icon path; added [game] section with input_scheme="ARROWS"; and extended arrow key mappings with additional physical key events.
scenes/BattleDirector/... Adjusted UI elements: node positions, gradient texture widths, layout offsets, and updated texture resources (BattleFrame1.png, bgupdate.png); modified combo text format and ZIndex for particles.
scenes/ChartViewport/... Modified node positions, sizes, and color properties; updated modulation from Modulate to SelfModulate for note arrows.
scenes/Maps/... Increased load steps; added a new background sprite with specific visual properties; implemented button focus navigation in map drawing.
scenes/NoteManager/... Updated texture resources and node properties; added a new Outline sprite and introduced changes in InputHandler (new LoadControlScheme method) and NoteArrow (new OutlineSprite property).
scenes/Puppets/scripts/PuppetTemplate.cs Adjusted the health bar position by a downward offset.
scenes/Remapping/...
(ControlSchemes.cs, ControlSettings.cs, Remap.tscn, assets imports)
Introduced control remapping UI with new classes (ControlSchemes, ControlSettings), a new scene (Remap.tscn), and multiple asset import configuration files for control key visuals.
scenes/SceneTransitions/... Added a "Change Controls" button in TitleScreen.tscn and removed ScenePath properties from buttons in testTransition.tscn.

Sequence Diagram(s)

sequenceDiagram
    participant Game
    participant StageProducer
    participant RemapScene
    Game->>StageProducer: Request transition to Controls stage
    StageProducer->>RemapScene: Load "Remap.tscn" scene
    RemapScene-->>Game: Display remapping interface
Loading
sequenceDiagram
    participant User
    participant TitleScreen
    participant ControlSettings
    participant InputHandler
    User->>TitleScreen: Click "Change Controls" button
    TitleScreen->>ControlSettings: Open control settings UI
    ControlSettings->>User: Show control scheme options
    User->>ControlSettings: Select desired control scheme
    ControlSettings->>InputHandler: Update project settings & invoke LoadControlScheme()
    InputHandler->>Engine: Reconfigure input mappings
Loading

Poem

I'm a hopping rabbit, coding with delight,
New controls and changes make my days so bright.
Scenes have shifted like fields of clover,
Key maps and textures updated over and over.
Carrots and code, what a magical sight!


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 5

🧹 Nitpick comments (12)
scenes/Puppets/scripts/PuppetTemplate.cs (2)

27-27: Extract magic number to a constant.

Consider extracting the value 155 to a named constant at the class level for better maintainability and clarity.

 public partial class PuppetTemplate : Node2D
 {
+    private const float HEALTH_BAR_VERTICAL_OFFSET = 155f;
     // ...
-    _healthBar.Position += Vector2.Down * 155;
+    _healthBar.Position += Vector2.Down * HEALTH_BAR_VERTICAL_OFFSET;

4-6: Address the TODO comment about interfaces.

The TODO comment suggests exploring interfaces. Consider implementing an IBattleEntity interface to define the contract for entities with health and damage mechanics.

Would you like me to help design and implement the interface?

Globals/StageProducer.cs (1)

163-165: Add error handling for scene transition.

Consider adding error handling to gracefully handle cases where the Remap scene file is missing.

 case Stages.Controls:
+    var scenePath = "res://scenes/Remapping/Remap.tscn";
+    if (!ResourceLoader.Exists(scenePath))
+    {
+        GD.PrintErr($"Scene file not found: {scenePath}");
+        return;
+    }
-    GetTree().ChangeSceneToFile("res://scenes/Remapping/Remap.tscn");
+    GetTree().ChangeSceneToFile(scenePath);
     break;
scenes/SceneTransitions/TitleScreen.tscn (1)

108-112: Consider button placement and visibility.

The new button is placed at the bottom of VBoxContainer, separate from other buttons in HBoxContainer. Consider:

  1. Moving it into the HBoxContainer for consistent layout
  2. Adding visible property like other buttons
-[node name="Button" type="Button" parent="VBoxContainer"]
+[node name="MarginContainer4" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
+layout_mode = 2
+size_flags_horizontal = 3
+size_flags_stretch_ratio = 0.5
+theme_override_constants/margin_left = 20
+theme_override_constants/margin_top = 20
+theme_override_constants/margin_right = 20
+theme_override_constants/margin_bottom = 20
+
+[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer/MarginContainer4"]
 layout_mode = 2
+size_flags_horizontal = 3
 text = "Change Controls"
 script = ExtResource("2_7f3m6")
 ScenePath = 4
scenes/Maps/scripts/Cartographer.cs (1)

66-66: Remove debug print statement.

Debug print statements should be removed before production deployment.

-        GD.Print(validButtons);
scenes/Remapping/ControlSchemes.cs (1)

52-75: Consider using constants for asset paths.

Hardcoded asset paths make maintenance more difficult and are prone to typos.

Consider creating constants or a configuration file for asset paths:

public static class AssetPaths
{
    public const string KEY_ASSETS_BASE = "res://scenes/Remapping/assets/";
    public static class Keys
    {
        public const string A_KEY = KEY_ASSETS_BASE + "A_Key_Light.png";
        public const string D_KEY = KEY_ASSETS_BASE + "D_Key_Light.png";
        // ... other keys
    }
}

Then use these constants in the SpriteMappings dictionary.

scenes/Remapping/ControlSettings.cs (2)

59-59: Remove debug print statement.

Debug print statement should be removed before merging.

-GD.Print(scheme);

35-37: Add error handling for project settings save.

The code doesn't verify if the project settings were saved successfully.

Add error handling:

 ProjectSettings.SetSetting("game/input_scheme", scheme);
-ProjectSettings.Save();
+Error err = ProjectSettings.Save();
+if (err != Error.Ok)
+{
+    GD.PrintErr($"Failed to save project settings: {err}");
+}

Also applies to: 43-45, 51-53

scenes/BattleDirector/test_battle_scene.tscn (1)

11-18: Consider extracting gradient as a shared resource.

The gradient resource is used for visual styling. If this gradient style is used across multiple scenes, consider moving it to a shared resource file to maintain consistency and ease updates.

Create a new shared resource file:

+ # res://resources/gradients/dark_theme.tres
+ [gd_resource type="GradientTexture2D" load_steps=2 format=3]
+ [sub_resource type="Gradient" id="Gradient_8uy3a"]
+ offsets = PackedFloat32Array(0, 0.766234, 1)
+ colors = PackedColorArray(0.0823529, 0, 0.0784314, 1, 0.305882, 0.247059, 0.321569, 1, 0.27451, 0.243137, 0.403922, 1)
+ [resource]
+ gradient = SubResource("Gradient_8uy3a")
+ fill_from = Vector2(1, 0)
+ fill_to = Vector2(0.738532, 1)
scenes/NoteManager/note_manager.tscn (2)

20-22: Consider using a scene for repeated arrow outline setup.

The arrow outline setup is repeated for each direction. Consider creating a reusable arrow scene to reduce duplication and ease maintenance.

Create a new scene file:

+ # res://scenes/NoteManager/arrow.tscn
+ [gd_scene format=3]
+ [node name="Arrow" type="Sprite2D"]
+ texture = ExtResource("new_arrow")
+ [node name="Outline" type="Sprite2D" parent="."]
+ modulate = Color(0, 0, 0, 1)
+ texture = ExtResource("arrow_outline")

Also applies to: 30-32, 40-42, 49-51


55-56: Document the reason for hiding dividers.

The dividers node is now hidden. Add a comment explaining why this change was made to help future maintenance.

 [node name="dividers" type="Node2D" parent="ui"]
+# Hidden as part of the remapping UI update
 visible = false
scenes/BattleDirector/NotePlacementBar.tscn (1)

36-37: Document the reason for swapping note paths.

The current and next note paths have been swapped. Add a comment explaining this change to prevent accidental reversions.

+# Swapped for correct visual order in remapping UI
 _currentNote = NodePath("NoteQueueSprite/NextNote")
 _nextNote = NodePath("NoteQueueSprite/CurrentNote")
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 511be2b and f32970a.

⛔ Files ignored due to path filters (18)
  • scenes/BattleDirector/assets/BattleFrame1.png is excluded by !**/*.png
  • scenes/BattleDirector/assets/CoolBG.jpg is excluded by !**/*.jpg
  • scenes/BattleDirector/assets/bgupdate.png is excluded by !**/*.png
  • scenes/BattleDirector/assets/temp_note_queue.png is excluded by !**/*.png
  • scenes/NoteManager/assets/arrow_outline.png is excluded by !**/*.png
  • scenes/NoteManager/assets/new_arrow.png is excluded by !**/*.png
  • scenes/Remapping/assets/A_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/Arrow_Down_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/Arrow_Left_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/Arrow_Right_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/Arrow_Up_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/D_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/E_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/Q_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/R_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/S_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/T_Key_Light.png is excluded by !**/*.png
  • scenes/Remapping/assets/W_Key_Light.png is excluded by !**/*.png
📒 Files selected for processing (38)
  • .gitignore (1 hunks)
  • Globals/FunkEngineNameSpace.cs (1 hunks)
  • Globals/StageProducer.cs (1 hunks)
  • project.godot (2 hunks)
  • scenes/BattleDirector/NotePlacementBar.tscn (3 hunks)
  • scenes/BattleDirector/assets/BattleFrame1.png.import (1 hunks)
  • scenes/BattleDirector/assets/bgupdate.png.import (1 hunks)
  • scenes/BattleDirector/scripts/NotePlacementBar.cs (1 hunks)
  • scenes/BattleDirector/scripts/TextParticle.cs (1 hunks)
  • scenes/BattleDirector/test_battle_scene.tscn (2 hunks)
  • scenes/ChartViewport/ChartManager.cs (2 hunks)
  • scenes/ChartViewport/ChartViewport.tscn (1 hunks)
  • scenes/Maps/cartographer.tscn (1 hunks)
  • scenes/Maps/scripts/Cartographer.cs (2 hunks)
  • scenes/NoteManager/assets/arrow_outline.png.import (1 hunks)
  • scenes/NoteManager/assets/new_arrow.png.import (1 hunks)
  • scenes/NoteManager/note.tscn (1 hunks)
  • scenes/NoteManager/note_manager.tscn (1 hunks)
  • scenes/NoteManager/scripts/InputHandler.cs (1 hunks)
  • scenes/NoteManager/scripts/NoteArrow.cs (1 hunks)
  • scenes/Puppets/scripts/PuppetTemplate.cs (1 hunks)
  • scenes/Remapping/ControlSchemes.cs (1 hunks)
  • scenes/Remapping/ControlSettings.cs (1 hunks)
  • scenes/Remapping/Remap.tscn (1 hunks)
  • scenes/Remapping/assets/A_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/Arrow_Down_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/Arrow_Left_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/Arrow_Right_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/Arrow_Up_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/D_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/E_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/Q_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/R_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/S_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/T_Key_Light.png.import (1 hunks)
  • scenes/Remapping/assets/W_Key_Light.png.import (1 hunks)
  • scenes/SceneTransitions/TitleScreen.tscn (1 hunks)
  • scenes/SceneTransitions/testTransition.tscn (0 hunks)
💤 Files with no reviewable changes (1)
  • scenes/SceneTransitions/testTransition.tscn
✅ Files skipped from review due to trivial changes (17)
  • scenes/BattleDirector/scripts/NotePlacementBar.cs
  • .gitignore
  • scenes/BattleDirector/assets/BattleFrame1.png.import
  • scenes/Remapping/assets/D_Key_Light.png.import
  • scenes/Remapping/assets/Arrow_Right_Key_Light.png.import
  • scenes/Remapping/assets/Arrow_Up_Key_Light.png.import
  • scenes/NoteManager/assets/new_arrow.png.import
  • scenes/Remapping/assets/W_Key_Light.png.import
  • scenes/Remapping/assets/Arrow_Down_Key_Light.png.import
  • scenes/Remapping/assets/E_Key_Light.png.import
  • scenes/Remapping/assets/Arrow_Left_Key_Light.png.import
  • scenes/Remapping/assets/T_Key_Light.png.import
  • scenes/Remapping/assets/A_Key_Light.png.import
  • scenes/Remapping/assets/R_Key_Light.png.import
  • scenes/Remapping/assets/Q_Key_Light.png.import
  • scenes/NoteManager/assets/arrow_outline.png.import
  • scenes/BattleDirector/assets/bgupdate.png.import
🔇 Additional comments (24)
scenes/ChartViewport/ChartViewport.tscn (5)

10-10: LGTM! Viewport height reduction is properly synchronized.

The viewport height reduction is consistently applied to both the container and sub-viewport, maintaining proper coordination between parent and child nodes.

Also applies to: 17-17


22-25: LGTM! Visual adjustments improve coverage and contrast.

The expanded horizontal bounds and darker background color enhance the visual presentation while maintaining the original color scheme.


28-28: LGTM! Camera position aligns with viewport changes.

The adjusted camera position coordinates well with the expanded viewport bounds.


1-49: LGTM! Scene structure maintains integrity.

The scene hierarchy, node references, and resource connections remain well-structured after the visual adjustments.


36-46:

Details

❓ Verification inconclusive

Verify the visual impact of removing modulate property.

The removal of the modulate property (previously Color(2,2,2,1)) aligns with the changes in ChartManager.cs to use SelfModulate. Please ensure this change maintains the desired visual appearance of the chart backgrounds.


🏁 Script executed:

#!/bin/bash
# Search for related modulate/self_modulate property usage
rg -l "(?i)modulate|self_modulate" --type cs

Length of output: 212


Verify the visual consistency of the chart backgrounds

The modulate property (previously set to Color(2,2,2,1)) has been removed from the ChartBG nodes in scenes/ChartViewport/ChartViewport.tscn, and the corresponding brightness adjustments now rely on self_modulate in scenes/ChartViewport/ChartManager.cs. Please ensure that these changes render the chart backgrounds with the intended brightness, and verify that no unintended visual regressions occur.

  • Confirm that the new self_modulate logic in ChartManager.cs correctly replicates the previous brightness effect.
  • Manually test the chart backgrounds to ensure visual consistency.
scenes/BattleDirector/scripts/TextParticle.cs (1)

10-10: LGTM! Setting ZIndex ensures proper rendering order.

The change ensures text particles are rendered above other elements like note arrows (which use ZIndex = 1).

Globals/FunkEngineNameSpace.cs (1)

36-36: LGTM! Stage added for control remapping.

The addition of Controls to the Stages enum aligns with the PR's objective of implementing a remap menu.

scenes/NoteManager/scripts/NoteArrow.cs (1)

16-18: LGTM! Property added for outline customization.

The OutlineSprite property is well-designed:

  • Marked with [Export] for Godot editor integration
  • Clear naming that indicates its purpose
  • Appropriate type for visual customization
scenes/SceneTransitions/TitleScreen.tscn (1)

112-112:

Details

✅ Verification successful

Verify ScenePath enumeration value.

Ensure that ScenePath = 4 correctly maps to Stages.Controls in the SceneChange script.


🏁 Script executed:

#!/bin/bash
# Search for ScenePath enum definition
rg -A 5 "enum.*ScenePath|Stages" --type cs

Length of output: 4507


ScenePath Enumeration Mapping Verified

The mapping is correct. The value 4 assigned to ScenePath in scenes/SceneTransitions/TitleScreen.tscn aligns with the Stages.Controls case in the scene change logic (as seen in Globals/StageProducer.cs). The enumeration order—assuming it is defined as Title (0), Battle (1), Quit (2), Map (3), and Controls (4)—ensures that setting ScenePath to 4 correctly triggers the "Controls" transition.

scenes/NoteManager/scripts/InputHandler.cs (1)

64-66: LGTM! Good error handling for missing settings.

The code properly handles missing project settings by defaulting to "ARROWS".

scenes/Remapping/assets/S_Key_Light.png.import (1)

1-34: LGTM! Standard texture import configuration.

The import settings are appropriate for a UI texture asset.

scenes/ChartViewport/ChartManager.cs (2)

112-113: Good use of SelfModulate for individual node color modulation!

Using SelfModulate instead of Modulate is more appropriate here as it only affects the individual node without propagating to its children.


124-124: LGTM: Consistent outline coloring with arrow type.

Setting the outline color to match the arrow type's color maintains visual consistency.

scenes/Maps/cartographer.tscn (1)

9-13: LGTM: Well-structured scene configuration!

The background sprite is properly configured with appropriate modulation, position, and scaling.

scenes/Remapping/ControlSchemes.cs (1)

35-38: Consider revising QWERT key mapping for intuitive controls.

The current mapping (E=up, W=down) might be counterintuitive for users as W is typically associated with upward movement in games.

Consider swapping the keys to match common gaming conventions:

-                { "arrowUp", "E" },
-                { "arrowDown", "W" },
+                { "arrowUp", "W" },
+                { "arrowDown", "S" },
project.godot (2)

15-15: LGTM!

The icon path has been updated to use a character asset.


34-36: LGTM!

Added new game configuration section with input scheme setting.

scenes/NoteManager/note.tscn (1)

3-14: LGTM!

Good improvements to the visual feedback:

  • Updated arrow textures
  • Added outline sprite for better visibility
scenes/BattleDirector/test_battle_scene.tscn (3)

55-60: LGTM! Background texture setup looks good.

The background texture is properly configured with appropriate z-index and dimensions.


6-7:

Details

✅ Verification successful

Verify texture resource paths.

The scene references new texture resources bgupdate.png and BattleFrame1.png. Ensure these assets are properly committed and their import configurations are correct.


🏁 Script executed:

#!/bin/bash
# Check if texture files exist and have import configurations
for texture in "bgupdate.png" "BattleFrame1.png"; do
  echo "Checking $texture..."
  fd "$texture" "scenes/BattleDirector/assets"
  fd "$texture.import" "scenes/BattleDirector/assets"
done

Length of output: 729


Texture resource paths verified.
After running the checks, both bgupdate.png and BattleFrame1.png along with their .import configurations were confirmed to exist in the scenes/BattleDirector/assets directory. No further action on these resources is required.


38-42:

Details

❓ Verification inconclusive

Verify SubViewport positioning impact.

The SubViewport node's position has been adjusted. Ensure this change doesn't affect the visibility or interaction with child elements.


🏁 Script executed:

#!/bin/bash
# Search for references to SubViewport positioning
rg -A 3 "SubViewport.*offset" "scenes/BattleDirector"

Length of output: 53


Action Required: Verify the Impact of Updated SubViewport Offsets

The SubViewport node now uses the following offsets in scenes/BattleDirector/test_battle_scene.tscn (lines 38–42):

[node name="SubViewport" parent="." instance=ExtResource("2_cupb3")]
offset_left = 80.0
offset_top = 180.0
offset_right = 560.0
offset_bottom = 360.0

No additional references to offset changes were detected in our searches. Please manually verify that these adjustments do not adversely affect the visibility or interaction of child elements. In particular, ensure that the node’s content remains properly aligned and that no functional regressions occur.

  • Confirm that the updated offsets do not clip or misalign any child nodes.
  • Perform a quick playtest or visual review to ensure the layout behaves as expected.
scenes/NoteManager/note_manager.tscn (1)

4-6:

Details

❓ Verification inconclusive

Verify texture resource compatibility.

The arrow textures have been updated. Ensure the new textures maintain visual consistency with the game's art style.


🏁 Script executed:

#!/bin/bash
# Check texture dimensions and import settings
fd "new_arrow.png|arrow_outline.png" "scenes/NoteManager/assets" -e png -x identify {}

Length of output: 168


Manual Verification Needed: Texture Resource Compatibility

The texture resources declared in scenes/NoteManager/note_manager.tscn appear correct. However, the automated check using the identify command couldn’t run (command not found), which prevents us from programmatically verifying texture dimensions and import settings. Please manually confirm that both new_arrow.png and arrow_outline.png:

  • Exist in the scenes/NoteManager/assets directory.
  • Conform to the intended dimensions and overall visual style of the game.
scenes/BattleDirector/NotePlacementBar.tscn (2)

16-18: Verify gradient color scheme accessibility.

The gradient colors have been modified. Ensure the new color scheme maintains sufficient contrast for accessibility.

#!/usr/bin/env python3
import colorsys

def check_contrast(color1, color2):
    # Convert RGB to relative luminance
    def get_luminance(r, g, b):
        return 0.2126 * r + 0.7152 * g + 0.0722 * b

    # Extract RGB values
    r1, g1, b1 = color1[:3]
    r2, g2, b2 = color2[:3]
    
    # Calculate luminance
    l1 = get_luminance(r1, g1, b1)
    l2 = get_luminance(r2, g2, b2)
    
    # Calculate contrast ratio
    ratio = (max(l1, l2) + 0.05) / (min(l1, l2) + 0.05)
    return ratio >= 4.5  # WCAG AA standard for normal text

# Check adjacent colors in the gradient
colors = [
    (0, 1, 0, 1),      # Green
    (1, 0, 0.4, 1),    # Red
    (0, 1, 0.95, 1),   # Cyan
    (1, 0, 0, 1)       # Red
]

for i in range(len(colors)-1):
    print(f"Checking contrast between colors {i} and {i+1}")
    print(f"Contrast ratio acceptable: {check_contrast(colors[i], colors[i+1])}")

65-78: LGTM! Note queue sprite setup looks good.

The note queue sprite and its children are properly configured with correct positions and rotations.

Comment on lines +76 to +85
var selectedScheme = ControlSchemes.Schemes[scheme];
foreach (var arrow in Arrows)
{
if (selectedScheme.ContainsKey(arrow.Key))
{
InputEventKey eventKey = new InputEventKey();
eventKey.Keycode = (Key)Enum.Parse(typeof(Key), selectedScheme[arrow.Key]);
InputMap.ActionAddEvent(arrow.Key, eventKey);
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add null safety and error handling.

The code should handle cases where:

  1. The scheme doesn't exist in ControlSchemes.Schemes
  2. The enum parsing fails for invalid key values
-        var selectedScheme = ControlSchemes.Schemes[scheme];
+        if (!ControlSchemes.Schemes.TryGetValue(scheme, out var selectedScheme))
+        {
+            GD.PrintErr($"Control scheme '{scheme}' not found, defaulting to ARROWS");
+            selectedScheme = ControlSchemes.Schemes["ARROWS"];
+        }
         foreach (var arrow in Arrows)
         {
             if (selectedScheme.ContainsKey(arrow.Key))
             {
-                InputEventKey eventKey = new InputEventKey();
-                eventKey.Keycode = (Key)Enum.Parse(typeof(Key), selectedScheme[arrow.Key]);
-                InputMap.ActionAddEvent(arrow.Key, eventKey);
+                try
+                {
+                    InputEventKey eventKey = new InputEventKey();
+                    eventKey.Keycode = (Key)Enum.Parse(typeof(Key), selectedScheme[arrow.Key]);
+                    InputMap.ActionAddEvent(arrow.Key, eventKey);
+                }
+                catch (ArgumentException ex)
+                {
+                    GD.PrintErr($"Invalid key value '{selectedScheme[arrow.Key]}' for {arrow.Key}: {ex.Message}");
+                }
             }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var selectedScheme = ControlSchemes.Schemes[scheme];
foreach (var arrow in Arrows)
{
if (selectedScheme.ContainsKey(arrow.Key))
{
InputEventKey eventKey = new InputEventKey();
eventKey.Keycode = (Key)Enum.Parse(typeof(Key), selectedScheme[arrow.Key]);
InputMap.ActionAddEvent(arrow.Key, eventKey);
}
}
if (!ControlSchemes.Schemes.TryGetValue(scheme, out var selectedScheme))
{
GD.PrintErr($"Control scheme '{scheme}' not found, defaulting to ARROWS");
selectedScheme = ControlSchemes.Schemes["ARROWS"];
}
foreach (var arrow in Arrows)
{
if (selectedScheme.ContainsKey(arrow.Key))
{
try
{
InputEventKey eventKey = new InputEventKey();
eventKey.Keycode = (Key)Enum.Parse(typeof(Key), selectedScheme[arrow.Key]);
InputMap.ActionAddEvent(arrow.Key, eventKey);
}
catch (ArgumentException ex)
{
GD.PrintErr($"Invalid key value '{selectedScheme[arrow.Key]}' for {arrow.Key}: {ex.Message}");
}
}
}

Comment on lines 69 to 106
validButtons[i].FocusNeighborRight = validButtons[(i + 1) % (validButtons.Length)]
.GetPath();
validButtons[(i + 1) % (validButtons.Length)].FocusNeighborLeft = validButtons[i]
.GetPath();
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add null check and empty array validation.

The modulo operation could cause issues if validButtons is empty. Consider adding validation.

-            validButtons[i].FocusNeighborRight = validButtons[(i + 1) % (validButtons.Length)]
-                .GetPath();
-            validButtons[(i + 1) % (validButtons.Length)].FocusNeighborLeft = validButtons[i]
-                .GetPath();
+            if (validButtons.Length > 1)
+            {
+                validButtons[i].FocusNeighborRight = validButtons[(i + 1) % (validButtons.Length)]
+                    .GetPath();
+                validButtons[(i + 1) % (validButtons.Length)].FocusNeighborLeft = validButtons[i]
+                    .GetPath();
+            }

Committable suggestion skipped: line range outside the PR's diff.

"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix conflicting and unintuitive key mappings.

There are several issues with the key mappings:

  • arrowDown maps to 'W' which conflicts with arrowUp
  • The mapping of 'E' for up, 'Q' for left, and 'R' for right seems unintuitive

Consider this alternative mapping:

-physical_keycode":69,"key_label":0,"unicode":101 # 'E' for up
+physical_keycode":84,"key_label":0,"unicode":116 # 'T' for up
-physical_keycode":87,"key_label":0,"unicode":119 # 'W' for down (conflicts)
+physical_keycode":71,"key_label":0,"unicode":103 # 'G' for down
-physical_keycode":81,"key_label":0,"unicode":113 # 'Q' for left
+physical_keycode":70,"key_label":0,"unicode":102 # 'F' for left
-physical_keycode":82,"key_label":0,"unicode":114 # 'R' for right
+physical_keycode":72,"key_label":0,"unicode":104 # 'H' for right

Also applies to: 51-51, 58-58, 65-65

Comment on lines +50 to +57
[node name="QWERTButton" type="Button" parent="Panel"]
layout_mode = 0
offset_left = 459.0
offset_top = 152.0
offset_right = 555.0
offset_bottom = 183.0
text = "QWER"

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistent button label.

The button is labeled as "QWER" but the code in ControlSettings.cs uses "QWERT" as the scheme identifier.

Either update the button text to match the scheme or update the scheme identifier in the code:

-text = "QWER"
+text = "QWERT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[node name="QWERTButton" type="Button" parent="Panel"]
layout_mode = 0
offset_left = 459.0
offset_top = 152.0
offset_right = 555.0
offset_bottom = 183.0
text = "QWER"
[node name="QWERTButton" type="Button" parent="Panel"]
layout_mode = 0
offset_left = 459.0
offset_top = 152.0
offset_right = 555.0
offset_bottom = 183.0
text = "QWERT"

Comment on lines +58 to +63
var selectedScheme = ControlSchemes.SpriteMappings[scheme];
GD.Print(scheme);
leftKey.Texture = GD.Load<Texture2D>(selectedScheme["left"]);
rightKey.Texture = GD.Load<Texture2D>(selectedScheme["right"]);
upKey.Texture = GD.Load<Texture2D>(selectedScheme["up"]);
downKey.Texture = GD.Load<Texture2D>(selectedScheme["down"]);
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error handling for sprite mappings.

The code assumes the scheme exists in SpriteMappings and all required textures can be loaded, which could lead to runtime errors.

Add error handling:

 private void ChangeKeySprites(string scheme)
 {
+    if (!ControlSchemes.SpriteMappings.ContainsKey(scheme))
+    {
+        GD.PrintErr($"Unknown control scheme: {scheme}");
+        return;
+    }
     var selectedScheme = ControlSchemes.SpriteMappings[scheme];
-    GD.Print(scheme);
+    try
+    {
         leftKey.Texture = GD.Load<Texture2D>(selectedScheme["left"]);
         rightKey.Texture = GD.Load<Texture2D>(selectedScheme["right"]);
         upKey.Texture = GD.Load<Texture2D>(selectedScheme["up"]);
         downKey.Texture = GD.Load<Texture2D>(selectedScheme["down"]);
+    }
+    catch (Exception e)
+    {
+        GD.PrintErr($"Failed to load textures for scheme {scheme}: {e.Message}");
+    }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var selectedScheme = ControlSchemes.SpriteMappings[scheme];
GD.Print(scheme);
leftKey.Texture = GD.Load<Texture2D>(selectedScheme["left"]);
rightKey.Texture = GD.Load<Texture2D>(selectedScheme["right"]);
upKey.Texture = GD.Load<Texture2D>(selectedScheme["up"]);
downKey.Texture = GD.Load<Texture2D>(selectedScheme["down"]);
private void ChangeKeySprites(string scheme)
{
if (!ControlSchemes.SpriteMappings.ContainsKey(scheme))
{
GD.PrintErr($"Unknown control scheme: {scheme}");
return;
}
var selectedScheme = ControlSchemes.SpriteMappings[scheme];
try
{
leftKey.Texture = GD.Load<Texture2D>(selectedScheme["left"]);
rightKey.Texture = GD.Load<Texture2D>(selectedScheme["right"]);
upKey.Texture = GD.Load<Texture2D>(selectedScheme["up"]);
downKey.Texture = GD.Load<Texture2D>(selectedScheme["down"]);
}
catch (Exception e)
{
GD.PrintErr($"Failed to load textures for scheme {scheme}: {e.Message}");
}
}

@LifeHckr LifeHckr changed the base branch from main to Sprint-3 February 25, 2025 00:47
added a seperate scene were the player can choose from the three schemes, defaults to arrows. slight tweak to inputhandler to refresh the controls. button to control scene was addded. will try to use sprites/icons to show which keys will correspend to each arrow in next push
Added icons to represent which key correspond to each direction, changes as the user changes the scheme. Fixed a typo that caused it to always default to WASD. Sprite paths are added to the ControlSchemes as a dictionary set. Icons are from this free pack: https://thoseawesomeguys.com/prompts/
removed dupe code from rebase
@LifeHckr LifeHckr merged commit 0ca318e into Sprint-3 Feb 25, 2025
2 checks passed
@LifeHckr LifeHckr deleted the Remap_Menu branch February 25, 2025 22:48
This was referenced Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants