@wayward/types 2.13.0-beta.dev.20230420.1 → 2.13.0-beta.dev.20230422.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 +2 -1
- package/definitions/game/game/doodad/DoodadManager.d.ts +2 -1
- package/definitions/game/game/entity/creature/Creature.d.ts +2 -2
- package/definitions/game/game/entity/creature/CreatureManager.d.ts +3 -2
- package/definitions/game/game/entity/creature/corpse/Corpse.d.ts +2 -1
- package/definitions/game/game/entity/creature/corpse/CorpseManager.d.ts +4 -3
- package/definitions/game/game/inspection/InfoProvider.d.ts +1 -1
- package/definitions/game/game/inspection/infoProviders/creature/CreatureTamedInfo.d.ts +1 -1
- 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/island/Island.d.ts +12 -11
- package/definitions/game/game/item/IItem.d.ts +2 -1
- package/definitions/game/game/item/Item.d.ts +2 -1
- package/definitions/game/game/item/ItemManager.d.ts +7 -7
- package/definitions/game/game/reference/IReferenceManager.d.ts +4 -2
- package/definitions/game/game/reference/ReferenceManager.d.ts +4 -3
- package/definitions/game/game/tile/TileEvent.d.ts +2 -1
- package/definitions/game/game/tile/TileEventManager.d.ts +4 -3
- package/definitions/game/language/Translation.d.ts +23 -5
- package/definitions/game/multiplayer/Multiplayer.d.ts +1 -0
- package/definitions/game/multiplayer/networking/SmartConnection.d.ts +1 -0
- package/definitions/game/ui/component/{Article.d.ts → ArticleComponent.d.ts} +1 -1
- package/definitions/game/ui/screen/screens/game/dialog/BookDialog.d.ts +1 -1
- package/definitions/game/ui/screen/screens/game/dialog/crafting/RecipeCache.d.ts +1 -1
- package/definitions/game/ui/screen/screens/menu/menus/mods/ModInfoMenu.d.ts +2 -2
- package/package.json +1 -1
|
@@ -33,6 +33,7 @@ import MagicalPropertyManager from "game/magic/MagicalPropertyManager";
|
|
|
33
33
|
import type { IHasInsulation, TempType } from "game/temperature/ITemperature";
|
|
34
34
|
import { FireStage } from "game/tile/events/IFire";
|
|
35
35
|
import type Tile from "game/tile/Tile";
|
|
36
|
+
import { Article } from "language/Translation";
|
|
36
37
|
import type { IUnserializedCallback } from "save/serializer/ISerializer";
|
|
37
38
|
import type { IRGB } from "utilities/Color";
|
|
38
39
|
import type { Direction } from "utilities/math/Direction";
|
|
@@ -131,7 +132,7 @@ export default class Doodad extends Entity<IDoodadDescription, DoodadType, Dooda
|
|
|
131
132
|
* - `doodad.getName(false)` // "stone furnace"
|
|
132
133
|
* - `doodad.getName(undefined, 3)` // "stone furnaces"
|
|
133
134
|
*/
|
|
134
|
-
getName(article?:
|
|
135
|
+
getName(article?: Article, count?: number): import("../../language/impl/TranslationImpl").default;
|
|
135
136
|
protected getDescription(): IDoodadDescription | undefined;
|
|
136
137
|
updateTile(tileUpdateType: TileUpdateType): void;
|
|
137
138
|
changeType(doodadType: DoodadType): void;
|
|
@@ -18,6 +18,7 @@ import { ObjectManager } from "game/ObjectManager";
|
|
|
18
18
|
import type { TerrainType } from "game/tile/ITerrain";
|
|
19
19
|
import Tile from "game/tile/Tile";
|
|
20
20
|
import type { WorldZ } from "game/WorldZ";
|
|
21
|
+
import type { Article } from "language/Translation";
|
|
21
22
|
import Translation from "language/Translation";
|
|
22
23
|
export interface IDoodadManagerEvents {
|
|
23
24
|
/**
|
|
@@ -55,7 +56,7 @@ export default class DoodadManager extends ObjectManager<Doodad, IDoodadManagerE
|
|
|
55
56
|
*/
|
|
56
57
|
static isDoodadExtra(type: number): type is DoodadTypeExtra;
|
|
57
58
|
static getGroupDoodads(doodadGroup: DoodadTypeGroup): Set<DoodadType>;
|
|
58
|
-
static getDoodadTypeGroupName(doodadType: DoodadType | DoodadTypeGroup, article?:
|
|
59
|
+
static getDoodadTypeGroupName(doodadType: DoodadType | DoodadTypeGroup, article?: Article, count?: number): Translation;
|
|
59
60
|
/**
|
|
60
61
|
* Note: This can be called multiple times in the same game depending on loading/unloading of islands
|
|
61
62
|
*/
|
|
@@ -21,7 +21,7 @@ import { TileUpdateType } from "game/IGame";
|
|
|
21
21
|
import type { IObject } from "game/IObject";
|
|
22
22
|
import type Item from "game/item/Item";
|
|
23
23
|
import type Tile from "game/tile/Tile";
|
|
24
|
-
import Translation from "language/Translation";
|
|
24
|
+
import Translation, { Article } from "language/Translation";
|
|
25
25
|
import type { IUnserializedCallback } from "save/serializer/ISerializer";
|
|
26
26
|
import { Direction } from "utilities/math/Direction";
|
|
27
27
|
import type { IVector3 } from "utilities/math/IVector";
|
|
@@ -72,7 +72,7 @@ export default class Creature extends EntityWithStats<ICreatureDescription, Crea
|
|
|
72
72
|
* - `creature.getName(false)` // "acid spitter demon"
|
|
73
73
|
* - `creature.getName(undefined, 3)` // "acid spitter demons"
|
|
74
74
|
*/
|
|
75
|
-
getName(article?:
|
|
75
|
+
getName(article?: Article, count?: number): Translation;
|
|
76
76
|
protected getDescription(): ICreatureDescription | undefined;
|
|
77
77
|
hasAi(aiType: AiType): boolean;
|
|
78
78
|
isHidden(): boolean;
|
|
@@ -17,6 +17,7 @@ import EntityManager from "game/entity/EntityManager";
|
|
|
17
17
|
import type Human from "game/entity/Human";
|
|
18
18
|
import { MoveType } from "game/entity/IEntity";
|
|
19
19
|
import Tile from "game/tile/Tile";
|
|
20
|
+
import type { Article } from "language/Translation";
|
|
20
21
|
import type { IVector3 } from "utilities/math/IVector";
|
|
21
22
|
export interface ICreatureManagerEvents extends Events<EntityManager<Creature>> {
|
|
22
23
|
/**
|
|
@@ -42,8 +43,8 @@ export default class CreatureManager extends EntityManager<Creature> {
|
|
|
42
43
|
get combatStrength(): CombatStrengthManager;
|
|
43
44
|
static generateLookups(): void;
|
|
44
45
|
load(): void;
|
|
45
|
-
static getName(creature: Creature | CreatureType, aberrant?: boolean, count?: number, article?:
|
|
46
|
-
getName(creature: Creature | CreatureType, aberrant?: boolean, count?: number, article?:
|
|
46
|
+
static getName(creature: Creature | CreatureType, aberrant?: boolean, count?: number, article?: Article): import("../../../language/impl/TranslationImpl").default;
|
|
47
|
+
getName(creature: Creature | CreatureType, aberrant?: boolean, count?: number, article?: Article): import("../../../language/impl/TranslationImpl").default;
|
|
47
48
|
getHappinessLevel(human: Human, creature: Creature, bonus?: number): number;
|
|
48
49
|
/**
|
|
49
50
|
* Spawns a creature.
|
|
@@ -20,6 +20,7 @@ import type { IObject } from "game/IObject";
|
|
|
20
20
|
import { ItemType } from "game/item/IItem";
|
|
21
21
|
import type Tile from "game/tile/Tile";
|
|
22
22
|
import type Translation from "language/Translation";
|
|
23
|
+
import type { Article } from "language/Translation";
|
|
23
24
|
import type { IVector3 } from "utilities/math/IVector";
|
|
24
25
|
export interface ICorpseEvents extends IEntityEvents {
|
|
25
26
|
/**
|
|
@@ -69,7 +70,7 @@ export default class Corpse extends Entity<ICorpseDescription, CreatureType> imp
|
|
|
69
70
|
* - `corpse.getName(false)` // "acid spitter demon"
|
|
70
71
|
* - `corpse.getName(undefined, 3)` // "acid spitter demons"
|
|
71
72
|
*/
|
|
72
|
-
getName(article?:
|
|
73
|
+
getName(article?: Article, count?: number): Translation;
|
|
73
74
|
protected getDescription(): ICorpseDescription | undefined;
|
|
74
75
|
creatureDescription(): ICreatureDescription | undefined;
|
|
75
76
|
isValid(): boolean;
|
|
@@ -14,6 +14,7 @@ import type { CreatureType } from "game/entity/creature/ICreature";
|
|
|
14
14
|
import { ObjectManager } from "game/ObjectManager";
|
|
15
15
|
import type Tile from "game/tile/Tile";
|
|
16
16
|
import type { TextContext } from "language/ITranslation";
|
|
17
|
+
import { Article } from "language/Translation";
|
|
17
18
|
export interface ICorpseManagerEvents {
|
|
18
19
|
create(corpse: Corpse): any;
|
|
19
20
|
remove(corpse: Corpse): any;
|
|
@@ -23,7 +24,7 @@ export default class CorpseManager extends ObjectManager<Corpse, ICorpseManagerE
|
|
|
23
24
|
create(type: CreatureType, tile: Tile, decay?: number, aberrant?: boolean, name?: string, qualityBonus?: number, respawned?: number): Corpse | undefined;
|
|
24
25
|
updateAll(): void;
|
|
25
26
|
remove(corpse: Corpse): void;
|
|
26
|
-
getName(typeOrCorpse: CreatureType | Corpse, article?:
|
|
27
|
-
getCorpseTranslations(corpses: Corpse[], article?:
|
|
28
|
-
getCorpseListTranslation(corpses: Corpse[], article?:
|
|
27
|
+
getName(typeOrCorpse: CreatureType | Corpse, article?: Article, count?: number, showCount?: boolean): import("../../../../language/impl/TranslationImpl").default;
|
|
28
|
+
getCorpseTranslations(corpses: Corpse[], article?: Article, context?: TextContext): Stream<import("../../../../language/impl/TranslationImpl").default>;
|
|
29
|
+
getCorpseListTranslation(corpses: Corpse[], article?: Article, context?: TextContext): import("../../../../language/impl/TranslationImpl").default;
|
|
29
30
|
}
|
|
@@ -159,7 +159,7 @@ export declare class SimpleInfoProvider extends InfoProvider {
|
|
|
159
159
|
private childComponentClass;
|
|
160
160
|
private validWhen?;
|
|
161
161
|
constructor(...translations: Array<TranslationGenerator | InfoProvider>);
|
|
162
|
-
get(): (import("../../language/
|
|
162
|
+
get(): (import("../../language/ITranslation").ISerializedTranslation | import("../../language/impl/TranslationImpl").default | import("../../language/dictionary/UiTranslation").default | (() => import("../../language/ITranslation").ISerializedTranslation | import("../../language/impl/TranslationImpl").default | Iterable<import("../../utilities/string/Interpolator").IStringSection> | import("../../language/dictionary/UiTranslation").default | undefined) | InfoProvider)[];
|
|
163
163
|
add(...translations: Array<TranslationGenerator | InfoProvider | Falsy>): this;
|
|
164
164
|
onlyIfHasContents(): this | undefined;
|
|
165
165
|
addInfoGetter(provider: () => InfoProvider | undefined): this;
|
|
@@ -22,6 +22,6 @@ export default class CreatureTamedInfoProvider extends InfoProvider {
|
|
|
22
22
|
constructor(creature: Creature);
|
|
23
23
|
getClass(): string[];
|
|
24
24
|
hasContent(): boolean;
|
|
25
|
-
get(): (
|
|
25
|
+
get(): (import("game/inspection/InfoProvider").SimpleInfoProvider | LabelledValue)[];
|
|
26
26
|
private getHappinessMessage;
|
|
27
27
|
}
|
|
@@ -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<number> | 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(tile: Tile): 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;
|
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import EventEmitter from "event/EventEmitter";
|
|
12
|
+
import type { Game } from "game/Game";
|
|
13
|
+
import type { IGameOld } from "game/IGame";
|
|
14
|
+
import { TickFlag, TileUpdateType } from "game/IGame";
|
|
15
|
+
import { Quality } from "game/IObject";
|
|
12
16
|
import type { BiomeTypes } from "game/biome/IBiome";
|
|
13
17
|
import type { ITemplateBiomeOptions } from "game/biome/template/Template";
|
|
14
18
|
import type Doodad from "game/doodad/Doodad";
|
|
15
19
|
import DoodadManager from "game/doodad/DoodadManager";
|
|
16
|
-
import
|
|
20
|
+
import Human from "game/entity/Human";
|
|
21
|
+
import type { SkillType } from "game/entity/IHuman";
|
|
17
22
|
import Creature from "game/entity/creature/Creature";
|
|
18
23
|
import CreatureManager from "game/entity/creature/CreatureManager";
|
|
19
24
|
import type { IDamageInfo, IDamageOutcome, IDamageOutcomeInput } from "game/entity/creature/ICreature";
|
|
25
|
+
import CorpseManager from "game/entity/creature/corpse/CorpseManager";
|
|
20
26
|
import FlowFieldManager from "game/entity/flowfield/FlowFieldManager";
|
|
21
|
-
import Human from "game/entity/Human";
|
|
22
|
-
import type { SkillType } from "game/entity/IHuman";
|
|
23
27
|
import NPCManager from "game/entity/npc/NPCManager";
|
|
24
|
-
import type {
|
|
25
|
-
import type { IGameOld } from "game/IGame";
|
|
26
|
-
import { TickFlag, TileUpdateType } from "game/IGame";
|
|
27
|
-
import { Quality } from "game/IObject";
|
|
28
|
-
import type { IIslandEvents, IIslandLoadOptions, IIslandPort, IMobCheck, ISeeds, IslandId, IWaterContamination, IWaterFill, IWell } from "game/island/IIsland";
|
|
28
|
+
import type { IIslandEvents, IIslandLoadOptions, IIslandPort, IMobCheck, ISeeds, IWaterContamination, IWaterFill, IWell, IslandId } from "game/island/IIsland";
|
|
29
29
|
import { WaterType } from "game/island/IIsland";
|
|
30
30
|
import type { ILiquidGather } from "game/item/IItem";
|
|
31
31
|
import type { IRequirementInfo } from "game/item/IItemManager";
|
|
@@ -44,12 +44,12 @@ import TimeManager from "game/time/TimeManager";
|
|
|
44
44
|
import Translation from "language/Translation";
|
|
45
45
|
import World from "renderer/world/World";
|
|
46
46
|
import type { IPostSerializeCallback, IPreSerializeCallback, ISerializer } from "save/serializer/ISerializer";
|
|
47
|
+
import type { IVersionInfo } from "utilities/Version";
|
|
47
48
|
import { Direction } from "utilities/math/Direction";
|
|
48
49
|
import type { IVector2, IVector3 } from "utilities/math/IVector";
|
|
50
|
+
import type { Random } from "utilities/random/Random";
|
|
49
51
|
import type { LegacySeededGenerator } from "utilities/random/generators/LegacySeededGenerator";
|
|
50
52
|
import type { PCGSeededGenerator } from "utilities/random/generators/PCGSeededGenerator";
|
|
51
|
-
import type { Random } from "utilities/random/Random";
|
|
52
|
-
import type { IVersionInfo } from "utilities/Version";
|
|
53
53
|
export interface IIslandDetails {
|
|
54
54
|
seed: number;
|
|
55
55
|
biomeType: BiomeTypes;
|
|
@@ -113,7 +113,7 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
113
113
|
private _world;
|
|
114
114
|
modifiersCollection?: IslandModifiersCollection;
|
|
115
115
|
details?: IIslandDetails;
|
|
116
|
-
|
|
116
|
+
private _ranUpgrade;
|
|
117
117
|
private serializeObjectStats?;
|
|
118
118
|
constructor(game?: Game, position?: IVector2, seed?: number, mapSize?: number);
|
|
119
119
|
toString(): string;
|
|
@@ -146,6 +146,7 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
|
|
|
146
146
|
private getNameDescriptor;
|
|
147
147
|
private getNameNoun;
|
|
148
148
|
getNeighboringIslands(): Island[];
|
|
149
|
+
ensureUpgraded(isSynced: boolean): void;
|
|
149
150
|
/**
|
|
150
151
|
* Loads the island
|
|
151
152
|
*/
|
|
@@ -33,6 +33,7 @@ import type Tile from "game/tile/Tile";
|
|
|
33
33
|
import type Message from "language/dictionary/Message";
|
|
34
34
|
import type TranslationImpl from "language/impl/TranslationImpl";
|
|
35
35
|
import type Translation from "language/Translation";
|
|
36
|
+
import type { Article } from "language/Translation";
|
|
36
37
|
import type { IModdable } from "mod/ModRegistry";
|
|
37
38
|
import type { IRGB } from "utilities/Color";
|
|
38
39
|
import type { IVector3 } from "utilities/math/IVector";
|
|
@@ -274,7 +275,7 @@ export interface IItemDescription extends IObjectDescription, IModdable, ITemper
|
|
|
274
275
|
/**
|
|
275
276
|
* The item name to display instead of the item's default translation
|
|
276
277
|
*/
|
|
277
|
-
getName?: (item: Item, article?:
|
|
278
|
+
getName?: (item: Item, article?: Article, count?: number, showCount?: boolean, showQuality?: boolean, showRenamedQuotes?: boolean, showMagicalType?: boolean) => TranslationImpl | {
|
|
278
279
|
translation: TranslationImpl;
|
|
279
280
|
noReference?: boolean;
|
|
280
281
|
} | undefined;
|
|
@@ -36,6 +36,7 @@ import type { IHasInsulation, TempType } from "game/temperature/ITemperature";
|
|
|
36
36
|
import { FireStage } from "game/tile/events/IFire";
|
|
37
37
|
import type Tile from "game/tile/Tile";
|
|
38
38
|
import TranslationImpl from "language/impl/TranslationImpl";
|
|
39
|
+
import { Article } from "language/Translation";
|
|
39
40
|
import type { IUnserializedCallback } from "save/serializer/ISerializer";
|
|
40
41
|
import type { Direction } from "utilities/math/Direction";
|
|
41
42
|
import type Vector3 from "utilities/math/Vector3";
|
|
@@ -161,7 +162,7 @@ export default class Item extends EntityMovable<IItemDescription, ItemType, Item
|
|
|
161
162
|
* - `item.getName(false)` // "stone axe"
|
|
162
163
|
* - `item.getName(undefined, 3)` // "stone axes"
|
|
163
164
|
*/
|
|
164
|
-
getName(article?:
|
|
165
|
+
getName(article?: Article, count?: number, showCount?: boolean, showQuality?: boolean, showRenamedQuotes?: boolean, showMagicalType?: boolean): TranslationImpl;
|
|
165
166
|
protected getDescription(): IItemDescription | undefined;
|
|
166
167
|
isTransient(): boolean;
|
|
167
168
|
isValid(): boolean;
|
|
@@ -28,7 +28,7 @@ import { WorldZ } from "game/WorldZ";
|
|
|
28
28
|
import Message from "language/dictionary/Message";
|
|
29
29
|
import type TranslationImpl from "language/impl/TranslationImpl";
|
|
30
30
|
import type { ListEnder } from "language/ITranslation";
|
|
31
|
-
import Translation from "language/Translation";
|
|
31
|
+
import Translation, { Article } from "language/Translation";
|
|
32
32
|
import Vector3 from "utilities/math/Vector3";
|
|
33
33
|
import type { Random } from "utilities/random/Random";
|
|
34
34
|
export interface IItemManagerEvents {
|
|
@@ -96,7 +96,7 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
96
96
|
static isItemExtra(type: number): type is ItemTypeExtra;
|
|
97
97
|
static getGroupItems(itemGroup: ItemType | ItemTypeGroup): Set<ItemType>;
|
|
98
98
|
private static getGroupItemsWithoutCache;
|
|
99
|
-
static getItemTypeGroupName(itemType: ItemType | ItemTypeGroup, article?:
|
|
99
|
+
static getItemTypeGroupName(itemType: ItemType | ItemTypeGroup, article?: Article, count?: number): Translation;
|
|
100
100
|
static getGroupDefault(itemGroup: ItemTypeGroup, weightType?: WeightType, ancestorGroups?: ItemTypeGroup[]): ItemType;
|
|
101
101
|
/**
|
|
102
102
|
* Returns the "processed" weight of the given item.
|
|
@@ -190,7 +190,7 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
190
190
|
isInGroup(itemType: ItemType, itemGroup: ItemTypeGroup | ItemType): boolean;
|
|
191
191
|
isItemExtra(type: number): type is ItemTypeExtra;
|
|
192
192
|
getGroupItems(itemGroup: ItemType | ItemTypeGroup): Set<ItemType>;
|
|
193
|
-
getItemTypeGroupName(itemType: ItemType | ItemTypeGroup, article?:
|
|
193
|
+
getItemTypeGroupName(itemType: ItemType | ItemTypeGroup, article?: Article, count?: number): Translation;
|
|
194
194
|
getGroupDefault(itemGroup: ItemTypeGroup, weightType?: WeightType, ancestorGroups?: ItemTypeGroup[]): ItemType;
|
|
195
195
|
getGroups(itemType: ItemType): ItemTypeGroup[];
|
|
196
196
|
getPlayerFromInventoryContainer(containable: IContainable): Player | undefined;
|
|
@@ -269,16 +269,16 @@ export default class ItemManager extends ObjectManager<Item, IItemManagerEvents>
|
|
|
269
269
|
capWeightOfItems(createdItems: Item[], itemWeight: number): void;
|
|
270
270
|
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup): Translation;
|
|
271
271
|
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup, count: number): Translation;
|
|
272
|
-
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup, article:
|
|
273
|
-
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup, count: number, article:
|
|
274
|
-
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup, count?: number, article?:
|
|
272
|
+
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup, article: Article): Translation;
|
|
273
|
+
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup, count: number, article: Article): Translation;
|
|
274
|
+
getItemTypeTranslation(itemType: ItemType | ItemTypeGroup, count?: number, article?: Article): Translation;
|
|
275
275
|
getItemTypeListTranslation(itemTypes: Array<ItemType | ItemTypeGroup>): TranslationImpl;
|
|
276
276
|
/**
|
|
277
277
|
* Maps each item in the given array to its name translation.
|
|
278
278
|
* @param article Whether the item name translation should include an article
|
|
279
279
|
* @param formatter A formatting translation that should be used for each item translation
|
|
280
280
|
*/
|
|
281
|
-
getItemTranslations(items: Item[], article?:
|
|
281
|
+
getItemTranslations(items: Item[], article?: Article, formatter?: Translation): TranslationImpl[];
|
|
282
282
|
/**
|
|
283
283
|
* Formats a list translation out of an array of items.
|
|
284
284
|
* @param listEnder The way the list should end (ie `and`, `or`, etc)
|
|
@@ -16,6 +16,7 @@ import type { EquipType, SkillType } from "game/entity/IHuman";
|
|
|
16
16
|
import type { Stat } from "game/entity/IStats";
|
|
17
17
|
import type NPC from "game/entity/npc/NPC";
|
|
18
18
|
import type Player from "game/entity/player/Player";
|
|
19
|
+
import type { IslandId } from "game/island/IIsland";
|
|
19
20
|
import type Island from "game/island/Island";
|
|
20
21
|
import type { ItemType } from "game/item/IItem";
|
|
21
22
|
import type Item from "game/item/Item";
|
|
@@ -68,8 +69,9 @@ export interface IReferenceTypeMap {
|
|
|
68
69
|
[ReferenceType.Action]: [ReferenceType.Action, ActionId, Item?];
|
|
69
70
|
[ReferenceType.EquipSlot]: [ReferenceType.EquipSlot, EquipType];
|
|
70
71
|
}
|
|
72
|
+
export type ReferenceContext = [number, ReferenceType?];
|
|
71
73
|
type ReferenceId<REFTYPE extends ReferenceType> = IReferenceTypeMap[REFTYPE] extends [REFTYPE, infer IdType, any?] ? IdType : number;
|
|
72
|
-
export type Reference<REFTYPE extends ReferenceType | undefined = ReferenceType | undefined> = REFTYPE extends ReferenceType ? [id: ReferenceId<REFTYPE>, type: REFTYPE, context?:
|
|
74
|
+
export type Reference<REFTYPE extends ReferenceType | undefined = ReferenceType | undefined> = REFTYPE extends ReferenceType ? [id: ReferenceId<REFTYPE>, type: REFTYPE, context?: ReferenceContext, islandId?: IslandId] : [number];
|
|
73
75
|
export type Referenceable = IReferenceTypeMap[ReferenceableReferenceTypes];
|
|
74
76
|
export type ResolveReference<REFTYPE extends ReferenceType> = IReferenceTypeMap[REFTYPE];
|
|
75
77
|
export type EnumReferenceResolved<REFTYPE extends EnumReferenceTypes = EnumReferenceTypes> = IReferenceTypeMap[REFTYPE];
|
|
@@ -77,6 +79,6 @@ export declare module Reference {
|
|
|
77
79
|
function setReferenceResolver(resolver: typeof ReferenceManager.get): void;
|
|
78
80
|
function create(id: number): Reference;
|
|
79
81
|
function create<REFTYPE extends ReferenceType>(id: ReferenceId<REFTYPE>, type: REFTYPE, context?: Referenceable | number | [number, ReferenceType?]): Reference;
|
|
80
|
-
function context(reference?: Reference): [number] | [id: number, type: ReferenceType.Item, context?:
|
|
82
|
+
function context(reference?: Reference): [number] | [id: number, type: ReferenceType.Item, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: number, type: ReferenceType.Creature, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: number, type: ReferenceType.Doodad, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: number, type: ReferenceType.NPC, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: number, type: ReferenceType.Player, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: number, type: ReferenceType.TileEvent, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: number, type: ReferenceType.Island, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: number, type: ReferenceType.Corpse, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: SkillType, type: ReferenceType.Skill, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: Milestone, type: ReferenceType.Milestone, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: ItemType, type: ReferenceType.Recipe, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: ItemType, type: ReferenceType.ItemType, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: ItemType, type: ReferenceType.Dismantle, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: Stat, type: ReferenceType.Stat, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: ActionId, type: ReferenceType.Action, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | [id: EquipType, type: ReferenceType.EquipSlot, context?: ReferenceContext | undefined, islandId?: `${number},${number}` | undefined] | undefined;
|
|
81
83
|
}
|
|
82
84
|
export {};
|
|
@@ -33,14 +33,15 @@ export default class ReferenceManager {
|
|
|
33
33
|
constructor(game: Game);
|
|
34
34
|
create(): number;
|
|
35
35
|
reset(): void;
|
|
36
|
-
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 | Player[] | import("game/entity/IHuman").EquipType[] | readonly
|
|
36
|
+
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 | Player[] | import("game/entity/IHuman").EquipType[] | readonly Milestone[] | readonly SkillType[] | IterableIterator<Island> | readonly Stat[] | readonly ItemType[] | (string | ActionType)[];
|
|
37
37
|
get(thing: Item): Reference<ReferenceType.Item> | undefined;
|
|
38
38
|
get(thing: Doodad): Reference<ReferenceType.Doodad> | undefined;
|
|
39
39
|
get(thing: Creature): Reference<ReferenceType.Creature> | undefined;
|
|
40
40
|
get(thing: Referenceable): Reference | undefined;
|
|
41
41
|
getReferenceType(thing: Value<IReferenceTypeMap>): ReferenceType;
|
|
42
|
-
resolve<REFTYPE extends ReferenceType>(reference?: Reference<REFTYPE
|
|
43
|
-
resolve(reference?: Reference): IReferenceTypeMap[ReferenceType] | undefined;
|
|
42
|
+
resolve<REFTYPE extends ReferenceType>(reference?: Reference<REFTYPE>, gameIsland?: Island): IReferenceTypeMap[REFTYPE] | undefined;
|
|
43
|
+
resolve(reference?: Reference, gameIsland?: Island): IReferenceTypeMap[ReferenceType] | undefined;
|
|
44
|
+
private resolveInternal;
|
|
44
45
|
inspect<REFTYPE extends ReferenceType>(reference: Reference<REFTYPE>, ...args: any[]): Inspection<any> | undefined;
|
|
45
46
|
inspect(reference: Reference, ...args: any[]): Inspection<any> | undefined;
|
|
46
47
|
tooltip(reference: Reference, initializer?: (tooltip: Tooltip, handler: ReferenceTooltipHandler) => any): (tooltip: Tooltip) => Promise<void>;
|
|
@@ -19,6 +19,7 @@ import { FireStage } from "game/tile/events/IFire";
|
|
|
19
19
|
import type { ITileEventDescription } from "game/tile/ITileEvent";
|
|
20
20
|
import { TileEventType } from "game/tile/ITileEvent";
|
|
21
21
|
import type Tile from "game/tile/Tile";
|
|
22
|
+
import type { Article } from "language/Translation";
|
|
22
23
|
import type { IVector3 } from "utilities/math/IVector";
|
|
23
24
|
export interface ITileEventEvents extends IEntityMovableEvents {
|
|
24
25
|
/**
|
|
@@ -63,7 +64,7 @@ export default class TileEvent extends EntityMovable<ITileEventDescription, Tile
|
|
|
63
64
|
get tile(): Tile;
|
|
64
65
|
toString(): string;
|
|
65
66
|
protected getDescription(): ITileEventDescription | undefined;
|
|
66
|
-
getName(article?:
|
|
67
|
+
getName(article?: Article, count?: number): import("../../language/impl/TranslationImpl").default;
|
|
67
68
|
getProducedTemperature(): number | undefined;
|
|
68
69
|
updateFire(tile: Tile): void;
|
|
69
70
|
protected updateTile(fromTile: Tile, toTile: Tile): boolean;
|
|
@@ -15,6 +15,7 @@ import { TileEventType } from "game/tile/ITileEvent";
|
|
|
15
15
|
import type Tile from "game/tile/Tile";
|
|
16
16
|
import TileEvent from "game/tile/TileEvent";
|
|
17
17
|
import type { TextContext } from "language/ITranslation";
|
|
18
|
+
import { Article } from "language/Translation";
|
|
18
19
|
import type { IVector3 } from "utilities/math/IVector";
|
|
19
20
|
export interface ITileManagerEvents {
|
|
20
21
|
/**
|
|
@@ -60,7 +61,7 @@ export default class TileEventManager extends ObjectManager<TileEvent, ITileMana
|
|
|
60
61
|
*/
|
|
61
62
|
createBlood(origin: IVector3): boolean;
|
|
62
63
|
containsDamagingTileEvents(events: TileEvent[] | undefined): boolean;
|
|
63
|
-
getName(typeOrEvent: CreatureType | TileEvent, article?:
|
|
64
|
-
getEventTranslations(events: TileEvent[], article?:
|
|
65
|
-
getEventListTranslation(events: TileEvent[], article?:
|
|
64
|
+
getName(typeOrEvent: CreatureType | TileEvent, article?: Article, count?: number, showCount?: boolean): import("../../language/impl/TranslationImpl").default;
|
|
65
|
+
getEventTranslations(events: TileEvent[], article?: Article, context?: TextContext): Stream<import("../../language/impl/TranslationImpl").default>;
|
|
66
|
+
getEventListTranslation(events: TileEvent[], article?: Article, context?: TextContext): import("../../language/impl/TranslationImpl").default;
|
|
66
67
|
}
|
|
@@ -25,6 +25,24 @@ import type { ISerializedTranslation } 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";
|
|
28
|
+
export declare enum Article {
|
|
29
|
+
/**
|
|
30
|
+
* Use no article.
|
|
31
|
+
*/
|
|
32
|
+
None = "",
|
|
33
|
+
/**
|
|
34
|
+
* In English, this is "a" or "an" in front of the text, assuming the "count" is one.
|
|
35
|
+
*/
|
|
36
|
+
Indefinite = "indefinite",
|
|
37
|
+
/**
|
|
38
|
+
* In English, this is "the" in front of the text.
|
|
39
|
+
*/
|
|
40
|
+
Definite = "definite",
|
|
41
|
+
/**
|
|
42
|
+
* Uses "indefinite" if the user hasn't opted out of articles in titles.
|
|
43
|
+
*/
|
|
44
|
+
Title = "title"
|
|
45
|
+
}
|
|
28
46
|
type Translation = TranslationImpl;
|
|
29
47
|
declare module Translation {
|
|
30
48
|
function equals(a: Translation, b: Translation): boolean;
|
|
@@ -119,15 +137,15 @@ declare module Translation {
|
|
|
119
137
|
function nameOf(type: Dictionary, thing: number | {
|
|
120
138
|
type: number;
|
|
121
139
|
renamed?: string | ISerializedTranslation;
|
|
122
|
-
}, article?:
|
|
140
|
+
}, article?: Article): Translation;
|
|
123
141
|
function nameOf(type: Dictionary, thing: number | {
|
|
124
142
|
type: number;
|
|
125
143
|
renamed?: string | ISerializedTranslation;
|
|
126
|
-
}, count?: number, article?:
|
|
144
|
+
}, count?: number, article?: Article, showRenamedQuotes?: boolean): Translation;
|
|
127
145
|
function reformatSingularNoun(): Translation;
|
|
128
146
|
function reformatSingularNoun(count: number): Translation;
|
|
129
|
-
function reformatSingularNoun(article:
|
|
130
|
-
function reformatSingularNoun(count: number, article:
|
|
131
|
-
function reformatSingularNoun(count?: number |
|
|
147
|
+
function reformatSingularNoun(article: Article): Translation;
|
|
148
|
+
function reformatSingularNoun(count: number, article: Article): Translation;
|
|
149
|
+
function reformatSingularNoun(count?: number | Article, article?: Article): Translation;
|
|
132
150
|
}
|
|
133
151
|
export default Translation;
|
|
@@ -150,6 +150,7 @@ export default class Multiplayer extends EventEmitter.Host<IMultiplayerEvents> {
|
|
|
150
150
|
updatePlayerId(oldPid: number, newPid: number): void;
|
|
151
151
|
suppressSyncChecks(suppress: boolean): void;
|
|
152
152
|
syncGameState(): void;
|
|
153
|
+
isKeepAliveTimeoutPaused(): boolean;
|
|
153
154
|
pauseKeepAliveTimeouts(): void;
|
|
154
155
|
resumeKeepAliveTimeouts(): void;
|
|
155
156
|
updateGlobalServerDirectory(): void;
|
|
@@ -41,6 +41,7 @@ export declare class SmartConnection extends Connection {
|
|
|
41
41
|
protected onClosed(): void;
|
|
42
42
|
addKeepAliveTimeout(): void;
|
|
43
43
|
sendKeepAlive(): void;
|
|
44
|
+
clearTimeout(): boolean;
|
|
44
45
|
send(data: Uint8Array, byteOffset: number, length?: number): boolean;
|
|
45
46
|
processMatchmakingMessage(message: MatchmakingMessageData): Promise<boolean>;
|
|
46
47
|
private trySteamNetwork;
|
|
@@ -16,7 +16,7 @@ export default class BookDialog extends Dialog {
|
|
|
16
16
|
private book?;
|
|
17
17
|
private readonly text;
|
|
18
18
|
constructor();
|
|
19
|
-
getName(): import("../../../../../language/
|
|
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
22
|
protected onInventoryItemRemove(_: any, item: Item): void;
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import type { ItemType } from "game/item/IItem";
|
|
12
|
-
import ItemOutput from "game/item/recipe/output/ItemOutput";
|
|
13
12
|
import type Recipe from "game/item/recipe/Recipe";
|
|
13
|
+
import ItemOutput from "game/item/recipe/output/ItemOutput";
|
|
14
14
|
export declare enum RecipeSort {
|
|
15
15
|
Name = 0
|
|
16
16
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
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 {
|
|
11
|
+
import { ArticleComponent } from "ui/component/ArticleComponent";
|
|
12
12
|
import { Block } from "ui/component/Block";
|
|
13
13
|
import { BlockRow } from "ui/component/BlockRow";
|
|
14
14
|
import Component from "ui/component/Component";
|
|
@@ -18,7 +18,7 @@ export default class ModInfoMenu extends Menu {
|
|
|
18
18
|
protected modImage: Component<HTMLElement>;
|
|
19
19
|
protected modMetadata: Block;
|
|
20
20
|
protected mainInfo: BlockRow;
|
|
21
|
-
protected readme:
|
|
21
|
+
protected readme: ArticleComponent;
|
|
22
22
|
private readonly hostRef;
|
|
23
23
|
get host(): ModRow;
|
|
24
24
|
constructor(host: ModRow);
|
package/package.json
CHANGED