Make the lobby more compatible with the colour/ship objects

This commit is contained in:
Oliver Akins 2022-03-12 23:14:42 -06:00
parent 6f38c7e2a3
commit dd5a1e8cb9
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99
2 changed files with 8 additions and 7 deletions

View file

@ -16,8 +16,8 @@ let player = $players.find(p => p.name == $myName);
$: myColour = player.colour;
$: takenColours = $players.map(p => p.colour);
var selectedColour = player.colour;
var selectedShip = player.ship;
var selectedColour = player.colour.hex;
var selectedShip = player.ship.id;
var error = null;
function saveShipDesign() {
@ -74,8 +74,8 @@ function saveShipDesign() {
<option
value="{c.hex}"
disabled="{
c.hex != myColour
&& takenColours.includes(c.hex)
c.hex != myColour.hex
&& takenColours.includes(c)
}"
>
{c.name}