Revert noList prop

This commit is contained in:
nickofolas 2022-04-17 15:26:43 -05:00
parent 4073050333
commit 7f2ab4f27a
2 changed files with 85 additions and 84 deletions

@ -65,88 +65,90 @@ export const CurrentOptionsPage = (props: IProps): React.ReactElement => {
const pages = { const pages = {
[GameOptionsTab.SYSTEM]: ( [GameOptionsTab.SYSTEM]: (
<GameOptionsPage title="System" noList> <GameOptionsPage title="System">
<OptionsSlider <>
label=".script exec time (ms)" <OptionsSlider
value={execTime} label=".script exec time (ms)"
callback={handleExecTimeChange} value={execTime}
step={1} callback={handleExecTimeChange}
min={5} step={1}
max={100} min={5}
tooltip={ max={100}
<> tooltip={
The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low can <>
result in poor performance if you have many scripts running. The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low
</> can result in poor performance if you have many scripts running.
} </>
/> }
<OptionsSlider />
label="Recently killed scripts size" <OptionsSlider
value={recentScriptsSize} label="Recently killed scripts size"
callback={handleRecentScriptsSizeChange} value={recentScriptsSize}
step={25} callback={handleRecentScriptsSizeChange}
min={0} step={25}
max={500} min={0}
tooltip={ max={500}
<> tooltip={
The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a <>
lot of memory if you have many scripts running. The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a
</> lot of memory if you have many scripts running.
} </>
/> }
<OptionsSlider />
label="Netscript log size" <OptionsSlider
value={logSize} label="Netscript log size"
callback={handleLogSizeChange} value={logSize}
step={20} callback={handleLogSizeChange}
min={20} step={20}
max={500} min={20}
tooltip={ max={500}
<> tooltip={
The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a <>
lot of memory if you have many scripts running. The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a
</> lot of memory if you have many scripts running.
} </>
/> }
<OptionsSlider />
label="Netscript port size" <OptionsSlider
value={portSize} label="Netscript port size"
callback={handlePortSizeChange} value={portSize}
step={1} callback={handlePortSizeChange}
min={20} step={1}
max={100} min={20}
tooltip={ max={100}
<> tooltip={
The maximum number of entries that can be written to a port using Netscript's write() function. Setting <>
this too high can cause the game to use a lot of memory. The maximum number of entries that can be written to a port using Netscript's write() function. Setting
</> this too high can cause the game to use a lot of memory.
} </>
/> }
<OptionsSlider />
label="Terminal capacity" <OptionsSlider
value={terminalSize} label="Terminal capacity"
callback={handleTerminalSizeChange} value={terminalSize}
step={50} callback={handleTerminalSizeChange}
min={50} step={50}
max={500} min={50}
tooltip={ max={500}
<> tooltip={
The maximum number of entries that can be written to the terminal. Setting this too high can cause the <>
game to use a lot of memory. The maximum number of entries that can be written to the terminal. Setting this too high can cause the
</> game to use a lot of memory.
} </>
marks }
/> marks
<OptionsSlider />
label="Autosave interval (s)" <OptionsSlider
value={autosaveInterval} label="Autosave interval (s)"
callback={handleAutosaveIntervalChange} value={autosaveInterval}
step={30} callback={handleAutosaveIntervalChange}
min={0} step={30}
max={600} min={0}
tooltip={<>The time (in seconds) between each autosave. Set to 0 to disable autosave.</>} max={600}
marks tooltip={<>The time (in seconds) between each autosave. Set to 0 to disable autosave.</>}
/> marks
/>
</>
</GameOptionsPage> </GameOptionsPage>
), ),
[GameOptionsTab.INTERFACE]: ( [GameOptionsTab.INTERFACE]: (

@ -5,14 +5,13 @@ import React from "react";
interface IProps { interface IProps {
children: React.ReactElement | (React.ReactElement | null)[]; children: React.ReactElement | (React.ReactElement | null)[];
title: string; title: string;
noList?: boolean;
} }
export const GameOptionsPage = (props: IProps): React.ReactElement => { export const GameOptionsPage = (props: IProps): React.ReactElement => {
return ( return (
<Paper sx={{ height: "fit-content", p: 1 }}> <Paper sx={{ height: "fit-content", p: 1 }}>
<Typography variant="h6">{props.title}</Typography> <Typography variant="h6">{props.title}</Typography>
{(props.children as any)?.length > 1 && !props.noList ? ( {(props.children as any)?.length > 1 ? (
<List disablePadding dense> <List disablePadding dense>
{(props.children as React.ReactElement[]) {(props.children as React.ReactElement[])
.filter((c) => c) .filter((c) => c)