Calm + Weight Settings 0.0.6

This commit is contained in:
Martin Jencka
2020-11-21 21:15:18 -07:00
parent 35666a0faa
commit dbc9ff70cd
9 changed files with 164 additions and 50 deletions
+30
View File
@@ -30,6 +30,13 @@ export class MothershipActorSheet extends ActorSheet {
this._prepareCharacterItems(data);
}
if (data.data.settings == null) {
data.data.settings = {};
}
data.data.settings.useCalm = game.settings.get("mothership", "useCalm");
data.data.settings.hideWeight = game.settings.get("mothership", "hideWeight");
return data;
}
@@ -224,6 +231,18 @@ export class MothershipActorSheet extends ActorSheet {
});
// Rollable Item/Anything with a description that we want to click on.
html.find('.calm-roll').click(ev => {
const attribute = this.actor.data.data.other.stress;
attribute.label = "Calm";
this.actor.rollStress(attribute);
});
// Rollable Item/Anything with a description that we want to click on.
html.find('.stress-roll').click(ev => {
const attribute = this.actor.data.data.other.stress;
attribute.label = "Stress";
this.actor.rollStress(attribute);
});
}
/* -------------------------------------------- */
@@ -305,4 +324,15 @@ export class MothershipActorSheet extends ActorSheet {
}
}
async _updateObject(event, formData) {
const actor = this.object;
const updateData = expandObject(formData);
await actor.update(updateData, {
diff: false
});
}
}