Merge pull request #40 from Eldritch-Oliver/feature/prevent-item-creation

Prevent item creation and hide the item tab
This commit is contained in:
Oliver 2025-09-04 19:36:05 -06:00 committed by GitHub
commit da57b12800
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,7 @@
const { Item } = foundry.documents;
export class TAFItem extends Item {
async _preCreate() {
return false;
};
};

View file

@ -6,6 +6,7 @@ import { PlayerData } from "../data/Player.mjs";
// Documents // Documents
import { TAFActor } from "../documents/Actor.mjs"; import { TAFActor } from "../documents/Actor.mjs";
import { TAFItem } from "../documents/Item.mjs";
import { TAFTokenDocument } from "../documents/Token.mjs"; import { TAFTokenDocument } from "../documents/Token.mjs";
// Settings // Settings
@ -25,6 +26,10 @@ Hooks.on(`init`, () => {
CONFIG.Actor.dataModels.player = PlayerData; CONFIG.Actor.dataModels.player = PlayerData;
// We disable items in the system for now
CONFIG.Item.documentClass = TAFItem;
delete CONFIG.ui.sidebar.TABS.items;
foundry.documents.collections.Actors.registerSheet( foundry.documents.collections.Actors.registerSheet(
__ID__, __ID__,
PlayerSheet, PlayerSheet,