mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 01:03:01 +02:00
Merge branch 'dev' into documentation-updates
This commit is contained in:
+41
-8
@@ -109,12 +109,6 @@ interface RunningScript {
|
||||
threads: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filename or PID of a script.
|
||||
* @public
|
||||
*/
|
||||
type FilenameOrPID = string | number;
|
||||
|
||||
/**
|
||||
* Data representing the internal values of a crime.
|
||||
* @public
|
||||
@@ -3965,6 +3959,36 @@ interface UserInterface {
|
||||
* RAM cost: cost: 0 GB
|
||||
*/
|
||||
resetTheme(): void;
|
||||
|
||||
/**
|
||||
* Get the current styles
|
||||
* @remarks
|
||||
* RAM cost: cost: 0 GB
|
||||
*
|
||||
* @returns An object containing the player's styles
|
||||
*/
|
||||
getStyles(): IStyleSettings;
|
||||
|
||||
/**
|
||||
* Sets the current styles
|
||||
* @remarks
|
||||
* RAM cost: cost: 0 GB
|
||||
* @example
|
||||
* Usage example (NS2)
|
||||
* ```ts
|
||||
* const styles = ns.ui.getStyles();
|
||||
* styles.fontFamily = 'Comic Sans Ms';
|
||||
* ns.ui.setStyles(styles);
|
||||
* ```
|
||||
*/
|
||||
setStyles(newStyles: IStyleSettings): void;
|
||||
|
||||
/**
|
||||
* Resets the player's styles to the default values
|
||||
* @remarks
|
||||
* RAM cost: cost: 0 GB
|
||||
*/
|
||||
resetStyles(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5719,7 +5743,7 @@ export interface NS extends Singularity {
|
||||
* @param args - Formating arguments.
|
||||
* @returns Formated text.
|
||||
*/
|
||||
sprintf(format: string, ...args: string[]): string;
|
||||
sprintf(format: string, ...args: any[]): string;
|
||||
|
||||
/**
|
||||
* Format a string with an array of arguments.
|
||||
@@ -5731,7 +5755,7 @@ export interface NS extends Singularity {
|
||||
* @param args - Formating arguments.
|
||||
* @returns Formated text.
|
||||
*/
|
||||
vsprintf(format: string, args: string[]): string;
|
||||
vsprintf(format: string, args: any[]): string;
|
||||
|
||||
/**
|
||||
* Format a number
|
||||
@@ -6443,3 +6467,12 @@ interface UserInterfaceTheme {
|
||||
backgroundsecondary: string;
|
||||
button: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface Styles
|
||||
* @internal
|
||||
*/
|
||||
interface IStyleSettings {
|
||||
fontFamily: string;
|
||||
lineHeight: number;
|
||||
}
|
||||
|
||||
@@ -686,7 +686,9 @@ export function Root(props: IProps): React.ReactElement {
|
||||
const serverScript = server.scripts.find((s) => s.filename === openScript.fileName);
|
||||
if (serverScript === undefined) return " *";
|
||||
|
||||
return serverScript.code !== openScript.code ? " *" : "";
|
||||
// The server code is stored with its starting & trailing whitespace removed
|
||||
const openScriptFormatted = Script.formatCode(openScript.code);
|
||||
return serverScript.code !== openScriptFormatted ? " *" : "";
|
||||
}
|
||||
|
||||
// Toolbars are roughly 112px:
|
||||
@@ -846,7 +848,7 @@ export function Root(props: IProps): React.ReactElement {
|
||||
<span style={{ color: Settings.theme.primary, fontSize: "20px", textAlign: "center" }}>
|
||||
<Typography variant="h4">No open files</Typography>
|
||||
<Typography variant="h5">
|
||||
Use `nano FILENAME` in
|
||||
Use <code>nano FILENAME</code> in
|
||||
<br />
|
||||
the terminal to open files
|
||||
</Typography>
|
||||
|
||||
Reference in New Issue
Block a user