Begin working on a custom DOTDUNGEON config block

This commit is contained in:
Oliver-Akins 2024-01-07 00:55:13 -07:00
parent 07bebdba4d
commit c273111004
3 changed files with 16 additions and 4 deletions

View file

@ -19,6 +19,7 @@ import "./module/hooks/hotReload.mjs";
// Misc Imports
import loadSettings from "./module/settings/index.mjs";
import { DOTDUNGEON } from "./module/config.mjs";
Hooks.once(`init`, () => {
@ -31,6 +32,8 @@ Hooks.once(`init`, () => {
CONFIG.Item.dataModels.aspect = AspectItemData;
CONFIG.Actor.documentClass = ActorHandler;
CONFIG.DOTDUNGEON = DOTDUNGEON;
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("dotdungeon", PlayerSheet, {
makeDefault: true,

9
module/config.mjs Normal file
View file

@ -0,0 +1,9 @@
export const DOTDUNGEON = {};
DOTDUNGEON.statDice = [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
DOTDUNGEON.trainingLevels = [``, `locked`, `+2`, `+4`];
DOTDUNGEON.damageTypes = [ `slashing`, `piercing`, `smashing`, `gun`, `neon`, `shadow`, `solar` ];
DOTDUNGEON.ammoTypes = [`quivers`, `mags`, `cells`];

View file

@ -4,7 +4,7 @@ function diceChoiceField() {
blank: true,
trim: true,
options() {
return [ `d4`, `d6`, `d8`, `d10`, `d12`, `d20` ];
return CONFIG.DOTDUNGEON.statDice;
},
});
};
@ -14,7 +14,7 @@ function trainingLevelField() {
initial: ``,
blank: true,
trim: true,
options: [ ``, `locked`, `+2`, `+4` ],
options: CONFIG.DOTDUNGEON.trainingLevels,
});
};
@ -22,7 +22,7 @@ function weaponDamageTypeField() {
return new foundry.data.fields.StringField({
initial: ``,
blank: true,
options: [ ``, `slashing`, `piercing`, `smashing`, `gun`, `neon`, `shadow`, `solar` ],
options: [ ``, ...CONFIG.DOTDUNGEON.damageTypes ],
});
};
@ -30,7 +30,7 @@ function ammoTypeField() {
return new foundry.data.fields.StringField({
initial: ``,
blank: true,
options: [ ``, `quivers`, `mags`, `cells` ],
options: [ ``, ...CONFIG.DOTDUNGEON.ammoTypes ],
});
};