diff --git a/changelog.md b/changelog.md index e65f0b86..8dc63218 100644 --- a/changelog.md +++ b/changelog.md @@ -8,7 +8,9 @@ - correction des boutons pour lancer les maladresses - utilisation des tables de compendium - correction des droits pour mise à jour du message - +- correction de la cuisine + - reprise de l'image de cuisine dans l'équipement + - prise en compte de la difficulté pour préparer la nourriture brute ## 13.0.23 - Le marché d'Illysis diff --git a/css/foundryvtt-reve-de-dragon.css b/css/foundryvtt-reve-de-dragon.css index 9297772e..6b995961 100644 --- a/css/foundryvtt-reve-de-dragon.css +++ b/css/foundryvtt-reve-de-dragon.css @@ -1528,6 +1528,7 @@ body { } .system-foundryvtt-reve-de-dragon .item-actions-controls img, .system-foundryvtt-reve-de-dragon .item-controls img { + vertical-align: text-bottom; display: inline; max-width: 1rem; max-height: 1rem; @@ -1540,10 +1541,17 @@ body { font-size: 0.8em; color: var(--color-controls-light); } -.system-foundryvtt-reve-de-dragon .item-actions-controls img:hover, -.system-foundryvtt-reve-de-dragon .item-controls img:hover, -.system-foundryvtt-reve-de-dragon .item-actions-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover, -.system-foundryvtt-reve-de-dragon .item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover { +.system-foundryvtt-reve-de-dragon .item-actions-controls a:hover, +.system-foundryvtt-reve-de-dragon .item-controls a:hover { + text-shadow: 1px 0px 0px #ff6600; +} +.system-foundryvtt-reve-de-dragon .item-actions-controls a img:hover, +.system-foundryvtt-reve-de-dragon .item-controls a img:hover { + opacity: 0.6; + filter: drop-shadow(1px 1px 1px #009966) invert(0.8); +} +.system-foundryvtt-reve-de-dragon .item-actions-controls a i:is(.fas, .far, .fa-solid, .fa-regular):hover, +.system-foundryvtt-reve-de-dragon .item-controls a i:is(.fas, .far, .fa-solid, .fa-regular):hover { opacity: 0.6; } .system-foundryvtt-reve-de-dragon .rdd-roll-dialog .description-sort { diff --git a/less/foundryvtt-reve-de-dragon.less b/less/foundryvtt-reve-de-dragon.less index 1aff0122..8c26f300 100644 --- a/less/foundryvtt-reve-de-dragon.less +++ b/less/foundryvtt-reve-de-dragon.less @@ -852,6 +852,7 @@ // } img { + vertical-align: text-bottom; display: inline; max-width: 1rem; max-height: 1rem; @@ -865,8 +866,16 @@ color: var(--color-controls-light); } - img:hover, - i:is(.fas, .far, .fa-solid, .fa-regular):hover { + a:hover { + text-shadow: 1px 0px 0px #ff6600; + } + + a img:hover{ + opacity: 0.6; + filter: drop-shadow(1px 1px 1px #009966) invert(0.8); + } + + a i:is(.fas, .far, .fa-solid, .fa-regular):hover { opacity: 0.6; } } diff --git a/module/item/item-actions.js b/module/item/item-actions.js index 1ccf2cad..fe4f96af 100644 --- a/module/item/item-actions.js +++ b/module/item/item-actions.js @@ -48,7 +48,9 @@ const _EQUIPER = { } const _CUISINER = { - code: 'item-cuisiner', label: 'Cuisiner', icon: it => 'fa-solid fa-utensils', + code: 'item-cuisiner', label: 'Cuisiner', + img: it => 'systems/foundryvtt-reve-de-dragon/assets/actions/cuisine.svg', + // icon: it => 'fa-solid fa-spoon', filter: it => it.getUtilisation() == 'cuisine' && it.system.sust > 0, action: (item, actor) => actor.preparerNourriture(item) } @@ -94,7 +96,7 @@ const _SORT_RESERVE = { } export const COMMON_ACTIONS = [_EQUIPER] -export const DEFAULT_ACTIONS = [_ACHETER, _SPACEHOLDER, _SPLIT, _VENDRE, _MONTRER, _EDIT, _DELETE] +export const DEFAULT_ACTIONS = [_ACHETER, _SPLIT, _SPACEHOLDER, _VENDRE, _MONTRER, _EDIT, _DELETE] export const ITEM_ACTIONS = { faune: [_CUISINER, _MANGER_CRU], @@ -119,11 +121,18 @@ export class ItemAction { && (!action.optionsFilter || action.optionsFilter(options)) } - static icon(action, item) { - if (action && action.icon) { - return action.icon(item) + + static img(action, item) { + if (action.placeholder){ + return "" } - return undefined + if (action?.img) { + return `` + } + if (action?.icon) { + return `` + } + return action.label } static async onActionItem(event, actor, options) { diff --git a/module/rdd-utility.js b/module/rdd-utility.js index ad8b56e9..6f818763 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -348,7 +348,7 @@ export class RdDUtility { // Items Handlebars.registerHelper('rarete-getChamp', (rarete, field) => RdDRaretes.getChamp(rarete, field)); Handlebars.registerHelper('item-action-applies', (action, item, options) => ItemAction.applies(action, item, options)) - Handlebars.registerHelper('item-action-icon', (action, item) => ItemAction.icon(action, item)) + Handlebars.registerHelper('item-action-img', (action, item) => new Handlebars.SafeString(ItemAction.img(action, item))) Handlebars.registerHelper('item-name', (item) => item.nameDisplay) // TMRs diff --git a/module/roll/roll-part-cuisine.mjs b/module/roll/roll-part-cuisine.mjs index 17e33c63..25042266 100644 --- a/module/roll/roll-part-cuisine.mjs +++ b/module/roll/roll-part-cuisine.mjs @@ -150,12 +150,13 @@ export class RollPartCuisine extends RollPartSelect { this.$selectPreparation(rollDialog.rollData, selectOptions[index]?.value) rollDialog.render() }) - + checkboxFabriquer?.addEventListener("change", e => { current.fabriquer = e.currentTarget.checked }) inputDiff?.addEventListener("change", e => { current.value = parseInt(e.currentTarget.value) + rollDialog.render() }) inputProportions?.addEventListener("change", e => { current.proportions = parseInt(e.currentTarget.value) diff --git a/module/roll/roll-type-cuisine.mjs b/module/roll/roll-type-cuisine.mjs index 021efb7a..e6c60f03 100644 --- a/module/roll/roll-type-cuisine.mjs +++ b/module/roll/roll-type-cuisine.mjs @@ -7,7 +7,7 @@ import { RollType } from "./roll-type.mjs" export class RollTypeCuisine extends RollType { get code() { return ROLL_TYPE_CUISINE } - get name() { return `Interpréter une oeuvre` } + get name() { return `Cuisiner un plat` } visible(rollData) { return rollData.active.actor.isPersonnage() } title(rollData) { diff --git a/templates/actor/item-action-controls.hbs b/templates/actor/item-action-controls.hbs index 5027b35c..8ef4ef05 100644 --- a/templates/actor/item-action-controls.hbs +++ b/templates/actor/item-action-controls.hbs @@ -1,15 +1,9 @@ {{#each item.actions as |action|}} - {{#if action.placeholder}} -   - {{/if}} - {{#if (item-action-applies action ../item ../options)}} + {{#if action.placeholder}}  + {{else if (item-action-applies action ../item ../options)}} - {{#if (item-action-icon action ../item)}} - - {{else}} - {{action.label}} - {{/if}} + {{item-action-img action ../item}} {{/if}} {{/each}}