Work towards using pop-out item sheets instead of inline-editing because inline-editing is annoying and kinda ugly TBH

This commit is contained in:
Oliver-Akins 2024-01-10 22:18:18 -07:00
parent dcdc1b7764
commit 516f7ac826
13 changed files with 150 additions and 73 deletions

View file

@ -6,17 +6,37 @@ const damageTypes = [ `slashing`, `piercing`, `smashing`, `gun`, `neon`, `shadow
const ammoTypes = [`quivers`, `mags`, `cells`];
const stats = [ `build`, `meta`, `presence`, `hands`, `tilt`, `rng` ];
const buildSkills = [ "defense", "magic", "melee", "platforming", "strength", ];
const metaSkills = [ "alchemy", "arcanum", "dreams", "lore", "navigation", ];
const presenceSkills = [ "animal_handling", "perception", "sneak", "speech", "vibes", ];
const handsSkills = [ "accuracy", "crafting", "engineering", "explosives", "piloting", ];
const allSkills = [
...buildSkills,
...metaSkills,
...presenceSkills,
...handsSkills,
];
const skills = {
build: [ "defense", "magic", "melee", "platforming", "strength", ],
meta: [ "alchemy", "arcanum", "dreams", "lore", "navigation", ],
presence: [ "animal_handling", "perception", "sneak", "speech", "vibes", ],
hands: [ "accuracy", "crafting", "engineering", "explosives", "piloting", ]
build: buildSkills,
meta: metaSkills,
presence: presenceSkills,
hands: handsSkills,
};
export default {
stats,
statDice,
trainingLevels,
damageTypes,
ammoTypes,
buildSkills,
metaSkills,
presenceSkills,
handsSkills,
allSkills,
skills,
};

View file

@ -25,5 +25,6 @@ export default {
"nor": (a, b) => !(a || b),
"nand": (a, b) => !(a && b),
"xor": (a, b) => (a || b) && !(a && b),
"xnor": (a, b) => !((a || b) && !(a && b))
"xnor": (a, b) => !((a || b) && !(a && b)),
"defined": v => v != null
};

View file

@ -10,11 +10,10 @@ export class SpellItemData extends DescribedItemData {
blank: true,
trim: true,
options() {
let skills = [ `` ];
for (const group in DOTDUNGEON.skills) {
skills.push(...skills[group]);
};
return skills;
return [
``,
...DOTDUNGEON.allSkills
];
},
}),
});

View file

@ -1,3 +1,4 @@
import DOTDUNGEON from "../config.mjs";
import { preloadIcons } from "../handlebars.mjs";
export class GenericItemSheet extends ItemSheet {
@ -20,7 +21,6 @@ export class GenericItemSheet extends ItemSheet {
async getData() {
const ctx = {};
const item = this.item.toObject(false);
// Send all of the settings that sheets need into their context
ctx.settings = {};
@ -32,9 +32,10 @@ export class GenericItemSheet extends ItemSheet {
ctx.meta = {
expanded: this._expanded,
idp: this.actor.uuid,
idp: this.item.uuid,
};
ctx.config = DOTDUNGEON;
ctx.icons = await preloadIcons();
return ctx;

View file

@ -23,14 +23,12 @@ export class SpellSheet extends GenericItemSheet {
};
async getData() {
const ctx = {};
const item = this.item.toObject(false);
ctx.name = super.name;
ctx.item = item;
ctx.system = item.system;
ctx.flags = item.flags;
const ctx = await super.getData();
ctx.item = this.item;
ctx.system = this.item.system;
ctx.flags = this.item.flags;
console.log(ctx)
return ctx;
};
};