mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Move resources select to scrolly text and accept actor object
This commit is contained in:
parent
a4a7b8e7ca
commit
007d1bc055
4 changed files with 18 additions and 17 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { adversaryResources, characterResources, companionResources } from '../config/actorConfig.mjs';
|
||||
import { diceTypes, getDiceSoNicePresets, getDiceSoNicePreset, range } from '../config/generalConfig.mjs';
|
||||
import Tagify from '@yaireo/tagify';
|
||||
|
||||
|
|
@ -378,8 +379,21 @@ export const arraysEqual = (a, b) =>
|
|||
|
||||
export const setsEqual = (a, b) => a.size === b.size && [...a].every(value => b.has(value));
|
||||
|
||||
export function getScrollTextData(resources, resource, key, actorType) {
|
||||
const { reverse, label } = CONFIG.DH.ACTOR.getScrollingTextResources(actorType)[key];
|
||||
export function getScrollTextData(actor, resource, key) {
|
||||
const actorType = actor.type;
|
||||
const resources = actor.system.resources;
|
||||
const { reverse, label } = {
|
||||
armor: {
|
||||
label: 'DAGGERHEART.GENERAL.armor',
|
||||
reverse: true
|
||||
},
|
||||
...(actorType === 'character'
|
||||
? characterResources
|
||||
: actorType === 'adversary'
|
||||
? adversaryResources
|
||||
: companionResources)
|
||||
}[key];
|
||||
|
||||
const { BOTTOM, TOP } = CONST.TEXT_ANCHOR_POINTS;
|
||||
const increased = resources[key].value < resource.value;
|
||||
const value = -1 * (resources[key].value - resource.value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue