11import { SubDocumentDataModel } from '../sub/sub-document-data-model.mjs' ;
2- import { CombatEventRuleTrigger } from './triggers/combat-event-rule-trigger.mjs' ;
32import FoundryUtils from '../../helpers/foundry-utils.mjs' ;
43import { SubDocumentCollectionField } from '../sub/sub-document-collection-field.mjs' ;
54import { DataModelRegistry } from '../../fields/data-model-registry.mjs' ;
@@ -9,6 +8,7 @@ import { RuleTriggerRegistry } from './triggers/rule-trigger-data-model.mjs';
98import { RulePredicateDataModel , RulePredicateRegistry } from './predicates/rule-predicate-data-model.mjs' ;
109import { FU } from '../../helpers/config.mjs' ;
1110import { StringUtils } from '../../helpers/string-utils.mjs' ;
11+ import { EmptyRuleTrigger } from './triggers/empty-rule-trigger.mjs' ;
1212
1313const fields = foundry . data . fields ;
1414
@@ -46,8 +46,7 @@ export class RuleElementDataModel extends SubDocumentDataModel {
4646 static defineSchema ( ) {
4747 return Object . assign ( super . defineSchema ( ) , {
4848 trigger : new fields . TypedSchemaField ( RuleTriggerRegistry . instance . types , {
49- initial : new CombatEventRuleTrigger ( ) ,
50- nullable : true ,
49+ initial : new EmptyRuleTrigger ( ) ,
5150 } ) ,
5251 actions : new SubDocumentCollectionField ( RuleActionDataModel ) ,
5352 predicates : new SubDocumentCollectionField ( RulePredicateDataModel ) ,
@@ -74,7 +73,12 @@ export class RuleElementDataModel extends SubDocumentDataModel {
7473 async addRuleAction ( ) {
7574 let subTypes = this . getMatchingSubTypes ( RuleActionRegistry . instance ) ;
7675 const options = FoundryUtils . generateConfigOptions ( subTypes ) ;
77- const type = await FoundryUtils . selectOptionDialog ( 'FU.RuleElementNew' , options ) ;
76+ const type = await FoundryUtils . selectOptionDialog (
77+ StringUtils . localize ( 'FU.AddElement' , {
78+ element : StringUtils . localize ( 'FU.RuleActions' ) ,
79+ } ) ,
80+ options ,
81+ ) ;
7882 if ( type ) {
7983 await SubDocumentCollectionField . addModel ( this . actions , type , this ) ;
8084 }
@@ -113,7 +117,12 @@ export class RuleElementDataModel extends SubDocumentDataModel {
113117 async addRulePredicate ( ) {
114118 let subTypes = this . getMatchingSubTypes ( RulePredicateRegistry . instance ) ;
115119 const options = FoundryUtils . generateConfigOptions ( subTypes ) ;
116- const type = await FoundryUtils . selectOptionDialog ( 'FU.Add' , options ) ;
120+ const type = await FoundryUtils . selectOptionDialog (
121+ StringUtils . localize ( 'FU.AddElement' , {
122+ element : StringUtils . localize ( 'FU.RulePredicates' ) ,
123+ } ) ,
124+ options ,
125+ ) ;
117126 if ( type ) {
118127 await SubDocumentCollectionField . addModel ( this . predicates , type , this ) ;
119128 }
0 commit comments