From d6931a61189e0bbd3844d5e09851dcf57b8dfc06 Mon Sep 17 00:00:00 2001 From: fabiryn Date: Sun, 27 Dec 2020 22:37:43 +0100 Subject: [PATCH 1/4] fix novoice icon for host --- src/renderer/Voice.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/Voice.tsx b/src/renderer/Voice.tsx index 1f9f6043..1c04b1ed 100644 --- a/src/renderer/Voice.tsx +++ b/src/renderer/Voice.tsx @@ -655,7 +655,7 @@ const Voice: React.FC = function ({ } = {}; for (const k of Object.keys(socketClients)) { - if (socketClients[k].playerId) + if (socketClients[k].playerId !== undefined) playerSocketIds[socketClients[k].playerId] = k; } return ( From 8f65fa1cf29f86b1949a0b825c6656db451ee68f Mon Sep 17 00:00:00 2001 From: fabiryn Date: Sun, 27 Dec 2020 22:39:24 +0100 Subject: [PATCH 2/4] fix skin size for crewmates --- src/renderer/Avatar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/Avatar.tsx b/src/renderer/Avatar.tsx index 07aff0c4..ca55e6f5 100644 --- a/src/renderer/Avatar.tsx +++ b/src/renderer/Avatar.tsx @@ -141,6 +141,7 @@ const useCanvasStyles = makeStyles(() => ({ position: 'absolute', top: '38%', left: '17%', + width: '73.5%', transform: 'scale(0.8)', zIndex: 3, display: ({ isAlive }: UseCanvasStylesParams) => From 919d06d69389bf224123f4ea32cee168d678410e Mon Sep 17 00:00:00 2001 From: fabiryn Date: Sun, 27 Dec 2020 22:53:58 +0100 Subject: [PATCH 3/4] fix join issue when host left lobby before creating own one --- src/main/GameReader.ts | 3 ++- src/renderer/Voice.tsx | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/GameReader.ts b/src/main/GameReader.ts index a6ffc1d8..9a361880 100644 --- a/src/main/GameReader.ts +++ b/src/main/GameReader.ts @@ -202,7 +202,8 @@ export default class GameReader { this.PlayerStruct ); playerAddrPtr += 4; - players.push(player); + if (state !== GameState.MENU) + players.push(player); if ( player.name === '' || diff --git a/src/renderer/Voice.tsx b/src/renderer/Voice.tsx index 1c04b1ed..d830c868 100644 --- a/src/renderer/Voice.tsx +++ b/src/renderer/Voice.tsx @@ -390,7 +390,6 @@ const Voice: React.FC = function ({ clientId: number ) => { console.log('Connect called', lobbyCode, playerId, clientId); - socket.emit('leave'); if (lobbyCode === 'MENU') { Object.keys(peerConnections).forEach((k) => { disconnectPeer(k); @@ -476,7 +475,7 @@ const Voice: React.FC = function ({ }); }); connection.on('data', (data) => { - if (gameState.hostId !== socketClientsRef.current[peer].clientId) + if (gameState.hostId !== socketClientsRef.current[peer]?.clientId) return; const settings = JSON.parse(data); Object.keys(lobbySettings).forEach((field: string) => { From 151afe010fdce12fb008ff937a7c3d674c07f117 Mon Sep 17 00:00:00 2001 From: fabiryn Date: Tue, 29 Dec 2020 02:32:38 +0100 Subject: [PATCH 4/4] fix keyboard shortcuts (F-keys) --- src/renderer/settings/Settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/settings/Settings.tsx b/src/renderer/settings/Settings.tsx index c338ab3d..482534d6 100644 --- a/src/renderer/settings/Settings.tsx +++ b/src/renderer/settings/Settings.tsx @@ -472,7 +472,7 @@ const Settings: React.FC = function ({ if (k === 'Control' || k === 'Alt' || k === 'Shift') k = (ev.location === 1 ? 'L' : 'R') + k; - if (/^[0-9A-Z]$/.test(k) || /^F[0-9]{1, 2}$/.test(k) || keys.has(k)) { + if (/^[0-9A-Z]$/.test(k) || /^F[0-9]{1,2}$/.test(k) || keys.has(k)) { setSettings({ type: 'setOne', action: [shortcut, k],