Skip to content

Commit 6dc0eda

Browse files
committed
Update for 2.14.0-beta.dev.20241202.1
1 parent 62cf240 commit 6dc0eda

97 files changed

Lines changed: 920 additions & 632 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"watch": "npx tsc --build --watch --pretty --preserveWatchOutput"
1111
},
1212
"devDependencies": {
13-
"@wayward/types": "^2.14.0-beta.dev.20241130.1",
13+
"@wayward/types": "^2.14.0-beta.dev.20241201.1",
1414
"rimraf": "3.0.2",
1515
"typescript": "^5.7.2"
1616
}

src/Actions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { ActionUsability, IActionHandlerApi } from "@wayward/game/game/entity/action/IAction";
1+
import type { IActionHandlerApi } from "@wayward/game/game/entity/action/IAction";
22
import Mod from "@wayward/game/mod/Mod";
3-
import Log from "@wayward/utilities/Log";
4-
import DebugTools from "./DebugTools";
3+
import type Log from "@wayward/utilities/Log";
4+
import type DebugTools from "./DebugTools";
55
import { DEBUG_TOOLS_ID } from "./IDebugTools";
6-
import Human from "@wayward/game/game/entity/Human";
7-
8-
export const defaultUsability: ActionUsability[] = [ActionUsability.Ghost, ActionUsability.Paused, ActionUsability.Delayed, ActionUsability.Moving];
6+
import type Human from "@wayward/game/game/entity/Human";
97

8+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
109
export const defaultCanUseHandler = (action: IActionHandlerApi<Human>) => {
1110
if (!Actions.DEBUG_TOOLS.hasPermission(action.executor.asPlayer)) {
1211
return { usable: false };
@@ -15,6 +14,7 @@ export const defaultCanUseHandler = (action: IActionHandlerApi<Human>) => {
1514
return { usable: true };
1615
};
1716

17+
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
1818
export default class Actions {
1919
@Mod.instance<DebugTools>(DEBUG_TOOLS_ID)
2020
public static readonly DEBUG_TOOLS: DebugTools;

src/DebugTools.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,11 +599,11 @@ export default class DebugTools extends Mod {
599599
}
600600

601601
public toggleFog(fog: boolean): void {
602-
SetPlayerData.execute(localPlayer, localPlayer, "fog", fog);
602+
void SetPlayerData.execute(localPlayer, localPlayer, "fog", fog);
603603
}
604604

605605
public toggleLighting(lighting: boolean): void {
606-
SetPlayerData.execute(localPlayer, localPlayer, "lighting", lighting);
606+
void SetPlayerData.execute(localPlayer, localPlayer, "lighting", lighting);
607607
}
608608

609609
////////////////////////////////////
@@ -619,7 +619,7 @@ export default class DebugTools extends Mod {
619619
const targetPlayer = game.playerManager.getByName(args);
620620
if (targetPlayer !== undefined && !targetPlayer.isLocalPlayer) {
621621
const newPermissions = !this.getPlayerData(targetPlayer, "permissions");
622-
SetPlayerData.execute(localPlayer, targetPlayer, "permissions", newPermissions);
622+
void SetPlayerData.execute(localPlayer, targetPlayer, "permissions", newPermissions);
623623
}
624624
}
625625

@@ -798,7 +798,7 @@ export default class DebugTools extends Mod {
798798
return false;
799799
}
800800

801-
Heal.execute(localPlayer, localPlayer);
801+
void Heal.execute(localPlayer, localPlayer);
802802
return true;
803803
}
804804

@@ -813,7 +813,7 @@ export default class DebugTools extends Mod {
813813
return false;
814814
}
815815

816-
TeleportEntity.execute(localPlayer, localPlayer, tile);
816+
void TeleportEntity.execute(localPlayer, localPlayer, tile);
817817
return true;
818818
}
819819

@@ -823,7 +823,7 @@ export default class DebugTools extends Mod {
823823
return false;
824824
}
825825

826-
ToggleNoClip.execute(localPlayer, localPlayer);
826+
void ToggleNoClip.execute(localPlayer, localPlayer);
827827
return true;
828828
}
829829

@@ -833,7 +833,7 @@ export default class DebugTools extends Mod {
833833
return false;
834834
}
835835

836-
ToggleFastMovement.execute(localPlayer, localPlayer);
836+
void ToggleFastMovement.execute(localPlayer, localPlayer);
837837
return true;
838838
}
839839

src/LocationSelector.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { Priority } from "@wayward/utilities/event/EventEmitter";
22
import { EventHandler } from "@wayward/game/event/EventManager";
3-
import Tile from "@wayward/game/game/tile/Tile";
3+
import type Tile from "@wayward/game/game/tile/Tile";
44
import Mod from "@wayward/game/mod/Mod";
55
import Register, { Registry } from "@wayward/game/mod/ModRegistry";
66
import { RenderSource } from "@wayward/game/renderer/IRenderer";
77
import Bind from "@wayward/game/ui/input/Bind";
8-
import Bindable from "@wayward/game/ui/input/Bindable";
8+
import type Bindable from "@wayward/game/ui/input/Bindable";
99
import { IInput } from "@wayward/game/ui/input/IInput";
1010
import InputManager from "@wayward/game/ui/input/InputManager";
1111
import MovementHandler from "@wayward/game/ui/screen/screens/game/util/movement/MovementHandler";
1212
import { Bound } from "@wayward/utilities/Decorators";
13-
import DebugTools from "./DebugTools";
13+
import type DebugTools from "./DebugTools";
1414
import { DEBUG_TOOLS_ID } from "./IDebugTools";
1515
import CancelablePromise from "@wayward/utilities/promise/CancelablePromise";
16-
import { IOverlayInfo } from "@wayward/game/game/tile/ITerrain";
16+
import type { IOverlayInfo } from "@wayward/game/game/tile/ITerrain";
1717

1818
export default class SelectLocation {
1919

@@ -33,7 +33,9 @@ export default class SelectLocation {
3333
// Fields
3434
//
3535

36-
public get selecting() { return this.selectionPromise !== undefined; }
36+
public get selecting(): boolean {
37+
return this.selectionPromise !== undefined;
38+
}
3739

3840
private hoverTile?: { tile: Tile; overlay: IOverlayInfo };
3941
private selectTileHeld = false;
@@ -55,7 +57,7 @@ export default class SelectLocation {
5557

5658
setTimeout(this.selectionTick, game.interval);
5759

58-
return this.selectionPromise
60+
return this.selectionPromise;
5961
}
6062

6163
////////////////////////////////////

src/UnlockedCameraMovementHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Mod from "@wayward/game/mod/Mod";
22
import Register from "@wayward/game/mod/ModRegistry";
33
import { RenderSource } from "@wayward/game/renderer/IRenderer";
4-
import Bindable from "@wayward/game/ui/input/Bindable";
4+
import type Bindable from "@wayward/game/ui/input/Bindable";
55
import { IInput } from "@wayward/game/ui/input/IInput";
66
import InputManager from "@wayward/game/ui/input/InputManager";
77
import Vector2 from "@wayward/game/utilities/math/Vector2";

src/action/AddItemToInventory.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ import { Quality } from "@wayward/game/game/IObject";
22
import Human from "@wayward/game/game/entity/Human";
33
import { EntityType } from "@wayward/game/game/entity/IEntity";
44
import { Action } from "@wayward/game/game/entity/action/Action";
5-
import { ActionArgument } from "@wayward/game/game/entity/action/IAction";
5+
import { ActionArgument, ActionUsability } from "@wayward/game/game/entity/action/IAction";
66
import { ItemType, ItemTypeGroup } from "@wayward/game/game/item/IItem";
7-
import Item from "@wayward/game/game/item/Item";
7+
import type Item from "@wayward/game/game/item/Item";
88
import ItemManager from "@wayward/game/game/item/ItemManager";
99
import Dictionary from "@wayward/game/language/Dictionary";
1010
import Translation from "@wayward/game/language/Translation";
1111
import Enums from "@wayward/game/utilities/enum/Enums";
1212
import Arrays from "@wayward/utilities/collection/Arrays";
1313
import { Tuple } from "@wayward/utilities/collection/Tuple";
1414
import StackMap from "@wayward/utilities/collection/map/StackMap";
15-
import { defaultCanUseHandler, defaultUsability } from "../Actions";
15+
import { defaultCanUseHandler } from "../Actions";
1616
import InspectDialog from "../ui/InspectDialog";
1717

1818
export const ADD_ITEM_RANDOM = 1000000001;
1919
export const ADD_ITEM_ALL = 1000000002;
2020

2121
const FILTER_REGEX_CACHE = new StackMap<string, RegExp>(undefined, 500);
2222
const WORD_TO_GROUPS_MAP = new StackMap<string, ItemTypeGroup[]>(undefined, 100);
23-
const GROUP_REGEX = new RegExp(`^group:(.*)$`);
23+
const GROUP_REGEX = new RegExp("^group:(.*)$");
2424
let GROUP_MAP: Map<string, ItemTypeGroup> | undefined;
2525

2626
function itemMatchesWord(word: string, item: ItemType, text: string): boolean {
@@ -54,7 +54,7 @@ function itemMatchesWord(word: string, item: ItemType, text: string): boolean {
5454
*/
5555
export default new Action(ActionArgument.Container, ActionArgument.ANY(ActionArgument.Integer32, ActionArgument.String), ActionArgument.ENUM(Quality), ActionArgument.Integer32)
5656
.setUsableBy(EntityType.Human)
57-
.setUsableWhen(...defaultUsability)
57+
.setUsableWhen(ActionUsability.Always)
5858
.setCanUse(defaultCanUseHandler)
5959
.setHandler((action, target, item: ItemType | typeof ADD_ITEM_RANDOM | typeof ADD_ITEM_ALL | string, quality, quantity) => {
6060
const containerObject = action.executor.island.items.resolveContainer(target);
@@ -67,7 +67,7 @@ export default new Action(ActionArgument.Container, ActionArgument.ANY(ActionArg
6767
const text = Translation.get(Dictionary.Item, item).getString();
6868
return text.includes(filterBy) || filterWords.every(word =>
6969
itemMatchesWord(word, item, text));
70-
})
70+
});
7171
}
7272

7373
const createdItems: Item[] = [];

src/action/ChangeLayer.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { Action } from "@wayward/game/game/entity/action/Action";
2-
import { ActionArgument } from "@wayward/game/game/entity/action/IAction";
2+
import { ActionArgument, ActionUsability } from "@wayward/game/game/entity/action/IAction";
33
import { EntityType } from "@wayward/game/game/entity/IEntity";
44
import WorldZ from "@wayward/utilities/game/WorldZ";
55
import Enums from "@wayward/game/utilities/enum/Enums";
6-
import { defaultCanUseHandler, defaultUsability } from "../Actions";
6+
import { defaultCanUseHandler } from "../Actions";
77

88
export default new Action(ActionArgument.Integer32)
99
.setUsableBy(EntityType.Human)
10-
.setUsableWhen(...defaultUsability)
10+
.setUsableWhen(ActionUsability.Always)
1111
.setCanUse(defaultCanUseHandler)
1212
.setHandler((action, z) => {
13-
if (!Enums.isValid(WorldZ, z))
13+
if (!Enums.isValid(WorldZ, z)) {
1414
return;
15+
}
1516

1617
action.executor.setZ(z);
1718
});

src/action/ChangeTerrain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Action } from "@wayward/game/game/entity/action/Action";
2-
import { ActionArgument } from "@wayward/game/game/entity/action/IAction";
2+
import { ActionArgument, ActionUsability } from "@wayward/game/game/entity/action/IAction";
33
import { EntityType } from "@wayward/game/game/entity/IEntity";
4-
import { TerrainType } from "@wayward/game/game/tile/ITerrain";
5-
import { defaultCanUseHandler, defaultUsability } from "../Actions";
4+
import type { TerrainType } from "@wayward/game/game/tile/ITerrain";
5+
import { defaultCanUseHandler } from "../Actions";
66
import SetTilled from "./helpers/SetTilled";
77

88
export default new Action(ActionArgument.Integer32, ActionArgument.Tile)
99
.setUsableBy(EntityType.Human)
10-
.setUsableWhen(...defaultUsability)
10+
.setUsableWhen(ActionUsability.Always)
1111
.setCanUse(defaultCanUseHandler)
1212
.setHandler((action, terrain: TerrainType, tile) => {
1313
tile.changeTile(terrain, false);

src/action/ClearInventory.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
import { Action } from "@wayward/game/game/entity/action/Action";
2-
import { ActionArgument } from "@wayward/game/game/entity/action/IAction";
2+
import { ActionArgument, ActionUsability } from "@wayward/game/game/entity/action/IAction";
33
import Human from "@wayward/game/game/entity/Human";
44
import { EntityType } from "@wayward/game/game/entity/IEntity";
5-
import { defaultCanUseHandler, defaultUsability } from "../Actions";
5+
import { defaultCanUseHandler } from "../Actions";
66
import InspectDialog from "../ui/InspectDialog";
77

88
/**
99
* Adds an item to the inventory of a doodad, human, or tile.
1010
*/
1111
export default new Action(ActionArgument.Container)
1212
.setUsableBy(EntityType.Human)
13-
.setUsableWhen(...defaultUsability)
13+
.setUsableWhen(ActionUsability.Always)
1414
.setCanUse(defaultCanUseHandler)
1515
.setHandler((action, container) => {
1616
action.executor.island.items.removeContainerItems(container, { removeContainedItems: true });
1717

1818
const containerObject = action.executor.island?.items.resolveContainer(container);
19-
if (containerObject instanceof Human)
19+
if (containerObject instanceof Human) {
2020
containerObject.updateTablesAndWeight("M");
21-
else
21+
} else {
2222
action.setUpdateView();
23+
}
2324

2425
InspectDialog.INSTANCE?.update();
2526
});

0 commit comments

Comments
 (0)