Skip to content

Commit d4de004

Browse files
committed
Update for 2.14.2-beta
1 parent 550aa27 commit d4de004

14 files changed

Lines changed: 41 additions & 18 deletions

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Debug Tools",
33
"description": "Adds a special debug tools menu into the game.",
4-
"version": "2.3.4",
4+
"version": "2.3.5",
55
"author": "Chiri Vulpes",
66
"github": "https://github.com/WaywardGame/debugtools",
77
"waywardVersion": "2.14.0-beta",

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.1-beta",
13+
"@wayward/types": "^2.14.2-beta",
1414
"rimraf": "3.0.2",
1515
"typescript": "^5.7.2"
1616
}

src/ui/InspectDialog.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Entity from "@wayward/game/game/entity/Entity";
55
import type Island from "@wayward/game/game/island/Island";
66
import Item from "@wayward/game/game/item/Item";
77
import type { IOverlayInfo } from "@wayward/game/game/tile/ITerrain";
8-
import { TerrainType } from "@wayward/game/game/tile/ITerrain";
98
import Tile from "@wayward/game/game/tile/Tile";
109
import type Translation from "@wayward/game/language/Translation";
1110
import Mod from "@wayward/game/mod/Mod";
@@ -40,6 +39,7 @@ import ItemInformation from "./inspect/ItemInformation";
4039
import TerrainInformation from "./inspect/TerrainInformation";
4140
import TileEventInformation from "./inspect/TileEventInformation";
4241
import VehicleInformation from "./inspect/VehicleInformation";
42+
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";
4343

4444
export type InspectDialogInformationSectionClass = new () => InspectInformationSection;
4545

@@ -164,7 +164,8 @@ export default class InspectDialog extends TabDialog<InspectInformationSection>
164164

165165
const item = what instanceof Item ? what : undefined;
166166
if (item) {
167-
this.LOG.info("Item:", item);
167+
ConsoleUtility.magic.$$item(item);
168+
this.LOG.info("$$item:", item["debug"]);
168169
}
169170

170171
while (what instanceof Item) {
@@ -352,8 +353,13 @@ export default class InspectDialog extends TabDialog<InspectInformationSection>
352353
@Bound
353354
private logUpdate(): void {
354355
if (this.shouldLog) {
355-
const tileData = this.tile ? this.tile.getTileData() : undefined;
356-
this.LOG.info("Tile:", this.tile, this.tile?.toString(), tileData?.map(data => TerrainType[data.type]).join(", "), tileData);
356+
Object.defineProperty(window, "$$tile", {
357+
configurable: true,
358+
get: () => {
359+
return this.tile;
360+
},
361+
});
362+
this.LOG.info("$$tile:", this.tile?.["debug"]);
357363
this.shouldLog = false;
358364
}
359365

src/ui/inspect/CorpseInformation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class CorpseInformation extends InspectInformationSection {
6666

6767
public override logUpdate(): void {
6868
for (const corpse of this.corpses) {
69-
this.LOG.info("Corpse:", corpse);
69+
this.LOG.info("Corpse:", corpse?.["debug"]);
7070
}
7171
}
7272

src/ui/inspect/CreatureInformation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import ToggleAiMask from "../../action/ToggleAiMask";
1717
import ToggleAiType from "../../action/ToggleAiType";
1818
import { DebugToolsTranslation, translation } from "../../IDebugTools";
1919
import InspectEntityInformationSubsection from "../component/InspectEntityInformationSubsection";
20+
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";
2021

2122
interface IAiRefreshable {
2223
refresh?(): any;
@@ -135,6 +136,7 @@ export default class CreatureInformation extends InspectEntityInformationSubsect
135136
return;
136137
}
137138

139+
ConsoleUtility.magic.$$creature(this, me => me?.creature);
138140
this.creature = entity.asCreature;
139141
this.event.emit("change");
140142

src/ui/inspect/DoodadInformation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import SetGrowingStage from "../../action/SetGrowingStage";
1818
import Container from "../component/Container";
1919
import type { TabInformation } from "../component/InspectInformationSection";
2020
import InspectInformationSection from "../component/InspectInformationSection";
21+
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";
2122

2223
export default class DoodadInformation extends InspectInformationSection {
2324

@@ -83,7 +84,8 @@ export default class DoodadInformation extends InspectInformationSection {
8384
}
8485

8586
public override logUpdate(): void {
86-
this.LOG.info("Doodad:", this.doodad);
87+
ConsoleUtility.magic.$$doodad(this, me => me?.doodad);
88+
this.LOG.info("$$doodad:", this.doodad?.["debug"]);
8789
}
8890

8991
@Bound

src/ui/inspect/EntityInformation.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import CreatureInformation from "./CreatureInformation";
4343
import HumanInformation from "./HumanInformation";
4444
import NpcInformation from "./NpcInformation";
4545
import PlayerInformation from "./PlayerInformation";
46+
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";
4647

4748
export type InspectDialogEntityInformationSubsectionClass = new () => InspectEntityInformationSubsection;
4849

@@ -201,9 +202,13 @@ export default class EntityInformation extends InspectInformationSection {
201202
}
202203

203204
public override logUpdate(): void {
204-
for (const entity of this.entities) {
205-
this.LOG.info("Entity:", entity);
205+
for (let i = 0; i < this.entities.length; i++) {
206+
const entity = this.entities[i];
207+
const isLastEntity = i === this.entities.length - 1;
208+
this.LOG.info(isLastEntity ? "$$entity" : `Entity ${i}:`, entity?.["debug"]);
206209
}
210+
211+
ConsoleUtility.magic.$$entity(this, me => me?.entities.at(-1));
207212
}
208213

209214
private initializeStats(): void {

src/ui/inspect/ItemInformation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { DEBUG_TOOLS_ID, DebugToolsTranslation, translation } from "../../IDebug
77
import Container from "../component/Container";
88
import type { TabInformation } from "../component/InspectInformationSection";
99
import InspectInformationSection from "../component/InspectInformationSection";
10+
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";
1011

1112
export default class ItemInformation extends InspectInformationSection {
1213

@@ -37,7 +38,8 @@ export default class ItemInformation extends InspectInformationSection {
3738
}
3839

3940
public override logUpdate(): void {
40-
this.LOG.info("Items:", this.tile?.containedItems);
41+
ConsoleUtility.magic.$$items(this, me => me?.tile.containedItems);
42+
this.LOG.info("$$items:", this.tile?.containedItems?.map(item => item["debug"]));
4143
}
4244

4345
@Bound private getTile(): ITileContainer {

src/ui/inspect/NpcInformation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Bound } from "@wayward/utilities/Decorators";
66
import Remove from "../../action/Remove";
77
import { DebugToolsTranslation, translation } from "../../IDebugTools";
88
import InspectEntityInformationSubsection from "../component/InspectEntityInformationSubsection";
9+
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";
910

1011
export default class NpcInformation extends InspectEntityInformationSubsection {
1112
private npc: NPC | undefined;
@@ -22,6 +23,10 @@ export default class NpcInformation extends InspectEntityInformationSubsection {
2223
public override update(entity: Creature | Player | NPC): void {
2324
this.npc = entity.asNPC;
2425
this.toggle(!!this.npc);
26+
27+
if (this.npc) {
28+
ConsoleUtility.magic.$$npc(this, me => me?.npc);
29+
}
2530
}
2631

2732
@Bound

0 commit comments

Comments
 (0)