we did it
This commit is contained in:
@@ -2,7 +2,7 @@ import { Accessor, createContext, For, useContext } from "solid-js";
|
||||
import type {
|
||||
SimpleAction,
|
||||
SimplePlayerView,
|
||||
} from "@games/server/src/games/simple";
|
||||
} from "@games/shared/games/simple";
|
||||
import { me, profile } from "~/profile";
|
||||
import Hand from "./Hand";
|
||||
import Pile from "./Pile";
|
||||
@@ -44,7 +44,9 @@ export default () => {
|
||||
</div>
|
||||
<button
|
||||
class="button fixed tl m-4 p-1"
|
||||
onClick={() => table.sendWs({ quit: true })}
|
||||
onClick={() => {
|
||||
table.sendWs({ quit: true });
|
||||
}}
|
||||
>
|
||||
Quit
|
||||
</button>
|
||||
@@ -54,10 +56,7 @@ export default () => {
|
||||
mount={document.getElementById(`player-${playerKey}`)!}
|
||||
ref={(ref) => {
|
||||
const midOffset =
|
||||
i() +
|
||||
0.5 -
|
||||
Object.values(view().playerHandCounts).length /
|
||||
2;
|
||||
i() + 0.5 - Object.values(view().playerHandCounts).length / 2;
|
||||
|
||||
ref.style = `position: absolute; display: flex; justify-content: center; top: 65%; transform: translate(${Math.abs(
|
||||
midOffset * 0
|
||||
|
||||
@@ -37,11 +37,11 @@ export default (props: { tableKey: string }) => {
|
||||
);
|
||||
onCleanup(() => wsPromise.then((ws) => ws.close()));
|
||||
|
||||
const presenceEvents = wsEvents.filter((evt) => evt.players != null);
|
||||
const presenceEvents = wsEvents.filter((evt) => evt.playersPresent != null);
|
||||
const gameEvents = wsEvents.filter((evt) => evt.view !== undefined);
|
||||
|
||||
const players = createObservableWithInit<string[]>(
|
||||
presenceEvents.map((evt) => evt.players!),
|
||||
presenceEvents.map((evt) => evt.playersPresent!),
|
||||
[]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user