Skip to content

Commit c0d78a2

Browse files
committed
Version bump
- fixed errors thrown when toggling TVA hud button - tva hud menu will now perform portrait search when a MassEdit scenescape is detected
1 parent a8f49e8 commit c0d78a2

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 6.0.4
2+
3+
- Fixed errors thrown when toggling HUD art select
4+
- Switch Token HUD name search to `Portrait` category while on a `Mass Edit` scenescape
5+
16
# 6.0.3
27

38
**Mappings**

token-variants/applications/tokenHUD.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,13 @@ export async function renderPalette(token, searchText = '', fp_files = null) {
250250
}
251251

252252
if (search) {
253+
let searchType = SEARCH_TYPE.TOKEN;
254+
if (!foundry.utils.isEmpty(canvas.scene?.getFlag('multi-token-edit', 'scenescape'))) {
255+
searchType = SEARCH_TYPE.PORTRAIT;
256+
}
257+
253258
let artSearch = await doImageSearch(search, {
254-
searchType: SEARCH_TYPE.TOKEN,
259+
searchType,
255260
searchOptions: { keywordSearch: worldHudSettings.includeKeywords },
256261
});
257262

token-variants/module.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"id": "token-variants",
33
"title": "Token Variant Art",
44
"description": "Searches a customizable list of directories and displays art variants for tokens/actors through pop-ups and a new Token HUD button. Variants can be individually shared with players allowing them to switch out their token art on the fly.",
5-
"version": "6.0.3",
5+
"version": "6.0.4",
66
"compatibility": {
77
"minimum": 13,
88
"verified": 13
99
},
10-
"download": "https://github.com/Aedif/TokenVariants/releases/download/6.0.3/token-variants.zip",
10+
"download": "https://github.com/Aedif/TokenVariants/releases/download/6.0.4/token-variants.zip",
1111
"url": "https://github.com/Aedif/TokenVariants",
1212
"manifest": "https://raw.githubusercontent.com/Aedif/TokenVariants/master/token-variants/module.json",
1313
"authors": [

token-variants/scripts/wrappers/hudWrappers.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,24 @@ function _initializeApplicationOptions(wrapped, options) {
4848
}
4949

5050
async function tvaButtonClick(event) {
51-
const palette = this.element.querySelector(`.palette[data-palette="tva"]`);
51+
const button = event.target.closest('.control-icon');
52+
let palette = this.element.querySelector(`.palette[data-palette="tva"]`);
5253

5354
const FULL_ACCESS = TVA_CONFIG.permissions.hudFullAccess[game.user.role];
5455

5556
if (FULL_ACCESS && event.button === 2) {
5657
if (!palette || !palette.classList.contains('contextmenu')) {
5758
palette?.remove();
58-
this.element.querySelector('.col.right').appendChild((await renderContextMenuPalette(this.document))[0]);
59+
palette = (await renderContextMenuPalette(this.document))[0];
60+
this.element.querySelector('.col.right').appendChild(palette);
5961
}
6062
} else if (!palette || palette.classList.contains('contextmenu')) {
6163
palette?.remove();
62-
this.element.querySelector('.col.right').appendChild((await renderPalette(this.document))[0]);
64+
palette = (await renderPalette(this.document))[0];
65+
this.element.querySelector('.col.right').appendChild(palette);
6366
}
6467

65-
this.togglePalette('tva');
68+
const active = !button.classList.contains('active');
69+
button.classList.toggle('active', active);
70+
if (palette) palette.classList.toggle('active', active);
6671
}

0 commit comments

Comments
 (0)