Skip to content

Commit a1f15fa

Browse files
committed
Fix more deprecation warnings.
1 parent 20fe5e5 commit a1f15fa

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

module/applications/terrain-types-config.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class TerrainTypesConfig extends FormApplication {
5454
const formData = super._getSubmitData(updateData);
5555

5656
/** @type {(TerrainType & { isZone: boolean; })[]} */
57-
const terrainTypes = Object.entries(expandObject(formData))
57+
const terrainTypes = Object.entries(foundry.utils.expandObject(formData))
5858
.sort((a, b) => a[0] - b[0])
5959
.map(([_, value]) => value);
6060

@@ -135,7 +135,11 @@ export class TerrainTypesConfig extends FormApplication {
135135
this.sync();
136136
const { terrainTypeId } = event.currentTarget.closest("[data-terrain-type-id]").dataset;
137137
const existingTerrainType = this.object.find(t => t.id === terrainTypeId);
138-
const newTerrainType = { ...existingTerrainType, id: randomID(), name: existingTerrainType.name + " (2)" };
138+
const newTerrainType = {
139+
...existingTerrainType,
140+
id: foundry.utils.randomID(),
141+
name: existingTerrainType.name + " (2)"
142+
};
139143
this.object.push(newTerrainType);
140144
this._expandedTypes[newTerrainType.id] = true;
141145
this.render();

module/utils/terrain-types.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { alphaToHex } from "./misc-utils.mjs";
3636
*/
3737
export function createDefaultTerrainType(id = undefined) {
3838
return {
39-
id: id ?? randomID(),
39+
id: id ?? foundry.utils.randomID(),
4040
name: "New Terrain Type",
4141
usesHeight: true,
4242
isSolid: true,

styles/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ ul.terrain-type-palette li .terrain-type-name {
299299
font-family: Consolas, Courier New, Courier, monaco, monospace;
300300
}
301301

302+
#tht_terrainTypesConfig file-picker {
303+
align-items: stretch;
304+
}
305+
302306

303307
/* --------------------------- */
304308
/* Terrain Types Import/Export */

templates/terrain-types-config.hbs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
<div class="form-group-stacked">
5252
<label>{{localize "DRAWING.StrokeColor"}}</label>
53-
{{colorPicker name=(concat idx ".lineColor") value=terrainType.lineColor}}
53+
<color-picker name="{{idx}}.lineColor" value="{{terrainType.lineColor}}" />
5454
</div>
5555

5656
<div class="form-group-stacked">
@@ -84,7 +84,7 @@
8484

8585
<div class="form-group-stacked">
8686
<label>{{localize "DRAWING.FillColor"}}</label>
87-
{{colorPicker name=(concat idx ".fillColor") value=terrainType.fillColor}}
87+
<color-picker name="{{idx}}.fillColor" value="{{terrainType.fillColor}}" />
8888
</div>
8989

9090
<div class="form-group-stacked">
@@ -97,8 +97,7 @@
9797
<div class="form-group-stacked">
9898
<label>{{localize "DRAWING.FillTexture"}}</label>
9999
<div class="form-group">
100-
{{filePicker target=(concat idx ".fillTexture") type="image"}}
101-
<input class="image" type="text" name="{{idx}}.fillTexture" placeholder="path/image.png" value="{{terrainType.fillTexture}}"/>
100+
<file-picker name="{{idx}}.fillTexture" type="image" value="{{terrainType.fillTexture}}"></file-picker>
102101
</div>
103102
</div>
104103

@@ -153,7 +152,7 @@
153152

154153
<div class="form-group-stacked">
155154
<label>{{localize "DRAWING.TextColor"}}</label>
156-
{{colorPicker name=(concat idx ".textColor") value=terrainType.textColor}}
155+
<color-picker name="{{idx}}.textColor" value="{{terrainType.textColor}}" />
157156
</div>
158157

159158
<div class="form-group-stacked">

0 commit comments

Comments
 (0)