@wayward/types 2.12.0-beta.dev.20220826.1 → 2.12.0-beta.dev.20220827.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.
- package/definitions/game/game/entity/Human.d.ts +1 -1
- package/definitions/game/game/entity/action/ActionExecutor.d.ts +7 -2
- package/definitions/game/game/entity/action/ActionsRegistration.d.ts +1 -3
- package/definitions/game/game/entity/action/IAction.d.ts +5 -11
- package/definitions/game/game/entity/action/actions/Craft.d.ts +6 -1
- package/definitions/game/game/entity/action/actions/PromptResponse.d.ts +1 -1
- package/definitions/game/game/entity/action/actions/helper/ConfirmItemOnFire.d.ts +2 -6
- package/definitions/game/game/entity/action/actions/helper/ConfirmOnFire.d.ts +2 -6
- package/definitions/game/game/entity/action/usable/UsableAction.d.ts +90 -3
- package/definitions/game/game/entity/action/usable/UsableActionRegistrar.d.ts +5 -1
- package/definitions/game/game/entity/action/usable/actions/UsableActionsMain.d.ts +50 -2
- package/definitions/game/game/entity/action/usable/actions/UsableActionsMisc.d.ts +13 -0
- package/definitions/game/game/entity/action/usable/actions/item/UsableActionsItemMisc.d.ts +13 -0
- package/definitions/game/game/entity/creature/ICreature.d.ts +2 -1
- package/definitions/game/game/entity/player/Player.d.ts +6 -0
- package/definitions/game/game/inspection/infoProviders/item/ItemDetails.d.ts +1 -1
- package/definitions/game/game/inspection/infoProviders/stat/AttackInfo.d.ts +1 -1
- package/definitions/game/game/inspection/inspections/CorpseInspection.d.ts +1 -1
- package/definitions/game/game/item/Item.d.ts +0 -9
- package/definitions/game/game/item/ItemRecipeRequirementChecker.d.ts +2 -0
- package/definitions/game/game/mapping/SavedTilesSerializer.d.ts +1 -1
- package/definitions/game/game/meta/prompt/IPrompt.d.ts +1 -1
- package/definitions/game/game/meta/prompt/PromptDescriptionFactory.d.ts +3 -1
- package/definitions/game/game/reference/ReferenceManager.d.ts +1 -1
- package/definitions/game/language/Dictionary.d.ts +4 -4
- package/definitions/game/language/DictionaryMap.d.ts +8 -8
- package/definitions/game/language/dictionary/Message.d.ts +2 -2
- package/definitions/game/language/impl/TranslationImpl.d.ts +3 -1
- package/definitions/game/mod/ModRegistry.d.ts +18 -2
- package/definitions/game/multiplayer/packets/client/PromptPacket.d.ts +3 -3
- package/definitions/game/renderer/world/World.d.ts +1 -1
- package/definitions/game/replay/ReplayLogEntry.d.ts +1 -1
- package/definitions/game/save/serializer/ISerializer.d.ts +1 -1
- package/definitions/game/ui/old/IOldUi.d.ts +0 -18
- package/definitions/game/ui/old/OldUi.d.ts +0 -9
- package/definitions/game/ui/old/screens/InGameScreen.d.ts +3 -65
- package/definitions/game/ui/screen/screens/game/static/ActionBar.d.ts +2 -1
- package/definitions/game/utilities/collection/map/DefaultMap.d.ts +1 -1
- package/definitions/game/utilities/math/Vector2.d.ts +1 -1
- package/definitions/game/utilities/math/Vector3.d.ts +1 -1
- package/definitions/test/core/applicationInteractions.d.ts +4 -7
- package/definitions/test/interfaces.d.ts +5 -0
- package/package.json +1 -1
- package/definitions/game/game/entity/action/actions/ActionConfirmerResponse.d.ts +0 -17
- package/definitions/game/game/entity/action/actions/UpdateItemQuickSlot.d.ts +0 -14
- package/definitions/game/multiplayer/packets/client/ActionConfirmerPacket.d.ts +0 -27
|
@@ -147,7 +147,7 @@ export default abstract class Human extends Entity implements IHasInsulation {
|
|
|
147
147
|
loadUi(): void;
|
|
148
148
|
startResting(restData: IRestData): void;
|
|
149
149
|
cancelResting(reason: RestCancelReason): boolean;
|
|
150
|
-
|
|
150
|
+
resetMovementIntent(): void;
|
|
151
151
|
createItemInInventory(itemType: ItemType | ItemTypeGroup | Array<ItemType | ItemTypeGroup>, quality?: Quality, updateTables?: boolean): Item;
|
|
152
152
|
damageRandomEquipment(): void;
|
|
153
153
|
getDamageModifier(): number;
|
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { SfxType } from "audio/IAudio";
|
|
12
12
|
import EventEmitter from "event/EventEmitter";
|
|
13
|
-
import type { AnyActionDescription, IActionApi, IActionArgumentTypeMap, IActionDescription, IActionHandlerApi, IActionNotUsable, IActionParticle, IActionSoundEffect, IActionUsable } from "game/entity/action/IAction";
|
|
13
|
+
import type { AnyActionDescription, IActionApi, IActionArgumentTypeMap, IActionConfirmerApi, IActionDescription, IActionHandlerApi, IActionNotUsable, IActionParticle, IActionSoundEffect, IActionUsable } from "game/entity/action/IAction";
|
|
14
14
|
import { ActionArgument, ActionType } from "game/entity/action/IAction";
|
|
15
15
|
import type Entity from "game/entity/Entity";
|
|
16
16
|
import type { SkillType } from "game/entity/IHuman";
|
|
17
17
|
import type { TurnType } from "game/entity/player/IPlayer";
|
|
18
18
|
import type Item from "game/item/Item";
|
|
19
|
+
import type { IPromptDescriptionBase, PromptDescriptionArgs } from "game/meta/prompt/IPrompt";
|
|
19
20
|
import { Milestone } from "game/milestones/IMilestone";
|
|
20
21
|
import type { ITile } from "game/tile/ITerrain";
|
|
21
22
|
import ActionPacket from "multiplayer/packets/shared/ActionPacket";
|
|
@@ -35,7 +36,7 @@ interface ActionEvents {
|
|
|
35
36
|
*/
|
|
36
37
|
postExecuteAction(actionType: ActionType, actionApi: IActionHandlerApi<any, any>, args: any[]): any;
|
|
37
38
|
}
|
|
38
|
-
export default class ActionExecutor<A extends Array<ActionArgument | ActionArgument[]>, E extends Entity, R, CU extends IActionUsable, AV extends any[]> extends EventEmitter.Host<ActionEvents> implements IActionApi<E, CU> {
|
|
39
|
+
export default class ActionExecutor<A extends Array<ActionArgument | ActionArgument[]>, E extends Entity, R, CU extends IActionUsable, AV extends any[]> extends EventEmitter.Host<ActionEvents> implements IActionApi<E, CU>, IActionConfirmerApi<E, CU> {
|
|
39
40
|
/**
|
|
40
41
|
* Gets an action by its description. If you're using the Action class for constructing the descriptions, just pass the action instance.
|
|
41
42
|
*
|
|
@@ -99,6 +100,10 @@ export default class ActionExecutor<A extends Array<ActionArgument | ActionArgum
|
|
|
99
100
|
private processNotUsableResult;
|
|
100
101
|
execute(actionApiOrExecutor: IActionApi<E, CU> | E, ...args: AV): R | Promise<R>;
|
|
101
102
|
executeConfirmer(actionApiOrExecutor: IActionApi<E, CU> | E, args: AV, argumentTypes?: ActionArgument[]): Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Prompts the user about something
|
|
105
|
+
*/
|
|
106
|
+
prompt<PROMPT extends IPromptDescriptionBase<any[]>>(prompt: PROMPT, ...args: PromptDescriptionArgs<PROMPT>): Promise<boolean>;
|
|
102
107
|
isArgumentType<AA extends ActionArgument>(argument: any, index: number, argumentType: AA): argument is IActionArgumentTypeMap[AA];
|
|
103
108
|
setDelay(delay: number, replace?: boolean): this;
|
|
104
109
|
setPassTurn(turnType?: TurnType): this;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const actionDescriptionsSlow: {
|
|
16
16
|
109: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory, [import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Absorb").IAbsorbCanUse, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
|
|
17
|
-
113: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.Integer32, import("game/entity/action/IAction").ActionArgument.Boolean], import("../player/Player").default, void, import("game/entity/action/IAction").IActionUsable, [number, boolean]>;
|
|
18
17
|
51: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../Human").default, void, import("game/entity/action/actions/AddFuel").IAddFuelCanUse, [import("../../item/Item").default, import("../../item/Item").default]>;
|
|
19
18
|
95: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory, [import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Alter").IAlterCanUse, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
|
|
20
19
|
75: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../Human").default, void, import("./actions/ConsumeItem").IConsumeItemCanUse, [import("../../item/Item").default]>;
|
|
@@ -27,7 +26,7 @@ export declare const actionDescriptionsSlow: {
|
|
|
27
26
|
71: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.Container, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/ToggleContainer").IToggleContainerCanUse, [(import("../../item/IItem").IContainer | undefined)?, (boolean | undefined)?]>;
|
|
28
27
|
50: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.Doodad, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, true | undefined, import("game/entity/action/actions/ToggleDoor").IToggleDoorCanUse, [(import("../../doodad/Doodad").default | undefined)?]>;
|
|
29
28
|
26: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [import("../../item/Item").default]>;
|
|
30
|
-
66: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemType, import("game/entity/action/IAction").ActionArgument.ItemArrayNearby, import("game/entity/action/IAction").ActionArgument.ItemArrayNearby, [import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Craft").ICraftCanUse, [import("../../item/IItem").ItemType, import("../../item/Item").default[]
|
|
29
|
+
66: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemType, [import("game/entity/action/IAction").ActionArgument.ItemArrayNearby, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.ItemArrayNearby, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Craft").ICraftCanUse, [import("../../item/IItem").ItemType, (import("../../item/Item").default[] | undefined)?, (import("../../item/Item").default[] | undefined)?, (import("../../item/Item").default | undefined)?, (boolean | undefined)?]>;
|
|
31
30
|
32: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby], import("../Human").default, void, import("./actions/ConsumeItem").IConsumeItemCanUse, [import("../../item/Item").default]>;
|
|
32
31
|
79: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.Doodad, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/DetachContainer").IDetachContainerCanUse, [(import("../../doodad/Doodad").default | undefined)?]>;
|
|
33
32
|
13: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Dig").IDigGenericCanUse | import("game/entity/action/actions/Dig").IDigTileCanUse, [(import("../../item/Item").default | undefined)?]>;
|
|
@@ -141,7 +140,6 @@ export declare const actionDescriptionsSlow: {
|
|
|
141
140
|
}, [import("../../../utilities/math/Direction").Direction.None | import("../../../utilities/math/Direction").Direction.East | import("../../../utilities/math/Direction").Direction.North | import("../../../utilities/math/Direction").Direction.West | import("../../../utilities/math/Direction").Direction.South, (number | undefined)?]>;
|
|
142
141
|
106: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.Object], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [any?]>;
|
|
143
142
|
90: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.Container, [import("game/entity/action/IAction").ActionArgument.UnsignedInteger32NumberArray, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [import("../../item/IItem").IContainer, (number[] | undefined)?]>;
|
|
144
|
-
97: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.Item, import("game/entity/action/IAction").ActionArgument.Integer32, [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [import("../../item/Item").default, number, (boolean | undefined)?]>;
|
|
145
143
|
105: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.String, import("game/entity/action/IAction").ActionArgument.Object], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [string, any?]>;
|
|
146
144
|
107: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.Vector2Array, import("game/entity/action/IAction").ActionArgument.Undefined], [import("game/entity/action/IAction").ActionArgument.Boolean, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/IAction").IActionUsable, [(import("../../../utilities/math/IVector").IVector2[] | undefined)?, (boolean | undefined)?]>;
|
|
147
145
|
92: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemNearby, [import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default, void, import("game/entity/action/actions/Upgrade").IUpgradeCanUse, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
|
|
@@ -27,6 +27,7 @@ import type Island from "game/island/Island";
|
|
|
27
27
|
import type { IContainer, ItemType } from "game/item/IItem";
|
|
28
28
|
import type Item from "game/item/Item";
|
|
29
29
|
import type { RecipeType } from "game/item/recipe/RecipeRegistry";
|
|
30
|
+
import type { IPromptDescriptionBase, PromptDescriptionArgs } from "game/meta/prompt/IPrompt";
|
|
30
31
|
import type { Milestone } from "game/milestones/IMilestone";
|
|
31
32
|
import type { ITile } from "game/tile/ITerrain";
|
|
32
33
|
import type TileEvent from "game/tile/TileEvent";
|
|
@@ -133,7 +134,7 @@ export declare enum ActionType {
|
|
|
133
134
|
Shoot = 94,
|
|
134
135
|
Alter = 95,
|
|
135
136
|
SailToIsland = 96,
|
|
136
|
-
|
|
137
|
+
Unused1 = 97,
|
|
137
138
|
RenameIsland = 98,
|
|
138
139
|
Chop = 99,
|
|
139
140
|
Mine = 100,
|
|
@@ -148,8 +149,7 @@ export declare enum ActionType {
|
|
|
148
149
|
Absorb = 109,
|
|
149
150
|
Exude = 110,
|
|
150
151
|
PackGround = 111,
|
|
151
|
-
ToggleTilled = 112
|
|
152
|
-
ActionConfirmerResponse = 113
|
|
152
|
+
ToggleTilled = 112
|
|
153
153
|
}
|
|
154
154
|
export declare enum ActionUsability {
|
|
155
155
|
Paused = 0,
|
|
@@ -293,15 +293,9 @@ export interface IActionHandlerApi<E extends Entity = Entity, CU extends IAction
|
|
|
293
293
|
}
|
|
294
294
|
export interface IActionConfirmerApi<E extends Entity = Entity, CU extends IActionUsable = IActionUsable> extends IActionApi<E, CU> {
|
|
295
295
|
/**
|
|
296
|
-
*
|
|
297
|
-
* called from the `confirmer` of the action, a confirmation dialog will be shown asking if you want to
|
|
298
|
-
* proceed with the action.
|
|
299
|
-
*
|
|
300
|
-
* Note: This is called automatically if items are added in the `preExecutionHandler`. This should only be used in
|
|
301
|
-
* a custom confirmer if new items are added to the action here, and items *aren't* added in the `preExecutionHandler`.
|
|
302
|
-
* Otherwise the player could get two confirmations, and that's annoying.
|
|
296
|
+
* Prompts the user about something
|
|
303
297
|
*/
|
|
304
|
-
|
|
298
|
+
prompt<PROMPT extends IPromptDescriptionBase<any[]>>(prompt: PROMPT, ...args: PromptDescriptionArgs<PROMPT>): Promise<boolean>;
|
|
305
299
|
}
|
|
306
300
|
export interface IActionSoundEffect {
|
|
307
301
|
type: SfxType;
|
|
@@ -12,8 +12,13 @@ import { Action } from "game/entity/action/Action";
|
|
|
12
12
|
import type { IActionUsable } from "game/entity/action/IAction";
|
|
13
13
|
import { ActionArgument } from "game/entity/action/IAction";
|
|
14
14
|
import type { IRequirementInfo } from "game/item/IItemManager";
|
|
15
|
+
import type Item from "game/item/Item";
|
|
15
16
|
export interface ICraftCanUse extends IActionUsable {
|
|
16
17
|
requirementInfo: IRequirementInfo;
|
|
18
|
+
componentsRequired: Item[];
|
|
19
|
+
componentsConsumed: Item[];
|
|
20
|
+
baseComponent: Item | undefined;
|
|
21
|
+
canBurn: boolean;
|
|
17
22
|
}
|
|
18
|
-
declare const _default: Action<[ActionArgument.ItemType, ActionArgument.ItemArrayNearby, ActionArgument.ItemArrayNearby, [ActionArgument.ItemNearby, ActionArgument.Undefined], [ActionArgument.Boolean, ActionArgument.Undefined]], import("../../Human").default, void, ICraftCanUse, [import("../../../item/IItem").ItemType,
|
|
23
|
+
declare const _default: Action<[ActionArgument.ItemType, [ActionArgument.ItemArrayNearby, ActionArgument.Undefined], [ActionArgument.ItemArrayNearby, ActionArgument.Undefined], [ActionArgument.ItemNearby, ActionArgument.Undefined], [ActionArgument.Boolean, ActionArgument.Undefined]], import("../../Human").default, void, ICraftCanUse, [import("../../../item/IItem").ItemType, (Item[] | undefined)?, (Item[] | undefined)?, (Item | undefined)?, (boolean | undefined)?]>;
|
|
19
24
|
export default _default;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { Action } from "game/entity/action/Action";
|
|
12
12
|
import { ActionArgument } from "game/entity/action/IAction";
|
|
13
13
|
import type Player from "game/entity/player/Player";
|
|
14
|
-
import { Prompt } from "game/meta/prompt/IPrompt";
|
|
14
|
+
import type { Prompt } from "game/meta/prompt/IPrompt";
|
|
15
15
|
import type InterruptChoice from "language/dictionary/InterruptChoice";
|
|
16
16
|
declare const _default: Action<[ActionArgument.Integer32, [ActionArgument.Boolean, ActionArgument.Integer32]], Player, void, import("game/entity/action/IAction").IActionUsable, [number, number | boolean]>;
|
|
17
17
|
export default _default;
|
|
@@ -8,10 +8,6 @@
|
|
|
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 type { IActionConfirmerApi } from "game/entity/action/IAction";
|
|
11
12
|
import type Human from "game/entity/Human";
|
|
12
|
-
export default function (
|
|
13
|
-
WITH?: (string | import("../../../../../language/ITranslation").ISerializedTranslation | import("../../../../../language/impl/TranslationImpl").default) | undefined;
|
|
14
|
-
ACTION: string | import("../../../../../language/ITranslation").ISerializedTranslation | import("../../../../../language/impl/TranslationImpl").default;
|
|
15
|
-
AMOUNT: number;
|
|
16
|
-
LAVA?: true | undefined;
|
|
17
|
-
}]>>;
|
|
13
|
+
export default function (action: IActionConfirmerApi<Human>, all: boolean): true | Promise<boolean>;
|
|
@@ -8,13 +8,9 @@
|
|
|
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 type { IActionConfirmerApi } from "game/entity/action/IAction";
|
|
11
12
|
import type Human from "game/entity/Human";
|
|
12
13
|
import type { ITile } from "game/tile/ITerrain";
|
|
13
14
|
import type Message from "language/dictionary/Message";
|
|
14
15
|
import Translation from "language/Translation";
|
|
15
|
-
export default function (
|
|
16
|
-
WITH?: (string | import("../../../../../language/ITranslation").ISerializedTranslation | import("../../../../../language/impl/TranslationImpl").default) | undefined;
|
|
17
|
-
ACTION: string | import("../../../../../language/ITranslation").ISerializedTranslation | import("../../../../../language/impl/TranslationImpl").default;
|
|
18
|
-
AMOUNT: number;
|
|
19
|
-
LAVA?: true | undefined;
|
|
20
|
-
}]>>;
|
|
16
|
+
export default function (action: IActionConfirmerApi<Human>, tile: ITile, thing: Translation | undefined, message: Message): true | Promise<boolean>;
|
|
@@ -113,19 +113,93 @@ export interface IUsableActionExecutionContext {
|
|
|
113
113
|
}
|
|
114
114
|
export interface IUsableActionDefinitionBase<REQUIREMENTS extends IUsableActionRequirements = IUsableActionRequirements> {
|
|
115
115
|
id?: string | number;
|
|
116
|
+
/**
|
|
117
|
+
* Whether this action can be slotted in the action bar. Defaults to `true`.
|
|
118
|
+
*/
|
|
116
119
|
slottable?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Whether this action is "applicable" given this player and these "provided" objects.
|
|
122
|
+
* @param player The player executing this action. This isn't always the local player!
|
|
123
|
+
* @param using What the player is using — items, doodads, etc.
|
|
124
|
+
*/
|
|
117
125
|
isApplicable?(player: Player, using: IUsableActionPossibleUsing): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* A handler for registering translations for the action's name, description, etc.
|
|
128
|
+
*/
|
|
118
129
|
translate?: (translator: UsableActionTranslator) => UsableActionTranslator;
|
|
130
|
+
/**
|
|
131
|
+
* The icon this action should have, if any.
|
|
132
|
+
*/
|
|
119
133
|
icon?: UsableActionIconReference;
|
|
134
|
+
/**
|
|
135
|
+
* Where the icon should appear, when slotted with an item. Defaults to bottom right.
|
|
136
|
+
*
|
|
137
|
+
* Generally, top left means "something else interacting with the slotted item" rather than "the slotted item interacting with something."
|
|
138
|
+
* For example, "Harvest" shows in bottom right, because it's using this tool to harvest. Whereas "Repair With X" shows in top left,
|
|
139
|
+
* because it's repairing this tool.
|
|
140
|
+
*/
|
|
120
141
|
iconLocationOnItem?: ItemDetailIconLocation;
|
|
142
|
+
/**
|
|
143
|
+
* The tooltip this action should have, or an initialiser for it.
|
|
144
|
+
*/
|
|
121
145
|
tooltip?: ActionType | ((tooltip: Tooltip) => any);
|
|
146
|
+
/**
|
|
147
|
+
* A handler for what this action will highlight when hovered with the mouse.
|
|
148
|
+
* @param selectors The default selectors. The defaults can be removed, and/or additional selectors can be added.
|
|
149
|
+
* @param using What this action is using. Item, doodad, etc.
|
|
150
|
+
*/
|
|
122
151
|
highlight?(selectors: HighlightSelector[], using: IUsableActionPossibleUsing): any;
|
|
152
|
+
/**
|
|
153
|
+
* The bindable assigned to this action, for use in action context menus (ie, right clicking on the world or an item.)
|
|
154
|
+
* Allows for a dynamically generated bindable based on what this action is using — item, doodad, etc.
|
|
155
|
+
*/
|
|
123
156
|
bindable?: Bindable | ((using: IUsableActionUsing<REQUIREMENTS>) => Bindable | undefined);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
157
|
+
/**
|
|
158
|
+
* The contexts this action appears in.
|
|
159
|
+
* - "Always" means whenever an action of this type is shown, it will be. For example, the "item actions" menu.
|
|
160
|
+
* - "Direct" means whenever an action of this type is applicable to given objects, it will be. For example, a specific item's menu.
|
|
161
|
+
* - "Never" means it will never be shown in menus. This results in an action which is executable but never appears in menus.
|
|
162
|
+
*/
|
|
127
163
|
displayLevel?: ActionDisplayLevel;
|
|
164
|
+
/**
|
|
165
|
+
* The display order of this action compared to other actions.
|
|
166
|
+
* Generally you want to leave this as 0 (default) and just register your action in the correct place.
|
|
167
|
+
* Order can be generated dynamically based on the given objects — item, doodad, etc.
|
|
168
|
+
*/
|
|
128
169
|
order?: number | ((using: IUsableActionPossibleUsing) => number | undefined);
|
|
170
|
+
/**
|
|
171
|
+
* Whether this action is currently usable — even if an action "makes sense" with the player and the objects they're using,
|
|
172
|
+
* and the player can slot it and stuff, it might not currently be usable. For example, "harvest" having nothing to harvest.
|
|
173
|
+
* @param player The player executing this action. This isn't always the local player!
|
|
174
|
+
* @param using What the player is using — items, doodads, etc.
|
|
175
|
+
*/
|
|
176
|
+
isUsable?(player: Player, using: IUsableActionUsing<REQUIREMENTS>): ReturnableUsableActionUsability;
|
|
177
|
+
/**
|
|
178
|
+
* Marks this "action" as a submenu container instead of an executable. Is a generator for the submenu.
|
|
179
|
+
* @param registrar The registrar that submenu actions should be appended to.
|
|
180
|
+
* @param using What this action is using. Item, doodad, etc.
|
|
181
|
+
*/
|
|
182
|
+
submenu?(registrar: UsableActionRegistrar, using: IUsableActionUsing<REQUIREMENTS>): UsableActionRegistrar | void;
|
|
183
|
+
/**
|
|
184
|
+
* Executes this action. Generally, this is where you want to execute an internal action registered with `@Register.action`,
|
|
185
|
+
* as internal actions are called on all sides, rather than only clientside*.
|
|
186
|
+
*
|
|
187
|
+
* ***Warning:** While usable actions appear to only ever be client-side, they're *not always.*
|
|
188
|
+
* The "use when moving" feature for action slots results in actions being executed *only* on the server's side.
|
|
189
|
+
* **If you try to perform a client-side UI function here, such as showing a prompt, and a player puts the action in a "use when moving" action slot,
|
|
190
|
+
* the host will receive the prompt instead!**
|
|
191
|
+
*
|
|
192
|
+
* If you'd like to execute some things on clientside, you can check if the player is the local player by checking `if (player.asLocalPlayer)`,
|
|
193
|
+
* or ensure that this action is only executed clientside by setting `clientSide: true`, which disables support for the "use when moving" feature.
|
|
194
|
+
* @param player The player executing this action. This isn't always the local player!
|
|
195
|
+
* @param using What the player is using — items, doodads, etc.
|
|
196
|
+
* @param context Context to do with this action execution — where it's executed from, etc.
|
|
197
|
+
*/
|
|
198
|
+
execute?(player: Player, using: IUsableActionUsing<REQUIREMENTS>, context: IUsableActionExecutionContext): any;
|
|
199
|
+
/**
|
|
200
|
+
* Marks this usable action as only executable client-side. This disables support for "use when moving" in action slots.
|
|
201
|
+
*/
|
|
202
|
+
clientSide?: true;
|
|
129
203
|
}
|
|
130
204
|
export interface IUsableActionDefinitionSubmenu<REQUIREMENTS extends IUsableActionRequirements = IUsableActionRequirements> extends IUsableActionDefinitionBase<REQUIREMENTS> {
|
|
131
205
|
submenu(registrar: UsableActionRegistrar, using: IUsableActionUsing<REQUIREMENTS>): UsableActionRegistrar | void;
|
|
@@ -141,6 +215,19 @@ export interface IUsableActionDefinitionExecutable<REQUIREMENTS extends IUsableA
|
|
|
141
215
|
}
|
|
142
216
|
export declare type IUsableActionDefinition<REQUIREMENTS extends IUsableActionRequirements = IUsableActionRequirements> = IUsableActionDefinitionSubmenu<REQUIREMENTS> | IUsableActionDefinitionExecutable<REQUIREMENTS>;
|
|
143
217
|
export declare type ActionId = string | ActionType | UsableActionType;
|
|
218
|
+
/**
|
|
219
|
+
* Create a basic usable action:
|
|
220
|
+
* ```ts
|
|
221
|
+
* UsableAction.create({...definition});
|
|
222
|
+
* ```
|
|
223
|
+
* If your action has item/doodad/creature/npc requirements:
|
|
224
|
+
* ```ts
|
|
225
|
+
* UsableAction.requiring({...requirements})
|
|
226
|
+
* .create({...definition});
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* To learn about action definitions, see {@link IUsableActionDefinitionBase}
|
|
230
|
+
*/
|
|
144
231
|
declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsableActionRequirements, DEFINITION extends IUsableActionDefinition<REQUIREMENTS> = IUsableActionDefinition<REQUIREMENTS>> {
|
|
145
232
|
readonly requirements: REQUIREMENTS;
|
|
146
233
|
readonly definition: DEFINITION;
|
|
@@ -46,10 +46,14 @@ export declare class UsableActionGenerator<ARGS extends any[] = []> extends Even
|
|
|
46
46
|
static persisting(initializer: (persist: IUsableActionGeneratorPersistenceFactory<IUsableActionGeneratorFactory>) => UsableActionGenerator): UsableActionGenerator;
|
|
47
47
|
static singleton<REQUIREMENTS extends IUsableActionRequirements>(id: string | number, action: UsableAction<REQUIREMENTS>): UsableActionGenerator<[]>;
|
|
48
48
|
private readonly id?;
|
|
49
|
-
private readonly
|
|
49
|
+
private readonly registrationHandlers;
|
|
50
50
|
private get log();
|
|
51
51
|
constructor(id: string, registrationHandler: UsableActionGeneratorRegistrationHandler<ARGS>);
|
|
52
52
|
constructor(registrationHandler: UsableActionGeneratorRegistrationHandler<ARGS>);
|
|
53
|
+
add(registrationHandler: UsableActionGeneratorRegistrationHandler<ARGS>): this;
|
|
54
|
+
add(generator: UsableActionGenerator<ARGS>): this;
|
|
55
|
+
remove(registrationHandler: UsableActionGeneratorRegistrationHandler<ARGS>): this;
|
|
56
|
+
remove(generator: UsableActionGenerator<ARGS>): this;
|
|
53
57
|
register(registrar: UsableActionRegistrar, ...args: ARGS): void;
|
|
54
58
|
private contextMenuInitializer?;
|
|
55
59
|
/**
|
|
@@ -9,5 +9,53 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import { UsableActionGenerator } from "game/entity/action/usable/UsableActionRegistrar";
|
|
12
|
-
declare const
|
|
13
|
-
export default
|
|
12
|
+
declare const UsableActionsMain: UsableActionGenerator<[]>;
|
|
13
|
+
export default UsableActionsMain;
|
|
14
|
+
export declare enum UsableActionSet {
|
|
15
|
+
/**
|
|
16
|
+
* A set of usable action that appear before all other actions, unless {@link IUsableActionDefinitionBase.order} causes them to appear even earlier.
|
|
17
|
+
* Note that `order` is used to sort "use item/doodad/npc" actions to the top — the actions that appear in {@link IItemDescription.use}.
|
|
18
|
+
*/
|
|
19
|
+
First = 0,
|
|
20
|
+
WithHands = 1,
|
|
21
|
+
PickUp = 2,
|
|
22
|
+
Rest = 3,
|
|
23
|
+
Misc = 4,
|
|
24
|
+
Till = 5,
|
|
25
|
+
UseItem = 6,
|
|
26
|
+
CloseContainer = 7,
|
|
27
|
+
Equip = 8,
|
|
28
|
+
Craft = 9,
|
|
29
|
+
XWithY = 10,
|
|
30
|
+
ItemMisc = 11,
|
|
31
|
+
ItemDrop = 12,
|
|
32
|
+
ItemMoveMenus = 13,
|
|
33
|
+
Doodads = 14,
|
|
34
|
+
Creatures = 15,
|
|
35
|
+
UseNPC = 16,
|
|
36
|
+
Rename = 17,
|
|
37
|
+
Protect = 18,
|
|
38
|
+
Main = 19
|
|
39
|
+
}
|
|
40
|
+
export declare const usableActionSets: {
|
|
41
|
+
0: UsableActionGenerator<[]>;
|
|
42
|
+
1: UsableActionGenerator<[]>;
|
|
43
|
+
2: UsableActionGenerator<[]>;
|
|
44
|
+
3: UsableActionGenerator<[]>;
|
|
45
|
+
4: UsableActionGenerator<[]>;
|
|
46
|
+
5: UsableActionGenerator<[]>;
|
|
47
|
+
6: import("./UsableActionsDynamic").default<import("game/entity/action/usable/actions/item/UsableActionsUseItem").IUseItemAction, import("game/entity/action/usable/UsableAction").IUsableActionRequirements>;
|
|
48
|
+
7: UsableActionGenerator<[]>;
|
|
49
|
+
8: UsableActionGenerator<[]>;
|
|
50
|
+
9: UsableActionGenerator<[]>;
|
|
51
|
+
10: UsableActionGenerator<[]>;
|
|
52
|
+
11: UsableActionGenerator<[]>;
|
|
53
|
+
12: UsableActionGenerator<[isDropMenu?: true | undefined]>;
|
|
54
|
+
13: UsableActionGenerator<[]>;
|
|
55
|
+
14: UsableActionGenerator<[]>;
|
|
56
|
+
15: UsableActionGenerator<[]>;
|
|
57
|
+
16: import("./UsableActionsDynamic").default<import("game/entity/action/usable/actions/UsableActionsUseNPC").IUseNPCAction, import("game/entity/action/usable/UsableAction").IUsableActionRequirements>;
|
|
58
|
+
17: UsableActionGenerator<[]>;
|
|
59
|
+
18: UsableActionGenerator<[]>;
|
|
60
|
+
19: UsableActionGenerator<[]>;
|
|
61
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 Unlok
|
|
3
|
+
* https://www.unlok.ca
|
|
4
|
+
*
|
|
5
|
+
* Credits & Thanks:
|
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
|
7
|
+
*
|
|
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
|
+
* https://github.com/WaywardGame/types/wiki
|
|
10
|
+
*/
|
|
11
|
+
import { UsableActionGenerator } from "game/entity/action/usable/UsableActionRegistrar";
|
|
12
|
+
declare const _default: UsableActionGenerator<[]>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 Unlok
|
|
3
|
+
* https://www.unlok.ca
|
|
4
|
+
*
|
|
5
|
+
* Credits & Thanks:
|
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
|
7
|
+
*
|
|
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
|
+
* https://github.com/WaywardGame/types/wiki
|
|
10
|
+
*/
|
|
11
|
+
import { UsableActionGenerator } from "game/entity/action/usable/UsableActionRegistrar";
|
|
12
|
+
declare const _default: UsableActionGenerator<[]>;
|
|
13
|
+
export default _default;
|
|
@@ -23,7 +23,9 @@ import type { IslandId } from "game/island/IIsland";
|
|
|
23
23
|
import type Island from "game/island/Island";
|
|
24
24
|
import type { IContainer } from "game/item/IItem";
|
|
25
25
|
import { ItemType } from "game/item/IItem";
|
|
26
|
+
import type { Prompt } from "game/meta/prompt/IPrompt";
|
|
26
27
|
import { Milestone } from "game/milestones/IMilestone";
|
|
28
|
+
import type InterruptChoice from "language/dictionary/InterruptChoice";
|
|
27
29
|
import type IClientStore from "save/clientStore/IClientStore";
|
|
28
30
|
import type { IUnserializedCallback } from "save/serializer/ISerializer";
|
|
29
31
|
import type { IDialogInfo } from "ui/old/IOldUi";
|
|
@@ -71,6 +73,10 @@ export default class Player extends Human implements IUnserializedCallback {
|
|
|
71
73
|
private updateCraftTable;
|
|
72
74
|
updateDismantleTable(adjacentContainers?: IContainer[], force?: boolean): void;
|
|
73
75
|
getName(): import("../../../language/impl/TranslationImpl").default;
|
|
76
|
+
/**
|
|
77
|
+
* Prompts the player
|
|
78
|
+
*/
|
|
79
|
+
prompt(type: Prompt, ...args: any[]): Promise<boolean | InterruptChoice>;
|
|
74
80
|
updateActionSlots(slots: number[], data: IActionBarSlotData[]): void;
|
|
75
81
|
updateDialogInfo(dialogIndex: string | number): void;
|
|
76
82
|
getDialogInfo(dialogIndex: string | number): IDialogInfo;
|
|
@@ -19,7 +19,7 @@ export default class ItemDetailsInfoProvider extends InfoProvider {
|
|
|
19
19
|
private readonly description;
|
|
20
20
|
constructor(item: Item | ItemType);
|
|
21
21
|
getClass(): string[];
|
|
22
|
-
get(): (0 |
|
|
22
|
+
get(): (0 | import("game/inspection/InfoProvider").SimpleInfoProvider | LabelledValue | ItemWorthInfoProvider)[];
|
|
23
23
|
private getInsulation;
|
|
24
24
|
private getPreservation;
|
|
25
25
|
private getGroupings;
|
|
@@ -15,7 +15,7 @@ export default class AttackInfo extends InfoProvider {
|
|
|
15
15
|
private readonly human?;
|
|
16
16
|
constructor(human?: Human | undefined);
|
|
17
17
|
getClass(): string[];
|
|
18
|
-
get(): (
|
|
18
|
+
get(): (import("game/inspection/InfoProvider").SimpleInfoProvider | LabelledValue)[];
|
|
19
19
|
private getTactics;
|
|
20
20
|
private getMainHand;
|
|
21
21
|
private getOffHand;
|
|
@@ -19,7 +19,7 @@ export default class CorpseInspection extends Inspection<Corpse> {
|
|
|
19
19
|
static getFromTile(position: IVector3): CorpseInspection[];
|
|
20
20
|
static handles(type: InspectType, corpse: unknown): boolean;
|
|
21
21
|
constructor(corpse: Corpse);
|
|
22
|
-
get(context: InfoProviderContext): (0 |
|
|
22
|
+
get(context: InfoProviderContext): (0 | import("game/inspection/InfoProvider").SimpleInfoProvider | LabelledValue)[];
|
|
23
23
|
private getDecay;
|
|
24
24
|
private decay;
|
|
25
25
|
private shouldRefreshDecay;
|
|
@@ -46,12 +46,6 @@ export interface IItemEvents {
|
|
|
46
46
|
moved(): any;
|
|
47
47
|
remove(): any;
|
|
48
48
|
movedIsland(islandId: IslandId, itemId: number): any;
|
|
49
|
-
/**
|
|
50
|
-
* Called when the human quickslots an item
|
|
51
|
-
* @param human The human object
|
|
52
|
-
* @param quickSlot The quickslot number
|
|
53
|
-
*/
|
|
54
|
-
quickslot?(human: Human, quickSlot: number | undefined): void;
|
|
55
49
|
/**
|
|
56
50
|
* Called when the human equips an item to a slot
|
|
57
51
|
* @param human The human object
|
|
@@ -102,7 +96,6 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
|
|
|
102
96
|
vehicleFacingDirection?: Direction.Cardinal;
|
|
103
97
|
weight: number;
|
|
104
98
|
weightFraction?: number;
|
|
105
|
-
quickSlot: number[] | undefined;
|
|
106
99
|
magic: MagicalPropertyManager;
|
|
107
100
|
map: ItemMapManager;
|
|
108
101
|
islandId: IslandId;
|
|
@@ -193,8 +186,6 @@ export default class Item extends EventEmitter.Host<IItemEvents> implements IRef
|
|
|
193
186
|
isEquipped(includeDisabled?: true): boolean;
|
|
194
187
|
getEquippedPlayer(): Human | undefined;
|
|
195
188
|
getEquipSlot(includeDisabled?: true): EquipType | undefined;
|
|
196
|
-
setQuickSlot(human: Human, quickSlot: number, removeQuickSlot?: boolean): void;
|
|
197
|
-
clearQuickSlot(): void;
|
|
198
189
|
isDecayed(): boolean;
|
|
199
190
|
changeInto(type: ItemType, disableNotify?: boolean, emitTransformation?: boolean): void;
|
|
200
191
|
/**
|
|
@@ -14,6 +14,6 @@ import type { ISerializer, ISerializable } from "save/serializer/ISerializer";
|
|
|
14
14
|
export declare type SavedMapTiles = Array<[terrain: TerrainType | undefined, decoration: MapTile | undefined, x: number, y: number]>;
|
|
15
15
|
export default class SavedTilesSerializer implements ISerializable {
|
|
16
16
|
saved: SavedMapTiles;
|
|
17
|
-
serializeObject(serializer: ISerializer):
|
|
17
|
+
serializeObject(serializer: ISerializer): undefined;
|
|
18
18
|
deserializeObject(serializer: ISerializer): boolean;
|
|
19
19
|
}
|
|
@@ -137,7 +137,7 @@ export declare enum PromptPriority {
|
|
|
137
137
|
}
|
|
138
138
|
export declare type PromptDescriptionArgs<PROMPT extends IPromptDescriptionBase<any[]>> = PROMPT extends IPromptDescriptionBase<infer A> ? A : never;
|
|
139
139
|
export interface IPromptDescriptionBase<A extends any[]> {
|
|
140
|
-
type
|
|
140
|
+
type: Prompt;
|
|
141
141
|
promptType: PromptType;
|
|
142
142
|
priority?: PromptPriority;
|
|
143
143
|
title?: TranslationGenerator<UiTranslation, A>;
|
|
@@ -8,10 +8,12 @@
|
|
|
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 type { IPromptChoiceDescription, IPromptConfirmDescription, IPromptInfoDescription, IPromptInputDescription, IPromptMenuDescription, Prompt, PromptChoices, PromptPriority } from "game/meta/prompt/IPrompt";
|
|
11
|
+
import type { IPromptChoiceDescription, IPromptConfirmDescription, IPromptDescriptionBase, IPromptInfoDescription, IPromptInputDescription, IPromptMenuDescription, Prompt, PromptChoices, PromptPriority } from "game/meta/prompt/IPrompt";
|
|
12
|
+
import { PromptType } from "game/meta/prompt/IPrompt";
|
|
12
13
|
import type InterruptChoice from "language/dictionary/InterruptChoice";
|
|
13
14
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
14
15
|
import type { MenuId } from "ui/screen/screens/menu/component/IMenu";
|
|
16
|
+
export declare const promptDescriptions: Descriptions<PromptType, IPromptDescriptionBase<any>>;
|
|
15
17
|
declare class PromptDescriptionFactory {
|
|
16
18
|
private readonly _priority?;
|
|
17
19
|
constructor(_priority?: PromptPriority | undefined);
|
|
@@ -59,7 +59,7 @@ export declare module Reference {
|
|
|
59
59
|
}
|
|
60
60
|
export default class ReferenceManager {
|
|
61
61
|
static isEnumReference(type: ReferenceType): type is EnumReferenceTypes;
|
|
62
|
-
static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default |
|
|
62
|
+
static getList(type: ReferenceType, gameIsland?: Island): import("../entity/creature/corpse/CorpseManager").default | import("../entity/creature/CreatureManager").default | import("../doodad/DoodadManager").default | import("../item/ItemManager").default | import("../entity/npc/NPCManager").default | import("../tile/TileEventManager").default | readonly Milestone[] | readonly SkillType[] | (Player | undefined)[] | readonly ItemType[] | EquipType[] | IterableIterator<Island> | readonly Stat[] | (string | ActionType)[];
|
|
63
63
|
static get(thing: Referenceable): Reference | undefined;
|
|
64
64
|
static getReferenceType(thing: Value<IReferenceTypeMap>): ReferenceType;
|
|
65
65
|
private referenceCursor;
|
|
@@ -100,10 +100,10 @@ declare enum Dictionary {
|
|
|
100
100
|
Terrain = 88,
|
|
101
101
|
TileEvent = 89,
|
|
102
102
|
Ui = 90,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
UiQuadrant = 91,
|
|
104
|
+
UnableToJoinReason = 92,
|
|
105
|
+
UnlockedRecipesStrategy = 93,
|
|
106
|
+
UsableActionType = 94,
|
|
107
107
|
Website = 95,
|
|
108
108
|
WeightStatus = 96,
|
|
109
109
|
WorldLayer = 97
|
|
@@ -174,10 +174,10 @@ declare const dictionaryMap: {
|
|
|
174
174
|
88: typeof TerrainType;
|
|
175
175
|
89: typeof TileEventType;
|
|
176
176
|
90: typeof UiTranslation;
|
|
177
|
-
91: typeof
|
|
178
|
-
92: typeof
|
|
179
|
-
93: typeof
|
|
180
|
-
94: typeof
|
|
177
|
+
91: typeof Quadrant;
|
|
178
|
+
92: typeof UnableToJoinReason;
|
|
179
|
+
93: typeof UnlockedRecipesStrategy;
|
|
180
|
+
94: typeof UsableActionType;
|
|
181
181
|
95: typeof Website;
|
|
182
182
|
96: typeof WeightStatus;
|
|
183
183
|
97: typeof WorldZ;
|
|
@@ -274,10 +274,10 @@ export declare const strictDictionaries: {
|
|
|
274
274
|
88: typeof TerrainType;
|
|
275
275
|
89: typeof TileEventType;
|
|
276
276
|
90: typeof UiTranslation;
|
|
277
|
-
91: typeof
|
|
278
|
-
92: typeof
|
|
279
|
-
93: typeof
|
|
280
|
-
94: typeof
|
|
277
|
+
91: typeof Quadrant;
|
|
278
|
+
92: typeof UnableToJoinReason;
|
|
279
|
+
93: typeof UnlockedRecipesStrategy;
|
|
280
|
+
94: typeof UsableActionType;
|
|
281
281
|
95: typeof Website;
|
|
282
282
|
96: typeof WeightStatus;
|
|
283
283
|
97: typeof WorldZ;
|
|
@@ -80,8 +80,8 @@ declare enum Message {
|
|
|
80
80
|
ActionToggleHitchAlreadyUnhitched = 68,
|
|
81
81
|
ActionToggleHitchNoCreature = 69,
|
|
82
82
|
ActionToggleHitchNoHitch = 70,
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
ActionToggleTilledAlreadyPacked = 71,
|
|
84
|
+
ActionToggleTilledAlreadyTilled = 72,
|
|
85
85
|
ActionUpgrade = 73,
|
|
86
86
|
ActionUpgradeFailed = 74,
|
|
87
87
|
ActionUpgradeNotMagical = 75,
|
|
@@ -14,6 +14,7 @@ import type { ISerializedTranslation } from "language/ITranslation";
|
|
|
14
14
|
import { TextContext } from "language/ITranslation";
|
|
15
15
|
import type { Link } from "language/segment/LinkSegment";
|
|
16
16
|
import type { ITooltipSection } from "language/segment/TooltipSegment";
|
|
17
|
+
import type { ISerializable } from "save/serializer/ISerializer";
|
|
17
18
|
import type { TranslationGenerator } from "ui/component/IComponent";
|
|
18
19
|
import type { Random } from "utilities/random/Random";
|
|
19
20
|
import type { ISegment, IStringSection } from "utilities/string/Interpolator";
|
|
@@ -24,7 +25,7 @@ export interface ITranslationConfig {
|
|
|
24
25
|
interpolator: Interpolator;
|
|
25
26
|
provideTranslation(dictionary: Dictionary, entry: number | string, ignoreInvalid?: boolean): string[] | undefined;
|
|
26
27
|
}
|
|
27
|
-
export default class TranslationImpl {
|
|
28
|
+
export default class TranslationImpl implements Omit<ISerializable, "deserializeObject"> {
|
|
28
29
|
private static defaultInterpolatorSegmentIds?;
|
|
29
30
|
private static _config?;
|
|
30
31
|
static set config(config: ITranslationConfig | undefined);
|
|
@@ -97,6 +98,7 @@ export default class TranslationImpl {
|
|
|
97
98
|
getString(...args: any[]): string;
|
|
98
99
|
toString(): string;
|
|
99
100
|
private getCustomInterpolatorSegments;
|
|
101
|
+
serializeObject(): ISerializedTranslation;
|
|
100
102
|
serialize(): ISerializedTranslation;
|
|
101
103
|
private canCache;
|
|
102
104
|
private getCachedTranslation;
|
|
@@ -13,6 +13,9 @@ import type { Command, CommandCallback } from "command/ICommand";
|
|
|
13
13
|
import type { BiomeType, IBiomeDescription } from "game/biome/IBiome";
|
|
14
14
|
import type { DoodadType, DoodadTypeGroup, IDoodadDescription, IDoodadGroupDescription } from "game/doodad/IDoodad";
|
|
15
15
|
import type { ActionType, IActionDescription } from "game/entity/action/IAction";
|
|
16
|
+
import type { UsableActionSet, usableActionSets } from "game/entity/action/usable/actions/UsableActionsMain";
|
|
17
|
+
import type UsableActionRegistrar from "game/entity/action/usable/UsableActionRegistrar";
|
|
18
|
+
import type { UsableActionGenerator } from "game/entity/action/usable/UsableActionRegistrar";
|
|
16
19
|
import type { ICorpseDescription } from "game/entity/creature/corpse/ICorpse";
|
|
17
20
|
import type { CreatureType, ICreatureDescription } from "game/entity/creature/ICreature";
|
|
18
21
|
import type { StatusType } from "game/entity/IEntity";
|
|
@@ -108,7 +111,8 @@ export declare enum ModRegistrationType {
|
|
|
108
111
|
TerrainDecoration = 40,
|
|
109
112
|
TileEvent = 41,
|
|
110
113
|
TileLayerType = 42,
|
|
111
|
-
|
|
114
|
+
UsableActions = 43,
|
|
115
|
+
WorldLayer = 44
|
|
112
116
|
}
|
|
113
117
|
export interface ILanguageRegistration extends IBaseModRegistration {
|
|
114
118
|
type: ModRegistrationType.Language;
|
|
@@ -322,10 +326,16 @@ export interface IQuadrantComponentRegistration extends IBaseModRegistration {
|
|
|
322
326
|
name: string;
|
|
323
327
|
class: new (id: QuadrantComponentId) => QuadrantComponent;
|
|
324
328
|
}
|
|
329
|
+
export interface IUsableActionsRegistration extends IBaseModRegistration {
|
|
330
|
+
type: ModRegistrationType.UsableActions;
|
|
331
|
+
name: string;
|
|
332
|
+
set: UsableActionSet;
|
|
333
|
+
registrationHandler: (registrar: UsableActionRegistrar, ...args: any[]) => any;
|
|
334
|
+
}
|
|
325
335
|
export interface IInheritsRegistrationTime {
|
|
326
336
|
useRegistrationTime: ModRegistrationType;
|
|
327
337
|
}
|
|
328
|
-
export declare type ModRegistration =
|
|
338
|
+
export declare type ModRegistration = IActionRegistration | IBindableRegistration | IBiomeRegistration | IBulkRegistration | ICommandRegistration | ICreatureRegistration | IDialogRegistration | IDictionaryRegistration | IDoodadGroupRegistration | IDoodadRegistration | IHelpArticleRegistration | IInspectionTypeRegistration | IInterModRegistration | IInterModRegistryRegistration | IInterruptChoiceRegistration | IInterruptRegistration | IItemGroupRegistration | IItemRegistration | ILanguageExtensionRegistration | ILanguageRegistration | ILoadRegistration | IMenuBarButtonRegistration | IMessageRegistration | IMessageSourceRegistration | IMusicTrackRegistration | INoteRegistration | INPCRegistration | IOptionsSectionRegistration | IOverlayRegistration | IPacketRegistration | IPromptRegistration | IQuadrantComponentRegistration | IQuestRegistration | IQuestRequirementRegistration | IRegistryRegistration | ISkillRegistration | ISoundEffectRegistration | IStatRegistration | IStatusEffectRegistration | ITerrainDecorationRegistration | ITerrainRegistration | ITileEventRegistration | ITileLayerTypeRegistration | IUsableActionsRegistration;
|
|
329
339
|
export declare const SYMBOL_SUPER_REGISTRY: unique symbol;
|
|
330
340
|
declare module Register {
|
|
331
341
|
/**
|
|
@@ -592,6 +602,12 @@ declare module Register {
|
|
|
592
602
|
* @param description The definition of this action.
|
|
593
603
|
*/
|
|
594
604
|
export function action(name: string, description?: IActionDescription): <K extends string | number | symbol, T extends { [k in K]: ActionType; }>(target: T, key: K) => void;
|
|
605
|
+
/**
|
|
606
|
+
* Registers a "usable" action generator — actions that appear in the UI, and can be slotted in the action bar.
|
|
607
|
+
* @param set Where to append the usable actions
|
|
608
|
+
* @param registrationHandler The handler that will register the new actions
|
|
609
|
+
*/
|
|
610
|
+
export function usableActions<SET extends UsableActionSet>(name: string, set: SET, registrationHandler: (registrar: UsableActionRegistrar, ...args: (typeof usableActionSets)[SET] extends UsableActionGenerator<infer ARGS> ? ARGS : []) => any): <K extends string | number | symbol, T extends { [k in K]: UsableActionGenerator<[]>; }>(target: T, key: K) => void;
|
|
595
611
|
export function interModRegistry<V>(name: string): <K extends string | number | symbol, T extends { [k in K]: InterModRegistry<V>; }>(target: T, key: K) => void;
|
|
596
612
|
export function interModRegistration<V>(modName: string, registryName: string, value: V): <K extends string | number | symbol, T extends { [k in K]: InterModRegistration<V>; }>(target: T, key: K) => void;
|
|
597
613
|
type ExtractRegisteredType<F> = F extends (...args: any) => infer F2 ? F2 extends (t: infer T, k: infer K) => any ? T[Extract<K, keyof T>] : never : never;
|
|
@@ -8,11 +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 { Prompt } from "game/meta/prompt/IPrompt";
|
|
11
|
+
import type { Prompt } from "game/meta/prompt/IPrompt";
|
|
12
12
|
import ClientPacket from "multiplayer/packets/ClientPacket";
|
|
13
13
|
export default class PromptPacket extends ClientPacket {
|
|
14
|
-
|
|
15
|
-
args: any;
|
|
14
|
+
type: Prompt;
|
|
15
|
+
args: any[];
|
|
16
16
|
getDebugInfo(): string;
|
|
17
17
|
process(): Promise<void>;
|
|
18
18
|
}
|
|
@@ -34,6 +34,6 @@ export default class World extends EventEmitter.Host<IWorldEvents> implements IS
|
|
|
34
34
|
updateTile(x: number, y: number, z: number, tile: ITile, tileUpdateType: TileUpdateType, updateNeighbors?: boolean, flush?: boolean): void;
|
|
35
35
|
startUpdateTileBatch(): void;
|
|
36
36
|
endUpdateTileBatch(): void;
|
|
37
|
-
serializeObject(_serializer: ISerializer):
|
|
37
|
+
serializeObject(_serializer: ISerializer): undefined;
|
|
38
38
|
deserializeObject(serializer: ISerializer): boolean;
|
|
39
39
|
}
|
|
@@ -23,7 +23,7 @@ export declare class ReplayLogEntry implements IReplayLogEntry, ISerializable {
|
|
|
23
23
|
/**
|
|
24
24
|
* Custom serializer to reduce save data size
|
|
25
25
|
*/
|
|
26
|
-
serializeObject(serializer: ISerializer):
|
|
26
|
+
serializeObject(serializer: ISerializer): undefined;
|
|
27
27
|
/**
|
|
28
28
|
* Custom serializer to reduce save data size
|
|
29
29
|
*/
|
|
@@ -40,7 +40,7 @@ export interface ISerializerOptions {
|
|
|
40
40
|
swallowErrors?: boolean;
|
|
41
41
|
}
|
|
42
42
|
export interface ISerializable {
|
|
43
|
-
serializeObject(serializer: ISerializer):
|
|
43
|
+
serializeObject(serializer: ISerializer): object | undefined;
|
|
44
44
|
deserializeObject(serializer: ISerializer, dataType: Types): boolean;
|
|
45
45
|
}
|
|
46
46
|
export interface IPreSerializeCallback {
|
|
@@ -8,8 +8,6 @@
|
|
|
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 type { ItemType } from "game/item/IItem";
|
|
12
|
-
import type { ActionType } from "game/entity/action/IAction";
|
|
13
11
|
export declare enum DialogId {
|
|
14
12
|
Inventory = 0,
|
|
15
13
|
Crafting = 1,
|
|
@@ -45,13 +43,6 @@ export interface IDialogInfo {
|
|
|
45
43
|
onClose?(): void;
|
|
46
44
|
onResizeStop?(): void;
|
|
47
45
|
}
|
|
48
|
-
export interface IQuickSlotInfo {
|
|
49
|
-
itemType?: ItemType;
|
|
50
|
-
contextActionSlot?: number;
|
|
51
|
-
contextActionType?: ActionType;
|
|
52
|
-
canUseProtected?: boolean;
|
|
53
|
-
action: IContextMenuAction | undefined;
|
|
54
|
-
}
|
|
55
46
|
export declare enum SortType {
|
|
56
47
|
Name = 0,
|
|
57
48
|
Group = 1,
|
|
@@ -71,15 +62,6 @@ export interface IContainerSortInfo {
|
|
|
71
62
|
sortType: SortType;
|
|
72
63
|
reverse?: boolean;
|
|
73
64
|
}
|
|
74
|
-
export interface IContextMenuAction {
|
|
75
|
-
action: string;
|
|
76
|
-
text: string;
|
|
77
|
-
keybind?: number;
|
|
78
|
-
data?: any;
|
|
79
|
-
isContextAction?: number;
|
|
80
|
-
actionType?: ActionType;
|
|
81
|
-
canUseProtected?: boolean;
|
|
82
|
-
}
|
|
83
65
|
export declare enum UiEvent {
|
|
84
66
|
HelpShow = 0,
|
|
85
67
|
HelpHide = 1
|
|
@@ -34,8 +34,6 @@ export default class OldUi {
|
|
|
34
34
|
hideInGameScreen(): void;
|
|
35
35
|
onWindowResize(): void;
|
|
36
36
|
isInGameScreenShown(): boolean;
|
|
37
|
-
loadQuickSlots(): void;
|
|
38
|
-
isContextMenuOpen(): boolean;
|
|
39
37
|
isOptionsOverlayShown(): boolean;
|
|
40
38
|
isOptionsOverlayEnabled(): boolean;
|
|
41
39
|
tooltipRefresh(): void;
|
|
@@ -46,17 +44,10 @@ export default class OldUi {
|
|
|
46
44
|
updateItem(item: Item, updateChildren?: boolean): void;
|
|
47
45
|
syncDecayBar(item: Item, syncDamage?: boolean): void;
|
|
48
46
|
syncItemElements(itemIds: number | number[], forceSyncDecay?: boolean): void;
|
|
49
|
-
hideContextMenu(): void;
|
|
50
|
-
hideActionsMenu(): void;
|
|
51
47
|
setEquipSlot(equip: EquipType, itemId: number, internal?: boolean): void;
|
|
52
|
-
setQuickSlot(quickSlot: number, itemId: number, internal?: boolean): void;
|
|
53
|
-
refreshQuickSlots(): void;
|
|
54
|
-
getUsedQuickSlots(): number[];
|
|
55
|
-
removeItemFromQuickSlot(itemId: number): void;
|
|
56
48
|
removeItemFromEquipSlot(equip: EquipType): void;
|
|
57
49
|
shouldRefreshMods(): boolean;
|
|
58
50
|
onGameEnd(): void;
|
|
59
|
-
onUpdateDirection(): void;
|
|
60
51
|
toggleUIDisplay(hide: boolean): void;
|
|
61
52
|
getSerializationProperties(_: string): string[];
|
|
62
53
|
onMove(): void;
|
|
@@ -9,18 +9,16 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type Doodad from "game/doodad/Doodad";
|
|
12
|
-
import { ActionType } from "game/entity/action/IAction";
|
|
13
12
|
import { EquipType } from "game/entity/IHuman";
|
|
14
13
|
import NPC from "game/entity/npc/NPC";
|
|
15
14
|
import type { IContainer, IDismantleComponent } from "game/item/IItem";
|
|
16
15
|
import { ItemType } from "game/item/IItem";
|
|
17
16
|
import Item from "game/item/Item";
|
|
18
|
-
import ItemRecipeRequirementChecker from "game/item/ItemRecipeRequirementChecker";
|
|
19
17
|
import Message from "language/dictionary/Message";
|
|
20
18
|
import type { IBindHandlerApi } from "ui/input/Bind";
|
|
21
19
|
import { GlobalMouseInfo } from "ui/input/InputManager";
|
|
22
20
|
import type { ISortableEvent } from "ui/old/functional/IFunctionalSortable";
|
|
23
|
-
import type { IContainerSortInfo,
|
|
21
|
+
import type { IContainerSortInfo, IDialogInfo } from "ui/old/IOldUi";
|
|
24
22
|
import { DialogId, SortType } from "ui/old/IOldUi";
|
|
25
23
|
import BaseScreen from "ui/old/screens/BaseScreen";
|
|
26
24
|
import type ActionBar from "ui/screen/screens/game/static/ActionBar";
|
|
@@ -35,11 +33,9 @@ export declare enum TextElementId {
|
|
|
35
33
|
}
|
|
36
34
|
declare global {
|
|
37
35
|
interface JQuery {
|
|
38
|
-
contextmenu(p: any, p2?: any, p3?: any): any;
|
|
39
36
|
isVisible(): boolean;
|
|
40
37
|
quickShow(): void;
|
|
41
38
|
quickHide(): void;
|
|
42
|
-
getQuickSlot(): number;
|
|
43
39
|
getEquipSlot(): number;
|
|
44
40
|
}
|
|
45
41
|
interface JQuery {
|
|
@@ -58,7 +54,6 @@ export default class InGameScreen extends BaseScreen {
|
|
|
58
54
|
isQuickmoving: boolean;
|
|
59
55
|
elementVisibleInGame: JQuery;
|
|
60
56
|
elementCanvas: JQuery;
|
|
61
|
-
elementQuickSlotsContainer: JQuery;
|
|
62
57
|
elementActions: JQuery;
|
|
63
58
|
elementDialogs: JQuery;
|
|
64
59
|
elementDialogInventory: JQuery;
|
|
@@ -73,17 +68,7 @@ export default class InGameScreen extends BaseScreen {
|
|
|
73
68
|
elementVersion: JQuery;
|
|
74
69
|
elementContainerDialogs: JQuery[];
|
|
75
70
|
elementOtherDialogs: JQuery[];
|
|
76
|
-
contextMenuOpen: boolean;
|
|
77
|
-
private contextMenu;
|
|
78
|
-
private contextMenuTarget;
|
|
79
|
-
private contextMenuLastTarget;
|
|
80
|
-
private lastContextMenuPosition;
|
|
81
|
-
private actionsMenuOpen;
|
|
82
|
-
private autoActionsMenuOpen;
|
|
83
|
-
private actionsMenuTileOverlay;
|
|
84
|
-
actionsMenuCentered: boolean;
|
|
85
71
|
private activeContainer;
|
|
86
|
-
private multipleContainersOpened;
|
|
87
72
|
private sortableElement;
|
|
88
73
|
private sortableElementPosition;
|
|
89
74
|
private sortableElementTargetContainer;
|
|
@@ -104,13 +89,10 @@ export default class InGameScreen extends BaseScreen {
|
|
|
104
89
|
toggleCraftingTabElements(which: "crafting" | "dismantle"): void;
|
|
105
90
|
unbindElements(): void;
|
|
106
91
|
bindSortable(element: JQuery): void;
|
|
107
|
-
pressHotKey(hotKeyNumber: number): boolean;
|
|
108
|
-
useQuickSlot(slot: number): boolean;
|
|
109
92
|
isSorting(): boolean;
|
|
110
93
|
runSortableAction(sortable: JQuery, action: string, ...data: any[]): void;
|
|
111
94
|
runGlobalSortableAction(action: string, ...data: any[]): void;
|
|
112
95
|
cancelSorting(): void;
|
|
113
|
-
setupContextMenu(): any;
|
|
114
96
|
onShow(): void;
|
|
115
97
|
makeActiveContainer(dialog: JQuery): void;
|
|
116
98
|
makeTopDialog(dialog: JQuery): void;
|
|
@@ -146,15 +128,9 @@ export default class InGameScreen extends BaseScreen {
|
|
|
146
128
|
afterAddingMultipleItemsToContainer(container: IContainer): void;
|
|
147
129
|
removeItemFromContainer(item: Item, container: IContainer): void;
|
|
148
130
|
refreshContainerName(container: IContainer): void;
|
|
149
|
-
refreshQuickSlots(): void;
|
|
150
131
|
getInventoryItemsInOrder(): any[];
|
|
151
|
-
loadQuickSlots(): void;
|
|
152
132
|
saveItemOrder(containerElement: JQuery, activeSort?: boolean): void;
|
|
153
|
-
|
|
154
|
-
onContextMenuAction(element: JQuery, action: IContextMenuAction, toElement?: JQuery): void;
|
|
155
|
-
runContextMenuItemAction(itemId: number, action: IContextMenuAction, skipSound?: boolean, usedFromQuickSlot?: boolean, itemTypeBypass?: ItemType): boolean;
|
|
156
|
-
craftItemChecker(itemType: ItemType): void;
|
|
157
|
-
craftItem(item: ItemType, checker: ItemRecipeRequirementChecker): Promise<void>;
|
|
133
|
+
craftItem(itemType: ItemType): void;
|
|
158
134
|
onDismantleItemClick(dismantleItem: Item | undefined): void;
|
|
159
135
|
getTooltipHtml(element: JQuery): string;
|
|
160
136
|
tooltipEnable(): void;
|
|
@@ -162,20 +138,6 @@ export default class InGameScreen extends BaseScreen {
|
|
|
162
138
|
tooltipDisable(): void;
|
|
163
139
|
tooltipHide(): void;
|
|
164
140
|
unSelectElements(): void;
|
|
165
|
-
getUsedQuickSlots(): number[];
|
|
166
|
-
getFreeQuickSlots(): number[];
|
|
167
|
-
getQuickSlots(): number;
|
|
168
|
-
getQuickSlotItemElement(quickSlot: number): JQuery;
|
|
169
|
-
getItemIdInQuickSlot(quickSlot: number): number | undefined;
|
|
170
|
-
setQuickSlot(quickSlot: number, itemId?: number, internal?: boolean): boolean;
|
|
171
|
-
setQuickSlotByItemType(quickSlot: number, itemType: ItemType, disabled: boolean, item?: Item | undefined): void;
|
|
172
|
-
setQuickSlotByContextAction(quickSlot: number, action: IContextMenuAction): void;
|
|
173
|
-
addItemToFreeQuickSlot(itemId: number): boolean;
|
|
174
|
-
clearQuickSlot(quickSlot: number, internal?: boolean): void;
|
|
175
|
-
removeItemFromQuickSlot(quickSlot: number, itemId?: number, skipSync?: boolean): void;
|
|
176
|
-
setItemQuickslot(item: Item, quickSlot: number, removeQuickSlot?: boolean): void;
|
|
177
|
-
updateQuickSlotItem(quickSlot: number): boolean;
|
|
178
|
-
onUpdateQuickSlotsOrEquips(): void;
|
|
179
141
|
onSortableItemReceive(sortableEvent: ISortableEvent): void;
|
|
180
142
|
getEquipSlotItemElement(equip: EquipType): JQuery;
|
|
181
143
|
getItemIdInEquipSlot(equip: EquipType): number | undefined;
|
|
@@ -211,12 +173,6 @@ export default class InGameScreen extends BaseScreen {
|
|
|
211
173
|
updateActiveContainer(): void;
|
|
212
174
|
getActiveContainer(): IUiContainer | undefined;
|
|
213
175
|
getOpenContainers(): IUiContainer[];
|
|
214
|
-
hideContextMenu(): boolean;
|
|
215
|
-
hideActionsMenu(): void;
|
|
216
|
-
toggleActionsMenu(center?: boolean): void;
|
|
217
|
-
toggleAutoActionsMenu(center?: boolean): void;
|
|
218
|
-
showAutoActionsMenu(center?: boolean, updatePosition?: boolean, skipSound?: boolean, quickSlotNumber?: number): void;
|
|
219
|
-
showActionsMenu(center?: boolean, updatePosition?: boolean, skipSound?: boolean, quickSlotNumber?: number): void;
|
|
220
176
|
getFilterText(containerElement: JQuery | undefined): any;
|
|
221
177
|
getFilterElement(containerElement: JQuery): JQuery;
|
|
222
178
|
/**
|
|
@@ -237,14 +193,12 @@ export default class InGameScreen extends BaseScreen {
|
|
|
237
193
|
* Will force an update on crafting and dismantle tables based on dirty variables.
|
|
238
194
|
*/
|
|
239
195
|
updateTablesDirty(which?: "crafting" | "dismantle"): void;
|
|
240
|
-
|
|
196
|
+
showSortMenu(element: JQuery, container: JQuery, messageType: Message): void;
|
|
241
197
|
getContainerId(containerElement: JQuery): string;
|
|
242
198
|
sortItems(containerElement: JQuery, sortType: SortType, messageType?: Message, canReverse?: boolean, activeSort?: boolean): void;
|
|
243
199
|
onUpdateContainer(containerElement: JQuery, activeSort: boolean): void;
|
|
244
200
|
updateSort(containerElement: JQuery, activeSort: boolean): void;
|
|
245
201
|
isContainerDialogOver(x: number, y: number): boolean;
|
|
246
|
-
onUpdateDirection(): void;
|
|
247
|
-
onItemMenu(api: IBindHandlerApi): boolean;
|
|
248
202
|
onItemQuickMove(api: IBindHandlerApi): boolean;
|
|
249
203
|
onStopItemQuickMove(): boolean;
|
|
250
204
|
onItemMove(api: IBindHandlerApi): boolean;
|
|
@@ -252,27 +206,11 @@ export default class InGameScreen extends BaseScreen {
|
|
|
252
206
|
onItemEquipToggle(api: IBindHandlerApi): boolean;
|
|
253
207
|
onItemProtectToggle(api: IBindHandlerApi): boolean;
|
|
254
208
|
onItemRename(api: IBindHandlerApi): boolean;
|
|
255
|
-
onContextMenu(api: IBindHandlerApi): boolean;
|
|
256
|
-
onQuickSlotToggle(api: IBindHandlerApi): boolean;
|
|
257
|
-
onQuickSlot(api: IBindHandlerApi): boolean;
|
|
258
|
-
onQuickSlotClear(api: IBindHandlerApi): boolean;
|
|
259
|
-
protected onQuickSlotBindAction(api: IBindHandlerApi): boolean;
|
|
260
|
-
protected onQuickSlotBindItemAction(api: IBindHandlerApi): boolean;
|
|
261
209
|
onDropItem(api: IBindHandlerApi): boolean;
|
|
262
210
|
onReleaseDrop(): void;
|
|
263
|
-
onMenuCancel(): boolean;
|
|
264
211
|
onCloseAllDialogs(): boolean;
|
|
265
212
|
onMoreInformation(api: IBindHandlerApi): boolean;
|
|
266
213
|
onDismantleTab(): boolean;
|
|
267
|
-
onInput(api: IBindHandlerApi): void;
|
|
268
|
-
private clearActionsMenuTileOverlay;
|
|
269
|
-
getAutoActionItem(actionType: ActionType, allowProtectedItems?: boolean): Item | undefined;
|
|
270
|
-
private runAutoAction;
|
|
271
|
-
private runAction;
|
|
272
|
-
private runContextMenuAction;
|
|
273
|
-
private updateContextMenu;
|
|
274
|
-
private confirmAction;
|
|
275
|
-
private resetQuickSlotBinds;
|
|
276
214
|
private isOverlayVisible;
|
|
277
215
|
private readonly onInterrupt;
|
|
278
216
|
private readonly onInterruptClosed;
|
|
@@ -106,7 +106,8 @@ export declare class ActionSlot extends Button implements IRefreshable {
|
|
|
106
106
|
private isUsable;
|
|
107
107
|
clear(): void;
|
|
108
108
|
equipItem(item: Item, configure?: boolean): void;
|
|
109
|
-
|
|
109
|
+
protected onConfigureBind(api: IBindHandlerApi): boolean;
|
|
110
|
+
configure(): void;
|
|
110
111
|
protected onAppend(): void;
|
|
111
112
|
protected onItemMaybeInaccessible(): void;
|
|
112
113
|
postExecuteAction(action: IActionApi): void;
|
|
@@ -14,7 +14,7 @@ export default class DefaultMap<K, V> extends Map<K, V> implements ISerializable
|
|
|
14
14
|
readonly defaultValue: V;
|
|
15
15
|
constructor(defaultValue: V, entries?: Iterable<readonly [K, V]>);
|
|
16
16
|
initialize(key: K): V;
|
|
17
|
-
serializeObject(serializer: ISerializer):
|
|
17
|
+
serializeObject(serializer: ISerializer): undefined;
|
|
18
18
|
deserializeObject(serializer: ISerializer): boolean;
|
|
19
19
|
[Objects.SYMBOL_CLONE](clone: typeof Objects.deepClone): this;
|
|
20
20
|
}
|
|
@@ -117,7 +117,7 @@ export default class Vector2 implements IVector2, ISerializable {
|
|
|
117
117
|
clamp(a: IVector2, b: IVector2): this;
|
|
118
118
|
offset(direction: Direction): this;
|
|
119
119
|
toString(): string;
|
|
120
|
-
serializeObject(serializer: ISerializer):
|
|
120
|
+
serializeObject(serializer: ISerializer): undefined;
|
|
121
121
|
deserializeObject(serializer: ISerializer, dataType: Types): boolean;
|
|
122
122
|
}
|
|
123
123
|
export {};
|
|
@@ -73,6 +73,6 @@ export default class Vector3 implements IVector3, ISerializable {
|
|
|
73
73
|
normalize<D extends IVector3>(dest: D): D;
|
|
74
74
|
raw(): IVector3;
|
|
75
75
|
toString(): string;
|
|
76
|
-
serializeObject(serializer: ISerializer):
|
|
76
|
+
serializeObject(serializer: ISerializer): undefined;
|
|
77
77
|
deserializeObject(serializer: ISerializer, dataType: Types): boolean;
|
|
78
78
|
}
|
|
@@ -13,7 +13,7 @@ import type { Stat } from "../../game/game/entity/IStats";
|
|
|
13
13
|
import type { IslandId } from "../../game/game/island/IIsland";
|
|
14
14
|
import { Direction } from "../../game/utilities/math/Direction";
|
|
15
15
|
import type { Random, SeededGenerator } from "../../game/utilities/random/Random";
|
|
16
|
-
import type { IDedicatedServerGameOptions, IJoinServerOptions, INewGameOptions } from "../interfaces";
|
|
16
|
+
import type { IDedicatedServerGameOptions, IJoinServerOptions, INewGameOptions, IWaitUntilGameLoadedOptions } from "../interfaces";
|
|
17
17
|
import ApplicationDom from "./applicationDom";
|
|
18
18
|
import ApplicationLogger from "./applicationLogger";
|
|
19
19
|
export default class ApplicationInteractions {
|
|
@@ -25,13 +25,13 @@ export default class ApplicationInteractions {
|
|
|
25
25
|
private readonly savedStates;
|
|
26
26
|
constructor(additionalArgs: string[], random: Random<SeededGenerator>);
|
|
27
27
|
waitForInitialStartup(expectedInitialScreen: "title" | "mp_gameplay_modifiers"): Promise<void>;
|
|
28
|
-
waitUntilLoadingIsFinished(
|
|
28
|
+
waitUntilLoadingIsFinished(options?: Partial<IWaitUntilGameLoadedOptions>): Promise<void>;
|
|
29
29
|
playDedicatedServer(options: IDedicatedServerGameOptions): Promise<void>;
|
|
30
30
|
playNewGame(options: INewGameOptions): Promise<void>;
|
|
31
31
|
private setupCommonOptions;
|
|
32
32
|
unlockMilestoneModifiers(): Promise<void>;
|
|
33
33
|
playImportedGame(savePath: string): Promise<void>;
|
|
34
|
-
playContinueGame(): Promise<void>;
|
|
34
|
+
playContinueGame(options?: Partial<IWaitUntilGameLoadedOptions>): Promise<void>;
|
|
35
35
|
quitGame(): Promise<void>;
|
|
36
36
|
clickOptions(): Promise<void>;
|
|
37
37
|
clickNewGame(): Promise<void>;
|
|
@@ -77,10 +77,7 @@ export default class ApplicationInteractions {
|
|
|
77
77
|
saveStateAndVerifyWithPrevious(): Promise<void>;
|
|
78
78
|
clearSavedStates(): void;
|
|
79
79
|
waitUntilPauseMenuIsShown(): Promise<void>;
|
|
80
|
-
waitUntilGameIsLoaded(options?: Partial<
|
|
81
|
-
isJoiningServer: boolean;
|
|
82
|
-
isCreatingServer: boolean;
|
|
83
|
-
}>): Promise<void>;
|
|
80
|
+
waitUntilGameIsLoaded(options?: Partial<IWaitUntilGameLoadedOptions>): Promise<void>;
|
|
84
81
|
isTitleScreenVisible(): Promise<WebdriverIO.Element[] | undefined>;
|
|
85
82
|
isButtonVisible(text: string): Promise<WebdriverIO.Element[] | undefined>;
|
|
86
83
|
isOverlayVisible(): Promise<WebdriverIO.Element[] | undefined>;
|
|
@@ -13,6 +13,11 @@ export interface ICommonGameOptions {
|
|
|
13
13
|
seed?: string | number;
|
|
14
14
|
enableAllMilestoneModifiers?: boolean;
|
|
15
15
|
}
|
|
16
|
+
export interface IWaitUntilGameLoadedOptions {
|
|
17
|
+
isJoiningServer: boolean;
|
|
18
|
+
isCreatingServer: boolean;
|
|
19
|
+
expectReopenServerPrompt: boolean;
|
|
20
|
+
}
|
|
16
21
|
export interface INewGameOptions extends ICommonGameOptions {
|
|
17
22
|
playMode: GamePlayMode;
|
|
18
23
|
reuseCharacter?: boolean;
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2011-2021 Unlok
|
|
3
|
-
* https://www.unlok.ca
|
|
4
|
-
*
|
|
5
|
-
* Credits & Thanks:
|
|
6
|
-
* https://www.unlok.ca/credits-thanks/
|
|
7
|
-
*
|
|
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
|
-
* https://github.com/WaywardGame/types/wiki
|
|
10
|
-
*/
|
|
11
|
-
import { Action } from "game/entity/action/Action";
|
|
12
|
-
import type { ActionType } from "game/entity/action/IAction";
|
|
13
|
-
import { ActionArgument } from "game/entity/action/IAction";
|
|
14
|
-
import type Player from "game/entity/player/Player";
|
|
15
|
-
declare const _default: Action<[ActionArgument.Integer32, ActionArgument.Boolean], Player, void, import("game/entity/action/IAction").IActionUsable, [number, boolean]>;
|
|
16
|
-
export default _default;
|
|
17
|
-
export declare function waitForActionConfirmerResponse(executor: Player, type: ActionType): Promise<boolean>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2011-2021 Unlok
|
|
3
|
-
* https://www.unlok.ca
|
|
4
|
-
*
|
|
5
|
-
* Credits & Thanks:
|
|
6
|
-
* https://www.unlok.ca/credits-thanks/
|
|
7
|
-
*
|
|
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
|
-
* https://github.com/WaywardGame/types/wiki
|
|
10
|
-
*/
|
|
11
|
-
import { Action } from "game/entity/action/Action";
|
|
12
|
-
import { ActionArgument } from "game/entity/action/IAction";
|
|
13
|
-
declare const _default: Action<[ActionArgument.Item, ActionArgument.Integer32, [ActionArgument.Boolean, ActionArgument.Undefined]], import("../../Human").default, void, import("game/entity/action/IAction").IActionUsable, [import("../../../item/Item").default, number, (boolean | undefined)?]>;
|
|
14
|
-
export default _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2011-2021 Unlok
|
|
3
|
-
* https://www.unlok.ca
|
|
4
|
-
*
|
|
5
|
-
* Credits & Thanks:
|
|
6
|
-
* https://www.unlok.ca/credits-thanks/
|
|
7
|
-
*
|
|
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
|
-
* https://github.com/WaywardGame/types/wiki
|
|
10
|
-
*/
|
|
11
|
-
import type { AnyActionDescription } from "game/entity/action/IAction";
|
|
12
|
-
import { ActionArgument, ActionType } from "game/entity/action/IAction";
|
|
13
|
-
import type Entity from "game/entity/Entity";
|
|
14
|
-
import { PacketType } from "multiplayer/packets/IPacket";
|
|
15
|
-
import ActionPacketBase from "multiplayer/packets/shared/ActionPacketBase";
|
|
16
|
-
export default class ActionConfirmerPacket extends ActionPacketBase {
|
|
17
|
-
entity: Entity;
|
|
18
|
-
actionType: ActionType;
|
|
19
|
-
arguments: any[];
|
|
20
|
-
argumentTypes: ActionArgument[];
|
|
21
|
-
getType(): PacketType;
|
|
22
|
-
get action(): AnyActionDescription;
|
|
23
|
-
getDebugInfo(): string;
|
|
24
|
-
process(): void;
|
|
25
|
-
protected writeData(): void;
|
|
26
|
-
protected readData(): void;
|
|
27
|
-
}
|