mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Merge pull request #4132 from danielyxie/fix-2962
UI: FIX #2962 Add a setting to display middle time unit in Time Elapsed String
This commit is contained in:
commit
4d40338e0a
@ -50,6 +50,12 @@ export const InterfacePage = (): React.ReactElement => {
|
|||||||
<>If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.</>
|
<>If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<OptionSwitch
|
||||||
|
checked={Settings.ShowMiddleNullTimeUnit}
|
||||||
|
onChange={(newValue) => (Settings.ShowMiddleNullTimeUnit = newValue)}
|
||||||
|
text="Show all intermediary times unit, even when null."
|
||||||
|
tooltip={<>ex : 1 hours 13 seconds becomes 1 hours 0 minutes 13 seconds.</>}
|
||||||
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={
|
title={
|
||||||
<Typography>
|
<Typography>
|
||||||
|
@ -154,6 +154,11 @@ interface IDefaultSettings {
|
|||||||
*/
|
*/
|
||||||
UseIEC60027_2: boolean;
|
UseIEC60027_2: boolean;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Display intermediary time unit when their value is null
|
||||||
|
*/
|
||||||
|
ShowMiddleNullTimeUnit: boolean;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Character overview settings
|
* Character overview settings
|
||||||
*/
|
*/
|
||||||
@ -222,6 +227,7 @@ export const defaultSettings: IDefaultSettings = {
|
|||||||
SuppressSavedGameToast: false,
|
SuppressSavedGameToast: false,
|
||||||
SuppressAutosaveDisabledWarnings: false,
|
SuppressAutosaveDisabledWarnings: false,
|
||||||
UseIEC60027_2: false,
|
UseIEC60027_2: false,
|
||||||
|
ShowMiddleNullTimeUnit: false,
|
||||||
ExcludeRunningScriptsFromSave: false,
|
ExcludeRunningScriptsFromSave: false,
|
||||||
IsSidebarOpened: true,
|
IsSidebarOpened: true,
|
||||||
|
|
||||||
@ -265,6 +271,7 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
|
|||||||
SuppressSavedGameToast: defaultSettings.SuppressSavedGameToast,
|
SuppressSavedGameToast: defaultSettings.SuppressSavedGameToast,
|
||||||
SuppressAutosaveDisabledWarnings: defaultSettings.SuppressAutosaveDisabledWarnings,
|
SuppressAutosaveDisabledWarnings: defaultSettings.SuppressAutosaveDisabledWarnings,
|
||||||
UseIEC60027_2: defaultSettings.UseIEC60027_2,
|
UseIEC60027_2: defaultSettings.UseIEC60027_2,
|
||||||
|
ShowMiddleNullTimeUnit: defaultSettings.ShowMiddleNullTimeUnit,
|
||||||
ExcludeRunningScriptsFromSave: defaultSettings.ExcludeRunningScriptsFromSave,
|
ExcludeRunningScriptsFromSave: defaultSettings.ExcludeRunningScriptsFromSave,
|
||||||
IsSidebarOpened: defaultSettings.IsSidebarOpened,
|
IsSidebarOpened: defaultSettings.IsSidebarOpened,
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { Settings } from "../Settings/Settings";
|
||||||
import { EqualityFunc } from "../types";
|
import { EqualityFunc } from "../types";
|
||||||
import { isString } from "./helpers/isString";
|
import { isString } from "./helpers/isString";
|
||||||
|
|
||||||
@ -39,10 +40,10 @@ function convertTimeMsToTimeElapsedString(time: number, showMilli = false): stri
|
|||||||
if (days > 0) {
|
if (days > 0) {
|
||||||
res += `${days} days `;
|
res += `${days} days `;
|
||||||
}
|
}
|
||||||
if (hours > 0) {
|
if (hours > 0 || (Settings.ShowMiddleNullTimeUnit && res != "")) {
|
||||||
res += `${hours} hours `;
|
res += `${hours} hours `;
|
||||||
}
|
}
|
||||||
if (minutes > 0) {
|
if (minutes > 0 || (Settings.ShowMiddleNullTimeUnit && res != "")) {
|
||||||
res += `${minutes} minutes `;
|
res += `${minutes} minutes `;
|
||||||
}
|
}
|
||||||
res += `${seconds} seconds`;
|
res += `${seconds} seconds`;
|
||||||
|
Loading…
Reference in New Issue
Block a user