Body, Mind & Soul — API Reference
    Preparing search index...

    Function buildConditionConfigFromForm

    • Build the config object to persist from a condition config dialog's form data.

      This is the single serializer shared by every condition save path (top-level, sub-condition, swing, keyword, event and stage). Multi-field types return the object they edit; single-value types return { value }, the same shape TriggerConditionModel.migrateData produces for legacy strings.

      Config: type selects the field layout; formData keys used by type:

      • compelCheck: opt_attr_*, opt_label_*, opt_formula_*, opt_keywords_*, opt_advantage_*, globalKeywords, advantage, allowTake10, hideDCs.
      • valueMatches: lhs, op, rhs.
      • attribute + op + formula: rollCheck, { attribute, op, formula }.
      • currencyBalance: op, val, optional currencyId.
      • op + val (+ optional vital): numeric threshold, { op, val, vital? }.
      • val + op + count: scryCardOfValue, { val, op, count }.
      • attribute + dc: { attribute, dc }.
      • subject / marked: isMarkedByOwner, { value: "<subject> <marked>" } (empty parts dropped).
      • anything else: { value: formData.value }.

      Parameters

      • type: string

        Condition type key (e.g. "valueMatches", "rollCheck").

      • formData: object

        Submitted dialog data (Dialog.input result).

      Returns object

      The config object to store under condition.config.

      buildConditionConfigFromForm("valueMatches", { lhs: "priorTriggerResults.0.wasNegated", op: "=", rhs: "1" });
      // => { lhs: "priorTriggerResults.0.wasNegated", op: "=", rhs: "1" }