Skip to content

Commit

Permalink
Added Hoverover image for some setting boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 17, 2024
1 parent dd8440b commit 8a004e6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/settingsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ function createSettingsRow(key, savedType, savedColor, isWorld) {
option
)} data-tooltip="${game.i18n.localize(
`${MODULE_ID}.module-settings.configuration-menu.hover.row.${backgroundType}.${option}`
)}">
)}${
checkboxHasHoverImage(option)
? `<img src="https://raw.githubusercontent.com/ChasarooniZ/PF2e-Reactive-Token-Ring/main/imgs/${tokenType}-${backgroundType}.webp">`
: ""
}">
</td>`
)
.join("");
Expand Down Expand Up @@ -200,7 +204,9 @@ export function displaySettingsMenu(isWorld) {
`${MODULE_ID}.module-settings.configuration-menu.notifications.saved`
)
);
canvas.tokens.placeables.forEach(tok => tok.ring?.configureVisuals())
canvas.tokens.placeables.forEach((tok) =>
tok.ring?.configureVisuals()
);
},
},
cancel: {
Expand Down Expand Up @@ -243,3 +249,7 @@ export function displaySettingsMenu(isWorld) {
$row.find('input[name="colorText"]').val(defaultColor);
});
}

function checkboxHasHoverImage(category) {
return ["dispostion", "health-percent", "level-diff"].contains(category);
}

0 comments on commit 8a004e6

Please sign in to comment.