Skip to content

feat(editor): in-game map editor mode with undo/redo (#13) - #354

Open
Aduersarius wants to merge 2 commits into
Bitcoindefi:mainfrom
Aduersarius:feat/ingame-map-editor-13
Open

feat(editor): in-game map editor mode with undo/redo (#13)#354
Aduersarius wants to merge 2 commits into
Bitcoindefi:mainfrom
Aduersarius:feat/ingame-map-editor-13

Conversation

@Aduersarius

@Aduersarius Aduersarius commented Sep 6, 2026

Copy link
Copy Markdown

Summary

Ships the in-game visual map editor for #13 on top of the already-merged /construccion stack (palette, PNG brush, publish/discard/revert APIs).

  • In-game mode on /play: accounts with game-data admin permission see Editar mapa; activates without reload/navigation. Visible Modo edición banner. Non-permitted accounts never see the control.
  • Gameplay suppressed while editing: movement + world clicks blocked via suppressGameplayInput so painting does not walk the character.
  • Terrain drag paint, PNG upload → brush same session (TerrainPalette), grid + blocked overlay toggles.
  • Undo/redo (Ctrl/Cmd+Z, Ctrl/Cmd+Y / Shift+Z) via local paint history against the tile paint API.
  • Alt+drag rectangle fill for area painting.
  • Publish confirmation warns with live players-on-map count from the running client session.

Deferred (incremental MVP)

Differentiation

No prior open PR targeted #13. Reuses merged world-builder editor APIs and /construccion UI inside /play — not a kitchen-sink converter/protocol dump.

Test plan

  • node --experimental-strip-types --test frontend/lib/editor/paintHistory.test.ts (undo/redo, inverse tiles, rect)
  • As game-data admin on /play: Editar mapa appears; non-admin: hidden
  • Enter edit mode → movement keys do nothing; Esc exits
  • Drag-paint terrain; Alt+drag fills rectangle; upload PNG and paint it
  • Ctrl+Z / Ctrl+Y undo/redo last terrain stroke
  • Toggle Bloqueo overlay
  • Publish dialog shows player count warning and confirmation

Tracks #13.

Activate visual map editing from /play without leaving the session.
Reuses the construction editor stack (palette, PNG brush, publish) and
adds paint history shortcuts, Alt+drag rectangle fill, blocked-tile
overlay toggle, and a publish warning with live players-on-map count.
Gameplay movement and clicks are suppressed while editing.

Co-authored-by: Nikolay Golovin <Aduersarius@users.noreply.github.com>
@cursor
cursor Bot force-pushed the feat/ingame-map-editor-13 branch from 8943917 to c779106 Compare September 6, 2026 14:12
@gitar-bot

gitar-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

Activate visual map editing from /play without leaving the session.
Reuses the construction editor stack (palette, PNG brush, publish) and
adds paint history shortcuts, Alt+drag rectangle fill, blocked-tile
overlay toggle, and a publish warning with live players-on-map count.
Gameplay movement and clicks are suppressed while editing.

Co-authored-by: Nikolay Golovin <Aduersarius@users.noreply.github.com>
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.

2 participants