Merge pull request #2077 from MartinFournier/feature/get-theme

Add ns.ui.getTheme() api function
This commit is contained in:
hydroflame
2021-12-21 10:57:58 -05:00
committed by GitHub
11 changed files with 154 additions and 5 deletions

View File

@@ -3741,6 +3741,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
@@ -3823,6 +3838,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.
*
@@ -5890,3 +5911,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;
}