Skip to content

Commit

Permalink
v1.4.2: add onyx board
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Sep 18, 2024
1 parent a2cb58d commit 6e819a0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.2] - 2024-09-18

### Added

- Added support for the new `onyx` board.

## [1.4.1] - 2024-09-10

### Added
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "abstractplay-designer",
"private": true,
"version": "1.4.1",
"version": "1.4.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down Expand Up @@ -29,7 +29,7 @@
"vite": "^4.4.5"
},
"dependencies": {
"@abstractplay/renderer": "^1.0.0-ci-10801591922.0",
"@abstractplay/renderer": "^1.0.0-ci-10927249259.0",
"nanoid": "^4.0.2",
"peerjs": "^1.4.7",
"rfdc": "^1.3.0"
Expand Down
31 changes: 31 additions & 0 deletions src/components/Board.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"snubsquare",
"A unique combination of squares and triangles where most cells have five connections; pieces are placed on the vertices",
],
[
"onyx",
"A snubsquare board where you can also place at the midpoints of squares.",
],
[
"squares-diamonds",
"A square board where the vertices are also spaces. In the designer, pieces cannot be placed anywhere. You can only use flood fill.",
Expand Down Expand Up @@ -113,6 +117,7 @@
$state.board.style.startsWith("hex-even") ||
$state.board.style.startsWith("hex-slanted") ||
$state.board.style === "snubsquare" ||
$state.board.style === "onyx" ||
$state.board.style === "conhex-cells" ||
$state.board.style.startsWith("cairo")
) {
Expand All @@ -131,6 +136,12 @@
if ($state.board.style === "cairo-collinear") {
canInvertOrientation = true;
}
if ($state.board.style === "snubsquare") {
$state.board.snubStart = "S";
}
if ($state.board.style === "onyx") {
$state.board.snubStart = "T";
}
whichWidth = "abs";
} else if (
$state.board.style === "circular-cobweb" ||
Expand Down Expand Up @@ -184,6 +195,7 @@
$state.board.style.startsWith("hex-even") ||
$state.board.style.startsWith("hex-slanted") ||
$state.board.style === "snubsquare" ||
$state.board.style === "onyx" ||
$state.board.style.startsWith("cairo")
) {
$state.board = {
Expand All @@ -192,6 +204,13 @@
height: 8,
blocked: canBlock ? $state.board.blocked : undefined,
};
if ($state.board.style === "snubsquare") {
$state.board.snubStart = "S";
} else if ($state.board.style === "onyx") {
$state.board.snubStart = "T";
} else {
$state.board.snubStart = undefined;
}
} else if ($state.board.style === "circular-cobweb") {
$state.board = {
style: $state.board.style,
Expand Down Expand Up @@ -475,6 +494,18 @@
</label>
</div>
{/if}
{#if $state.board.style === "snubsquare" || $state.board.style === "onyx"}
<div class="control">
<button
class="button apButton"
on:click="{() => {
$state.board.snubStart =
$state.board.snubStart === 'S' ? 'T' : 'S';
$state = $state;
}}">Toggle top-left starting configuration</button
>
</div>
{/if}
{#if canBlock}
<div class="content">
<p>
Expand Down

0 comments on commit 6e819a0

Please sign in to comment.