fix: Correct critical bugs and complete Creature/Group DataModel implementation
- Fix TypeError: controls.find is not a function in hooks.mjs - Fix undefined 'npc' variable in applications.mjs - Fix CONFIG.VERMINE.model undefined by checking game.system.template existence - Fix TypeError: html.find(...).forEach is not a function in roll.mjs - Fix Cannot set properties of undefined (setting 'initial') in actor.mjs - Fix Cannot read properties of undefined (reading 'difficulty') in actor.mjs - Fix ActiveEffect application phase 'initial' already completed by adding combatStatus to base template - Fix Missing helper: 'select' in roll-dialog.hbs (removed invalid Handlebars select block) - Add SIZE_LEVELS labels to creatureSizeLevels config - Add SIZE_LEVELS translations to fr.json - Add combatStatus to base actor template - Convert all .html templates to .hbs for Foundry v14 compatibility - Update item-sheet.mjs to use .hbs extension - Update handlebars-manager.mjs to use .hbs for all partials Complete Vermine2047 Creature and Group sheet implementation: - Creature: Pattern, Size, Role, Pack with computed values - Group: Totem, Reserve, Morale, Objectives, Members management - All templates functional with proper styling Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -79,7 +79,7 @@ export class ActorPicker extends Application {
|
||||
if (type == 'members') {
|
||||
actorsList = characters;
|
||||
} else if (type == 'relations') {
|
||||
actorsList = npc;//[...npc, ...characters];
|
||||
actorsList = npcs;//[...npcs, ...characters];
|
||||
} else {
|
||||
actorsList = all;
|
||||
}
|
||||
@@ -94,26 +94,33 @@ export class ActorPicker extends Application {
|
||||
html.find('.actor').click(async (event) => {
|
||||
const actorId = $(event.target).parent('div').data('actor-id');
|
||||
const type = $(this.linkEl).data('type');
|
||||
|
||||
if (!actorId) return;
|
||||
|
||||
let actorsList = [];
|
||||
|
||||
if (type == 'members') {
|
||||
actorsList = this.actor.system.members;
|
||||
actorsList = foundry.utils.duplicate(this.actor.system.members || []);
|
||||
} else if (type == 'encounters') {
|
||||
actorsList = this.actor.system.encounters;
|
||||
actorsList = foundry.utils.duplicate(this.actor.system.encounters || []);
|
||||
}
|
||||
|
||||
if (!Array.isArray(actorsList)) {
|
||||
actorsList = [];
|
||||
}
|
||||
|
||||
actorsList.push(actorId);
|
||||
|
||||
if (type == 'members') {
|
||||
actorsList = this.actor.system.members;
|
||||
this.actor.update({ 'system.members': actorsList });
|
||||
} else if (type == 'encounters') {
|
||||
this.actor.update({ 'system.encounters': actorsList });
|
||||
// Add actor if not already present
|
||||
if (!actorsList.includes(actorId)) {
|
||||
actorsList.push(actorId);
|
||||
}
|
||||
|
||||
if (type == 'members') {
|
||||
await this.actor.update({ 'system.members': actorsList });
|
||||
} else if (type == 'encounters') {
|
||||
await this.actor.update({ 'system.encounters': actorsList });
|
||||
}
|
||||
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user