Skip to content

Commit

Permalink
1.0.29 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IronMonk88 committed Jun 13, 2021
1 parent be47de6 commit 2b92c07
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version 1.0.29
Fixed issue with the config dialog

Added option to set the color for individual terrain

# Version 1.0.28
Support for Foundry 0.8.x

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ And it will also calculate other tokens so that when you're moving through anoth

Terrain Layer can either be shown all the time, or hidden until a token is selected and dragged across the screen. This can be changed using the Enable/Disable Terrain button with the other terrain controls.

You can also set blocks of Terrain to be shown or not shown, so if the difficult terrain is only temporary or conditional you can control it.
You can also set blocks of Terrain to be active or not active, so if the difficult terrain is only temporary or conditional you can control it.

You can also set the environment that the difficult terrain represents. So if you have water, or rocks, or arctic tundra you can record this information. If you have a system that allows characters to ignore difficult terrain of a certain type, and a ruler that supports checking on this, then it can be added to the calculations.

You can set the color of the terrain, on an individual basis, a default colour for that environment, a default for the scene, or a general color.

## Coding
For those who are developing Rulers based on the Enhanced Terrain Layer, to get access to the difficulty cost of terrain grid you call the cost function.
Expand Down
2 changes: 1 addition & 1 deletion classes/terrain.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class Terrain extends PlaceableObject {
}

get color() {
return setting('environment-color')[this.environment?.id] || this.environment?.color || canvas.scene.getFlag('enhanced-terrain-layer', 'defaultcolor') || setting('environment-color')['_default'] || "#FFFFFF";
return this.data.drawcolor || setting('environment-color')[this.environment?.id] || this.environment?.color || canvas.scene.getFlag('enhanced-terrain-layer', 'defaultcolor') || setting('environment-color')['_default'] || "#FFFFFF";
}

/*
Expand Down
3 changes: 2 additions & 1 deletion classes/terrainconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class TerrainConfig extends DocumentSheet {
//title: i18n("EnhancedTerrainLayer.Configuration"),
template: "modules/enhanced-terrain-layer/templates/terrain-config.html",
width: 400,
submitOnChange: true
submitOnChange: false
});
}

Expand Down Expand Up @@ -53,6 +53,7 @@ export class TerrainConfig extends DocumentSheet {
let val = $(event.target).val();
$(event.target).next().html(TerrainLayer.multipleText(val));
}
super._onChangeInput.call(this, event);
}

/* -------------------------------------------- */
Expand Down
1 change: 1 addition & 0 deletions classes/terraindocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class TerrainData extends DocumentData {
multiple: fields.NUMERIC_FIELD,
min: fields.NUMERIC_FIELD,
max: fields.NUMERIC_FIELD,
drawcolor: fields.STRING_FIELD,
environment: fields.STRING_FIELD,
obstacle: fields.STRING_FIELD,
flags: fields.OBJECT_FIELD
Expand Down
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "enhanced-terrain-layer",
"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.28",
"version": "1.0.29",
"author": "IronMonk, ironmonk88#4075",
"socket": true,
"languages": [
Expand Down Expand Up @@ -30,10 +30,10 @@
"styles": [ "css/terrainlayer.css" ],
"packs": [],
"url" : "https://github.com/ironmonk88/enhanced-terrain-layer",
"download" : "https://github.com/ironmonk88/enhanced-terrain-layer/archive/1.0.28.zip",
"download" : "https://github.com/ironmonk88/enhanced-terrain-layer/archive/1.0.29.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,
"minimumCoreVersion": "0.8.0",
"compatibleCoreVersion": "0.8.5"
"compatibleCoreVersion": "0.8.6"
}
6 changes: 6 additions & 0 deletions templates/terrain-config.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<span class="range-value">{{object.multiple}}</span>
</div>
</div>
<div class="form-group">
<label for="drawcolor">{{localize "EnhancedTerrainLayer.TerrainColor"}}</label>
<div class="form-fields">
{{ colorPicker name="drawcolor" value=object.drawcolor}}
</div>
</div>
<div class="form-group">
<label for="terrainheight">{{localize "EnhancedTerrainLayer.TerrainHeight"}}</label>
<div class="form-fields" style="position:relative;">
Expand Down

0 comments on commit 2b92c07

Please sign in to comment.