Merge branch 'dev' into documentation-updates

This commit is contained in:
hydroflame
2022-01-15 17:47:17 -05:00
committed by GitHub
72 changed files with 1253 additions and 743 deletions
+41 -8
View File
@@ -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;
}
+4 -2
View File
@@ -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>