mudlet-map-editor 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist-lib/index.js +22 -1
  2. package/package.json +1 -1
package/dist-lib/index.js CHANGED
@@ -8317,6 +8317,27 @@ function mn({ sceneRef: e }) {
8317
8317
  }, x = () => {
8318
8318
  let t = D.getState();
8319
8319
  if (!t.map) return p();
8320
+ if (y) {
8321
+ let n = je(t.map, y);
8322
+ Y({
8323
+ kind: "batch",
8324
+ cmds: y.map((e) => {
8325
+ let r = t.map.rooms[e];
8326
+ return {
8327
+ kind: "deleteRoom",
8328
+ id: e,
8329
+ room: { ...r },
8330
+ areaId: r.area,
8331
+ neighborEdits: n.get(e) ?? []
8332
+ };
8333
+ })
8334
+ }, e.current), e.current?.refresh(), D.bumpStructure(), D.setState({
8335
+ selection: null,
8336
+ status: `Deleted ${y.length} rooms`,
8337
+ contextMenu: null
8338
+ });
8339
+ return;
8340
+ }
8320
8341
  let r = t.map.rooms[n.roomId];
8321
8342
  if (!r) return p();
8322
8343
  let i = { ...r }, a = Ae(t.map, n.roomId);
@@ -9483,7 +9504,7 @@ function Nn({ sceneRef: e }) {
9483
9504
  let e = r.getRenderRoom(a.anchorRoomId);
9484
9505
  c = e ? e.x : i.reduce((e, t) => e + t.rx, 0) / i.length, l = e ? e.y : i.reduce((e, t) => e + t.ry, 0) / i.length;
9485
9506
  } else c = i.reduce((e, t) => e + t.rx, 0) / i.length, l = i.reduce((e, t) => e + t.ry, 0) / i.length;
9486
- let u = t.snapToGrid ? (e) => Math.round(e / t.gridStep) * t.gridStep : Math.round, d = [];
9507
+ let u = t.snapToGrid ? (e) => Math.round(e / t.gridStep) * t.gridStep : (e) => e, d = [];
9487
9508
  for (let { id: e, rx: n, ry: r } of i) {
9488
9509
  let i = u(c + (n - c) * s), a = u(l + (r - l) * s), o = t.map.rooms[e];
9489
9510
  if (!o) continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mudlet-map-editor",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "description": "Mudlet Map Editor",
6
6
  "keywords": [