Skip to content

Commit 5ec9fd2

Browse files
authoredSep 27, 2024··
Merge pull request #211 from BeardedGnome/mdahrea/mastermerge
V12 Support and Bug fixes.
2 parents cd6e6b7 + c63fc88 commit 5ec9fd2

File tree

7 files changed

+253
-284
lines changed

7 files changed

+253
-284
lines changed
 

‎.github/workflows/release.yml

+11-16
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,25 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v2
15+
# https://github.com/marketplace/actions/checkout
16+
# https://github.com/actions/checkout
17+
uses: actions/checkout@v4
1618
- name: Get version
1719
id: get_version
18-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/*/}
20+
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
1921
- name: Zip files
2022
run: |
2123
zip -r ${{ steps.get_version.outputs.VERSION }}.zip *.css module.json LICENSE scripts templates assets lang
22-
- name: Create Release
23-
id: create_release
24-
uses: actions/create-release@v1
24+
- name: Create and Upload Release
25+
# https://github.com/marketplace/actions/gh-release
26+
# https://github.com/softprops/action-gh-release
27+
uses: softprops/action-gh-release@v2
2528
env:
2629
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2730
with:
2831
tag_name: ${{ github.ref }}
29-
release_name: Release ${{ github.ref }}
32+
name: Release ${{ github.ref }}
3033
draft: false
3134
prerelease: false
32-
- name: Upload Release Asset
33-
id: upload-release-asset
34-
uses: actions/upload-release-asset@v1.0.2
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
with:
38-
upload_url: ${{ steps.create_release.outputs.upload_url }}
39-
asset_path: ./${{ steps.get_version.outputs.VERSION }}.zip
40-
asset_name: ${{ steps.get_version.outputs.VERSION }}.zip
41-
asset_content_type: application/zip
35+
files: ${{ steps.get_version.outputs.VERSION }}.zip
36+

‎CHANGELOG.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
1+
# v2.22.2
2+
- Fix exception on 'base'
3+
- Fix exception on promise when no hp formula
4+
- Fix localization of hover titles in configuration
5+
- Maybe fixed default overlay
6+
7+
# v2.22.1
8+
- Supporting v12 required removing v11 support.
9+
10+
# v2.22.0
11+
- Updated to support Foundry v12
12+
- NOTE: Due to V12 no longer supporing synchronous dice rolling HP are now set post token creation. That means you'll see the HP change displayed briefly (a small number with the delta will float over the token for a moment).
13+
- The code for the adjective table has been simplified. That might mean the table you previously select to choose adjectives from got reset.
14+
115
# v2.21.0
216
- Updated to support DnD5e 3.x and Foundry v11
317
- Dropped support for Foundry V9 and V10
418

519
# v2.20.3
620
- Corrected bug that prevented refresh tokens from functioning ( [[#181](https://github.com/Moerill/token-mold/issues/181)])
7-
21+
822
# V2.20.2
923
- Corrected bug where certain systems define types of Actors not meant to be instantiated, breaking DocumentClass reading ( [#176](https://github.com/Moerill/token-mold/issues/176) )
10-
24+
1125
# v2.20.1
1226
- Corrected bug with HP not rolling correctly ( [#173](https://github.com/Moerill/token-mold/issues/173)) )
1327

1428
# v2.20.0
1529
- Foundry v11 Compatibility Update ( [#167](https://github.com/Moerill/token-mold/issues/167))
1630
- Corrected bug that caused Token Mold to conflict with other modules due to overwriting certain data within the token ([#150](https://github.com/Moerill/token-mold/issues/150))
1731
- Corrected issue where bar attributes were being retrieved from the base Token Document, causing a problem if that document was overriden by the system ([#160](https://github.com/Moerill/token-mold/issues/160))
18-
32+
1933
# v2.15.4
2034
- Adjusted resolutions to #137 & #138
2135
- Corrected an issue where refreshing selected tokens was causing a circular reference error ( [#141](https://github.com/Moerill/token-mold/issues/141) ).
@@ -48,7 +62,7 @@
4862
- Merged Japanese localization, with thanks to BrotherSharper!
4963
- **Fix** Added support for Foundry v9
5064
- **Fix** Corrected a bug where Disposition was not properly getting saved ( Issue #60 )
51-
- **Fix** Corrected a bug where token scaling could be set to extremely tiny numbers in certain situations ( Issue #75 )
65+
- **Fix** Corrected a bug where token scaling could be set to extremely tiny numbers in certain situations ( Issue #75 )
5266

5367
# v2.13.1
5468

‎module.json

+8-17
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
{
22
"id": "token-mold",
3-
"name": "token-mold",
43
"title": "Token Mold",
54
"description": "<p>Gives the option to cast your tokens into a mold of your choosing.</p> <p>Possible options for your mold include:</p> <ul><li>Adding incrementing number suffixes.</li><li>Name generation for tokens.</li><li>Random adjective prefixes. (Examples: angry, calm, bloodthirsty, ...)</li><li>Rolling Hit Points by formula (dnd5e only)</li><li>Set token configuration on placement.</li><li>Providing an overlay to quickly check some stats on token hover.</li><li>Automatic creature size scaling (dnd5e only)</li></ul><hr>",
6-
"author": "Moerill",
75
"authors": [
86
{
97
"name": "Moerill"
108
},
119
{
1210
"name": "Geekswordsman",
1311
"discord": "@Geekswordsman#3085"
12+
},
13+
{
14+
"name": "BeardedGnome"
1415
}
1516
],
1617
"url": "https://github.com/Moerill/token-mold",
1718
"bugs": "https://github.com/Moerill/token-mold/issues",
18-
"flags": {},
19-
"version": "2.21.0",
20-
"minimumCoreVersion": "11",
21-
"compatibleCoreVersion": "11",
19+
"version": "2.22.2",
2220
"compatibility": {
23-
"minimum": "11",
24-
"verified": "11",
25-
"maximum": "11"
21+
"minimum": "12",
22+
"verified": "12",
23+
"maximum": "12"
2624
},
27-
"scripts": [],
2825
"esmodules": [
2926
"scripts/index.js"
3027
],
@@ -69,13 +66,7 @@
6966
"private": false
7067
}
7168
],
72-
"relationships": {
73-
"systems": [],
74-
"requires": []
75-
},
7669
"socket": false,
7770
"manifest": "https://raw.githubusercontent.com/Moerill/token-mold/master/module.json",
78-
"download": "https://github.com/Moerill/token-mold/releases/download/v2.21.0/v2.21.0.zip",
79-
"protected": false,
80-
"coreTranslation": false
71+
"download": "https://github.com/Moerill/token-mold/releases/download/v2.22.2/v2.22.2.zip"
8172
}

‎scripts/index.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import TokenMold from "./token-mold.js";
22

33
/*Enable Debug Module */
4+
// NOTE: Developer Mode doesn't work in Foundry v12
45
Hooks.once('devModeReady', ({ registerPackageDebugFlag }) => {
56
registerPackageDebugFlag(TokenMold.MODULEID);
67
});
78

8-
Hooks.on("init", () => {
9+
Hooks.once("init", () => {
910
game["token-mold"] = new TokenMold();
1011
});
11-
12-
// import Mold from './mold.js';
13-
// import MoldConfig from './settings.js';
14-
15-
// Hooks.on('setup', () => {
16-
// Mold.init();
17-
// MoldConfig.init();
18-
// });

‎scripts/overlay.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
export class TokenMoldOverlay extends BasePlaceableHUD {
2-
static FOUNDRY_VERSION = 0;
32

43
static get defaultOptions() {
5-
TokenMoldOverlay.FOUNDRY_VERSION = game.version ?? game.data.version;
6-
74
const options = super.defaultOptions;
85
options.classes = options.classes.concat(["token-mold-overlay"]);
96
options.template = "modules/token-mold/templates/overlay.html";
@@ -19,7 +16,7 @@ export class TokenMoldOverlay extends BasePlaceableHUD {
1916
const ret = {
2017
icon: e.icon,
2118
path: e.path,
22-
value: getProperty(this.object.actor, e.path),
19+
value: foundry.utils.getProperty(this.object.actor, e.path),
2320
};
2421
if (ret.value === "" || ret.value === null || ret.value === undefined)
2522
return null;

‎scripts/token-mold.js

+197-217
Large diffs are not rendered by default.

‎templates/token-mold.html

+16-17
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ <h2 style="margin:0;"></h2>
2727
</div>
2828
<p>{{ localize "tmold.name.numberStyle" }}</p>
2929
<div class="form-group">
30-
<input type='text' style='text-align:right' class='inp-small' value="{{data.name.number.prefix}}" title="{{ localize " tmold.name.prefix" }}" name="name.number.prefix" data-dtype="String">
30+
<input type='text' style='text-align:right' class='inp-small' value="{{data.name.number.prefix}}" title='{{ localize "tmold.name.prefix" }}' name="name.number.prefix" data-dtype="String">
3131
<select class='number-type' name="name.number.type" data-dtype="String">
3232
{{#select data.name.number.type}}
3333
{{#each numberStyles as |label key|}}
3434
<option value="{{key}}">{{label}}</option>
3535
{{/each}}
3636
{{/select}}
3737
</select>
38-
<input type='text' class='inp-small' value="{{data.name.number.suffix}}" title="{{ localize " tmold.name.suffix" }}" name="name.number.suffix" data-dtype="String">
38+
<input type='text' class='inp-small' value="{{data.name.number.suffix}}" title='{{ localize "tmold.name.suffix" }}' name="name.number.suffix" data-dtype="String">
3939
</div>
40-
<div class="form-group" title="{{ localize " tmold.name.increaseIndexHelp" }}">
40+
<div class="form-group" title='{{ localize "tmold.name.increaseIndexHelp" }}'>
4141
<label>{{ localize "tmold.name.increaseIndex" }}&nbsp;</label><input type="text" data-dtype="Number" name="name.number.range" value="{{#if data.name.number.range}}{{data.name.number.range}}{{else}}1{{/if}}" />
4242
</div>
4343
<div class="form-group">
@@ -84,7 +84,7 @@ <h2 style="margin:0;"></h2>
8484
<input type='checkbox' name='name.baseNameOverride' id='baseNameOverride' {{checked data.name.baseNameOverride}} data-dtype="Boolean"><label for='baseNameOverride'>{{ localize "tmold.name.baseNameOverride" }}</label>
8585
</div>
8686
<div class="form-group name-randomizer-options">
87-
<span title="{{ localize " tmold.name.replaceHelp" }}">
87+
<span title='{{ localize "tmold.name.replaceHelp" }}'>
8888
{{ localize "tmold.name.replaceInfo1" }}<br>{{ localize "tmold.name.replaceInfo2" }}<br><em>{{ localize "tmold.name.replaceInfo3" }}</em>
8989
</span>
9090

@@ -108,7 +108,7 @@ <h2 style="margin:0;"></h2>
108108
<h4 class='attribute'>{{ localize "tmold.name.attribute" }}</h4>
109109
<h4 class='value'>{{ localize "tmold.name.value" }}</h4>
110110
<h4 class='language'>{{ localize "tmold.name.language" }}</h4>
111-
<a class='reset' title="{{ localize " tmold.name.reset" }}"></a>
111+
<a class='reset' title='{{ localize "tmold.name.reset" }}'></a>
112112
</div>
113113
<div class="form-group language-selection language-group default-group">
114114
<span class='attribute default' value='default'>{{ localize "tmold.name.default" }}</span>
@@ -121,7 +121,7 @@ <h4 class='language'>{{ localize "tmold.name.language" }}</h4>
121121
{{/each}}
122122
{{/select}}
123123
</select>
124-
<a class='remove' title="{{ localize " tmold.name.delete" }}"></a>
124+
<a class='remove' title='{{ localize "tmold.name.delete" }}'></a>
125125
</div>
126126
{{#each data.name.options.attributes as |attrs idx|}}
127127
<div class="form-group attribute-selection attribute-group">
@@ -150,7 +150,7 @@ <h4 class='language'>{{ localize "tmold.name.language" }}</h4>
150150
{{/each}}
151151
{{/select}}
152152
</select>
153-
<a class='lang-remove' title="{{ localize " tmold.name.delete" }}"><i class="fas fa-times"></i></a>
153+
<a class='lang-remove' title='{{ localize "tmold.name.delete" }}'><i class="fas fa-times"></i></a>
154154
</div>
155155
{{/each}}
156156
<a class='add-language-value'><i class="fas fa-plus"></i>&nbsp;{{ localize "tmold.name.addValue" }}</a>
@@ -167,15 +167,15 @@ <h4 class='language'>{{ localize "tmold.name.language" }}</h4>
167167
</div>
168168
{{/if}}
169169
{{#if showCreatureSize}}
170-
<div class="form-group" title="{{ localize " tmold.system.setTokenSizeHelp" }}">
170+
<div class="form-group" title='{{ localize "tmold.system.setTokenSizeHelp" }}'>
171171
<input data-dtype="Boolean" type='checkbox' name='size.use' id='sizeUse' {{checked data.size.use}} /><label for='sizeUse'>{{ localize "tmold.system.setTokenSize" }}</label>
172172
</div>
173173
{{/if}}
174174
</div>
175175

176176
<div class="tab" data-tab="config" data-group='sections'>
177177
<div class="form-group">
178-
<label>{{ localize "TOKEN.ResourceDisplay" }}: </label>
178+
<label>{{ localize "TOKEN.ResourceDisplay" }}:</label>
179179
<div class="flexcol">
180180
<section>
181181
<input type='checkbox' name='config.displayBars.use' id='displayBarsUse' {{checked data.config.displayBars.use}}><label for='displayBarsUse'>{{ localize "tmold.default.overwrite" }}</label>
@@ -190,7 +190,7 @@ <h4 class='language'>{{ localize "tmold.name.language" }}</h4>
190190
</div>
191191
</div>
192192
<div class="form-group">
193-
<label>{{ localize "TOKEN.ResourceBar1A" }}: </label>
193+
<label>{{ localize "TOKEN.ResourceBar1A" }}:</label>
194194
<div class="flexcol">
195195
<section>
196196
<input type='checkbox' name='config.bar1.use' id='bar1Use' {{checked data.config.bar1.use}}><label for='bar1Use'>{{ localize "tmold.default.overwrite" }}</label>
@@ -210,7 +210,7 @@ <h4 class='language'>{{ localize "tmold.name.language" }}</h4>
210210
</div>
211211
</div>
212212
<div class="form-group">
213-
<label>{{ localize "TOKEN.ResourceBar2A" }}: </label>
213+
<label>{{ localize "TOKEN.ResourceBar2A" }}:</label>
214214
<div class="flexcol">
215215
<section>
216216
<input type='checkbox' name='config.bar2.use' id='bar2' {{checked data.config.bar2.use}}><label for='bar2Use'>{{ localize "tmold.default.overwrite" }}</label>
@@ -230,7 +230,7 @@ <h4 class='language'>{{ localize "tmold.name.language" }}</h4>
230230
</div>
231231
</div>
232232
<div class="form-group">
233-
<label>{{ localize "TOKEN.CharShowNameplate"}}: </label>
233+
<label>{{ localize "TOKEN.CharShowNameplate"}}:</label>
234234
<div class="flexcol">
235235
<section>
236236
<input type='checkbox' name='config.displayName.use' id='displayNameUse' {{checked data.config.displayName.use}}><label for='displayNameUse'>{{ localize "tmold.default.overwrite" }}</label>
@@ -245,8 +245,7 @@ <h4 class='language'>{{ localize "tmold.name.language" }}</h4>
245245
</div>
246246
</div>
247247
<div class="form-group">
248-
<label>
249-
{{ localize "TOKEN.Disposition"}}:</label>
248+
<label>{{ localize "TOKEN.Disposition"}}:</label>
250249
<div class="flexcol">
251250
<section>
252251
<input type='checkbox' name='config.disposition.use' id='dispositionUse' {{checked data.config.disposition.use}}><label for='dispositionUse'>{{ localize "tmold.default.overwrite" }}</label>
@@ -328,7 +327,7 @@ <h3>{{ localize "tmold.stat.attributeChooseDisplay" }}</h3>
328327
<div class="form-group attributes header">
329328
<h4 class='icon'>{{ localize "tmold.stat.attributeIcon" }}</h4>
330329
<h4 class='attribute'>{{ localize "tmold.stat.attribute" }}</h4>
331-
<a class='remove' title="{{ localize " tmold.stat.attributeDelete" }}"></a>
330+
<a class='remove' title='{{ localize "tmold.stat.attributeDelete" }}'></a>
332331
</div>
333332
{{#each data.overlay.attrs}}
334333
<div class="form-group attributes">
@@ -352,7 +351,7 @@ <h4 class='attribute'>{{ localize "tmold.stat.attribute" }}</h4>
352351
{{/each}}
353352
{{/select}}
354353
</select>
355-
<a class='remove' title="{{ localize " tmold.stat.attributeDelete" }}"><i class="fas fa-times"></i></a>
354+
<a class='remove' title='{{ localize "tmold.stat.attributeDelete" }}'><i class="fas fa-times"></i></a>
356355
</div>
357356
{{else}}
358357
<div class="form-group attributes">
@@ -372,7 +371,7 @@ <h4 class='attribute'>{{ localize "tmold.stat.attribute" }}</h4>
372371
</optgroup>
373372
{{/each}}
374373
</select>
375-
<a class='remove' title="{{ localize " tmold.stat.attributeDelete" }}"><i class="fas fa-times"></i></a>
374+
<a class='remove' title='{{ localize "tmold.stat.attributeDelete" }}'><i class="fas fa-times"></i></a>
376375
</div>
377376
{{/each}}
378377
<a class='add-attribute'><i class="fas fa-plus"></i>&nbsp;{{ localize "tmold.stat.attributeAdd" }}</a>

0 commit comments

Comments
 (0)
Please sign in to comment.