Skip to content

Commit

Permalink
10.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ironmonk88 committed Sep 11, 2022
1 parent 6e7b892 commit b25d833
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] Brief description of your issue"
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Please complete as much of the following information as possible:**
- Browser [e.g. chrome, safari]
- Foundry Version [e.g. v9]
- System [e.g. D&D5e, Pathfinder 2e]
- Module version
- Are there any errors in the console [e.g. press F12 and look for red text]
- Have you tried using `Find the Culprit` to make sure it isn't a module interaction.

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Version 10.1

Fixed issue with migrating to v10.

Fixed detecting if a token is defeated.

# Version 1.0.43

Updates to support v10
Expand Down
2 changes: 0 additions & 2 deletions classes/terrain.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ export class Terrain extends PlaceableObject {
if (hidden && (!game.user.isGM || setting("only-show-active")))
return false;

log("isVisible", canvas.terrain._tokenDrag, this.layer._tokenDrag);

if (!this.layer.showterrain && !(this.layer.showOnDrag && this.layer._tokenDrag))
return false;

Expand Down
6 changes: 3 additions & 3 deletions classes/terraindocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ export class BaseTerrain extends foundry.abstract.Document {
/**
* V10 migration to ShapeData model
* @deprecated since v10
*/
this._addDataFieldMigration(data, "type", "shape.type", "p");
*/
if (getProperty(data, "shape.type") == undefined)
setProperty(data, "shape.type", "p");
this._addDataFieldMigration(data, "width", "shape.width");
this._addDataFieldMigration(data, "height", "shape.height");
this._addDataFieldMigration(data, "points", "shape.points", d => d.points.flat());
return super.migrateData(data);
}

static shimData(data, options) {
this._addDataFieldShim(data, "type", "shape.type", { since: 10, until: 12 });
this._addDataFieldShim(data, "width", "shape.width", { since: 10, until: 12 });
this._addDataFieldShim(data, "height", "shape.height", { since: 10, until: 12 });
this._addDataFieldShim(data, "points", "shape.points", { since: 10, until: 12 });
Expand Down
4 changes: 2 additions & 2 deletions classes/terrainlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class TerrainLayer extends PlaceablesLayer {
let isDead = options.isDead || function (token) {
return !!token.actor?.effects?.find(e => {
const core = e.flags["core"];
return core && core["statusId"] === "dead";
return core && core["statusId"] === CONFIG.specialStatusEffects.DEFEATED;
});
}

Expand Down Expand Up @@ -345,7 +345,7 @@ export class TerrainLayer extends PlaceablesLayer {
if (etl) {
for (let [k, v] of Object.entries(etl)) {
if (k.startsWith('terrain')) {
if (k != 'terrainundefined' && v != undefined && v.x != undefined && v.y != undefined && v._id != undefined && v.shape?.points != undefined) {
if (k != 'terrainundefined' && v != undefined && v.x != undefined && v.y != undefined && v._id != undefined) {
//lets correct any changes
let change = false;
if (v.environment == '' && v.obstacle != '') {
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Enhanced Terrain Layer",
"description": "A base module that adds a Terrain Layer to Foundry. Used as a library for Rulers and other modules",
"version": "1.0.43",
"version": "10.1",
"authors": [
{
"name": "IronMonk",
Expand Down Expand Up @@ -47,7 +47,7 @@
"css/terrainlayer.css"
],
"url": "https://github.com/ironmonk88/enhanced-terrain-layer",
"download": "https://github.com/ironmonk88/enhanced-terrain-layer/archive/1.0.43.zip",
"download": "https://github.com/ironmonk88/enhanced-terrain-layer/archive/10.1.zip",
"manifest": "https://github.com/ironmonk88/enhanced-terrain-layer/releases/latest/download/module.json",
"bugs": "https://github.com/ironmonk88/enhanced-terrain-layer/issues",
"allowBugReporter": true,
Expand Down

0 comments on commit b25d833

Please sign in to comment.