@wayward/types 2.11.1-beta.dev.20220101.1 → 2.11.1-beta.dev.20220102.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ import { Delay, SkillType } from "game/entity/IHuman";
17
17
  import type { TurnType } from "game/entity/player/IPlayer";
18
18
  import type Player from "game/entity/player/Player";
19
19
  import type { IGameEvents, IPlayOptions, ISynchronizeState } from "game/IGame";
20
- import { SaveType, TickFlag, TurnMode } from "game/IGame";
20
+ import { SaveType, TickFlag, TurnMode, PauseSource } from "game/IGame";
21
21
  import type Island from "game/island/Island";
22
22
  import IslandManager from "game/island/IslandManager";
23
23
  import type { MultiplayerLoadingDescription } from "game/meta/Loading";
@@ -59,7 +59,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
59
59
  readonly interval = 16.6666;
60
60
  slot: number | undefined;
61
61
  absoluteTime: number;
62
- paused: boolean;
62
+ paused: Set<PauseSource>;
63
63
  playing: boolean;
64
64
  nextTickTime: number | undefined;
65
65
  lastTickTime: number | undefined;
@@ -82,6 +82,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
82
82
  private gameOptionsCached?;
83
83
  private synchronizeStateId;
84
84
  protected stringTokenizer: StringTokenizer | undefined;
85
+ get isPaused(): boolean;
85
86
  initializeRenderer(): void;
86
87
  globalSlotReady(): void;
87
88
  /**
@@ -96,7 +97,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
96
97
  resetWebGL(): void;
97
98
  setGlContextSize(width: number, height: number): void;
98
99
  resizeRenderer(): void;
99
- setPaused(paused: boolean, showChatMessage?: boolean): void;
100
+ setPaused(pause: boolean, source: PauseSource): void;
100
101
  gameLogicLoop: () => void;
101
102
  isSimulatedOrRealTimeMode(): boolean;
102
103
  getTurnMode(): TurnMode;
@@ -205,6 +205,18 @@ export declare enum CreationId {
205
205
  Item = 4,
206
206
  TileEvent = 5
207
207
  }
208
+ export declare enum PauseSource {
209
+ /**
210
+ * Used for pauses that the player will be able to turn on / off / override
211
+ */
212
+ Generic = 0,
213
+ IslandLoad = 1,
214
+ Mod = 2,
215
+ PlayerMoveToIsland = 3,
216
+ SyncGameState = 4,
217
+ WebGlContextLost = 5,
218
+ MultiplayerConnect = 6
219
+ }
208
220
  /**
209
221
  * For items and terrain that can decay, the temperature range that controls the rate of decay.
210
222
  * If not provided for items, they will always decays no matter the temperature.
@@ -201,7 +201,7 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
201
201
  * @param z The z coord to get the closest player.
202
202
  * @param canSee If set to true, check if the player can see the x/y/z coords. Defaults to false.
203
203
  */
204
- getNearestPlayer(x: number, y: number, z?: number, canSee?: boolean, includeConnecting?: boolean): {
204
+ getNearestPlayer(x: number, y: number, z?: number, canSee?: boolean, includeGhosts?: boolean, includeConnecting?: boolean): {
205
205
  player?: Player;
206
206
  distance?: number;
207
207
  };
@@ -8,10 +8,11 @@
8
8
  * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
+ import { PauseSource } from "game/IGame";
11
12
  import ClientPacket from "multiplayer/packets/ClientPacket";
12
13
  export default class PausePacket extends ClientPacket {
13
14
  paused: boolean;
14
- showChatMessage: boolean;
15
+ pauseSource: PauseSource;
15
16
  getDebugInfo(): string;
16
17
  process(): void;
17
18
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.11.1-beta.dev.20220101.1",
4
+ "version": "2.11.1-beta.dev.20220102.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",