Hierarchy

  • FormApplication
    • CurrencyTransfer

Constructors

  • Parameters

    • source: { actor: null; alt: boolean; amount: {}; container: null } = ...
    • dest: { actor: null; alt: boolean; amount: {}; container: null } = ...
    • options: {} = {}

    Returns CurrencyTransfer

Properties

dest: undefined | { actor: null; alt: boolean; amount: {}; container: null }
source: undefined | { actor: null; alt: boolean; amount: {}; container: null }

Accessors

  • get title(): string
  • An Application window should define its own title definition logic which may be dynamic depending on its data

    Returns string

  • get defaultOptions(): InsertKeys<
        {},
        OmitByValue<
            { classes: string[]; height: number; template: string; width: number },
            never,
        >,
    >
  • Assign the default options which are supported by the entity edit sheet.

    Returns InsertKeys<
        {},
        OmitByValue<
            { classes: string[]; height: number; template: string; width: number },
            never,
        >,
    >

    The default options for this FormApplication class

    Application.defaultOptions

    foundry.utils.mergeObject(super.defaultOptions, {
    classes: ["form"],
    closeOnSubmit: true,
    editable: true,
    sheetConfig: false,
    submitOnChange: false,
    submitOnClose: false
    });

Methods

  • This method is called upon form submission after form data is validated

    Parameters

    • event: any

      The initial triggering submission event

    • formData: any

      The object of validated form data with which to update the object

    Returns void

    A Promise which resolves once the update operation has completed

  • Parameters

    • _options: {} = {}

    Returns {
        dest:
            | undefined
            | { actor: null; alt: boolean; amount: {}; container: null };
        options: FormApplicationOptions;
        source:
            | undefined
            | { actor: null; alt: boolean; amount: {}; container: null };
        title: string;
        total: any;
    }

  • Convert totalAmount to a currency object containing

    Parameters

    • limit: object

      currency object containing max number of coins. Falsey values will assume infinity

    • totalAmount: number | object

      currency as gold pieces. If provided as a currency object, will convert to gold

    Returns boolean | object

    false if failed, currency object containing new amounts on conversion success

  • Transfer an amount of currency to a valid document

    Parameters

    • sourceDoc: Document

      ActorPF or ItemPF with currency

    • destDoc: Document

      ActorPF or ItemPF with currency

    • amount: number | object

      currency object containing transferred amount. Undefined keys will be assumed to be zero. Providing just a number will assume just gold

    • sourceAlt: boolean = false

      Use alt currency on source

    • destAlt: boolean = false

      Use alt currency on destination

    • OptionalallowConversion: number = false

      Attempts to make change with sourceDoc's currency limit

    Returns boolean | object

    false if failed, object containing amount transferred on success