Add polygon startbox column type#1
Conversation
5160d32 to
c75b0e7
Compare
p2004a
left a comment
There was a problem hiding this comment.
It doesn't even build so can't test it:
> yarn build
yarn run v1.22.19
warning ../../../package.json: No license field
$ craco build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
Failed to compile.
Module not found: Error: You attempted to import /src/components/fields/MapStartbox/DisplayCell which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules/.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
After I fix that, more stuff pops up, it's unusable.
|
Hrm that's really odd. This shouldn't been ready for integration. Maybe I left off changes accidentally or have things that aren't pushed? I'll figure it out |
This seems unnecessary and possibly incorrect statement: you already in this PR change the implementation of the component, so unless I'm missing something, the existing map startbox field will just get ability of doing polygons. The "field type" is only cosmetic, it doesn't change the fact that underlying component can do polygons. |
|
Removed the new column type since - as you pointed out - not duplicating the |
|
Also, in running through this...the UX leaves something to be desired (particularly for those who specifically want square startboxes, for whatever reason). I can either add it to this PR or i can intentionally keep it as a separate feature. If you're wanting to run through and test it yourself anyways (given the desire to spin it up when it errored on you) it seems like including it in this PR would be fine? |
|
I don't have opinion yet because I wasn't able to test anything. |
|
I went ahead and included the improved UX. Its purely front-end code anyways and shouldn't change the reviewability of the PR itself. |
Picks up where #574 left off, which rendered polygon startboxes in the preview but still handed the game a plain bounding-box rectangle at launch, so an offline game never got the real shape. Now the offline start script sends the start areas as modoptions, the way the game PR settled on: a selected preset goes out as the set (`mapmetadata_startboxes_set`, the server-owned default), and custom drag-edited boxes go out as the override (`mapmetadata_startbox_override`, lobby-owned) which the game prefers over the set. So an offline game enforces the real shape, custom boxes aren't silently replaced by the map's default, and online games get the set from the server. It also brings the preview's spline in line with the game and Chobby so the curves match exactly. The old math overshot at sharp corners and could draw a small curl the game never showed. Related PRs: - Core game: beyond-all-reason/Beyond-All-Reason#7513 - Chobby: beyond-all-reason/BYAR-Chobby#1184 - Maps-metadata: beyond-all-reason/maps-metadata#615 - Rowy fork: p2004a/rowy#1 - Original bar-lobby PR (merged): #574 Assisted by Claude Code (Opus 4.8); all code reviewed and verified locally.
Add polygon startbox editing support
Adds a new "Map Startbox (Polygon)" column type alongside the existing rectangle-only one. The idea is that the maps table can be switched over to the polygon type when needed, without breaking any existing data.
Is part of what would need to be done - at some point - to support beyond-all-reason/maps-metadata#605
What changed
MapStartboxPolygonfield type registered in the BAR Custom groupMapStartboxcomponent now handles N-vertex polygons (drag vertices, click edge midpoints to insert, delete vertex mode)Related PRs
What I didn't test
I didn't do a full end-to-end test within Rowy itself — getting Firebase Auth working locally was more hassle than it was worth for this. I built a standalone HTML test harness to validate all the editing interactions (vertex drag, insert, delete, move, text input, save/load roundtrip, backward compat). Since this is a new column type that doesn't touch the existing one, it should be safe to try out on the live instance without risk to current data.
AI disclosure
GitHub Copilot was used to assist with implementing this change, particularly since I couldn't run rowy locally.