@wayward/types 2.11.0-beta.dev.20211129.1 → 2.11.0-beta.dev.20211203.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.
@@ -87,6 +87,7 @@ export default abstract class Human extends Entity implements IHasInsulation {
87
87
  updateStatsAndAttributes(): void;
88
88
  staminaReduction(skill?: SkillType, level?: number): void;
89
89
  updateReputation(reputation: number): void;
90
+ capReputation(): void;
90
91
  setPaddling(item: Item | undefined, extinguishTorches?: boolean): void;
91
92
  /**
92
93
  * Extinguishes all torches the player is holding.
@@ -140,6 +140,12 @@ export interface IPlayerEvents extends Events<Human> {
140
140
  * @param slot The slot
141
141
  */
142
142
  equip?(item: Item, slot: EquipType): any;
143
+ /**
144
+ * Called when the players quickslots are updated
145
+ * @param quickslot The quick slot
146
+ * @param itemType The item type
147
+ */
148
+ updatedQuickslotInfo?(quickslot: number, itemType?: ItemType): any;
143
149
  /**
144
150
  * Called when input is being processed
145
151
  * @param player The player object
@@ -21,6 +21,8 @@ export interface IInfoProviderEvents {
21
21
  * Should be emitted when the info provider is starting to initialize its component.
22
22
  */
23
23
  init(component: Component): any;
24
+ /** Emitted when the info provider finishes initializing */
25
+ initDone(): any;
24
26
  /**
25
27
  * Should be emitted when the info provider has detected an update and its contents will need to be refreshed.
26
28
  */
@@ -1174,7 +1174,8 @@ export declare enum ItemTypeGroup {
1174
1174
  WispContainer = 889,
1175
1175
  Shirt = 890,
1176
1176
  Trousers = 891,
1177
- All = 892,
1178
- Last = 893
1177
+ Spine = 892,
1178
+ All = 893,
1179
+ Last = 894
1179
1180
  }
1180
1181
  export {};
@@ -13,7 +13,6 @@ import type { IContainer, IRecipe, ItemType, ItemTypeGroup } from "game/item/IIt
13
13
  import type Item from "game/item/Item";
14
14
  export default class ItemRecipeRequirementChecker {
15
15
  private readonly human;
16
- private readonly recipe?;
17
16
  private readonly trackItems?;
18
17
  private readonly cacheItems?;
19
18
  private readonly canUseItem?;
@@ -21,13 +20,14 @@ export default class ItemRecipeRequirementChecker {
21
20
  itemComponentsRequired: Item[];
22
21
  itemComponentsConsumed: Item[];
23
22
  itemComponentsCanBurn: boolean;
24
- numComponentsNeeded: number;
23
+ private numComponentsNeeded;
25
24
  private baseComponent;
26
25
  private components;
27
26
  private componentItems;
27
+ private recipe;
28
28
  private adjacentContainers;
29
29
  private readonly itemsToProcess;
30
- constructor(human: Human, recipe?: IRecipe | undefined, trackItems?: boolean | undefined, cacheItems?: boolean | undefined, canUseItem?: ((item: Item, isConsumed: boolean, forItemTypeOrGroup: ItemType | ItemTypeGroup) => boolean) | undefined);
30
+ constructor(human: Human, recipe?: IRecipe, trackItems?: boolean | undefined, cacheItems?: boolean | undefined, canUseItem?: ((item: Item, isConsumed: boolean, forItemTypeOrGroup: ItemType | ItemTypeGroup) => boolean) | undefined);
31
31
  /**
32
32
  * Returns the amount of items needed for the component
33
33
  */
@@ -45,7 +45,7 @@ export default class ItemRecipeRequirementChecker {
45
45
  * @returns true if the recipe's requirements are satisfied
46
46
  */
47
47
  process(): boolean;
48
- setRecipe(recipe: IRecipe): void;
48
+ setRecipe(recipe: IRecipe | undefined): boolean;
49
49
  /**
50
50
  * Looks around adjacent containers
51
51
  * @returns true if the recipe's requirements are satisfied
@@ -52,7 +52,7 @@ export default class ReferenceManager {
52
52
  resolve<R extends ReferenceType>(id: number, type: R): IReferenceTypeMap[R] | undefined;
53
53
  resolve(id: number, type?: ReferenceType): IReferenceTypeMap[ReferenceType] | undefined;
54
54
  inspect(id: number, type?: ReferenceType, ...args: any[]): import("../inspection/Inspection").default<any> | undefined;
55
- tooltip(id: number, type?: ReferenceType): (tooltip: import("../../ui/tooltip/Tooltip").default) => import("../../ui/tooltip/Tooltip").default | undefined;
55
+ tooltip(id: number, type?: ReferenceType): (tooltip: import("../../ui/tooltip/Tooltip").default) => Promise<void>;
56
56
  getReferenceType(thing: Value<IReferenceTypeMap>): ReferenceType;
57
57
  }
58
58
  export {};
@@ -46,6 +46,8 @@ export default abstract class BasePacket {
46
46
  protected writeUint16(value: number): void;
47
47
  protected readUint32(): number;
48
48
  protected writeUint32(value: number): void;
49
+ protected readInt16(): number;
50
+ protected writeInt16(value: number): void;
49
51
  protected readFloat32(): number;
50
52
  protected writeFloat32(value: number): void;
51
53
  protected readFloat64(): number;
@@ -110,7 +110,14 @@ declare class InputManager extends EventEmitter.Host<IInputManagerEvents> {
110
110
  */
111
111
  extractModifiers(evt: Event): Set<Modifier> | undefined;
112
112
  getCatalyst(evt: Event): InputCatalyst | undefined;
113
+ /**
114
+ * @param disabler Each `disableUntil` call should be given a unique `disabler`,
115
+ * as this system uses the timing from the latest `disableUntil` call
116
+ */
113
117
  disableUntil(until: number | Promise<any>, disabler: string): void;
118
+ /**
119
+ * @param disabler Each `disable` call should be given a unique `disabler`
120
+ */
114
121
  disable(disabler: string): boolean;
115
122
  enable(disabler: string): void;
116
123
  isDisabled(): boolean;
@@ -163,7 +163,7 @@ export default class InGameScreen extends BaseScreen {
163
163
  setQuickSlot(quickSlot: number, itemId?: number, internal?: boolean): boolean;
164
164
  setQuickSlotByItemType(quickSlot: number, itemType: ItemType, disabled: boolean, item?: Item | undefined): void;
165
165
  setQuickSlotByContextAction(quickSlot: number, action: IContextMenuAction): void;
166
- addItemToFreeQuickSlot(itemId: number): void;
166
+ addItemToFreeQuickSlot(itemId: number): boolean;
167
167
  clearQuickSlot(quickSlot: number, internal?: boolean): void;
168
168
  removeItemFromQuickSlot(itemId?: number, skipSync?: boolean): void;
169
169
  setItemQuickslot(item: Item, quickSlot: number | undefined): void;
@@ -21,7 +21,7 @@ export default abstract class InspectionsTooltipHandler<INSPECTIONS_LIST extends
21
21
  showExtraInfo?: Text;
22
22
  } | undefined;
23
23
  private lastMousePosition?;
24
- initializeTooltip(tooltip: Tooltip): Tooltip | undefined;
24
+ initializeTooltip(tooltip: Tooltip): Promise<void>;
25
25
  remove(): void;
26
26
  protected abstract initializeInspections(): INSPECTIONS_LIST | undefined;
27
27
  protected onUpdateTooltipPosition(position: Vector2): void;
@@ -37,6 +37,7 @@ export default class MapDialog extends PrerenderedCanvasDialog {
37
37
  getName(): import("../../../../../language/impl/TranslationImpl").default;
38
38
  read(map: DrawnMap, item: Item, resetView?: boolean): Promise<void>;
39
39
  protected onInventoryItemRemove(_: any, item: Item): void;
40
+ protected onToggleProtected(item: Item): void;
40
41
  protected onInventoryItemAdd(_: any, item: Item): void;
41
42
  protected onInventoryItemUpdate(_: any, item: Item): void;
42
43
  protected onPostMove(player: Player): void;
@@ -18,7 +18,7 @@ export default class TooltipManager {
18
18
  private current;
19
19
  private readonly disablers;
20
20
  constructor();
21
- show(host: HTMLElement): Tooltip | undefined;
21
+ show(host: HTMLElement, initialize?: (tooltip: Tooltip) => any): Tooltip | undefined;
22
22
  hide(host?: HTMLElement | undefined): void;
23
23
  /**
24
24
  * Disables tooltips.
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.0-beta.dev.20211129.1",
4
+ "version": "2.11.0-beta.dev.20211203.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",