Skip to content

Commit

Permalink
Update for 2.14.2-beta.dev.20241222.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetech committed Dec 22, 2024
1 parent 42e4093 commit 1ab24c0
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 17 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"watch": "npx tsc --build --watch --pretty --preserveWatchOutput"
},
"devDependencies": {
"@wayward/types": "^2.14.2-beta.dev.20241221.1",
"@wayward/types": "^2.14.2-beta.dev.20241222.1",
"rimraf": "3.0.2",
"typescript": "^5.7.2"
}
Expand Down
14 changes: 10 additions & 4 deletions src/ui/InspectDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Entity from "@wayward/game/game/entity/Entity";
import type Island from "@wayward/game/game/island/Island";
import Item from "@wayward/game/game/item/Item";
import type { IOverlayInfo } from "@wayward/game/game/tile/ITerrain";
import { TerrainType } from "@wayward/game/game/tile/ITerrain";
import Tile from "@wayward/game/game/tile/Tile";
import type Translation from "@wayward/game/language/Translation";
import Mod from "@wayward/game/mod/Mod";
Expand Down Expand Up @@ -40,6 +39,7 @@ import ItemInformation from "./inspect/ItemInformation";
import TerrainInformation from "./inspect/TerrainInformation";
import TileEventInformation from "./inspect/TileEventInformation";
import VehicleInformation from "./inspect/VehicleInformation";
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";

export type InspectDialogInformationSectionClass = new () => InspectInformationSection;

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

const item = what instanceof Item ? what : undefined;
if (item) {
this.LOG.info("Item:", item);
ConsoleUtility.magic.$$item(item);
this.LOG.info("$$item:", item["debug"]);
}

while (what instanceof Item) {
Expand Down Expand Up @@ -352,8 +353,13 @@ export default class InspectDialog extends TabDialog<InspectInformationSection>
@Bound
private logUpdate(): void {
if (this.shouldLog) {
const tileData = this.tile ? this.tile.getTileData() : undefined;
this.LOG.info("Tile:", this.tile, this.tile?.toString(), tileData?.map(data => TerrainType[data.type]).join(", "), tileData);
Object.defineProperty(window, "$$tile", {
configurable: true,
get: () => {
return this.tile;
},
});
this.LOG.info("$$tile:", this.tile?.["debug"]);
this.shouldLog = false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/inspect/CorpseInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class CorpseInformation extends InspectInformationSection {

public override logUpdate(): void {
for (const corpse of this.corpses) {
this.LOG.info("Corpse:", corpse);
this.LOG.info("Corpse:", corpse?.["debug"]);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/ui/inspect/CreatureInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import ToggleAiMask from "../../action/ToggleAiMask";
import ToggleAiType from "../../action/ToggleAiType";
import { DebugToolsTranslation, translation } from "../../IDebugTools";
import InspectEntityInformationSubsection from "../component/InspectEntityInformationSubsection";
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";

interface IAiRefreshable {
refresh?(): any;
Expand Down Expand Up @@ -135,6 +136,7 @@ export default class CreatureInformation extends InspectEntityInformationSubsect
return;
}

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

Expand Down
4 changes: 3 additions & 1 deletion src/ui/inspect/DoodadInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import SetGrowingStage from "../../action/SetGrowingStage";
import Container from "../component/Container";
import type { TabInformation } from "../component/InspectInformationSection";
import InspectInformationSection from "../component/InspectInformationSection";
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";

export default class DoodadInformation extends InspectInformationSection {

Expand Down Expand Up @@ -83,7 +84,8 @@ export default class DoodadInformation extends InspectInformationSection {
}

public override logUpdate(): void {
this.LOG.info("Doodad:", this.doodad);
ConsoleUtility.magic.$$doodad(this, me => me?.doodad);
this.LOG.info("$$doodad:", this.doodad?.["debug"]);
}

@Bound
Expand Down
9 changes: 7 additions & 2 deletions src/ui/inspect/EntityInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import CreatureInformation from "./CreatureInformation";
import HumanInformation from "./HumanInformation";
import NpcInformation from "./NpcInformation";
import PlayerInformation from "./PlayerInformation";
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";

export type InspectDialogEntityInformationSubsectionClass = new () => InspectEntityInformationSubsection;

Expand Down Expand Up @@ -201,9 +202,13 @@ export default class EntityInformation extends InspectInformationSection {
}

public override logUpdate(): void {
for (const entity of this.entities) {
this.LOG.info("Entity:", entity);
for (let i = 0; i < this.entities.length; i++) {
const entity = this.entities[i];
const isLastEntity = i === this.entities.length - 1;
this.LOG.info(isLastEntity ? "$$entity" : `Entity ${i}:`, entity?.["debug"]);
}

ConsoleUtility.magic.$$entity(this, me => me?.entities.at(-1));
}

private initializeStats(): void {
Expand Down
4 changes: 3 additions & 1 deletion src/ui/inspect/ItemInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DEBUG_TOOLS_ID, DebugToolsTranslation, translation } from "../../IDebug
import Container from "../component/Container";
import type { TabInformation } from "../component/InspectInformationSection";
import InspectInformationSection from "../component/InspectInformationSection";
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";

export default class ItemInformation extends InspectInformationSection {

Expand Down Expand Up @@ -37,7 +38,8 @@ export default class ItemInformation extends InspectInformationSection {
}

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

@Bound private getTile(): ITileContainer {
Expand Down
5 changes: 5 additions & 0 deletions src/ui/inspect/NpcInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Bound } from "@wayward/utilities/Decorators";
import Remove from "../../action/Remove";
import { DebugToolsTranslation, translation } from "../../IDebugTools";
import InspectEntityInformationSubsection from "../component/InspectEntityInformationSubsection";
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";

export default class NpcInformation extends InspectEntityInformationSubsection {
private npc: NPC | undefined;
Expand All @@ -22,6 +23,10 @@ export default class NpcInformation extends InspectEntityInformationSubsection {
public override update(entity: Creature | Player | NPC): void {
this.npc = entity.asNPC;
this.toggle(!!this.npc);

if (this.npc) {
ConsoleUtility.magic.$$npc(this, me => me?.npc);
}
}

@Bound
Expand Down
2 changes: 2 additions & 0 deletions src/ui/inspect/PlayerInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import ToggleFastMovement from "../../action/ToggleFastMovement";
import InspectEntityInformationSubsection from "../component/InspectEntityInformationSubsection";
import SetPlayerData from "../../action/SetPlayerData";
import { RenderSource } from "@wayward/game/renderer/IRenderer";
import ConsoleUtility from "@wayward/utilities/console/ConsoleUtility";

export default class PlayerInformation extends InspectEntityInformationSubsection {

Expand Down Expand Up @@ -160,6 +161,7 @@ export default class PlayerInformation extends InspectEntityInformationSubsectio
return;
}

ConsoleUtility.magic.$$player(this, me => me?.player);
this.event.emit("change");

this.refresh();
Expand Down
1 change: 0 additions & 1 deletion src/ui/inspect/TerrainInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export default class TerrainInformation extends InspectInformationSection {
}

public override logUpdate(): void {
this.LOG.info("Terrain:", this.terrainType, ...this.isTillable() ? ["Tilled:", this.isTilled()] : []);
}

@Bound
Expand Down
2 changes: 1 addition & 1 deletion src/ui/inspect/TileEventInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class TileEventInformation extends InspectInformationSection {

public override logUpdate(): void {
for (const tileEvent of this.tileEvents) {
this.LOG.info("Tile Event:", tileEvent);
this.LOG.info("Tile Event:", tileEvent?.["debug"]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/inspect/VehicleInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class VehicleInformation extends DoodadInformation {
}

public override logUpdate(): void {
this.LOG.info("Vehicle:", this.doodad);
this.LOG.info("Vehicle:", this.doodad?.["debug"]);
}

}

0 comments on commit 1ab24c0

Please sign in to comment.