Initial import
This commit is contained in:
71
oath-hammer.mjs
Normal file
71
oath-hammer.mjs
Normal file
@@ -0,0 +1,71 @@
|
||||
import { SYSTEM } from "./module/config/system.mjs"
|
||||
globalThis.SYSTEM = SYSTEM
|
||||
|
||||
import * as models from "./module/models/_module.mjs"
|
||||
import * as documents from "./module/documents/_module.mjs"
|
||||
import * as applications from "./module/applications/_module.mjs"
|
||||
import OathHammerUtils from "./module/utils.mjs"
|
||||
|
||||
Hooks.once("init", function () {
|
||||
console.info(SYSTEM.ASCII)
|
||||
console.info("Oath Hammer | Initializing System")
|
||||
|
||||
globalThis.oathHammer = game.system
|
||||
game.system.CONST = SYSTEM
|
||||
|
||||
game.system.api = { applications, models, documents }
|
||||
|
||||
CONFIG.Actor.documentClass = documents.OathHammerActor
|
||||
CONFIG.Actor.dataModels = {
|
||||
character: models.OathHammerCharacter,
|
||||
npc: models.OathHammerNPC
|
||||
}
|
||||
|
||||
CONFIG.Item.documentClass = documents.OathHammerItem
|
||||
CONFIG.Item.dataModels = {
|
||||
weapon: models.OathHammerWeapon,
|
||||
armor: models.OathHammerArmor,
|
||||
shield: models.OathHammerShield,
|
||||
ammunition: models.OathHammerAmmunition,
|
||||
equipment: models.OathHammerEquipment,
|
||||
spell: models.OathHammerSpell,
|
||||
miracle: models.OathHammerMiracle,
|
||||
"magic-item": models.OathHammerMagicItem,
|
||||
ability: models.OathHammerAbility,
|
||||
oath: models.OathHammerOath,
|
||||
condition: models.OathHammerCondition
|
||||
}
|
||||
|
||||
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet)
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-oath-hammer", applications.OathHammerCharacterSheet, {
|
||||
types: ["character"],
|
||||
makeDefault: true,
|
||||
label: "OATHHAMMER.Sheet.Character"
|
||||
})
|
||||
foundry.documents.collections.Actors.registerSheet("fvtt-oath-hammer", applications.OathHammerNPCSheet, {
|
||||
types: ["npc"],
|
||||
makeDefault: true,
|
||||
label: "OATHHAMMER.Sheet.NPC"
|
||||
})
|
||||
|
||||
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet)
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerWeaponSheet, { types: ["weapon"], makeDefault: true, label: "OATHHAMMER.Sheet.Weapon" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerArmorSheet, { types: ["armor"], makeDefault: true, label: "OATHHAMMER.Sheet.Armor" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerShieldSheet, { types: ["shield"], makeDefault: true, label: "OATHHAMMER.Sheet.Shield" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerAmmunitionSheet, { types: ["ammunition"], makeDefault: true, label: "OATHHAMMER.Sheet.Ammunition" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerEquipmentSheet, { types: ["equipment"], makeDefault: true, label: "OATHHAMMER.Sheet.Equipment" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerSpellSheet, { types: ["spell"], makeDefault: true, label: "OATHHAMMER.Sheet.Spell" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerMiracleSheet, { types: ["miracle"], makeDefault: true, label: "OATHHAMMER.Sheet.Miracle" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerMagicItemSheet, { types: ["magic-item"], makeDefault: true, label: "OATHHAMMER.Sheet.MagicItem" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerAbilitySheet, { types: ["ability"], makeDefault: true, label: "OATHHAMMER.Sheet.Ability" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerOathSheet, { types: ["oath"], makeDefault: true, label: "OATHHAMMER.Sheet.Oath" })
|
||||
foundry.documents.collections.Items.registerSheet("fvtt-oath-hammer", applications.OathHammerConditionSheet, { types: ["condition"], makeDefault: true, label: "OATHHAMMER.Sheet.Condition" })
|
||||
|
||||
OathHammerUtils.registerHandlebarsHelpers()
|
||||
|
||||
console.info("Oath Hammer | System Initialized")
|
||||
})
|
||||
|
||||
Hooks.once("ready", function () {
|
||||
console.info("Oath Hammer | System Ready")
|
||||
})
|
||||
Reference in New Issue
Block a user