mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
MISC: Add versionNumber to ns.ui.getGameInfo() (#2155)
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
## GameInfo.commit property
|
||||
|
||||
Git commit hash that the release was built from. E.g.: "d0d776700"
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -16,7 +16,8 @@ interface GameInfo
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [commit](./bitburner.gameinfo.commit.md) | | string | |
|
||||
| [platform](./bitburner.gameinfo.platform.md) | | string | |
|
||||
| [version](./bitburner.gameinfo.version.md) | | string | |
|
||||
| [commit](./bitburner.gameinfo.commit.md) | | string | Git commit hash that the release was built from. E.g.: "d0d776700" |
|
||||
| [platform](./bitburner.gameinfo.platform.md) | | "Browser" \| "Steam" | Platform that the game is running on |
|
||||
| [version](./bitburner.gameinfo.version.md) | | string | <p>Version as shown in release notes and in the UI. E.g.: "2.8.1"</p><p>Note that this property does not have the prefix "v". For example, with v2.8.1, this property is "2.8.1".</p> |
|
||||
| [versionNumber](./bitburner.gameinfo.versionnumber.md) | | number | Internal version number that increments during releases. E.g.: 43 |
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
|
||||
## GameInfo.platform property
|
||||
|
||||
Platform that the game is running on
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
platform: string;
|
||||
platform: "Browser" | "Steam";
|
||||
```
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
## GameInfo.version property
|
||||
|
||||
Version as shown in release notes and in the UI. E.g.: "2.8.1"
|
||||
|
||||
Note that this property does not have the prefix "v". For example, with v2.8.1, this property is "2.8.1".
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
|
||||
13
markdown/bitburner.gameinfo.versionnumber.md
Normal file
13
markdown/bitburner.gameinfo.versionnumber.md
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [GameInfo](./bitburner.gameinfo.md) > [versionNumber](./bitburner.gameinfo.versionnumber.md)
|
||||
|
||||
## GameInfo.versionNumber property
|
||||
|
||||
Internal version number that increments during releases. E.g.: 43
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
versionNumber: number;
|
||||
```
|
||||
@@ -159,17 +159,12 @@ export function NetscriptUserInterface(): InternalAPI<IUserInterface> {
|
||||
},
|
||||
|
||||
getGameInfo: () => () => {
|
||||
const version = CONSTANTS.VersionString;
|
||||
const commit = commitHash();
|
||||
const platform = navigator.userAgent.toLowerCase().includes(" electron/") ? "Steam" : "Browser";
|
||||
|
||||
const gameInfo = {
|
||||
version,
|
||||
commit,
|
||||
platform,
|
||||
return {
|
||||
version: CONSTANTS.VersionString,
|
||||
versionNumber: CONSTANTS.VersionNumber,
|
||||
commit: commitHash(),
|
||||
platform: navigator.userAgent.toLowerCase().includes(" electron/") ? "Steam" : "Browser",
|
||||
};
|
||||
|
||||
return gameInfo;
|
||||
},
|
||||
|
||||
clearTerminal: (ctx) => () => {
|
||||
|
||||
11
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
11
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -10104,9 +10104,18 @@ interface IStyleSettings {
|
||||
* @public
|
||||
*/
|
||||
interface GameInfo {
|
||||
/**
|
||||
* Version as shown in release notes and in the UI. E.g.: "2.8.1"
|
||||
*
|
||||
* Note that this property does not have the prefix "v". For example, with v2.8.1, this property is "2.8.1".
|
||||
*/
|
||||
version: string;
|
||||
/** Internal version number that increments during releases. E.g.: 43 */
|
||||
versionNumber: number;
|
||||
/** Git commit hash that the release was built from. E.g.: "d0d776700" */
|
||||
commit: string;
|
||||
platform: string;
|
||||
/** Platform that the game is running on */
|
||||
platform: "Browser" | "Steam";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user