Skip to content

Commit a489144

Browse files
thekannenclaude
andcommitted
1.4.1: rooms side by side share one wall, colour-mask floors, installer fix
Most of this release is @bularzik's work, from pull requests thekannen#10-thekannen#14: thank you, Dan. - Doors between rooms open in your VTT: a room built beside another shares its wall instead of doubling it. - Simple Tiles drawn as red colour masks come out brown, not white. - Line up a traced sketch with the grid; hide the editor grid. - Unpainted colourable objects come with a colour suggestion. - Moving an old bridge copy out of Program Files now says it needs an administrator before touching anything, instead of failing part-way. - The MCP Bridge panel's note says which settings are yours alone. - CI uses actions/setup-python 7.1.0 (thekannen#15), and a test no longer breaks under pytest 9.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2189ce3 commit a489144

17 files changed

Lines changed: 275 additions & 59 deletions

File tree

‎.claude-plugin/plugin.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://anthropic.com/claude-code/plugin.schema.json",
33
"name": "battlemap-mcp",
4-
"version": "1.4.0",
4+
"version": "1.4.1",
55
"description": "Build battle maps in a running Dungeondraft: the map tools plus art-direction skills. Needs the bridge mod in Dungeondraft, which your assistant can install.",
66
"author": {
77
"name": "thekannen",
@@ -11,5 +11,5 @@
1111
"skills": [
1212
"./skills"
1313
],
14-
"mcpServers": "https://github.com/thekannen/battlemap-mcp/releases/download/v1.4.0/battlemap-mcp-1.4.0.mcpb"
14+
"mcpServers": "https://github.com/thekannen/battlemap-mcp/releases/download/v1.4.1/battlemap-mcp-1.4.1.mcpb"
1515
}

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1818
with:
1919
persist-credentials: false
20-
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
20+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: Install development dependencies

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2626
with:
2727
persist-credentials: false
28-
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
28+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
2929
with:
3030
python-version: "3.11"
3131
- name: Check package version and tag
@@ -68,7 +68,7 @@ jobs:
6868
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6969
with:
7070
persist-credentials: false
71-
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
71+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
7272
with:
7373
python-version: "3.11"
7474
- name: Build and smoke-test native companion
@@ -126,7 +126,7 @@ jobs:
126126
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
127127
with:
128128
persist-credentials: false
129-
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
129+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
130130
with:
131131
python-version: "3.11"
132132
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2

‎.github/workflows/security.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1616
with:
1717
persist-credentials: false
18-
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
18+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
1919
with:
2020
python-version: '3.11'
2121
- name: Install package and dependency auditor

‎CHANGELOG.md‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,50 @@ What changed in each release, written for the people using it. Versions cover
44
the companion, the Dungeondraft mod and the map-making skills together; the
55
wire protocol between them is versioned separately and is currently 25.
66

7+
## 1.4.1 — 2026-10-30
8+
9+
Rooms built side by side share one wall, so their doors open in your VTT,
10+
and a few smaller fixes. Most of this release is @bularzik's work, from
11+
five pull requests: thank you, Dan.
12+
13+
**Doors between rooms open in your VTT.** Two rooms built next to each
14+
other used to get two walls on the edge they share. A door mounts on one of
15+
them, so in Foundry or Roll20 the other still blocked the doorway. Now the
16+
second room uses the wall that is already there and draws only its free
17+
sides, so the door opens. A room drawn inside walls that already surround
18+
it gets just its floor. Only a wall of the same kind is shared, so a cave
19+
wall is never borrowed for a stone room.
20+
21+
**Tiled floors drawn as colour masks come out brown, not white.** Simple
22+
Tiles such as damaged wood, diamonds and the ornate tile are drawn as red
23+
masks meant to be tinted. Placed without a colour they rendered white; they
24+
now get the same neutral brown as other plain floors. Floors with colours
25+
of their own are left as they are.
26+
27+
**Line up a traced sketch with the grid.** Your assistant can now put a
28+
reference image exactly where it should sit, so a hand-drawn plan's squares
29+
match the map's. Asking twice puts it in the same place, and the position
30+
is saved with the map.
31+
32+
**Hide the grid in the editor.** Your assistant can show or hide the grid,
33+
for example to take a clean screenshot. It works the View menu's own Grid
34+
checkbox, so the menu always matches what you see. It isn't saved: the grid
35+
is back when you reopen the map.
36+
37+
**A colour suggestion for unpainted objects.** When an object is placed
38+
without a colour and shows as a flat red shape, your assistant is now told
39+
Dungeondraft's own default colour as a fallback, while still choosing one
40+
that suits the object.
41+
42+
**Moving an old bridge copy out of Program Files explains itself.** If a
43+
copy sits in a folder only an administrator can change, the installer now
44+
says so before touching anything, instead of failing part-way with an
45+
error that read like a bug.
46+
47+
**The Battlemap MCP Bridge panel's note is accurate.** It said your assistant could
48+
not change any of the panel's settings, but it can switch Verbose log for
49+
troubleshooting. The note now says which settings are yours alone.
50+
751
## 1.4.0 — 2026-10-20
852

953
Furnish a room in one step, keep scattered art off walls, place lights with

‎mod/battlemap-mcp-bridge/mcp_bridge.ddmod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Battlemap MCP Bridge",
33
"unique_id": "thekannen.MCPBridge",
4-
"version": "1.4.0",
4+
"version": "1.4.1",
55
"author": "thekannen",
66
"description": "Exposes a localhost TCP/JSON bridge so an external MCP server can drive the open map.",
77
"dd_version": "1.2.0.1",

‎mod/battlemap-mcp-bridge/scripts/tools/mcp_bridge.gd‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7686,8 +7686,11 @@ func _register_tool():
76867686
if folder != null:
76877687
folder.connect("pressed", self, "_on_panel_open_output")
76887688
_panel_label(panel, "output", "")
7689-
panel.CreateNote("These settings belong to you. Your assistant can read " +
7690-
"them but cannot change them.")
7689+
7690+
panel.CreateNote("Pause, updates, placements and captures belong to you: " +
7691+
"your assistant can read them but cannot change them. Verbose log is " +
7692+
"for troubleshooting, either of you can switch it, and it lasts until " +
7693+
"Dungeondraft closes.")
76917694
_refresh_panel()
76927695

76937696
func _panel_icon() -> String:

‎server/battlemap_mcp/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Dungeondraft MCP server package."""
22

3-
__version__ = "1.4.0"
3+
__version__ = "1.4.1"

‎server/battlemap_mcp/installer.py‎

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
import json
77
import os
88
import re
9+
import secrets
910
import sys
1011
import tempfile
1112
from dataclasses import dataclass, replace
1213
from datetime import datetime
1314
from importlib import resources
1415
from pathlib import Path
15-
from shutil import copytree, move, rmtree
16+
from shutil import copy2, copytree, move, rmtree
1617
from typing import Any
1718

1819
from .bridge_client import PROTOCOL_VERSION, BridgeClient
@@ -459,11 +460,50 @@ def plan_install(mods_dir: Path, now: datetime, *, state_dir: Path) -> InstallPl
459460
def other_copy_backups(plan: InstallPlan) -> tuple[tuple[Path, Path], ...]:
460461
"""Runtime behavior and validation."""
461462
return tuple(
462-
(path, _state_backups_dir(plan) / f"{path.name}.backup-{_stamp(plan)}")
463+
(path, _free_path(_state_backups_dir(plan) / f"{path.name}.backup-{_stamp(plan)}"))
463464
for path in plan.other_copies
464465
)
465466

466467

468+
def _free_path(path: Path) -> Path:
469+
"""Runtime behavior and validation."""
470+
candidate, n = path, 2
471+
while candidate.exists():
472+
candidate = path.with_name(f"{path.name}-{n}")
473+
n += 1
474+
return candidate
475+
476+
477+
def _can_remove(path: Path) -> bool:
478+
"""Runtime behavior and validation."""
479+
for folder in (path.parent, path):
480+
probe = folder / f".battlemap-mcp-probe-{secrets.token_hex(8)}"
481+
try:
482+
handle = os.open(probe, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
483+
except OSError:
484+
return False
485+
os.close(handle)
486+
try:
487+
os.unlink(probe)
488+
except OSError:
489+
return False
490+
return True
491+
492+
493+
def _restore_changed(backup: Path, original: Path) -> None:
494+
"""Runtime behavior and validation."""
495+
for source in sorted(backup.rglob("*")):
496+
target = original / source.relative_to(backup)
497+
if source.is_dir():
498+
target.mkdir(parents=True, exist_ok=True)
499+
elif not target.is_file() or (
500+
hashlib.sha256(target.read_bytes()).digest()
501+
!= hashlib.sha256(source.read_bytes()).digest()
502+
):
503+
target.parent.mkdir(parents=True, exist_ok=True)
504+
copy2(source, target)
505+
506+
467507
def _state_backups_dir(plan: InstallPlan) -> Path:
468508
return plan.records_path.parent / "backups" / _destination_token(plan.destination)
469509

@@ -505,19 +545,23 @@ def apply_install(
505545
+ ", ".join(links)
506546
+ ". Remove the link itself by hand; the folder it points to is not affected."
507547
)
508-
for _, backup in moved:
509-
if backup.exists():
510-
raise InstallConflictError(f"Backup already exists: {backup}")
548+
protected = [str(original) for original, _ in moved if not _can_remove(original)]
549+
if protected:
550+
raise InstallConflictError(
551+
"These bridge copies are in a folder this account cannot change, such as "
552+
"Program Files: " + ", ".join(protected) + ". Moving them needs an "
553+
"administrator: delete or move them by hand from an administrator "
554+
"prompt, or install without move_other_copies. Nothing was changed."
555+
)
511556

512557
if plan.destination.exists():
513558
if not force:
514559
raise InstallConflictError("Existing bridge requires --force to replace")
515560

516-
backup_destination = state_backups_dir / (
517-
f"{plan.destination.name}.backup-{plan.now.strftime('%Y%m%dT%H%M%SZ')}"
561+
backup_destination = _free_path(
562+
state_backups_dir
563+
/ f"{plan.destination.name}.backup-{plan.now.strftime('%Y%m%dT%H%M%SZ')}"
518564
)
519-
if backup_destination.exists():
520-
raise InstallConflictError(f"Backup already exists: {backup_destination}")
521565

522566
# Stage outside mod discovery before moving any existing installation.
523567
plan.records_path.parent.mkdir(parents=True, exist_ok=True)
@@ -573,9 +617,9 @@ def apply_install(
573617
rmtree(plan.destination)
574618
if destination_removal_started and backup_destination is not None:
575619
if installed or not destination_removed or not plan.destination.exists():
576-
copytree(backup_destination, plan.destination, dirs_exist_ok=True)
620+
_restore_changed(backup_destination, plan.destination)
577621
for original, backup in reversed(restoring):
578-
copytree(backup, original, dirs_exist_ok=True)
622+
_restore_changed(backup, original)
579623
# Include prepared legacy copies whose removal was never reached.
580624
# A failed restore above leaves every recovery copy intact.
581625
for original, backup in reversed(owned_backups):

‎server/battlemap_mcp/server.py‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,14 @@ def place_object(
21002100
) -> dict:
21012101
"""Place an object (prop) on the current map. Returns the new element id.
21022102
2103+
If you place a colourable asset WITHOUT a colour, the response comes back
2104+
with `colorable: true` and `mask_fraction`, and its note says whether the
2105+
object is a flat red shape or just has red accents.
2106+
Colour is baked at placement, so the fix is to delete it and place it
2107+
again with `color`. Choose one that suits the object (a blue banner, a
2108+
green tablecloth); if nothing fits better, Dungeondraft's own default is
2109+
#6b3834.
2110+
21032111
asset: an Objects asset path from list_assets(category='Objects').
21042112
x, y: woxel coordinates; defaults to map center. rotation: degrees.
21052113
sorting: 0=over, 1=under. snap: 'none', 'grid' or 'auto'; see get_snap_settings.
@@ -2201,11 +2209,18 @@ def place_objects(
22012209
never holds a half-finished batch whose ids you were not told.
22022210
22032211
file: an absolute path to a JSON file of the same entries (a list, or
2204-
{\"objects\": [...]}), up to 1000. Use it when a script computed the
2212+
{"objects": [...]}), up to 1000. Use it when a script computed the
22052213
positions: write the file and pass its path instead of copying hundreds
22062214
of entries into the call. The reply is compact: `placed`, `id_ranges`
22072215
([first, last] runs of ids) and `colorable_without_color`.
22082216
2217+
Returns `objects`: one {id, position, layer} per entry, in the order you
2218+
passed them (with `light_id` for an entry that has a `light`), plus `ids`.
2219+
Entries placed from a colourable asset with no color are listed in the
2220+
note: those are flat red, and colour cannot be added afterwards. Give each
2221+
one a color that suits it; if nothing fits better, Dungeondraft's own
2222+
default is #6b3834.
2223+
22092224
One undo() reverses the whole batch while it is the latest operation.
22102225
snap applies to every entry with an x and y; see get_snap_settings.
22112226
@@ -2954,10 +2969,10 @@ def build_room(
29542969
existing wall on this level already covers, so two rooms side by side
29552970
share ONE wall and a door placed on it opens in a VTT export. Only a
29562971
wall of the same wall_type (and of wall_asset, when given) is shared.
2957-
A boundary walled all round gets no wall, only its floor; with
2958-
floor='none' that is refused. The shared wall belongs to the room
2959-
built first: deleting that room's wall later leaves this room open on
2960-
the shared side. 'keep' always draws the full loop.
2972+
A boundary walled all round gets only its floor (refused with
2973+
floor='none'). The shared wall belongs to the room built first:
2974+
deleting it later leaves this room open on that side. 'keep' always
2975+
draws the full loop.
29612976
29622977
Returns { wall_id, floor_id?, points }, or, when walls were shared,
29632978
{ wall_ids, shared_edges, floor_id?, points } (wall_ids may be empty).
@@ -3857,6 +3872,13 @@ def set_water_style(
38573872
Geometry first (add_water), then this. A muddy river, a clear shallow, a
38583873
peat swamp and a deep cold pool are the same mesh with different colour.
38593874
3875+
deep_color / shallow_color: hex, e.g. '#12304f'. Deep is the body, shallow
3876+
is the edge; the gap between them is most of the character.
3877+
blend_distance: how far the shallow colour reaches in from the shoreline.
3878+
Small is an abrupt drop-off, large is a gradual wade.
3879+
border: draw the shoreline border. Off suits a swamp or a flooded floor
3880+
where the edge should be indefinite.
3881+
38603882
Per LEVEL: every body of water on this level is restyled, and water drawn
38613883
later on a level whose bodies share one style takes that style too. The
38623884
response reads the style back off the water bodies, which are what the map

0 commit comments

Comments
 (0)