@wayward/types 2.13.0-beta.dev.20230422.1 → 2.13.0-beta.dev.20230423.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/doodad/Doodad.d.ts +1 -1
- package/definitions/game/game/doodad/IDoodad.d.ts +2 -2
- package/definitions/game/game/entity/IHuman.d.ts +10 -10
- package/definitions/game/game/entity/player/IMessageManager.d.ts +2 -0
- package/definitions/game/game/entity/player/MessageManager.d.ts +3 -0
- package/definitions/game/game/inspection/handlers/TilePositionInspection.d.ts +1 -1
- package/definitions/game/game/inspection/infoProviders/CivilizationScore.d.ts +1 -1
- package/definitions/game/game/inspection/infoProviders/ContainedItems.d.ts +1 -1
- package/definitions/game/game/inspection/infoProviders/DoodadSkill.d.ts +1 -1
- package/definitions/game/game/island/IIsland.d.ts +2 -3
- package/definitions/game/game/island/Island.d.ts +5 -6
- package/definitions/game/game/island/IslandManager.d.ts +1 -1
- package/definitions/game/game/island/Port.d.ts +43 -0
- package/definitions/game/game/item/IItem.d.ts +4 -4
- package/definitions/game/game/item/IItemManager.d.ts +16 -2
- package/definitions/game/game/item/ItemFinder.d.ts +2 -2
- package/definitions/game/game/item/ItemManager.d.ts +47 -28
- package/definitions/game/game/mapping/IRegion.d.ts +22 -0
- package/definitions/game/game/temperature/TemperatureManager.d.ts +2 -2
- package/definitions/game/language/Dictionary.d.ts +2 -1
- package/definitions/game/language/DictionaryMap.d.ts +17 -15
- package/definitions/game/language/Translation.d.ts +4 -1
- package/definitions/game/language/dictionary/Misc.d.ts +5 -4
- package/definitions/game/language/dictionary/UiTranslation.d.ts +1 -1
- package/definitions/game/language/english/game/Regions.d.ts +13 -0
- package/definitions/game/language/utility/TranslationSorter.d.ts +3 -3
- package/definitions/game/save/serializer/Serializer.d.ts +1 -1
- package/definitions/game/ui/component/dropdown/IslandPortsDropdown.d.ts +1 -1
- package/definitions/game/ui/old/OldUi.d.ts +0 -2
- package/definitions/game/ui/old/screens/InGameScreen.d.ts +11 -4
- package/definitions/game/ui/screen/screens/game/dialog/BookDialog.d.ts +2 -2
- package/definitions/game/ui/screen/screens/game/dialog/CraftingDialog.d.ts +4 -4
- package/definitions/game/ui/screen/screens/game/dialog/MapDialog.d.ts +3 -3
- package/definitions/game/ui/screen/screens/game/static/ActionBar.d.ts +1 -1
- package/definitions/game/utilities/Version.d.ts +15 -9
- package/package.json +1 -1
|
@@ -300,7 +300,7 @@ export default class Doodad extends Entity<IDoodadDescription, DoodadType, Dooda
|
|
|
300
300
|
* @param item The item that is being added to the bookcase.
|
|
301
301
|
* @param add True if adding score, false if you are substracting.
|
|
302
302
|
*/
|
|
303
|
-
updateBookcase(
|
|
303
|
+
updateBookcase(items: Item[], add: boolean): void;
|
|
304
304
|
/**
|
|
305
305
|
* Determines which graphic to show based on how full the bookcase is with books/text.
|
|
306
306
|
* @param item set to true if DisplayableItemType is to be returned.
|
|
@@ -188,8 +188,8 @@ export interface IDoodadDescription extends IObjectDescription, IModdable, ICaus
|
|
|
188
188
|
*/
|
|
189
189
|
getAssociatedItem?(doodad: Doodad): ItemType | ItemTypeExtra | undefined;
|
|
190
190
|
getVariation?(island: Island, tile: Tile, doodad: Doodad | undefined, existingVariationX: number, existingVariationY: number): [number, number] | undefined;
|
|
191
|
-
onContainerItemAdd?(container: Doodad & IContainer,
|
|
192
|
-
onContainerItemRemove?(container: Doodad & IContainer,
|
|
191
|
+
onContainerItemAdd?(container: Doodad & IContainer, items: Item[]): void;
|
|
192
|
+
onContainerItemRemove?(container: Doodad & IContainer, items: Item[]): void;
|
|
193
193
|
/**
|
|
194
194
|
* Item groups of this type in the container will provide skill bonuses to adjacent players.
|
|
195
195
|
*/
|
|
@@ -49,23 +49,23 @@ export interface IHumanEvents extends Events<EntityWithStats>, ISkillEvents {
|
|
|
49
49
|
restEnd(restData: IRestData): any;
|
|
50
50
|
/**
|
|
51
51
|
* Called when an item is added to the player's inventory
|
|
52
|
-
* @param item The
|
|
53
|
-
* @param container The container object the
|
|
52
|
+
* @param item The items
|
|
53
|
+
* @param container The container object the items were added to. This container might be inventory or a container within the inventory.
|
|
54
54
|
*/
|
|
55
|
-
inventoryItemAdd(
|
|
55
|
+
inventoryItemAdd(items: Item[], container: IContainer): any;
|
|
56
56
|
/**
|
|
57
57
|
* Called when an item is removed from the players inventory
|
|
58
|
-
* @param item The
|
|
59
|
-
* @param container The container object the
|
|
58
|
+
* @param item The items
|
|
59
|
+
* @param container The container object the items were moved to.
|
|
60
60
|
*/
|
|
61
|
-
inventoryItemRemove(
|
|
61
|
+
inventoryItemRemove(items: Item[], container: IContainer): any;
|
|
62
62
|
/**
|
|
63
63
|
* Called when an item is moved from one container to another, while still in the players inventory.
|
|
64
|
-
* @param
|
|
65
|
-
* @param container The container object the
|
|
66
|
-
* @param previousContainer The container object the
|
|
64
|
+
* @param items The items
|
|
65
|
+
* @param container The container object the items were moved to. This container might be inventory or a container within the inventory.
|
|
66
|
+
* @param previousContainer The container object the items were moved from. This container might be inventory or a container within the inventory.
|
|
67
67
|
*/
|
|
68
|
-
inventoryItemUpdate(
|
|
68
|
+
inventoryItemUpdate(items: Item[], container: IContainer, previousContainer?: IContainer): any;
|
|
69
69
|
/**
|
|
70
70
|
* Called when the human equips an item to a slot
|
|
71
71
|
* @param item The item being equipped
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type Stream from "@wayward/goodstream";
|
|
12
12
|
import type Human from "game/entity/Human";
|
|
13
13
|
import type Island from "game/island/Island";
|
|
14
|
+
import type Dictionary from "language/Dictionary";
|
|
14
15
|
import type { ISerializedTranslation, TranslationArg } from "language/ITranslation";
|
|
15
16
|
import type Translation from "language/Translation";
|
|
16
17
|
import type Message from "language/dictionary/Message";
|
|
@@ -127,6 +128,7 @@ export interface IMessageManager {
|
|
|
127
128
|
* Signal that the message was sent to everyone
|
|
128
129
|
*/
|
|
129
130
|
sentToAll(sentToAll?: boolean): this;
|
|
131
|
+
upgrade(id: `${keyof typeof Dictionary}:${string}`, dictionary: Dictionary, entry: number): this;
|
|
130
132
|
}
|
|
131
133
|
export interface IMessageHistoryItem {
|
|
132
134
|
id: number;
|
|
@@ -14,6 +14,7 @@ import type { IMessage, IMessageHistoryItem, IMessageManager, IPackedMessage } f
|
|
|
14
14
|
import { MessageType, Source } from "game/entity/player/IMessageManager";
|
|
15
15
|
import type Player from "game/entity/player/Player";
|
|
16
16
|
import type Island from "game/island/Island";
|
|
17
|
+
import type Dictionary from "language/Dictionary";
|
|
17
18
|
import Message from "language/dictionary/Message";
|
|
18
19
|
import type { TranslationArg } from "language/ITranslation";
|
|
19
20
|
import Translation from "language/Translation";
|
|
@@ -33,6 +34,7 @@ export declare class MessageManagerNoOp implements IMessageManager {
|
|
|
33
34
|
sentToAll(sentToAll?: boolean): this;
|
|
34
35
|
pruneMessageHistory(isLocalPlayer: boolean): boolean;
|
|
35
36
|
addToHistory(messageHistoryItem: IMessageHistoryItem): void;
|
|
37
|
+
upgrade(): this;
|
|
36
38
|
}
|
|
37
39
|
export interface IMessageManagerOptions {
|
|
38
40
|
shouldDisplayMessage(message: IMessage, id: number): boolean | undefined;
|
|
@@ -123,4 +125,5 @@ export default class MessageManager implements IMessageManager {
|
|
|
123
125
|
*/
|
|
124
126
|
sentToAll(sentToAll?: boolean): this;
|
|
125
127
|
private reset;
|
|
128
|
+
upgrade(id: `${keyof typeof Dictionary}:${string}`, dictionary: Dictionary, entry: number): this;
|
|
126
129
|
}
|
|
@@ -31,7 +31,7 @@ export default class TilePositionInspection extends InspectionsHandler {
|
|
|
31
31
|
protected onTileEventMove(tileEvent: TileEvent): void;
|
|
32
32
|
protected onTileEventCreate(_: any, tileEvent: TileEvent): void;
|
|
33
33
|
protected onItemCreate(_: any, item: Item): void;
|
|
34
|
-
protected onItemMove(_: any,
|
|
34
|
+
protected onItemMove(_: any, _items: Item[], containerFrom: IContainer | undefined, _containerFromTile: Tile | undefined, containerTo: IContainer): void;
|
|
35
35
|
protected onCorpseCreate(_: any, corpse: Corpse): void;
|
|
36
36
|
protected onDoodadCreate(_: any, doodad: Doodad): void;
|
|
37
37
|
private updateInspectionsForEntity;
|
|
@@ -25,6 +25,6 @@ export default class CivilizationInfoProvider extends InfoProvider {
|
|
|
25
25
|
getDefaultDisplayLevel(): InfoDisplayLevel;
|
|
26
26
|
hasContent(): boolean;
|
|
27
27
|
get(): LabelledValue;
|
|
28
|
-
protected onItemMove(_: any,
|
|
28
|
+
protected onItemMove(_: any, items: Item[], previousContainer: IContainer | undefined, _previousContainerTile: Tile | undefined, newContainer: IContainer): void;
|
|
29
29
|
private getCivilizationScore;
|
|
30
30
|
}
|
|
@@ -24,5 +24,5 @@ export default class ContainedItemsInfoProvider extends InfoProvider {
|
|
|
24
24
|
getDefaultDisplayLevel(): InfoDisplayLevel;
|
|
25
25
|
hasContent(): boolean;
|
|
26
26
|
get(): LabelledValue;
|
|
27
|
-
protected onItemMove(_: any,
|
|
27
|
+
protected onItemMove(_: any, items: Item[], previousContainer: IContainer | undefined, _previousContainerTile: Tile | undefined, newContainer: IContainer): void;
|
|
28
28
|
}
|
|
@@ -25,5 +25,5 @@ export default class DoodadSkillInfoProvider extends InfoProvider {
|
|
|
25
25
|
getDefaultDisplayLevel(): InfoDisplayLevel;
|
|
26
26
|
hasContent(): boolean;
|
|
27
27
|
get(): LabelledValue;
|
|
28
|
-
protected onItemMove(_: any,
|
|
28
|
+
protected onItemMove(_: any, items: Item[], previousContainer: IContainer | undefined, _previousContainerTile: Tile | undefined, newContainer: IContainer): void;
|
|
29
29
|
}
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type { BiomeType } from "game/biome/IBiome";
|
|
12
|
-
import type Doodad from "game/doodad/Doodad";
|
|
13
12
|
import type Creature from "game/entity/creature/Creature";
|
|
14
13
|
import type { CreatureType, IDamageOutcome, IDamageOutcomeInput } from "game/entity/creature/ICreature";
|
|
15
14
|
import type Human from "game/entity/Human";
|
|
16
15
|
import type { DamageType, Defense } from "game/entity/IEntity";
|
|
17
16
|
import type NPC from "game/entity/npc/NPC";
|
|
18
17
|
import type { IIslandTemplate, TickFlag, TileUpdateType } from "game/IGame";
|
|
18
|
+
import type Port from "game/island/Port";
|
|
19
19
|
import type { MultiplayerLoadingDescription } from "game/meta/Loading";
|
|
20
20
|
import type { TerrainType } from "game/tile/ITerrain";
|
|
21
21
|
import type Tile from "game/tile/Tile";
|
|
@@ -86,9 +86,8 @@ export interface IIslandEvents {
|
|
|
86
86
|
rename(human: Human, newName?: string, oldName?: string): any;
|
|
87
87
|
/**
|
|
88
88
|
* Emitted when island ports have changed
|
|
89
|
-
* @param doodad Doodad that caused the change
|
|
90
89
|
*/
|
|
91
|
-
portsChanged(
|
|
90
|
+
portsChanged(addedPort?: Port, removedPort?: Port): any;
|
|
92
91
|
getDefense(defense: Defense | undefined, target: Human | Creature | CreatureType, damageType?: DamageType): Defense | undefined;
|
|
93
92
|
calculateAttackOutcome(damageOutcome: IDamageOutcome, input: IDamageOutcomeInput, attackValue: number, defenseValue: number): IDamageOutcome | undefined;
|
|
94
93
|
}
|
|
@@ -15,7 +15,6 @@ import { TickFlag, TileUpdateType } from "game/IGame";
|
|
|
15
15
|
import { Quality } from "game/IObject";
|
|
16
16
|
import type { BiomeTypes } from "game/biome/IBiome";
|
|
17
17
|
import type { ITemplateBiomeOptions } from "game/biome/template/Template";
|
|
18
|
-
import type Doodad from "game/doodad/Doodad";
|
|
19
18
|
import DoodadManager from "game/doodad/DoodadManager";
|
|
20
19
|
import Human from "game/entity/Human";
|
|
21
20
|
import type { SkillType } from "game/entity/IHuman";
|
|
@@ -25,8 +24,9 @@ import type { IDamageInfo, IDamageOutcome, IDamageOutcomeInput } from "game/enti
|
|
|
25
24
|
import CorpseManager from "game/entity/creature/corpse/CorpseManager";
|
|
26
25
|
import FlowFieldManager from "game/entity/flowfield/FlowFieldManager";
|
|
27
26
|
import NPCManager from "game/entity/npc/NPCManager";
|
|
28
|
-
import type { IIslandEvents, IIslandLoadOptions,
|
|
27
|
+
import type { IIslandEvents, IIslandLoadOptions, IMobCheck, ISeeds, IWaterContamination, IWaterFill, IWell, IslandId } from "game/island/IIsland";
|
|
29
28
|
import { WaterType } from "game/island/IIsland";
|
|
29
|
+
import { PortManager } from "game/island/Port";
|
|
30
30
|
import type { ILiquidGather } from "game/item/IItem";
|
|
31
31
|
import type { IRequirementInfo } from "game/item/IItemManager";
|
|
32
32
|
import ItemManager from "game/item/ItemManager";
|
|
@@ -69,9 +69,12 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
69
69
|
readonly flowFieldManager: FlowFieldManager;
|
|
70
70
|
readonly items: ItemManager;
|
|
71
71
|
readonly npcs: NPCManager;
|
|
72
|
+
readonly ports: PortManager;
|
|
72
73
|
readonly temperature: TemperatureManager;
|
|
73
74
|
readonly tileEvents: TileEventManager;
|
|
74
75
|
readonly time: TimeManager;
|
|
76
|
+
saveVersion: string;
|
|
77
|
+
saveBuildTime?: number;
|
|
75
78
|
biomeType: BiomeTypes;
|
|
76
79
|
civilizationScore: number;
|
|
77
80
|
civilizationScoreTiles: Record<number, number>;
|
|
@@ -81,11 +84,9 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
81
84
|
name?: string;
|
|
82
85
|
position: IVector2;
|
|
83
86
|
readonly mapSize: number;
|
|
84
|
-
readonly ports: Map<number, IIslandPort>;
|
|
85
87
|
readonly treasureMaps: DrawnMap[];
|
|
86
88
|
readonly wellData: SaferNumberIndexedObject<IWell>;
|
|
87
89
|
referenceId?: number;
|
|
88
|
-
saveVersion: string;
|
|
89
90
|
templateBiomeOptions: ITemplateBiomeOptions | undefined;
|
|
90
91
|
tileContainers: ITileContainer[];
|
|
91
92
|
version: string;
|
|
@@ -263,6 +264,4 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
263
264
|
* Returns the type of liquid that can be gathered from the tile
|
|
264
265
|
*/
|
|
265
266
|
getLiquidGatherType(terrainType: TerrainType, terrainDescription: ITerrainDescription): keyof ILiquidGather | undefined;
|
|
266
|
-
addIslandPort(doodad: Doodad): void;
|
|
267
|
-
removeIslandPort(doodad: Doodad): boolean;
|
|
268
267
|
}
|
|
@@ -38,7 +38,7 @@ export default class IslandManager extends Map<IslandId, Island> {
|
|
|
38
38
|
* Gets an island by id. Try to use "get" instead!
|
|
39
39
|
* @returns Island or undefined if it does not exist
|
|
40
40
|
*/
|
|
41
|
-
getIfExists(islandId
|
|
41
|
+
getIfExists(islandId?: IslandId): Island | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Gets an island by position
|
|
44
44
|
*/
|
|
@@ -0,0 +1,43 @@
|
|
|
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 Doodad from "game/doodad/Doodad";
|
|
12
|
+
import type { IslandId } from "game/island/IIsland";
|
|
13
|
+
import type Island from "game/island/Island";
|
|
14
|
+
import type { Reference, ReferenceType } from "game/reference/IReferenceManager";
|
|
15
|
+
import { type ISerializedTranslation } from "language/ITranslation";
|
|
16
|
+
import TranslationImpl from "language/impl/TranslationImpl";
|
|
17
|
+
import { type ISerializer, type IUnserializedCallback } from "save/serializer/ISerializer";
|
|
18
|
+
import type { IVector3 } from "utilities/math/IVector";
|
|
19
|
+
interface IPort {
|
|
20
|
+
id: number;
|
|
21
|
+
islandId: IslandId;
|
|
22
|
+
renamed?: string | ISerializedTranslation;
|
|
23
|
+
name: ISerializedTranslation;
|
|
24
|
+
position: IVector3;
|
|
25
|
+
doodadRef?: Reference<ReferenceType.Doodad>;
|
|
26
|
+
}
|
|
27
|
+
interface Port extends Readonly<IPort> {
|
|
28
|
+
}
|
|
29
|
+
declare class Port {
|
|
30
|
+
static fromDoodad(doodad: Doodad): Port;
|
|
31
|
+
constructor(port: IPort);
|
|
32
|
+
get doodad(): Doodad | undefined;
|
|
33
|
+
get island(): Island | undefined;
|
|
34
|
+
getName(): TranslationImpl;
|
|
35
|
+
}
|
|
36
|
+
export default Port;
|
|
37
|
+
export declare class PortManager extends Map<number, Port> implements IUnserializedCallback {
|
|
38
|
+
private readonly island;
|
|
39
|
+
constructor(island: Island);
|
|
40
|
+
onUnserialized(serializer: ISerializer): void;
|
|
41
|
+
register(doodad: Doodad): void;
|
|
42
|
+
deregister(doodad: Doodad): boolean;
|
|
43
|
+
}
|
|
@@ -20,7 +20,7 @@ import type { Stat } from "game/entity/IStats";
|
|
|
20
20
|
import type { IDecayTemperatureRange } from "game/IGame";
|
|
21
21
|
import type { IObjectDescription, Quality } from "game/IObject";
|
|
22
22
|
import type { IslandId } from "game/island/IIsland";
|
|
23
|
-
import type {
|
|
23
|
+
import type { IMoveItemOptions } from "game/item/IItemManager";
|
|
24
24
|
import type Item from "game/item/Item";
|
|
25
25
|
import type Recipe from "game/item/recipe/Recipe";
|
|
26
26
|
import type MagicalPropertyManager from "game/magic/MagicalPropertyManager";
|
|
@@ -289,8 +289,8 @@ export interface IItemDescription extends IObjectDescription, IModdable, ITemper
|
|
|
289
289
|
displayItem?: SupplierOr<DisplayableItemType | undefined, [Item]>;
|
|
290
290
|
onEquip?(item: Item): void;
|
|
291
291
|
onUnequip?(item: Item): void;
|
|
292
|
-
onContainerItemAdd?(container: Item & IContainer,
|
|
293
|
-
onContainerItemRemove?(container: Item & IContainer,
|
|
292
|
+
onContainerItemAdd?(container: Item & IContainer, items: Item[]): void;
|
|
293
|
+
onContainerItemRemove?(container: Item & IContainer, items: Item[]): void;
|
|
294
294
|
onCreate?(item: Item): void;
|
|
295
295
|
onChangeInto?(item: Item, fromItemType: ItemType): void;
|
|
296
296
|
}
|
|
@@ -449,7 +449,7 @@ export interface IMoveToTileOptions {
|
|
|
449
449
|
toTile: Tile;
|
|
450
450
|
toTileApplyPlayerOffset?: boolean;
|
|
451
451
|
toContainer?: IContainer;
|
|
452
|
-
toContainerOptions?:
|
|
452
|
+
toContainerOptions?: IMoveItemOptions;
|
|
453
453
|
beforeMovement?: IMoveToTileBeforeMovementOptions;
|
|
454
454
|
extinguishTorches?: boolean;
|
|
455
455
|
/**
|
|
@@ -89,10 +89,20 @@ export interface IDoodadsUsed {
|
|
|
89
89
|
doodad: Doodad;
|
|
90
90
|
group: DoodadType | DoodadTypeGroup;
|
|
91
91
|
}
|
|
92
|
-
export interface
|
|
92
|
+
export interface IMoveItemOptions {
|
|
93
|
+
onMoveItem?: (item: Item) => void;
|
|
94
|
+
filter?: {
|
|
95
|
+
itemType?: ItemType;
|
|
96
|
+
itemQuality?: Quality;
|
|
97
|
+
filterText?: string;
|
|
98
|
+
};
|
|
93
99
|
skipMessage?: boolean;
|
|
94
|
-
|
|
100
|
+
skipSound?: boolean;
|
|
95
101
|
skipTileUpdate?: boolean;
|
|
102
|
+
skipUpdateTables?: boolean;
|
|
103
|
+
skipWeightChecks?: boolean;
|
|
104
|
+
suspendNotifier?: boolean;
|
|
105
|
+
moveToTileOptions?: IMoveToTileOptions;
|
|
96
106
|
}
|
|
97
107
|
export interface IPlaceOnTileOptions {
|
|
98
108
|
force?: boolean;
|
|
@@ -124,3 +134,7 @@ export interface ICraftResultChances {
|
|
|
124
134
|
export declare namespace ICraftResultChances {
|
|
125
135
|
const NEVER: Readonly<ICraftResultChances>;
|
|
126
136
|
}
|
|
137
|
+
export interface IAddToContainerResult {
|
|
138
|
+
itemsMoved: Item[];
|
|
139
|
+
noMoreRoomForItems: Item[];
|
|
140
|
+
}
|
|
@@ -39,8 +39,8 @@ export default class ItemFinder extends EventEmitter.Host<IItemFinderEvents> {
|
|
|
39
39
|
markDirty(): void;
|
|
40
40
|
private compute;
|
|
41
41
|
protected onItemStateChange(item: Item): void;
|
|
42
|
-
protected onContainerItemAdd(items: ItemManager,
|
|
43
|
-
protected onContainerItemRemove(items: ItemManager,
|
|
42
|
+
protected onContainerItemAdd(items: ItemManager, itemsAdded: Item[], containerAddedTo: IContainer): void;
|
|
43
|
+
protected onContainerItemRemove(items: ItemManager, itemsRemoved: Item[], containerRemovedFrom?: IContainer): void;
|
|
44
44
|
protected onLoadOnIsland(player: Player): void;
|
|
45
45
|
private trackContainer;
|
|
46
46
|
private untrackContainer;
|
|
@@ -16,9 +16,9 @@ import Human from "game/entity/Human";
|
|
|
16
16
|
import type NPC from "game/entity/npc/NPC";
|
|
17
17
|
import type Player from "game/entity/player/Player";
|
|
18
18
|
import { Quality } from "game/IObject";
|
|
19
|
-
import type { ContainerReference, IContainable, IContainer, IItemDescription, IItemWeightComponent,
|
|
19
|
+
import type { ContainerReference, IContainable, IContainer, IItemDescription, IItemWeightComponent, IRecipe } from "game/item/IItem";
|
|
20
20
|
import { ContainerType, CraftResult, ItemType, ItemTypeExtra, ItemTypeGroup } from "game/item/IItem";
|
|
21
|
-
import type {
|
|
21
|
+
import type { IMoveItemOptions, IAddToContainerResult, IDoodadsUsed, IGetBestItemsOptions, IGetItemOptions, IGetItemsOptions, IRequirementInfo } from "game/item/IItemManager";
|
|
22
22
|
import { ContainerReferenceSource, CraftStatus, ICraftResultChances, WeightType } from "game/item/IItemManager";
|
|
23
23
|
import Item from "game/item/Item";
|
|
24
24
|
import { ObjectManager } from "game/ObjectManager";
|
|
@@ -34,29 +34,32 @@ import type { Random } from "utilities/random/Random";
|
|
|
34
34
|
export interface IItemManagerEvents {
|
|
35
35
|
create(item: Item): any;
|
|
36
36
|
remove(item: Item): any;
|
|
37
|
-
canMoveItem(human: Human | undefined, item: Item, toContainer: IContainer): boolean | undefined;
|
|
38
|
-
canMoveItems(human: Human | undefined, fromContainer: IContainer, toContainer: IContainer, itemType: ItemType | undefined, ofQuality: Quality | undefined): boolean | undefined;
|
|
39
37
|
/**
|
|
40
|
-
* Called
|
|
41
|
-
|
|
38
|
+
* Called before moving items to another container
|
|
39
|
+
*/
|
|
40
|
+
canMoveItems(human: Human | undefined, itemsToMove: Item[], fromContainer: IContainer | undefined, toContainer: IContainer, options?: IMoveItemOptions): boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Called when items are removed from a container.
|
|
43
|
+
* @param items The items.
|
|
42
44
|
* @param container The container object the item was removed from.
|
|
43
45
|
* @param containerTile The tile of that container when the remove occurred.
|
|
44
46
|
*/
|
|
45
|
-
containerItemRemove(
|
|
47
|
+
containerItemRemove(items: Item[], container: IContainer | undefined, containerTile: Tile | undefined): any;
|
|
46
48
|
/**
|
|
47
|
-
* Called when
|
|
48
|
-
* @param
|
|
49
|
-
* @param containerFrom The container object the
|
|
49
|
+
* Called when items are moved from one container to another.
|
|
50
|
+
* @param items The items.
|
|
51
|
+
* @param containerFrom The container object the items were moved from. This container might be inventory or a container within the inventory.
|
|
50
52
|
* @param containerFromTile The tile of containerFrom when the update occurred.
|
|
51
|
-
* @param containerTo The container object the
|
|
53
|
+
* @param containerTo The container object the items were moved to. This container might be inventory or a container within the inventory.
|
|
52
54
|
*/
|
|
53
|
-
containerItemUpdate(
|
|
55
|
+
containerItemUpdate(items: Item[], containerFrom: IContainer | undefined, containerFromTile: Tile | undefined, containerTo: IContainer): any;
|
|
54
56
|
/**
|
|
55
|
-
* Called when
|
|
56
|
-
* @param
|
|
57
|
-
* @param container The container object the
|
|
57
|
+
* Called when items are added to a container.
|
|
58
|
+
* @param items The items.
|
|
59
|
+
* @param container The container object the items were added to. This container might be inventory or a container within the inventory.
|
|
60
|
+
* @param options Move item options.
|
|
58
61
|
*/
|
|
59
|
-
containerItemAdd(
|
|
62
|
+
containerItemAdd(items: Item[], container: IContainer, options?: IMoveItemOptions): any;
|
|
60
63
|
/**
|
|
61
64
|
* Called when an item is crafted
|
|
62
65
|
* @param human The human object
|
|
@@ -130,7 +133,34 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
130
133
|
hashContainer(containable: IContainable, containerReferenceSource?: ContainerReferenceSource): string;
|
|
131
134
|
hashContainerReference(containerReference: ContainerReference): string;
|
|
132
135
|
updateContainedWithin(containable: IContainable, containedWithin: IContainer | undefined): void;
|
|
133
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Moves an item into a container
|
|
138
|
+
* @param human Human causing the item movement
|
|
139
|
+
* @param item Item to move
|
|
140
|
+
* @param toContainer Container to move the item to
|
|
141
|
+
* @param options Item move options
|
|
142
|
+
* @returns Result that tells you what moved
|
|
143
|
+
*/
|
|
144
|
+
moveItemToContainer(human: Human | undefined, item: Item, toContainer: IContainer, options?: IMoveItemOptions): IAddToContainerResult;
|
|
145
|
+
/**
|
|
146
|
+
* Moves items from one container into another container
|
|
147
|
+
* @param human Human causing the item movement
|
|
148
|
+
* @param fromContainer Source container
|
|
149
|
+
* @param toContainer Destination container
|
|
150
|
+
* @param options Item move options
|
|
151
|
+
* @returns Result that tells you what moved
|
|
152
|
+
*/
|
|
153
|
+
moveItemsFromContainer(human: Human | undefined, fromContainer: IContainer, toContainer: IContainer, options?: IMoveItemOptions): IAddToContainerResult;
|
|
154
|
+
/**
|
|
155
|
+
* Moves items to a container.
|
|
156
|
+
* Note: All the items must be contained within the same container.
|
|
157
|
+
* @param human Human causing the item movement
|
|
158
|
+
* @param item Items to move
|
|
159
|
+
* @param toContainer Destination container
|
|
160
|
+
* @param options Item move options
|
|
161
|
+
* @returns Result that tells you what moved
|
|
162
|
+
*/
|
|
163
|
+
moveItemsToContainer(human: Human | undefined, items: Item[], toContainer: IContainer, options?: IMoveItemOptions): IAddToContainerResult;
|
|
134
164
|
removeContainerItems(container: IContainer, removeContainedItems?: boolean): void;
|
|
135
165
|
exists(item: Item): boolean;
|
|
136
166
|
remove(item: Item, removeContainedItems?: boolean, extinguishTorches?: boolean): void;
|
|
@@ -140,19 +170,8 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
140
170
|
create(itemType: ItemType | ItemTypeGroup | Array<ItemType | ItemTypeGroup>, container: IContainer | undefined, quality?: Quality, human?: Human, updateTables?: boolean): Item;
|
|
141
171
|
createFake(itemType: ItemType | ItemTypeGroup | Array<ItemType | ItemTypeGroup>, quality?: Quality, human?: Human): Item;
|
|
142
172
|
getContainedContainers(container: IContainer): IContainer[];
|
|
143
|
-
moveAllFromContainerToInventory(human: Human, container: IContainer, ofQuality?: Quality): Item[];
|
|
144
173
|
computeContainerWeight(container: IContainer): number;
|
|
145
174
|
getMagicalWeightCapacity(container: IContainer): number;
|
|
146
|
-
moveAllFromContainerToContainer(human: Human | undefined, fromContainer: IContainer, toContainer: IContainer, itemType?: ItemType | undefined, ofQuality?: Quality | undefined, checkWeight?: boolean, filterText?: string | undefined, onMoveItem?: (item: Item) => void, moveToTileOptions?: IMoveToTileOptions): Item[];
|
|
147
|
-
/**
|
|
148
|
-
* Moves an item into a container when the container has enough room for it
|
|
149
|
-
* @param human Human causing the item movement
|
|
150
|
-
* @param item Item to move
|
|
151
|
-
* @param container Container to move the item to
|
|
152
|
-
* @param moveToTileOptions When set, the movement will be animated
|
|
153
|
-
* @returns True if the item was moved, false if it wasn't
|
|
154
|
-
*/
|
|
155
|
-
moveToContainer(human: Human | undefined, item: Item, container: IContainer, moveToTileOptions?: IMoveToTileOptions): boolean;
|
|
156
175
|
hasRoomInContainer(targetContainer: IContainer, itemToMove: Item): boolean;
|
|
157
176
|
/**
|
|
158
177
|
* Gets the name of a container
|
|
@@ -0,0 +1,22 @@
|
|
|
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 Island from "game/island/Island";
|
|
12
|
+
import Translation from "language/Translation";
|
|
13
|
+
import { Direction } from "utilities/math/Direction";
|
|
14
|
+
interface IRegion extends Record<Uppercase<Direction.CardinalNames>, boolean> {
|
|
15
|
+
CENTER: boolean;
|
|
16
|
+
DIRECTION: Direction;
|
|
17
|
+
REGION: Translation;
|
|
18
|
+
}
|
|
19
|
+
declare namespace IRegion {
|
|
20
|
+
function get(island: Island, x: number, y: number): IRegion;
|
|
21
|
+
}
|
|
22
|
+
export default IRegion;
|
|
@@ -150,8 +150,8 @@ export default class TemperatureManager extends EventEmitter.Host<ITemperatureMa
|
|
|
150
150
|
protected onCreateOrRemoveObject(_: any, object: Doodad | TileEvent | Creature | NPC): void;
|
|
151
151
|
protected onEntityMove(object: EntityMovable, lastTile: Tile, tile: Tile): void;
|
|
152
152
|
protected onUpdateTile(island: Island, tile: Tile, oldType: TerrainType): void;
|
|
153
|
-
protected onItemContainerAdd(itemManager: ItemManager,
|
|
154
|
-
protected onItemContainerRemove(itemManager: ItemManager,
|
|
153
|
+
protected onItemContainerAdd(itemManager: ItemManager, items: Item[], container?: IContainer): void;
|
|
154
|
+
protected onItemContainerRemove(itemManager: ItemManager, items: Item[], container: IContainer | undefined, containerTile: Tile | undefined): void;
|
|
155
155
|
protected onItemFireUpdate(item: Item): void;
|
|
156
156
|
protected onPlay(): void;
|
|
157
157
|
protected onTickStart(island: Island): void;
|
|
@@ -8,19 +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 { MilestoneSort } from "ui/screen/screens/game/dialog/IMilestonesDialog";
|
|
12
|
-
import { SkillSort } from "ui/screen/screens/game/dialog/ISkillsDialog";
|
|
13
11
|
import { Command } from "command/ICommand";
|
|
12
|
+
import { Quality } from "game/IObject";
|
|
13
|
+
import { WorldZ } from "game/WorldZ";
|
|
14
14
|
import { BiomeType } from "game/biome/IBiome";
|
|
15
15
|
import { DoodadType, DoodadTypeExtra, DoodadTypeGroup, GrowingStage } from "game/doodad/IDoodad";
|
|
16
|
-
import { MapQuality } from "game/entity/action/actions/map/MapQuality";
|
|
17
|
-
import { ActionType } from "game/entity/action/IAction";
|
|
18
|
-
import { UsableActionType } from "game/entity/action/usable/UsableActionType";
|
|
19
16
|
import { CombatDangerLevel, CombatStrength } from "game/entity/CombatStrengthManager";
|
|
20
|
-
import { CreatureType } from "game/entity/creature/ICreature";
|
|
21
17
|
import { AiType, DamageType, StatusType } from "game/entity/IEntity";
|
|
22
18
|
import { EquipType, SkillType } from "game/entity/IHuman";
|
|
23
19
|
import { Stat } from "game/entity/IStats";
|
|
20
|
+
import { ActionType } from "game/entity/action/IAction";
|
|
21
|
+
import { MapQuality } from "game/entity/action/actions/map/MapQuality";
|
|
22
|
+
import { UsableActionType } from "game/entity/action/usable/UsableActionType";
|
|
23
|
+
import { CreatureType } from "game/entity/creature/ICreature";
|
|
24
24
|
import { NPCType } from "game/entity/npc/INPCs";
|
|
25
25
|
import { Source } from "game/entity/player/IMessageManager";
|
|
26
26
|
import { WeightStatus } from "game/entity/player/IPlayer";
|
|
@@ -31,9 +31,8 @@ import { BleedLevel } from "game/entity/status/handler/IBleeding";
|
|
|
31
31
|
import { ExhaustionLevel } from "game/entity/status/handler/IExhausted";
|
|
32
32
|
import { InfoDisplayLevel } from "game/inspection/IInfoProvider";
|
|
33
33
|
import { InspectType } from "game/inspection/IInspection";
|
|
34
|
-
import { DurabilityLevel } from "game/inspection/infoProviders/doodad/IDurability";
|
|
35
34
|
import { Level } from "game/inspection/infoProviders/ILevel";
|
|
36
|
-
import {
|
|
35
|
+
import { DurabilityLevel } from "game/inspection/infoProviders/doodad/IDurability";
|
|
37
36
|
import { BookType, EquipEffect, ItemType, ItemTypeExtra, ItemTypeGroup, RecipeLevel } from "game/item/IItem";
|
|
38
37
|
import { CraftEfficacy } from "game/item/recipe/Crafter";
|
|
39
38
|
import { MagicalPropertyType } from "game/magic/MagicalPropertyType";
|
|
@@ -48,11 +47,10 @@ import { IslandModifierType } from "game/options/modifiers/island/IslandModifier
|
|
|
48
47
|
import { MilestoneModifierGroup } from "game/options/modifiers/milestone/MilestoneModifier";
|
|
49
48
|
import Riddle from "game/riddle/Riddle";
|
|
50
49
|
import { TempType } from "game/temperature/ITemperature";
|
|
51
|
-
import { FireStage } from "game/tile/events/IFire";
|
|
52
50
|
import { TerrainType } from "game/tile/ITerrain";
|
|
53
51
|
import { TileEventType } from "game/tile/ITileEvent";
|
|
52
|
+
import { FireStage } from "game/tile/events/IFire";
|
|
54
53
|
import { PartOfDay } from "game/time/ITimeManager";
|
|
55
|
-
import { WorldZ } from "game/WorldZ";
|
|
56
54
|
import Dictionary from "language/Dictionary";
|
|
57
55
|
import { GameEndMessage } from "language/dictionary/GameEndMessage";
|
|
58
56
|
import { Health, HealthAccuracy } from "language/dictionary/Health";
|
|
@@ -63,27 +61,29 @@ import { MiscTranslation } from "language/dictionary/Misc";
|
|
|
63
61
|
import { MultiplayerCompatibility } from "language/dictionary/MultiplayerCompatibility";
|
|
64
62
|
import Note from "language/dictionary/Note";
|
|
65
63
|
import UiTranslation from "language/dictionary/UiTranslation";
|
|
66
|
-
import { IslandName } from "language/english/game/islandName/IslandName";
|
|
67
64
|
import { LighthouseName } from "language/english/game/LighthouseName";
|
|
65
|
+
import { IslandName } from "language/english/game/islandName/IslandName";
|
|
68
66
|
import { ModProvide, ModType } from "mod/IModInfo";
|
|
69
67
|
import { CanLoadState, ModLoadFailureReason } from "mod/IModManager";
|
|
70
68
|
import { DisconnectReason, JoinServerRetryReason, UnableToJoinReason } from "multiplayer/IMultiplayer";
|
|
71
|
-
import { MusicPlaylist, TooltipVisibilityOption } from "save/data/ISaveDataGlobal";
|
|
72
69
|
import { SaveImportErrorReason, SaveSort } from "save/ISaveManager";
|
|
73
|
-
import
|
|
70
|
+
import { MusicPlaylist, TooltipVisibilityOption } from "save/data/ISaveDataGlobal";
|
|
74
71
|
import { FontStyle } from "ui/IUi";
|
|
72
|
+
import Bindable, { BindableType } from "ui/input/Bindable";
|
|
75
73
|
import { SortType } from "ui/old/IOldUi";
|
|
76
|
-
import { Quadrant, QuadrantComponentContextMenuAction } from "ui/screen/screens/game/component/IQuadrantComponent";
|
|
77
74
|
import { DialogId } from "ui/screen/screens/game/Dialogs";
|
|
78
75
|
import { MessageTimestamp, QuadrantComponentId } from "ui/screen/screens/game/IGameScreenApi";
|
|
79
76
|
import { MessageFilterDefault } from "ui/screen/screens/game/IMessages";
|
|
77
|
+
import { Quadrant, QuadrantComponentContextMenuAction } from "ui/screen/screens/game/component/IQuadrantComponent";
|
|
78
|
+
import { MilestoneSort } from "ui/screen/screens/game/dialog/IMilestonesDialog";
|
|
79
|
+
import { SkillSort } from "ui/screen/screens/game/dialog/ISkillsDialog";
|
|
80
80
|
import { ActionSort } from "ui/screen/screens/game/static/actions/IActionsDrawer";
|
|
81
81
|
import { MenuBarButtonType } from "ui/screen/screens/game/static/menubar/IMenuBarButton";
|
|
82
82
|
import { CharacterSort } from "ui/screen/screens/menu/menus/character/Character";
|
|
83
83
|
import { HelpArticle } from "ui/screen/screens/menu/menus/help/HelpArticleDescriptions";
|
|
84
84
|
import { HighscoreSort } from "ui/screen/screens/menu/menus/highscores/IHighscoresMenu";
|
|
85
|
-
import { Website } from "ui/screen/screens/menu/menus/main/component/IWebsite";
|
|
86
85
|
import { Responsibility } from "ui/screen/screens/menu/menus/main/IAbout";
|
|
86
|
+
import { Website } from "ui/screen/screens/menu/menus/main/component/IWebsite";
|
|
87
87
|
import { ModSort } from "ui/screen/screens/menu/menus/mods/IModsMenu";
|
|
88
88
|
import { Direction } from "utilities/math/Direction";
|
|
89
89
|
import { ChangeType } from "utilities/trello/ITrello";
|
|
@@ -112,6 +112,7 @@ declare const dictionaryMap: {
|
|
|
112
112
|
19: typeof DamageType;
|
|
113
113
|
20: typeof DialogId;
|
|
114
114
|
21: typeof Direction;
|
|
115
|
+
110: typeof Direction;
|
|
115
116
|
22: typeof InfoDisplayLevel;
|
|
116
117
|
23: typeof DoodadType;
|
|
117
118
|
24: typeof DoodadTypeExtra;
|
|
@@ -224,6 +225,7 @@ export declare const strictDictionaries: {
|
|
|
224
225
|
19: typeof DamageType;
|
|
225
226
|
20: typeof DialogId;
|
|
226
227
|
21: typeof Direction;
|
|
228
|
+
110: typeof Direction;
|
|
227
229
|
22: typeof InfoDisplayLevel;
|
|
228
230
|
23: typeof DoodadType;
|
|
229
231
|
24: typeof DoodadTypeExtra;
|
|
@@ -21,7 +21,7 @@ import { EquipSlotTranslation, MiscTranslation } from "language/dictionary/Misc"
|
|
|
21
21
|
import type UiTranslation from "language/dictionary/UiTranslation";
|
|
22
22
|
import type { DictionaryEntryEnums } from "language/DictionaryMap";
|
|
23
23
|
import TranslationImpl from "language/impl/TranslationImpl";
|
|
24
|
-
import type { ISerializedTranslation } from "language/ITranslation";
|
|
24
|
+
import type { ISerializedTranslation, TranslationArg } from "language/ITranslation";
|
|
25
25
|
import { formatListTranslation } from "language/segment/FormatListSegment";
|
|
26
26
|
import ITranslationSorter from "language/utility/TranslationSorter";
|
|
27
27
|
import type { IStringSection } from "utilities/string/Interpolator";
|
|
@@ -117,6 +117,8 @@ declare module Translation {
|
|
|
117
117
|
const damage: (damageTypes: ArrayOr<DamageType>, colorize?: boolean, reformatter?: TranslationImpl | ((type: DamageType) => Translation) | undefined) => TranslationImpl;
|
|
118
118
|
function growthStage(stage: GrowingStage, spores?: boolean): TranslationImpl;
|
|
119
119
|
function growthStage(stage?: GrowingStage, spores?: boolean): TranslationImpl | undefined;
|
|
120
|
+
function merge(...content: TranslationArg[]): TranslationImpl;
|
|
121
|
+
function mergeSpaced(...content: TranslationArg[]): TranslationImpl;
|
|
120
122
|
const getString: typeof TranslationImpl.getString;
|
|
121
123
|
const resolve: typeof TranslationImpl.resolve;
|
|
122
124
|
function colorizeQuality(quality: Quality | string | undefined): Translation;
|
|
@@ -147,5 +149,6 @@ declare module Translation {
|
|
|
147
149
|
function reformatSingularNoun(article: Article): Translation;
|
|
148
150
|
function reformatSingularNoun(count: number, article: Article): Translation;
|
|
149
151
|
function reformatSingularNoun(count?: number | Article, article?: Article): Translation;
|
|
152
|
+
function upgrade(translation: ISerializedTranslation, id: `${keyof typeof Dictionary}:${string}`, dictionary: Dictionary, entry: number): void;
|
|
150
153
|
}
|
|
151
154
|
export default Translation;
|
|
@@ -138,8 +138,9 @@ export declare enum MiscTranslation {
|
|
|
138
138
|
Range = 36,
|
|
139
139
|
ReformatSingularNoun = 37,
|
|
140
140
|
Renamed = 38,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
Merge = 39,
|
|
142
|
+
MergeSpaced = 40,
|
|
143
|
+
Tilled = 41,
|
|
144
|
+
Unknown = 42,
|
|
145
|
+
UnknownItem = 43
|
|
145
146
|
}
|
|
@@ -193,7 +193,7 @@ declare enum UiTranslation {
|
|
|
193
193
|
GameTooltipIslandUnnamed = 178,
|
|
194
194
|
GameTooltipIslandSelf = 179,
|
|
195
195
|
GameTooltipIslandPlayers = 180,
|
|
196
|
-
|
|
196
|
+
GameTooltipIslandPorts = 181,
|
|
197
197
|
GameTooltipIslandNPCs = 182,
|
|
198
198
|
GameTooltipIslandModifiers = 183,
|
|
199
199
|
GameTooltipIslandMaps = 184,
|
|
@@ -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 { Direction } from "utilities/math/Direction";
|
|
12
|
+
declare const regions: Record<Direction, string>;
|
|
13
|
+
export default regions;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type Dictionary from "language/Dictionary";
|
|
12
|
-
import
|
|
12
|
+
import Translation from "language/Translation";
|
|
13
13
|
export interface ITranslationSorter<T = number> {
|
|
14
14
|
(a: T, b: T): number;
|
|
15
15
|
/**
|
|
@@ -37,12 +37,12 @@ export interface ITranslationSorter<T = number> {
|
|
|
37
37
|
/**
|
|
38
38
|
* Sets a custom translator, which takes each value to sort and makes a string from it. These strings are cached by the sorter
|
|
39
39
|
*/
|
|
40
|
-
setTranslator(translator: ITranslationSorter.Translator<
|
|
40
|
+
setTranslator<T2 = T>(translator: ITranslationSorter.Translator<T2>): ITranslationSorter<T2>;
|
|
41
41
|
}
|
|
42
42
|
declare module ITranslationSorter {
|
|
43
43
|
type EntryMapper<T = any> = (v: T) => number;
|
|
44
44
|
type SortFallback<T = any, A extends any[] = any[]> = (a: T, b: T, entryA: T extends Translation ? undefined : number, entryB: T extends Translation ? undefined : number, stringA: string, stringB: string, ...args: A) => number;
|
|
45
|
-
type Translator<T = any> = (v: T, entry
|
|
45
|
+
type Translator<T = any> = (v: T, entry?: number, dictionary?: Dictionary, index?: number) => Translation | string | undefined;
|
|
46
46
|
function create(): ITranslationSorter<Translation>;
|
|
47
47
|
function create<T = number>(dictionary: Dictionary, index?: number): ITranslationSorter<T>;
|
|
48
48
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Game } from "game/Game";
|
|
12
12
|
import type { ISerializer, ISerializerOptions } from "save/serializer/ISerializer";
|
|
13
|
-
import {
|
|
13
|
+
import { SavePropertyFlag, SerializerMetadataKey, Types } from "save/serializer/ISerializer";
|
|
14
14
|
import StringTokenizer from "save/serializer/StringTokenizer";
|
|
15
15
|
export default class Serializer implements ISerializer {
|
|
16
16
|
readonly game: Game;
|
|
@@ -8,10 +8,10 @@
|
|
|
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 { IIslandPort } from "game/island/IIsland";
|
|
11
12
|
import type Island from "game/island/Island";
|
|
12
13
|
import type Button from "ui/component/Button";
|
|
13
14
|
import Dropdown from "ui/component/Dropdown";
|
|
14
|
-
import type { IIslandPort } from "game/island/IIsland";
|
|
15
15
|
export default class IslandPortsDropdown extends Dropdown<number> {
|
|
16
16
|
private island;
|
|
17
17
|
constructor(island: Island | undefined);
|
|
@@ -52,9 +52,7 @@ export default class OldUi {
|
|
|
52
52
|
refreshContainerName(container: IContainer): void;
|
|
53
53
|
isContainerOpen(value: unknown): boolean;
|
|
54
54
|
startAddingMultipleItemsToContainer(container: IContainer): void;
|
|
55
|
-
addItemToContainer(item: Item, container: IContainer, internal?: boolean, updateTables?: boolean): void;
|
|
56
55
|
completeAddingMultipleItemsToContainer(container: IContainer, itemsToSync?: Item[]): void;
|
|
57
|
-
removeItemFromContainer(item: Item, container: IContainer): void;
|
|
58
56
|
getDialogInfo(dialogId: OldUiDialogId): IDialogInfo;
|
|
59
57
|
setVersionExtra(msg: string): void;
|
|
60
58
|
openDialogs(): void;
|
|
@@ -12,7 +12,9 @@ import type Doodad from "game/doodad/Doodad";
|
|
|
12
12
|
import type NPC from "game/entity/npc/NPC";
|
|
13
13
|
import type { ContainerReference, DisplayableItemType, IContainer, IDismantleComponent } from "game/item/IItem";
|
|
14
14
|
import { ItemType } from "game/item/IItem";
|
|
15
|
+
import type { IMoveItemOptions } from "game/item/IItemManager";
|
|
15
16
|
import Item from "game/item/Item";
|
|
17
|
+
import type ItemManager from "game/item/ItemManager";
|
|
16
18
|
import Message from "language/dictionary/Message";
|
|
17
19
|
import { SortDirection } from "save/ISaveManager";
|
|
18
20
|
import Input from "ui/component/Input";
|
|
@@ -48,6 +50,12 @@ export interface IUiContainer {
|
|
|
48
50
|
name: string;
|
|
49
51
|
owner: NPC | Doodad | Item;
|
|
50
52
|
}
|
|
53
|
+
export interface IOldUiContainerItemAdd {
|
|
54
|
+
containerDialogElement?: JQuery;
|
|
55
|
+
containerElement?: JQuery;
|
|
56
|
+
itemsToSync?: Item[];
|
|
57
|
+
skipSaveItemOrder?: boolean;
|
|
58
|
+
}
|
|
51
59
|
interface IDialogPosition {
|
|
52
60
|
title?: string;
|
|
53
61
|
x: number;
|
|
@@ -144,9 +152,7 @@ export default class InGameScreen extends BaseScreen {
|
|
|
144
152
|
private readonly SYMBOL_LAST_NEARLY_DECAYED;
|
|
145
153
|
private readonly SYMBOL_LAST_DECAY;
|
|
146
154
|
syncDecayBar(item: Item, force?: boolean, element?: HTMLElement | null): void;
|
|
147
|
-
addItemToContainer(item: Item, container: IContainer, _internal?: boolean, updateTables?: boolean, containerElement?: JQuery): void;
|
|
148
155
|
insertItemStringToContainer(itemElement: string | JQuery, containerElement: JQuery): void;
|
|
149
|
-
onAddItemsToContainer(containerElement: JQuery, containerDialogElement: JQuery | undefined, isInventoryContainer: boolean, updateTables?: boolean): void;
|
|
150
156
|
/**
|
|
151
157
|
* Call this before starting to add items to a container
|
|
152
158
|
*/
|
|
@@ -155,8 +161,9 @@ export default class InGameScreen extends BaseScreen {
|
|
|
155
161
|
* Call this after adding multiple items to a container.
|
|
156
162
|
* You must also call startAddingMultipleItemsToContainer before adding any items
|
|
157
163
|
*/
|
|
158
|
-
completeAddingMultipleItemsToContainer(container: IContainer, itemsToSync?: Item[]
|
|
159
|
-
|
|
164
|
+
completeAddingMultipleItemsToContainer(container: IContainer, itemsToSync?: Item[]): void;
|
|
165
|
+
onContainerItemAdd(itemManager: ItemManager, itemsAdded: Item[], container: IContainer, options?: IMoveItemOptions, customOptions?: IOldUiContainerItemAdd): void;
|
|
166
|
+
protected onContainerItemRemove(itemManager: ItemManager, itemsRemoved: Item[], containerRemovedFrom?: IContainer): void;
|
|
160
167
|
refreshContainerName(container: IContainer, nestedUpdate?: boolean): void;
|
|
161
168
|
getInventoryItemsInOrder(): any[];
|
|
162
169
|
saveItemOrder(containerElement: JQuery, activeSort?: boolean): void;
|
|
@@ -19,8 +19,8 @@ export default class BookDialog extends Dialog {
|
|
|
19
19
|
getName(): import("../../../../../language/ITranslation").ISerializedTranslation | import("../../../../../language/impl/TranslationImpl").default | Iterable<import("../../../../../utilities/string/Interpolator").IStringSection> | import("../../../../../language/dictionary/UiTranslation").default | undefined;
|
|
20
20
|
openBook(item: Item): void;
|
|
21
21
|
private getText;
|
|
22
|
-
protected onInventoryItemRemove(_: any,
|
|
23
|
-
protected onInventoryItemUpdate(_: any,
|
|
22
|
+
protected onInventoryItemRemove(_: any, itemOrItems: Item | Item[]): void;
|
|
23
|
+
protected onInventoryItemUpdate(_: any, items: Item[]): void;
|
|
24
24
|
protected onPostMove(player: Player): void;
|
|
25
25
|
private closeIfItemIsGone;
|
|
26
26
|
}
|
|
@@ -18,10 +18,10 @@ export default class CraftingDialog extends Dialog {
|
|
|
18
18
|
private readonly craftableWrapper;
|
|
19
19
|
constructor();
|
|
20
20
|
protected updateCraftableInventories(): void;
|
|
21
|
-
protected onContainerItemAdd(_: any,
|
|
22
|
-
protected onInventoryItemAdd(_: any,
|
|
23
|
-
protected onContainerItemRemove(_: any,
|
|
24
|
-
protected onInventoryItemRemove(_: any,
|
|
21
|
+
protected onContainerItemAdd(_: any, items: Item[], container: IContainer): void;
|
|
22
|
+
protected onInventoryItemAdd(_: any, items: Item[]): void;
|
|
23
|
+
protected onContainerItemRemove(_: any, items: Item[], previousContainer: IContainer | undefined): void;
|
|
24
|
+
protected onInventoryItemRemove(_: any, items: Item[]): void;
|
|
25
25
|
private addItem;
|
|
26
26
|
private addCraftable;
|
|
27
27
|
private removeItem;
|
|
@@ -36,10 +36,10 @@ export default class MapDialog extends PrerenderedCanvasDialog {
|
|
|
36
36
|
private rerender;
|
|
37
37
|
getName(): import("../../../../../language/impl/TranslationImpl").default;
|
|
38
38
|
read(map: DrawnMap, item: Item, resetView?: boolean): Promise<void>;
|
|
39
|
-
protected onInventoryItemRemove(_: any,
|
|
39
|
+
protected onInventoryItemRemove(_: any, itemOrItems: Item | Item[]): void;
|
|
40
40
|
protected onToggleProtected(item: Item): void;
|
|
41
|
-
protected onInventoryItemAdd(_: any,
|
|
42
|
-
protected onInventoryItemUpdate(_: any,
|
|
41
|
+
protected onInventoryItemAdd(_: any, items: Item[]): void;
|
|
42
|
+
protected onInventoryItemUpdate(_: any, items: Item[]): void;
|
|
43
43
|
protected onPostMove(player: Player): void;
|
|
44
44
|
protected onLoad(): Promise<void>;
|
|
45
45
|
private updateCopyMapButton;
|
|
@@ -140,7 +140,7 @@ export declare class ActionSlot extends Button implements IRefreshable {
|
|
|
140
140
|
private lastUsableResult?;
|
|
141
141
|
private lastUseAttempt;
|
|
142
142
|
onActivate(nonClick?: IBindHandlerApi | true, silent?: true): boolean;
|
|
143
|
-
protected onGetOrRemoveItemInInventory(player: Player,
|
|
143
|
+
protected onGetOrRemoveItemInInventory(player: Player, items: Item[]): void;
|
|
144
144
|
onToggle(api: IBindHandlerApi): boolean;
|
|
145
145
|
protected onLeave(reason: "mouse" | "focus" | "remove"): void;
|
|
146
146
|
static getTooltipLocation(actionBar: ActionBar, handler: TooltipLocationHandler): TooltipLocationHandler;
|
|
@@ -23,22 +23,28 @@ export interface IVersionInfo {
|
|
|
23
23
|
update?: number;
|
|
24
24
|
}
|
|
25
25
|
declare module Version {
|
|
26
|
-
const versionInfoRegExp: RegExp;
|
|
27
|
-
const versionInfoRegExpSemver: RegExp;
|
|
26
|
+
export const versionInfoRegExp: RegExp;
|
|
27
|
+
export const versionInfoRegExpSemver: RegExp;
|
|
28
28
|
/**
|
|
29
29
|
* Returns whether the given version is compatible with the game's version. This is used to check, for example,
|
|
30
30
|
* if a mod is compatible with the game's version.
|
|
31
31
|
*/
|
|
32
|
-
function isCompatible(version: IVersionInfo | string): boolean;
|
|
32
|
+
export function isCompatible(version: IVersionInfo | string): boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Returns whether the given `version` is `atLeast` another version. This can be used, for example,
|
|
35
35
|
* to see if a save or mod was created/edited after a specific thing was implemented.
|
|
36
36
|
*/
|
|
37
|
-
function isAtLeast(version: IVersionInfo | string, atLeast: IVersionInfo | string): boolean;
|
|
38
|
-
function create(stage: "beta" | "release", major: number, minor: number, patch?: number, date?: Date): IVersionInfo;
|
|
39
|
-
function getVersionInfo(version: string): IVersionInfo;
|
|
40
|
-
function isSameVersion(version: IVersionInfo, compareVersion: IVersionInfo): boolean;
|
|
41
|
-
function getVersionDisplayString(version?: string | IVersionInfo, development?: boolean): string;
|
|
42
|
-
function getUpdateDisplayString(version?: string | IVersionInfo): string | undefined;
|
|
37
|
+
export function isAtLeast(version: IVersionInfo | string, atLeast: IVersionInfo | string): boolean;
|
|
38
|
+
export function create(stage: "beta" | "release", major: number, minor: number, patch?: number, date?: Date): IVersionInfo;
|
|
39
|
+
export function getVersionInfo(version: string): IVersionInfo;
|
|
40
|
+
export function isSameVersion(version: IVersionInfo, compareVersion: IVersionInfo): boolean;
|
|
41
|
+
export function getVersionDisplayString(version?: string | IVersionInfo, development?: boolean): string;
|
|
42
|
+
export function getUpdateDisplayString(version?: string | IVersionInfo): string | undefined;
|
|
43
|
+
const timezones: {
|
|
44
|
+
nz: string;
|
|
45
|
+
build: string;
|
|
46
|
+
};
|
|
47
|
+
export function isBefore(date: Date, dateStr: `${string} ${number} ${number} ${number}:${number}`, timezone: keyof typeof timezones): boolean;
|
|
48
|
+
export {};
|
|
43
49
|
}
|
|
44
50
|
export default Version;
|
package/package.json
CHANGED