Skip to content

Commit

Permalink
v1.6.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
drewg13 committed Jun 5, 2021
1 parent 4294b52 commit 2771d6a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ v1.6.5 Bug fix for item import from compendiums
v1.6.6 Add tooltips to traumas, bug fixes for tooltips

v1.6.7 ALL THE TOOLTIPS, fixes for tooltips in dialogs, fix for class icon changes not persisting

v1.6.8 Fixes for clock HUDs
4 changes: 2 additions & 2 deletions module/sav-clock-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default {
newClock = oldClock.cycleSize();
} else if (target.classList.contains("cycle-theme")) {
newClock = oldClock.cycleTheme();
} else if (target.classList.contains("config")) {
} else if (target.dataset.action) {
return;
} else {
return error("ERROR: Unknown TokenHUD Button");
Expand Down Expand Up @@ -307,7 +307,7 @@ export default {
newClock = oldClock.increment();
} else if (target.classList.contains("progress-down")) {
newClock = oldClock.decrement();
} else if (target.classList.contains("visibility")) {
} else if (target.dataset.action) {
return;
} else {
return error("ERROR: Unknown TokenHUD Button");
Expand Down
34 changes: 29 additions & 5 deletions module/sav-clock-tiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,39 @@ export default {
});
},

renderTileHUD: async (_hud, html, tile) => {
renderTileHUD: async (_hud, html, tileData) => {
log("Render")
let t = canvas.tiles.get(tile._id);
if (!t.data.flags['scum-and-villainy'].clocks) {
let t, b, f;
if( game.majorVersion > 7 ) {
b = canvas.background.tiles.find( tile => tile.id === tileData._id );
f = canvas.foreground.tiles.find( tile => tile.id === tileData._id );
if( b?.id === tileData._id ) {
t = b;
} else if ( f?.id === tileData._id ) {
t = f;
} else { return false }
} else {
t = canvas.tiles.get( tileData._id );
}
if (!t?.data?.flags['scum-and-villainy']?.clocks) {
return;
}

const buttonHTML = await renderTemplate('systems/scum-and-villainy/templates/sav-clock-buttons.html');
html.find("div.left").append(buttonHTML).click(async (event) => {
log("HUD Clicked")
// re-get in case there has been an update
t = canvas.tiles.get(tile._id);
if( game.majorVersion > 7 ) {
b = canvas.background.tiles.find( tile => tile.id === tileData._id );
f = canvas.foreground.tiles.find( tile => tile.id === tileData._id );
if( b?.id === tileData._id ) {
t = b;
} else if ( f?.id === tileData._id ) {
t = f;
}
} else {
t = canvas.tiles.get(tileData._id);
}

const oldClock = new SaVClock(t.data.flags['scum-and-villainy'].clocks);
let newClock;
Expand All @@ -79,9 +100,12 @@ export default {
newClock = oldClock.increment();
} else if (target.classList.contains("progress-down")) {
newClock = oldClock.decrement();
} else if (target.dataset.action) {
return;
} else {
return error("ERROR: Unknown TileHUD Button");
return error("ERROR: Unknown TileHUD Button");
}

if( game.majorVersion > 7 ) {
await TileDocument.updateDocuments([{
_id: t.id,
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"authors": ["megastruktur", "Andrew Garinger [agaringer#6498]"],
"url": "https://github.com/drewg13/foundryvtt-scum-and-villainy/",
"flags": {},
"version": "1.6.7",
"version": "1.6.8",
"minimumCoreVersion": "0.7.2",
"compatibleCoreVersion": "0.8.6",
"system": [],
"dependencies": [],
"socket": false,
"manifest": "https://raw.githubusercontent.com/drewg13/foundryvtt-scum-and-villainy/master/system.json",
"download": "https://github.com/drewg13/foundryvtt-scum-and-villainy/archive/v1.6.7.zip",
"download": "https://github.com/drewg13/foundryvtt-scum-and-villainy/archive/v1.6.8.zip",
"protected": false,
"scripts": [],
"esmodules": [
Expand Down

0 comments on commit 2771d6a

Please sign in to comment.