Working on 0.8.x

- Working on title
- Added property update/delete for item patterns
This commit is contained in:
Vlyan
2021-05-21 14:12:14 +02:00
parent 4350ea25ee
commit 4f9b72c63f
22 changed files with 586 additions and 101 deletions

View File

@@ -399,7 +399,7 @@ export class DicePickerDialog extends FormApplication {
// Update Actor
if (this._actor) {
const actorData = duplicate(this._actor.data.data);
const actorData = foundry.utils.duplicate(this._actor.data.data);
// Update the actor stance on initiative only
if (this.object.isInitiativeRoll) {
@@ -416,10 +416,13 @@ export class DicePickerDialog extends FormApplication {
actorData.void_points.value = Math.max(actorData.void_points.value - 1, 0);
}
// Update actor
await this._actor.update({
data: diffObject(this._actor.data.data, actorData),
});
// Update actor if needed
const updateDiff = foundry.utils.diffObject(this._actor.data.data, actorData);
if (Object.keys(updateDiff).length > 0) {
await this._actor.update({
data: foundry.utils.diffObject(this._actor.data.data, actorData),
});
}
}
// Build the formula

View File

@@ -65,7 +65,7 @@ export class GmToolsDialog extends FormApplication {
*/
async close(options = {}) {
// TODO better implementation needed : see KeyboardManager._onEscape(event, up, modifiers)
// This windows is always open, so esc key si stuck at step 2 : Object.keys(ui.windows).length > 0
// This windows is always open, so esc key is stuck at step 2 : Object.keys(ui.windows).length > 0
// Case 3 (GM) - release controlled objects
if (canvas?.ready && game.user.isGM && Object.keys(canvas.activeLayer._controlled).length) {
canvas.activeLayer.releaseAll();