diff --git a/src/api/soldat/configs/types.ts b/src/api/soldat/configs/types.ts index 4560ef3..eedc406 100644 --- a/src/api/soldat/configs/types.ts +++ b/src/api/soldat/configs/types.ts @@ -48,6 +48,7 @@ export interface GraphicsConfig extends SoldatConfig { ui_style: string; r_scaleinterface: string; ui_playerindicator: string; + ui_sniperline: string; ui_killconsole: string; r_swapeffect: string; @@ -87,6 +88,7 @@ export interface ServerConfig extends SoldatConfig { sv_bullettime: string; sv_friendlyfire: string; sv_sniperline: string; + sv_stationaryguns: string; sv_survivalmode: string; sv_survivalmode_clearweapons: string; @@ -127,4 +129,4 @@ export interface ServerConfig extends SoldatConfig { net_port: string; }; -} \ No newline at end of file +} diff --git a/src/api/soldat/server.ts b/src/api/soldat/server.ts index 1ee312e..d0e5769 100644 --- a/src/api/soldat/server.ts +++ b/src/api/soldat/server.ts @@ -43,10 +43,15 @@ const start = ( // For now this seems to get the job done, even though a proper // communication system might be better... + let stdoutOutput = ""; serverProcess.stdout.setEncoding("utf8"); serverProcess.stdout.on("data", (output: string) => { - if (output.includes("[NET] Game networking initialized.")) { - onReady(); + if (!stdoutOutput.includes("[NET] Game networking initialized.")) { + stdoutOutput += output; + + if (stdoutOutput.includes("[NET] Game networking initialized.")) { + onReady(); + } } }); @@ -75,4 +80,4 @@ const stop = (): void => { serverProcess = undefined; } -export { start, stop }; \ No newline at end of file +export { start, stop }; diff --git a/src/components/LocalGame/Gameplay/Form.tsx b/src/components/LocalGame/Gameplay/Form.tsx index b17d69d..028978b 100644 --- a/src/components/LocalGame/Gameplay/Form.tsx +++ b/src/components/LocalGame/Gameplay/Form.tsx @@ -40,6 +40,10 @@ const GameplayForm: React.FC = props => { gameplay.sniperLine = checked; break; + case "stationary-guns": + gameplay.stationaryGuns = checked; + break; + case "survival-destroy-weapons": gameplay.styles.survivalDestroyWeaponsAfterRound = checked; break; @@ -244,7 +248,7 @@ const GameplayForm: React.FC = props => {
= props => { onToggle={handleCheckboxToggle} />
+ +
+ +
+ +
+
) } -export default observer(GameplayForm); \ No newline at end of file +export default observer(GameplayForm); diff --git a/src/components/Settings/GraphicsPanel.tsx b/src/components/Settings/GraphicsPanel.tsx index 7db7ed7..02e485e 100644 --- a/src/components/Settings/GraphicsPanel.tsx +++ b/src/components/Settings/GraphicsPanel.tsx @@ -84,6 +84,10 @@ const GraphicsPanel: React.FC = props => { graphicsSettings.playerIndicator = checked; } + const handleClientSniperlineToggle = (checked: boolean): void => { + graphicsSettings.clientSniperline = checked; + } + const handleKillsListToggle = (checked: boolean): void => { graphicsSettings.killsList = checked; } @@ -333,6 +337,21 @@ const GraphicsPanel: React.FC = props => { +
+ +
+ +
+
+