diff --git a/src/Settings/Settings.ts b/src/Settings/Settings.ts index 3654a87a5..09ff446c9 100644 --- a/src/Settings/Settings.ts +++ b/src/Settings/Settings.ts @@ -113,6 +113,11 @@ interface IDefaultSettings { * Theme colors */ theme: ITheme; + + /* + * Use GiB instead of GB + */ + UseIEC60027_2: boolean; } /** @@ -160,6 +165,7 @@ export const defaultSettings: IDefaultSettings = { SuppressBladeburnerPopup: false, SuppressTIXPopup: false, SuppressSavedGameToast: false, + UseIEC60027_2: false, theme: defaultTheme, }; @@ -192,6 +198,7 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = { SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup, SuppressTIXPopup: defaultSettings.SuppressTIXPopup, SuppressSavedGameToast: defaultSettings.SuppressSavedGameToast, + UseIEC60027_2: defaultSettings.UseIEC60027_2, MonacoTheme: "monokai", MonacoInsertSpaces: false, MonacoFontSize: 20, diff --git a/src/ui/React/GameOptionsRoot.tsx b/src/ui/React/GameOptionsRoot.tsx index 0c436fea6..73b8a364e 100644 --- a/src/ui/React/GameOptionsRoot.tsx +++ b/src/ui/React/GameOptionsRoot.tsx @@ -85,6 +85,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { const [enableBashHotkeys, setEnableBashHotkeys] = useState(Settings.EnableBashHotkeys); const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat); const [saveGameOnFileSave, setSaveGameOnFileSave] = useState(Settings.SaveGameOnFileSave); + const [useIEC60027_2, setUseIEC60027_2] = useState(Settings.UseIEC60027_2); const [locale, setLocale] = useState(Settings.Locale); const [diagnosticOpen, setDiagnosticOpen] = useState(false); @@ -163,6 +164,10 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { setDisableASCIIArt(event.target.checked); Settings.DisableASCIIArt = event.target.checked; } + function handleUseIEC60027_2Change(event: React.ChangeEvent): void { + setUseIEC60027_2(event.target.checked); + Settings.UseIEC60027_2 = event.target.checked; + } function handleDisableTextEffectsChange(event: React.ChangeEvent): void { setDisableTextEffects(event.target.checked); @@ -578,6 +583,16 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { } /> + + } + label={ + If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.}> + Use GiB instead of GB + + } + /> +