Correction cuisiner
- icone de l'action différente de "manger" - correction tooltip dans fenêtre de jet - support d'images svg pour les item-actions - prise en compte de la difficulté de préparation brute
This commit is contained in:
@@ -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 `<img src="${action.img(item)}" />`
|
||||
}
|
||||
if (action?.icon) {
|
||||
return `<i class="${action.icon(item)}"></i>`
|
||||
}
|
||||
return action.label
|
||||
}
|
||||
|
||||
static async onActionItem(event, actor, options) {
|
||||
|
||||
Reference in New Issue
Block a user