Skip to content

Commit

Permalink
Update for v12 (#16)
Browse files Browse the repository at this point in the history
* Add files via upload

* Add files via upload

* Update system.json
  • Loading branch information
deathtaco290 authored Aug 23, 2024
1 parent 59a4f21 commit e629183
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
8 changes: 5 additions & 3 deletions module/actor-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export class HoneyHeistActorSheet extends ActorSheet {

html.find(".attribute-roll").click(async (ev) => {
const roller = $(ev.currentTarget);
const roll = new Roll(roller.data("roll"), this.actor.getRollData()).evaluate({ async: false }); // avoid deprecation warning, backwards compatible
const roll = new Roll(roller.data("roll"), this.actor.getRollData());
await roll.evaluate();
const parent = roller.parent("div");
const label = parent.find("label").get(0).innerText;
const select = parent.find("select").get(0);
Expand Down Expand Up @@ -83,7 +84,8 @@ export class HoneyHeistActorSheet extends ActorSheet {
const roller = $(ev.currentTarget);
const input = roller.siblings(".stat-value").get(0);
const currentValue = parseInt(input.value);
const roll = new Roll(roller.data("roll"), this.actor.getRollData()).evaluate({ async: false }); // avoid deprecation warning, backwards compatible
const roll = new Roll(roller.data("roll"), this.actor.getRollData());
await roll.evaluate();
const isSuccess = roll.total <= currentValue;
const rollSuccess = isSuccess ? game.i18n.localize("HH.Success") : game.i18n.localize("HH.Failed");
const actionMessage = isSuccess
Expand All @@ -98,7 +100,7 @@ export class HoneyHeistActorSheet extends ActorSheet {
// GREED: When the plan goes off without a hitch, move
// one point from Bear into Criminal.
const isEnd = await this._updateStatsAsync(isSuccess ? -1 : 1, roll, isBearRoll);

if (!isEnd) {
roll.toMessage({
user: game.user.id, // avoid deprecation warning, backwards compatible
Expand Down
62 changes: 33 additions & 29 deletions system.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
{
"id": "honey-heist",
"title": "Honey Heist",
"description": "It's HoneyCon. You are going to undertake the greatest heist the world has ever seen.",
"version": 1.5,
"templateVersion": 2,
"compatibility": {
"minimum": "10",
"verified": "10",
"maximum": ""
},
"authors": [
{
"name": "JHaywood"
}
],
"esmodules": [ "module/main.js" ],
"styles": [ "styles/main.css" ],
"packs": [],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
}
],
"url": "https://github.com/jbhaywood/foundryvtt-honeyheist/",
"manifest": "https://raw.githubusercontent.com/jbhaywood/foundryvtt-honeyheist/master/system.json",
"download": "https://github.com/jbhaywood/foundryvtt-honeyheist/archive/v1.5.zip",
"license": "LICENSE.txt"
"id": "honey-heist",
"title": "Honey Heist",
"description": "It's HoneyCon. You are going to undertake the greatest heist the world has ever seen.",
"version": "1.5",
"compatibility": {
"minimum": "10",
"verified": "10",
"maximum": "12"
},
"authors": [
{
"name": "JHaywood",
"flags": {}
}
],
"esmodules": [
"module/main.js"
],
"styles": [
"styles/main.css"
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json",
"flags": {}
}
],
"url": "https://github.com/jbhaywood/foundryvtt-honeyheist/",
"manifest": "https://raw.githubusercontent.com/jbhaywood/foundryvtt-honeyheist/master/system.json",
"download": "https://github.com/jbhaywood/foundryvtt-honeyheist/archive/v1.5.zip",
"license": "LICENSE.txt"
}

0 comments on commit e629183

Please sign in to comment.