Migrating UI for new data structures

This commit is contained in:
Stefan Zermatten
2021-10-15 11:12:40 +02:00
parent f3c52999e8
commit ea68cdf86f
35 changed files with 511 additions and 271 deletions

View File

@@ -3,9 +3,9 @@ import walkDown from '/imports/api/engine/computation/utility/walkdown.js';
export default function computeInactiveStatus(node){
const prop = node.node;
if (isActive(prop)) return;
// Unequipped items disable their children, but are not disabled themselves
// All notes do the same
if (prop.type !== 'item' && prop.type !== 'note' ){
// Unequipped items, notes, and actions disable their children,
// but are not disabled themselves
if (prop.type !== 'item' && prop.type !== 'note' && prop.type !== 'action' ){
prop.inactive = true;
prop.deactivatedBySelf = true;
}
@@ -23,6 +23,7 @@ function isActive(prop){
case 'item': return !!prop.equipped;
case 'spell': return !!prop.prepared || !!prop.alwaysPrepared;
case 'note': return false;
case 'action': return false;
default: return true;
}
}