Add ns.ui.getTheme() api function

This commit is contained in:
Martin Fournier
2021-12-20 13:38:21 -05:00
parent 25f78f2b30
commit 65d0877edc
11 changed files with 154 additions and 5 deletions
+63
View File
@@ -3739,6 +3739,21 @@ interface Stanek {
remove(rootX: number, rootY: number): boolean;
}
/**
* User Interface API.
* @public
*/
interface UserInterface {
/**
* Get the current theme
* @remarks
* RAM cost: cost: 0 GB
*
* @returns An object containing the theme's colors
*/
getTheme(): UserInterfaceTheme;
}
/**
* Collection of all functions passed to scripts
* @public
@@ -3821,6 +3836,12 @@ export interface NS extends Singularity {
*/
readonly corporation: Corporation;
/**
* Namespace for user interface functions.
* RAM cost: 0 GB
*/
readonly ui: UserInterface;
/**
* Arguments passed into the script.
*
@@ -5882,3 +5903,45 @@ interface Division {
/** Cities in which this division has expanded */
cities: string[];
}
/**
* Interface Theme
* @internal
*/
interface UserInterfaceTheme {
[key: string]: string | undefined;
primarylight: string;
primary: string;
primarydark: string;
successlight: string;
success: string;
successdark: string;
errorlight: string;
error: string;
errordark: string;
secondarylight: string;
secondary: string;
secondarydark: string;
warninglight: string;
warning: string;
warningdark: string;
infolight: string;
info: string;
infodark: string;
welllight: string;
well: string;
white: string;
black: string;
hp: string;
money: string;
hack: string;
combat: string;
cha: string;
int: string;
rep: string;
disabled: string;
backgroundprimary: string;
backgroundsecondary: string;
button: string;
}