Skip to content

Commit 4497296

Browse files
committed
Add 'circular-wheel' board style and support shaped enter/exit annotations
1 parent e0a232c commit 4497296

5 files changed

Lines changed: 73 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.6.0] - 2024-11-13
9+
10+
### Added
11+
12+
- Added the `circular-wheel` board style.
13+
- Added support for different enter/exit annotation shapes.
14+
815
## [1.5.1] - 2024-10-24
916

1017
### Changed

package-lock.json

Lines changed: 40 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "abstractplay-designer",
33
"private": true,
4-
"version": "1.5.1",
4+
"version": "1.6.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -29,7 +29,7 @@
2929
"vite": "^4.4.5"
3030
},
3131
"dependencies": {
32-
"@abstractplay/renderer": "^1.0.0-ci-10967176584.0",
32+
"@abstractplay/renderer": "^1.0.0-ci-11827297972.0",
3333
"nanoid": "^4.0.2",
3434
"peerjs": "^1.4.7",
3535
"rfdc": "^1.3.0",

src/components/Annotate.svelte

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
} from "@abstractplay/renderer/build/schemas/schema";
1010
import { colourContext } from "@/stores/writeContext";
1111
12+
type Shape = "square"|"circle"|"hexf"|"hexp";
13+
1214
const boardClick = (row: number, col: number, piece: string) => {
1315
console.log(`Row: ${row}, Col: ${col}, Piece: ${piece}`);
1416
const idx = currentTargets.findIndex(
@@ -47,6 +49,7 @@
4749
4850
let newNote = false;
4951
let currentType: "move" | "enter" | "eject" | "dots" | undefined;
52+
let currentShape: Shape = "square";
5053
let currentTargets: [number, number][] = [];
5154
let currentNote: AnnotationBasic | undefined;
5255
let isDashed = false;
@@ -76,6 +79,11 @@
7679
} else {
7780
delete currentNote.style;
7881
}
82+
if (currentType === "enter" && currentShape !== "square") {
83+
currentNote.shape = currentShape;
84+
} else {
85+
delete currentNote.shape;
86+
}
7987
} else {
8088
currentNote = undefined;
8189
}
@@ -223,6 +231,18 @@
223231
</div>
224232
</div>
225233
{/if}
234+
{#if currentType === "enter"}
235+
<div class="field">
236+
<div class="select">
237+
<select bind:value="{currentShape}">
238+
<option value="square">Square</option>
239+
<option value="circle">Circle</option>
240+
<option value="hexf">Hex, flat</option>
241+
<option value="hexp">Hex, pointy</option>
242+
</select>
243+
</div>
244+
</div>
245+
{/if}
226246
<div class="field">
227247
<div class="content">
228248
<p>

src/components/Board.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"hex-of-cir",
7878
"A hexagonally shaped board consisting of circular cells, pieces placed in the cells",
7979
],
80+
["circular-wheel", "A circular wheel & spoke board"],
8081
["circular-cobweb", "A circular cobweb board"],
8182
[
8283
"conhex-cells",
@@ -172,7 +173,7 @@
172173
}
173174
whichWidth = "abs";
174175
} else if (
175-
$state.board.style === "circular-cobweb" ||
176+
$state.board.style.startsWith("circular-") ||
176177
$state.board.style.startsWith("conical-hex")
177178
) {
178179
whichWidth = "abs";
@@ -247,12 +248,13 @@
247248
} else {
248249
$state.board.snubStart = undefined;
249250
}
250-
} else if ($state.board.style === "circular-cobweb") {
251+
} else if ($state.board.style.startsWith("circular-")) {
251252
$state.board = {
252253
style: $state.board.style,
253254
width: 8,
254255
height: 4,
255256
};
257+
symmetryLocked = false;
256258
} else if ($state.board.style.startsWith("hex-of")) {
257259
$state.board = {
258260
style: $state.board.style,

0 commit comments

Comments
 (0)