@wayward/types 2.14.4-beta.dev.20250110.1 → 2.14.4-beta.dev.20250111.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.
@@ -35,7 +35,8 @@ import { type ISerializedTranslation } from "@wayward/game/language/ITranslation
35
35
  import type Translation from "@wayward/game/language/Translation";
36
36
  import type { RenderSource, UpdateRenderFlag } from "@wayward/game/renderer/IRenderer";
37
37
  import type { Renderer } from "@wayward/game/renderer/Renderer";
38
- import type { INotificationLocation, ItemNotifierType, MarkerIconType, StatNotificationType } from "@wayward/game/renderer/notifier/INotifier";
38
+ import type { INotificationLocation, ItemNotifierType, MarkerDescription, StatNotificationType } from "@wayward/game/renderer/notifier/INotifier";
39
+ import type { MarkerType } from "@wayward/game/renderer/notifier/INotifier";
39
40
  import type { IVector3 } from "@wayward/game/utilities/math/IVector";
40
41
  import type { IVector4 } from "@wayward/game/utilities/math/Vector4";
41
42
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
@@ -121,10 +122,10 @@ export default abstract class Entity<DescriptionType = unknown, TypeType extends
121
122
  * This is called clientside the first time the renderer seens the entity
122
123
  */
123
124
  onFirstRender(renderer: Renderer): void;
124
- getCurrentMarkerIconType(): MarkerIconType | undefined;
125
+ getCurrentMarkerType(): MarkerType | undefined;
125
126
  setMarkerIconHidden(hidden: boolean): void;
126
- addMarkerIcon(type: MarkerIconType): void;
127
- removeMarkerIcon(...types: MarkerIconType[]): void;
127
+ addMarker(description: MappedOmit<MarkerDescription, "guid">): void;
128
+ removeMarker(...types: MarkerType[]): void;
128
129
  getProducedTemperature(): number | undefined;
129
130
  setName(renamed: string | ISerializedTranslation | undefined): void;
130
131
  canInspect(human: Human): boolean;
@@ -103,6 +103,10 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
103
103
  private _minDur?;
104
104
  private _maxDur?;
105
105
  get zone(): CreatureZone;
106
+ /**
107
+ * Gets the tier of the zone the tile is in
108
+ */
109
+ get zoneTier(): number;
106
110
  /**
107
111
  * Creates a fake tile
108
112
  */
@@ -12,7 +12,7 @@ import type { CreatureType } from "@wayward/game/game/entity/creature/ICreature"
12
12
  import type { StatusChangeReason } from "@wayward/game/game/entity/IEntity";
13
13
  import type Status from "@wayward/game/game/entity/status/Status";
14
14
  import type { DisplayableItemType } from "@wayward/game/game/item/IItem";
15
- import type { INotificationLocation, NotifierIconType, ItemNotifierType, CreatureNotifierType, MarkerIconType } from "@wayward/game/renderer/notifier/INotifier";
15
+ import type { INotificationLocation, NotifierIconType, ItemNotifierType, CreatureNotifierType, MarkerDescription } from "@wayward/game/renderer/notifier/INotifier";
16
16
  import { StatNotificationType } from "@wayward/game/renderer/notifier/INotifier";
17
17
  import type Renderers from "@wayward/game/renderer/Renderers";
18
18
  export declare class RenderersNotifiers {
@@ -25,6 +25,6 @@ export declare class RenderersNotifiers {
25
25
  addStatus(location: INotificationLocation, status: Status, reason: StatusChangeReason): void;
26
26
  addItem(location: INotificationLocation, itemNotifierType: ItemNotifierType, type: DisplayableItemType): void;
27
27
  addCreature(location: INotificationLocation, creatureNotifierType: CreatureNotifierType, type: CreatureType, aberrant?: boolean): void;
28
- addMarker(location: INotificationLocation, markerType: MarkerIconType, markerGuid: string): void;
28
+ addMarker(location: INotificationLocation, marker: MarkerDescription): void;
29
29
  removeMarker(location: INotificationLocation, guid: string): void;
30
30
  }
@@ -9,8 +9,10 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import type { SfxType } from "@wayward/game/audio/IAudio";
12
+ import type { ItemType } from "@wayward/game/game/item/IItem";
12
13
  import type { IVector2 } from "@wayward/game/utilities/math/IVector";
13
14
  import type { IVector4 } from "@wayward/game/utilities/math/Vector4";
15
+ import type { IRGB } from "@wayward/utilities/Color";
14
16
  export interface INotificationLocation extends IVector4 {
15
17
  getMovementPoint?(timeStamp: number): IVector2;
16
18
  getMovementProgress?(timeStamp: number): number;
@@ -53,10 +55,43 @@ export declare enum NotifierIconType {
53
55
  DualWieldEnabled = 7,
54
56
  DualWieldDisabled = 8
55
57
  }
56
- export declare enum MarkerIconType {
58
+ export declare enum MarkerType {
57
59
  Tamed = 0,
58
60
  AlertedHostile = 1,
59
- AlertedScared = 2
61
+ AlertedScared = 2,
62
+ Text = 3,
63
+ Item = 4
60
64
  }
65
+ export interface IBaseMarkerDescription {
66
+ guid: string;
67
+ size?: number;
68
+ offsetY?: number;
69
+ }
70
+ /**
71
+ * Specific sprite icons
72
+ */
73
+ export interface ISpriteMarkerDescription extends IBaseMarkerDescription {
74
+ type: MarkerType.Tamed | MarkerType.AlertedHostile | MarkerType.AlertedScared;
75
+ }
76
+ /**
77
+ * Item icon
78
+ */
79
+ export interface IItemMarkerDescription extends IBaseMarkerDescription {
80
+ type: MarkerType.Item;
81
+ itemType: ItemType;
82
+ }
83
+ /**
84
+ * Generic text.
85
+ * This won't actually work because our text.png sprite only has numbers
86
+ */
87
+ export interface ITextMarkerDescription extends IBaseMarkerDescription {
88
+ type: MarkerType.Text;
89
+ text: string;
90
+ textColor: IRGB;
91
+ }
92
+ /**
93
+ * This value may be saved into Entity._persistentMarker!
94
+ */
95
+ export type MarkerDescription = ISpriteMarkerDescription | ITextMarkerDescription | IItemMarkerDescription;
61
96
  export declare const itemDamageNotifierThreshold = 3;
62
97
  export declare const doodadDamageNotifierThreshold = 5;
@@ -13,7 +13,7 @@ import { StatusChangeReason } from "@wayward/game/game/entity/IEntity";
13
13
  import type Status from "@wayward/game/game/entity/status/Status";
14
14
  import type { DisplayableItemType } from "@wayward/game/game/item/IItem";
15
15
  import type { IRendererContext } from "@wayward/game/renderer/context/IRendererContext";
16
- import type { INotificationLocation, MarkerIconType } from "@wayward/game/renderer/notifier/INotifier";
16
+ import type { INotificationLocation, MarkerDescription } from "@wayward/game/renderer/notifier/INotifier";
17
17
  import { CreatureNotifierType, ItemNotifierType, NotifierIconType, StatNotificationType } from "@wayward/game/renderer/notifier/INotifier";
18
18
  import type { IResourceContainer } from "@wayward/game/renderer/resources/IResourceContainer";
19
19
  export declare class Notifier {
@@ -37,7 +37,7 @@ export declare class Notifier {
37
37
  addStat(location: INotificationLocation, type: StatNotificationType, value: number): void;
38
38
  addStatus(location: INotificationLocation, status: Status, reason: StatusChangeReason): void;
39
39
  addNotifierIcon(location: INotificationLocation, type: NotifierIconType): void;
40
- addMarker(location: INotificationLocation, type: MarkerIconType, markerGuid: string): void;
40
+ addMarker(location: INotificationLocation, marker: MarkerDescription): void;
41
41
  removeMarker(guid: string): void;
42
42
  suspend(): void;
43
43
  resume(): void;
@@ -143,7 +143,8 @@ export declare class WorldRenderer extends EventEmitter.Host<IWorldRendererEvent
143
143
  private creatureFlyingBatch;
144
144
  private overlayBatch;
145
145
  private vehicleBatch;
146
- private readonly entitiesInViewport;
146
+ private readonly entitiesToRenderInViewport;
147
+ private readonly doodadsToNotRenderInViewport;
147
148
  /**
148
149
  * A set of entities seen before (rendered on screen at least once)
149
150
  */
@@ -8,9 +8,19 @@
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 { Quality } from "@wayward/game/game/IObject";
11
12
  import type { ILoadOnIslandOptions } from "@wayward/game/game/entity/IHuman";
12
13
  import type Island from "@wayward/game/game/island/Island";
14
+ import type { DisplayableItemType } from "@wayward/game/game/item/IItem";
13
15
  import SpriteEditor from "@wayward/game/ui/screen/screens/game/util/item/SpriteEditor";
16
+ declare enum Type {
17
+ Normal = 0,
18
+ Dim = 1,
19
+ Highlight = 2
20
+ }
21
+ type BackgroundIDTypeSuffix = `` | `-${Lowercase<keyof typeof Type>}`;
22
+ type BackgroundIDQuality = Lowercase<Exclude<keyof typeof Quality, "None" | "Random">>;
23
+ type BackgroundID = `default${BackgroundIDTypeSuffix}` | `quality-${BackgroundIDQuality}${BackgroundIDTypeSuffix}` | `damaged${BackgroundIDTypeSuffix}` | `trading${BackgroundIDTypeSuffix}` | `non-craftable` | `discovery-active` | `non-craftable-discovery`;
14
24
  export default class ItemStylesheetHandler {
15
25
  private readonly backgroundDefinitions;
16
26
  readonly editor: SpriteEditor;
@@ -28,6 +38,7 @@ export default class ItemStylesheetHandler {
28
38
  * Append items for the specified stage to the stylesheet.
29
39
  */
30
40
  private appendStylesheetsStage;
41
+ getItemSprite(backgroundID: BackgroundID, item: DisplayableItemType, abortSignal?: AbortSignal, itemPath?: string): Promise<string | undefined>;
31
42
  /**
32
43
  * Appends an array of item types to the specified stylesheet.
33
44
  * This no-ops for items that were already appended to the sheet.
@@ -38,3 +49,4 @@ export default class ItemStylesheetHandler {
38
49
  private getCSSColor;
39
50
  private getItemTypes;
40
51
  }
52
+ export {};
@@ -19,6 +19,9 @@ interface PartialUnionizer<TYPES extends any[]> {
19
19
  }
20
20
  declare global {
21
21
  type PartialUnion<TYPES extends any[]> = TYPES[number] & PartialUnionizer<TYPES>[Extract<TYPES["length"], keyof PartialUnionizer<TYPES>>];
22
+ type MappedOmit<T, K extends keyof T> = {
23
+ [P in keyof T as P extends K ? never : P]: T[P];
24
+ };
22
25
  }
23
26
  declare const _default: {};
24
27
  export default _default;
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.14.4-beta.dev.20250110.1",
4
+ "version": "2.14.4-beta.dev.20250111.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",