Add keyboard shortcuts for tools (V,B,R,L,U,1,2,3,X,O,G)#360
Open
constantinehuzenko wants to merge 1 commit intoamilich:mainfrom
Open
Add keyboard shortcuts for tools (V,B,R,L,U,1,2,3,X,O,G)#360constantinehuzenko wants to merge 1 commit intoamilich:mainfrom
constantinehuzenko wants to merge 1 commit intoamilich:mainfrom
Conversation
|
Your pull request is now ready for review with Assert. Stop waiting for your code to break. Ship with confidence using Assert. |
Contributor
|
@constantinehuzenko is attempting to deploy a commit to the andrew-4640's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds keyboard shortcut support for game tools and improves the visibility of these shortcuts throughout the UI. Users can now quickly switch tools using their keyboard, and the assigned shortcuts are displayed in tooltips, sidebars, and command menus for better discoverability.
Keyboard shortcut integration and tool switching:
shortcutproperty toToolInfoand assigned intuitive shortcut keys to major tools inTOOL_INFO, such as 'b' for bulldoze, 'r' for road, and number keys for zoning tools.Game.tsxto allow switching tools using the defined shortcuts, replacing the previous hardcoded key handling. [1] [2] [3]UI enhancements for shortcut visibility:
MenuItemtype and all relevant menu item builders now include theshortcutproperty, and the command menu UI shows the shortcut next to each item. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Minor improvements:
useEffecthook inGame.tsxfor proper effect execution.Note
Low Risk
Low risk: mostly UI/input plumbing around tool selection; primary risk is shortcut collisions or unintended tool switching in edge cases.
Overview
Adds a
shortcutfield toTOOL_INFOand assigns default keys to core tools/zoning actions (e.g.,b,r,1-3).Game.tsxnow derives a key→tool map fromTOOL_INFOand uses it in the global keydown handler (replacing the prior hardcoded bulldoze shortcut) to switch tools when no modifier keys are held.Improves shortcut discoverability by rendering shortcuts alongside tool names in the sidebar flyouts and the command menu, and extends command menu items to carry/display the shortcut metadata. Also fixes a missing
useEffectdependency (gt) inGame.tsx.Written by Cursor Bugbot for commit f0c9da1. This will update automatically on new commits. Configure here.