mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Merged with main
This commit is contained in:
commit
ecd33caa7b
2 changed files with 3 additions and 10 deletions
|
|
@ -43,11 +43,6 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async _prepareTurnContext(combat, combatant, index) {
|
|
||||||
const turn = await super._prepareTurnContext(combat, combatant, index);
|
|
||||||
return { ...turn, isNPC: combatant.isNPC, system: combatant.system.toObject() };
|
|
||||||
}
|
|
||||||
|
|
||||||
_getCombatContextOptions() {
|
_getCombatContextOptions() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|
@ -113,7 +108,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
tooltip: this._formatEffectsTooltip(effects)
|
tooltip: this._formatEffectsTooltip(effects)
|
||||||
};
|
};
|
||||||
|
|
||||||
return turn;
|
return { ...turn, isNPC: combatant.isNPC, system: combatant.system.toObject() };
|
||||||
}
|
}
|
||||||
|
|
||||||
async setCombatantSpotlight(combatantId) {
|
async setCombatantSpotlight(combatantId) {
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,7 @@ export class ActionsField extends MappingField {
|
||||||
*/
|
*/
|
||||||
export class ActionField extends foundry.data.fields.ObjectField {
|
export class ActionField extends foundry.data.fields.ObjectField {
|
||||||
getModel(value) {
|
getModel(value) {
|
||||||
return (
|
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
||||||
game.system.api.models.actions.actionsTypes[value.type] ??
|
|
||||||
null
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
@ -102,6 +99,7 @@ export class ActionField extends foundry.data.fields.ObjectField {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
initialize(value, model, options = {}) {
|
initialize(value, model, options = {}) {
|
||||||
|
if (value && !value.type) value.type = 'attack';
|
||||||
const cls = this.getModel(value);
|
const cls = this.getModel(value);
|
||||||
if (cls) return new cls(value, { parent: model, ...options });
|
if (cls) return new cls(value, { parent: model, ...options });
|
||||||
return foundry.utils.deepClone(value);
|
return foundry.utils.deepClone(value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue