Skip to content

Feat: Alphanumeric Coordinate Grid on Alternate View#2938

Draft
bijx wants to merge 19 commits intomainfrom
bijx/alphanumeric-coordinate-grid
Draft

Feat: Alphanumeric Coordinate Grid on Alternate View#2938
bijx wants to merge 19 commits intomainfrom
bijx/alphanumeric-coordinate-grid

Conversation

@bijx
Copy link
Contributor

@bijx bijx commented Jan 17, 2026

Description:

Adds a coordinate grid to the Alternate View (holding spacebar) using numbers on the X-axis, and letters on the Y-axis. No more "he's attacking you in that—well, the little peninsula thing... next to the island! which island? uhh..." moments when playing with friends. Optimally maps have letters A-J (just like in the Battleships board game) but special maps like Amazon River dynamically resize to only have 2 letters so as to not have too many number columns. This feature overall can be toggled via the settings menu.

Also saw it requested on the official discord a couple times, thought it was a neat idea.

World Map

image

Scales correctly when zoomed in

image

Amazon River

image

Enable/Disable via settings

Screen.Recording.2026-01-17.034212.mp4

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

bijx

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Walkthrough

A coordinate grid overlay feature was added: translations, a user setting and keybind (KeyM), an emitted toggle event, and a new rendering layer integrated into the renderer to draw alphanumeric grid lines and labels.

Changes

Cohort / File(s) Summary
Translations
resources/lang/en.json
Added three keys: action_coordinate_grid, coordinate_grid_label, coordinate_grid_desc.
Input & Events
src/client/InputHandler.ts
Added ToggleCoordinateGridEvent and a coordinateGrid keybind (KeyM). Key handling toggles the setting and emits the event.
User Settings
src/core/game/UserSettings.ts
Added coordinateGridEnabled() getter and toggleCoordinateGrid() method to store/toggle the grid state.
UI: Settings & Help
src/client/UserSettingModal.ts, src/client/HelpModal.ts
Added a keybind setting entry for coordinateGrid (default KeyM) in the settings modal and a help-row showing the action and description.
Rendering
src/client/graphics/GameRenderer.ts, src/client/graphics/layers/CoordinateGridLayer.ts
Imported and inserted CoordinateGridLayer into the renderer layer stack. New layer renders adaptive alphanumeric grid lines and cell labels, subscribes to toggle events, and respects user setting.

Sequence Diagram

sequenceDiagram
    actor User
    participant InputHandler
    participant UserSettings
    participant EventBus
    participant CoordinateGridLayer
    participant GameRenderer

    User->>InputHandler: Press KeyM
    InputHandler->>UserSettings: toggleCoordinateGrid()
    UserSettings-->>InputHandler: new enabled state
    InputHandler->>EventBus: Emit ToggleCoordinateGridEvent(enabled)
    EventBus->>CoordinateGridLayer: Notify toggle
    CoordinateGridLayer->>CoordinateGridLayer: Update visibility
    GameRenderer->>CoordinateGridLayer: renderLayer(context)
    CoordinateGridLayer->>CoordinateGridLayer: computeGrid()
    CoordinateGridLayer->>CoordinateGridLayer: draw lines & labels
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

A grid wakes up with KeyM's cheer,
Letters and numbers line paths clear,
Toggle, watch the canvas hum,
Cells align, the view becomes,
Quiet guides for maps near and far ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main feature addition: an alphanumeric coordinate grid overlay for the Alternate View, which is the core change across all modified files.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the coordinate grid feature, its behavior across different map types, toggle functionality, and including screenshots and implementation details.

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


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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 17, 2026
@ryanbarlow97
Copy link
Contributor

Already mentioned in the discord (and I know you reacted to it already) but going to repeat it here for anyone else:

It would be great to get the letters on the exact edge of the map (worried about ultrawide) and just being too far away from the map

@ryanbarlow97 ryanbarlow97 added the UI/UX UI/UX changes including assets, menus, QoL, etc. label Jan 18, 2026
@ryanbarlow97 ryanbarlow97 added this to the v30 milestone Jan 18, 2026
@bijx
Copy link
Contributor Author

bijx commented Jan 18, 2026

Already mentioned in the discord (and I know you reacted to it already) but going to repeat it here for anyone else:

It would be great to get the letters on the exact edge of the map (worried about ultrawide) and just being too far away from the map

@ryanbarlow97 awesome suggestion, just added that in!

Screen.Recording.2026-01-18.172805.mp4

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2026
@ryanbarlow97
Copy link
Contributor

do the lines need to go past the map?

image

can you do something like this instead

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2026
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2026
@bijx bijx marked this pull request as draft January 18, 2026 23:50
@bijx
Copy link
Contributor Author

bijx commented Jan 18, 2026

Put back into draft until #2946 is merged so we can make the grid view a hotkey instead of being part of Alternate View

@ryanbarlow97
Copy link
Contributor

(update)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI/UX UI/UX changes including assets, menus, QoL, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants