mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Merge branch 'main' into development
This commit is contained in:
commit
edc3017b39
5 changed files with 31 additions and 3 deletions
|
|
@ -618,6 +618,7 @@
|
||||||
},
|
},
|
||||||
"RerollDialog": {
|
"RerollDialog": {
|
||||||
"title": "Reroll",
|
"title": "Reroll",
|
||||||
|
"damageTitle": "Reroll Damage",
|
||||||
"deselectDiceNotification": "Deselect one of the selected dice first",
|
"deselectDiceNotification": "Deselect one of the selected dice first",
|
||||||
"acceptCurrentRolls": "Accept Current Rolls"
|
"acceptCurrentRolls": "Accept Current Rolls"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,15 @@ export default class DhSceneConfigSettings extends foundry.applications.sheets.S
|
||||||
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||||
const item = await foundry.utils.fromUuid(data.uuid);
|
const item = await foundry.utils.fromUuid(data.uuid);
|
||||||
if (item instanceof game.system.api.documents.DhpActor && item.type === 'environment') {
|
if (item instanceof game.system.api.documents.DhpActor && item.type === 'environment') {
|
||||||
|
let sceneUuid = data.uuid;
|
||||||
|
if (item.pack) {
|
||||||
|
const inWorldActor = await game.system.api.documents.DhpActor.create([item.toObject()]);
|
||||||
|
if (!inWorldActor.length) return;
|
||||||
|
sceneUuid = inWorldActor[0].uuid;
|
||||||
|
}
|
||||||
|
|
||||||
await this.daggerheartFlag.updateSource({
|
await this.daggerheartFlag.updateSource({
|
||||||
sceneEnvironments: [...this.daggerheartFlag.sceneEnvironments, data.uuid]
|
sceneEnvironments: [...this.daggerheartFlag.sceneEnvironments, sceneUuid]
|
||||||
});
|
});
|
||||||
this.render({ internalRefresh: true });
|
this.render({ internalRefresh: true });
|
||||||
}
|
}
|
||||||
|
|
@ -97,6 +104,10 @@ export default class DhSceneConfigSettings extends foundry.applications.sheets.S
|
||||||
/** @override */
|
/** @override */
|
||||||
async _processSubmitData(event, form, submitData, options) {
|
async _processSubmitData(event, form, submitData, options) {
|
||||||
submitData.flags.daggerheart = this.daggerheartFlag.toObject();
|
submitData.flags.daggerheart = this.daggerheartFlag.toObject();
|
||||||
|
submitData.flags.daggerheart.sceneEnvironments = submitData.flags.daggerheart.sceneEnvironments.filter(x =>
|
||||||
|
foundry.utils.fromUuidSync(x)
|
||||||
|
);
|
||||||
|
|
||||||
for (const key of Object.keys(this.document._source.flags.daggerheart?.sceneEnvironments ?? {})) {
|
for (const key of Object.keys(this.document._source.flags.daggerheart?.sceneEnvironments ?? {})) {
|
||||||
if (!submitData.flags.daggerheart.sceneEnvironments[key]) {
|
if (!submitData.flags.daggerheart.sceneEnvironments[key]) {
|
||||||
submitData.flags.daggerheart.sceneEnvironments[`-=${key}`] = null;
|
submitData.flags.daggerheart.sceneEnvironments[`-=${key}`] = null;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import D20RollDialog from '../applications/dialogs/d20RollDialog.mjs';
|
||||||
export default class DHRoll extends Roll {
|
export default class DHRoll extends Roll {
|
||||||
baseTerms = [];
|
baseTerms = [];
|
||||||
constructor(formula, data = {}, options = {}) {
|
constructor(formula, data = {}, options = {}) {
|
||||||
super(formula, data, options);
|
super(formula, data, foundry.utils.mergeObject(options, { roll: [] }, { overwrite: false }));
|
||||||
options.bonusEffects = this.bonusEffectBuilder();
|
options.bonusEffects = this.bonusEffectBuilder();
|
||||||
if (!this.data || !Object.keys(this.data).length) this.data = options.data;
|
if (!this.data || !Object.keys(this.data).length) this.data = options.data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,22 @@ export async function runMigrations() {
|
||||||
|
|
||||||
lastMigrationVersion = '1.2.7';
|
lastMigrationVersion = '1.2.7';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (foundry.utils.isNewerVersion('1.5.5', lastMigrationVersion)) {
|
||||||
|
for (const scene of game.scenes) {
|
||||||
|
if (!scene.flags.daggerheart) continue;
|
||||||
|
const systemData = new game.system.api.data.scenes.DHScene(scene.flags.daggerheart);
|
||||||
|
const sceneEnvironments = systemData.sceneEnvironments;
|
||||||
|
|
||||||
|
const newEnvironments = sceneEnvironments.filter(x => !x?.pack);
|
||||||
|
if (newEnvironments.length !== sceneEnvironments.length)
|
||||||
|
await scene.update({ 'flags.daggerheart.sceneEnvironments': newEnvironments });
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.nav.render(true);
|
||||||
|
|
||||||
|
lastMigrationVersion = '1.5.5';
|
||||||
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "1.5.4",
|
"version": "1.5.5",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13.346",
|
"minimum": "13.346",
|
||||||
"verified": "13.351",
|
"verified": "13.351",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue