forked from GitHub-Mirrors/foundry-sw5e
Merge branch 'master' into character-sheet-importer
This commit is contained in:
commit
ea7a6e063a
161 changed files with 5350 additions and 3368 deletions
30
sw5e.js
30
sw5e.js
|
@ -14,11 +14,9 @@ import { preloadHandlebarsTemplates } from "./module/templates.js";
|
|||
import { _getInitiativeFormula } from "./module/combat.js";
|
||||
import { measureDistances, getBarAttribute } from "./module/canvas.js";
|
||||
|
||||
|
||||
// Import Entities
|
||||
import Actor5e from "./module/actor/entity.js";
|
||||
import Item5e from "./module/item/entity.js";
|
||||
import CharacterImporter from "./module/characterImporter.js";
|
||||
|
||||
// Import Applications
|
||||
import AbilityTemplate from "./module/pixi/ability-template.js";
|
||||
|
@ -32,7 +30,8 @@ import ActorSheet5eNPCNew from "./module/actor/sheets/newSheet/npc.js";
|
|||
import ItemSheet5e from "./module/item/sheet.js";
|
||||
import ShortRestDialog from "./module/apps/short-rest.js";
|
||||
import TraitSelector from "./module/apps/trait-selector.js";
|
||||
import MovementConfig from "./module/apps/movement-config.js";
|
||||
import ActorMovementConfig from "./module/apps/movement-config.js";
|
||||
import ActorSensesConfig from "./module/apps/senses-config.js";
|
||||
|
||||
// Import Helpers
|
||||
import * as chat from "./module/chat.js";
|
||||
|
@ -45,7 +44,7 @@ import * as migrations from "./module/migration.js";
|
|||
/* -------------------------------------------- */
|
||||
|
||||
Hooks.once("init", function() {
|
||||
console.log(`SW5e | Initializing Star Wars 5th Edition System\n${SW5E.ASCII}`);
|
||||
console.log(`SW5e | Initializing SW5E System\n${SW5E.ASCII}`);
|
||||
|
||||
// Create a SW5E namespace within the game global
|
||||
game.sw5e = {
|
||||
|
@ -60,7 +59,7 @@ Hooks.once("init", function() {
|
|||
ItemSheet5e,
|
||||
ShortRestDialog,
|
||||
TraitSelector,
|
||||
MovementConfig
|
||||
ActorMovementConfig
|
||||
},
|
||||
canvas: {
|
||||
AbilityTemplate
|
||||
|
@ -81,7 +80,15 @@ Hooks.once("init", function() {
|
|||
CONFIG.Actor.entityClass = Actor5e;
|
||||
CONFIG.Item.entityClass = Item5e;
|
||||
CONFIG.time.roundTime = 6;
|
||||
|
||||
CONFIG.fontFamilies = [
|
||||
"Engli-Besh",
|
||||
"Open Sans",
|
||||
"Russo One"
|
||||
];
|
||||
|
||||
// 5e cone RAW should be 53.13 degrees
|
||||
CONFIG.MeasuredTemplate.defaults.angle = 53.13;
|
||||
|
||||
// Add DND5e namespace for module compatability
|
||||
game.dnd5e = game.sw5e;
|
||||
CONFIG.DND5E = CONFIG.SW5E;
|
||||
|
@ -143,12 +150,12 @@ Hooks.once("setup", function() {
|
|||
|
||||
// Localize CONFIG objects once up-front
|
||||
const toLocalize = [
|
||||
"abilities", "abilityAbbreviations", "abilityActivationTypes", "abilityConsumptionTypes", "actorSizes", "alignments",
|
||||
"abilities", "abilityAbbreviations", "abilityActivationTypes", "abilityConsumptionTypes", "actorSizes", "alignments",
|
||||
"armorProficiencies", "armorPropertiesTypes", "conditionTypes", "consumableTypes", "cover", "currencies", "damageResistanceTypes",
|
||||
"damageTypes", "distanceUnits", "equipmentTypes", "healingTypes", "itemActionTypes", "languages",
|
||||
"limitedUsePeriods", "movementUnits", "polymorphSettings", "proficiencyLevels", "senses", "skills",
|
||||
"powerComponents", "powerLevels", "powerPreparationModes", "powerScalingModes", "powerSchools", "targetTypes",
|
||||
"timePeriods", "toolProficiencies", "weaponProficiencies", "weaponProperties", "weaponTypes"
|
||||
"limitedUsePeriods", "movementTypes", "movementUnits", "polymorphSettings", "proficiencyLevels", "senses", "skills",
|
||||
"powerComponents", "powerLevels", "powerPreparationModes", "powerScalingModes", "powerSchools", "targetTypes",
|
||||
"timePeriods", "toolProficiencies", "weaponProficiencies", "weaponProperties", "weaponTypes"
|
||||
];
|
||||
|
||||
// Exclude some from sorting where the default order matters
|
||||
|
@ -188,7 +195,7 @@ Hooks.once("ready", function() {
|
|||
// Determine whether a system migration is required and feasible
|
||||
if ( !game.user.isGM ) return;
|
||||
const currentVersion = game.settings.get("sw5e", "systemMigrationVersion");
|
||||
const NEEDS_MIGRATION_VERSION = "1.1.0";
|
||||
const NEEDS_MIGRATION_VERSION = "1.2.1";
|
||||
const COMPATIBLE_MIGRATION_VERSION = 0.80;
|
||||
const needsMigration = currentVersion && isNewerVersion(NEEDS_MIGRATION_VERSION, currentVersion);
|
||||
if ( !needsMigration ) return;
|
||||
|
@ -241,7 +248,6 @@ Hooks.on("renderSceneDirectory", (app, html, data)=> {
|
|||
});
|
||||
Hooks.on("renderActorDirectory", (app, html, data)=> {
|
||||
setFolderBackground(html);
|
||||
CharacterImporter.addImportButton(html);
|
||||
});
|
||||
Hooks.on("renderItemDirectory", (app, html, data)=> {
|
||||
setFolderBackground(html);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue