Skip to content

Commit

Permalink
fireworks fix + description state fix
Browse files Browse the repository at this point in the history
  • Loading branch information
naueramant committed Jul 27, 2024
1 parent 9fdf29e commit 056bc36
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/stores/game.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const mapToRemote = (
dnf_player_ids: playerIndexesToIds(state, state.dnf_player_indexes),
dnf: options.dnf,

description: state.description,
description: options.description,
};
};

Expand Down
25 changes: 0 additions & 25 deletions src/stores/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ interface GameState {
dnf_player_indexes: number[];

draws: Card[];

imageBlob?: Blob;
description?: string;
}

interface GameActions {
Expand All @@ -50,9 +47,6 @@ interface GameActions {

SetPlayerDNF: (playerId: number, dnf: boolean) => void;

SetImageBlob: (blob: Blob | undefined) => void;
SetDescription: (description: string | undefined) => void;

StartChug: () => number;
StopChug: () => number;

Expand Down Expand Up @@ -84,9 +78,6 @@ const initialState: GameState = {
dnf_player_indexes: [],

draws: [],

description: undefined,
imageBlob: undefined,
};

const useGame = create<GameState & GameActions>()(
Expand Down Expand Up @@ -213,22 +204,6 @@ const useGame = create<GameState & GameActions>()(
}
},

SetImageBlob: (blob: Blob | undefined) => {
console.debug("[Game]", "Setting image blob");

set({
imageBlob: blob,
});
},

SetDescription: (description: string | undefined) => {
console.debug("[Game]", "Setting game description");

set({
description: description,
});
},

DrawCard: () => {
console.debug("[Game]", "Drawing card");

Expand Down
56 changes: 29 additions & 27 deletions src/views/Game/components/GamFinishedDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,37 @@ const GameFinishedDialog: FunctionComponent<GameFinishedDialogProps> = (

return (
<>
<Fireworks
ref={ref}
options={{
acceleration: 1,
autoresize: true,
intensity: 20,
lineWidth: {
explosion: {
min: 1,
max: 8,
{props.open && (
<Fireworks
ref={ref}
options={{
acceleration: 1,
autoresize: true,
intensity: 20,
lineWidth: {
explosion: {
min: 1,
max: 8,
},
trace: {
min: 0.1,
max: 5,
},
},
trace: {
min: 0.1,
max: 5,
rocketsPoint: {
min: 0,
max: 100,
},
},
rocketsPoint: {
min: 0,
max: 100,
},
}}
style={{
top: 0,
left: 0,
width: "100%",
height: "100%",
position: "fixed",
}}
/>
}}
style={{
top: 0,
left: 0,
width: "100%",
height: "100%",
position: "fixed",
}}
/>
)}

<Dialog
{...props}
Expand Down

0 comments on commit 056bc36

Please sign in to comment.