Skip to content

Set the defense formation visually, like the attack picker - #93

Merged
daedeloth merged 1 commit into
developfrom
claude/project-thread-tndqsd
Nov 5, 2026
Merged

daedeloth merged 1 commit into
developfrom
claude/project-thread-tndqsd

Conversation

@daedeloth

Copy link
Copy Markdown
Member

Requested by Thijs · project thread

What

The Defense Formation window used a dropdown per slot and row. It now shows the battlefield the attack picker uses: the village's terrain slots (grass, swamp, elevation...) with the regiments listed below.

  • Drag a regiment onto a slot (mouse), tap a regiment and then a slot, or finger-drag it on a touch screen. This reuses Game.dolumar.enableTapToPlace / enableTouchDrag from the attack picker, so mobile behaves the same as attacking.
  • Each slot has a front place and, when you have more regiments than slots, a reserve place under it (the old "row 2"). A short line explains what a reserve does.
  • Dropping a regiment on a taken place swaps the two. Each place has a Clear link. A reserve with an empty front place moves up, matching the existing save rule that ignores a reserve without a front regiment.
  • Placed regiments stay in the list, dimmed, so they can be dragged again to move them.
  • Classic+ style: ui-btn primary save button, p.true ui-msg feedback, h3 section, no new kit components. Window is 460×540 (was 300×300).
  • New texts in en, nl, de, fr, pl (battle.lng [formation]). The de/fr/pl lines need a native check.

Unchanged: the form still posts slot_<slot>_<row>, and processInput and the battle rules are the same, so saved formations and fights behave as before.

Screenshots

In the project files, folder defense-formation/:

  • desktop-1-before-placing.png, desktop-2-placed.png
  • mobile-1-tap-selected.png (tap to place), mobile-2-finger-drag.png, mobile-3-saved.png

The sandbox has no Verdana, so the desktop font there is a fallback. The broken Home Guard image is the existing missing static/images/units/swordsmen.jpg, not part of this change.

Tests

Checked by hand with Playwright against a local seeded world (PHP 8.3, MySQL 8, memcached): click-to-place, mouse drag, swap into a reserve, touch tap and touch finger-drag on an iPhone 13 profile, save, then reopen. The squad_units rows (s_slotId, s_priority) matched what was placed. php -l is clean. phpcs could not run in this sandbox because the PHPCompatibility standard was not registered.


Generated by Claude Code

…attlefield

The Defense Formation window used one dropdown per slot and row. It now shows
the same terrain slots as the attack picker, each with a front place and (when
there are more regiments than slots) a reserve place. Regiments are dragged onto
a place, tapped and then a place (touch screens), or finger-dragged; dropping on
a taken place swaps. The form still posts slot_<slot>_<row>, so saving and the
battle rules are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpWbfCGmL2XfCVKDE9frai
@daedeloth daedeloth self-assigned this Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Preview: removed, this pull request is closed.

@daedeloth
daedeloth merged commit 5e8dfe3 into develop Nov 5, 2026
5 checks passed
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