Skip to content

Commit

Permalink
Set ChatLog and prototype sheet subclasses only in V12 for now (fou…
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam authored Oct 30, 2024
1 parent 32faed9 commit d05ae5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/scripts/hooks/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "@module/apps/sidebar/index.ts";
import { setPerceptionModes } from "@module/canvas/perception/modes.ts";
import { RulerPF2e } from "@module/canvas/ruler.ts";
import { TokenConfigPF2e } from "@scene/token-document/sheet.ts";
import { PF2ECONFIG } from "@scripts/config/index.ts";
import { registerHandlebarsHelpers } from "@scripts/handlebars.ts";
import { registerFonts } from "@scripts/register-fonts.ts";
Expand Down Expand Up @@ -38,10 +39,14 @@ export const Init = {
CONFIG.ui.actors = ActorDirectoryPF2e;
CONFIG.ui.items = ItemDirectoryPF2e;
CONFIG.ui.combat = EncounterTrackerPF2e;
CONFIG.ui.chat = ChatLogPF2e;
CONFIG.ui.compendium = CompendiumDirectoryPF2e;
CONFIG.ui.hotbar = HotbarPF2e;

if (game.release.generation === 12) {
CONFIG.ui.chat = ChatLogPF2e;
CONFIG.Token.prototypeSheetClass = TokenConfigPF2e;
}

// Set after load in case of module conflicts
if (!RulerPF2e.hasModuleConflict) CONFIG.Canvas.rulerClass = RulerPF2e;

Expand Down
2 changes: 0 additions & 2 deletions src/scripts/hooks/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {
TokenDocumentPF2e,
} from "@scene/index.ts";
import { ActorDeltaPF2e } from "@scene/token-document/actor-delta.ts";
import { TokenConfigPF2e } from "@scene/token-document/sheet.ts";
import { monkeyPatchFoundry } from "@scripts/🐵🩹.ts";
import { CheckRoll, StrikeAttackRoll } from "@system/check/roll.ts";
import { ClientDatabaseBackendPF2e } from "@system/client-backend.ts";
Expand Down Expand Up @@ -80,7 +79,6 @@ export const Load = {
CONFIG.Tile.documentClass = TileDocumentPF2e;
CONFIG.Token.documentClass = TokenDocumentPF2e;
CONFIG.Token.objectClass = TokenPF2e;
CONFIG.Token.prototypeSheetClass = TokenConfigPF2e;
CONFIG.User.documentClass = UserPF2e;

// Assign canvas layer and placeable classes
Expand Down

0 comments on commit d05ae5d

Please sign in to comment.