Pathfinder 1e for Foundry VTT
    Preparing search index...

    Class DamageResistanceSelector

    Extend the FormApplication to handle creating, removing, and editing and Actor's Damage Reduction and Energy Resistances.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    damages: {}

    A list of key-value pairs for dropdown damage types

    dragDropHighlightTimeout: null
    entries: any
    isDR: boolean

    Basic properties for handling operations

    originalEntries: { [key: string]: any }[]

    Original copy of the trait's entries

    DEFAULT_OPTIONS: {
        actions: { deleteTag: (event: Event) => void };
        classes: string[];
        window: { icon: string };
    } = ...
    PARTS: { form: { template: string } } = ...

    Configure a registry of template parts which are supported for this application for partial rendering.

    {}

    Accessors

    • get actor(): ActorPF

      Alias the document property to actor

      Returns ActorPF

    • get attribute(): string

      Alias the name property

      Returns string

    • get dataCount(): number

      Get the data entry length

      Returns number

    • get dragDropType(): string

      Return the dragdrop element type for this application

      Returns string

    • get dtypes(): never[]

      Get the list of data types

      Returns never[]

    • get fields(): string[]

      Get the list of fields

      Returns string[]

    • get title(): string

      Configure the title of the window to include the Actor name

      Returns string

    Methods

    • Protected

      Provides default data for a new list entry

      Parameters

      • event: any

      Returns object

    • Protected

      Provides update data for saves

      Returns object

    • Initialize the configuration for this application. Override the default ID to be unique to this entry selector instance based on document and attribute that is being edited.

      Parameters

      • options: ApplicationConfiguration

        The provided configuration options for the Application

      Returns ApplicationConfiguration

      The final configuration values for the application

    • Internal

      The event handler for active keystrokes on the input field.

      Parameters

      • event: InputEvent

        The originating keydown event

      Returns void

    • Protected

      Update internal data snapshot on form change

      Parameters

      • ...this: any
      • formConfig: any
      • event: any

      Returns Promise<void>

    • Parameters

      • options: any

      Returns void

    • Internal

      The event handler for custom data.

      Parameters

      • event: Event

        The originating input event

      Returns void

    • Protected

      Highlight position that the element will be inserted to on drop

      Parameters

      • event: DragEvent

        The originating DragEvent

      Returns void

    • Protected

      Prepare drag-drop data and highlight dragged element

      Parameters

      • event: DragEvent

        The originating DragEvent

      Returns void

    • Protected

      Inject dragged element into its new position

      Parameters

      • event: DragEvent

        The originating DragEvent

      Returns Promise<void>

    • Protected

      Attach event listeners to the rendered application form.

      Parameters

      • context: ApplicationRenderContext

        Prepared context data

      • options: RenderOptions

        Provided render options

      Returns void

    • A triggered operation when any inputs or dropdowns are interacted with to save the data from UI

      Parameters

      • event: Event

      Returns Promise<void>

    • Parameters

      • options: any

      Returns Promise<void>

    • Protected Internal

      Parameters

      • partId: any
      • context: any
      • options: any

      Returns Promise<
          | {
              buttons?: undefined;
              cssClass: string;
              document: any;
              dtypes: string[];
              editable: boolean;
              entries: any;
              fields: string[];
              id: any;
          }
          | {
              buttons?: undefined;
              cssClass?: undefined;
              document?: undefined;
              dtypes?: undefined;
              editable?: undefined;
              entries?: undefined;
              fields?: undefined;
              id?: undefined;
          }
          | {
              buttons: { icon: string; label: string; type: string }[];
              cssClass?: undefined;
              document?: undefined;
              dtypes?: undefined;
              editable?: undefined;
              entries?: undefined;
              fields?: undefined;
              id?: undefined;
          },
      >

    • Parameters

      • partId: any
      • newElement: any
      • priorElement: any
      • state: any

      Returns void

    • Processes the input for damage resistance types.

      Parameters

      • event: Event

      Returns void

    • Parameters

      • partId: any
      • newElement: any
      • priorElement: any
      • state: any

      Returns void

    • Internal

      The event handler for deleting a resistance tag.

      Parameters

      • event: Event

        The originating click event

      Returns void

    • Internal

      Add a new entry to the list

      Parameters

      • ...this: any
      • event: any

      Returns Promise<void>

    • Internal

      Save the new data back to the document.

      Parameters

      • ...this: any
      • event: SubmitEvent

        The originating form submission event

      • form: HTMLFormElement

        The form element that was submitted

      • formData: FormDataExtended

        Processed data for the submitted form

        • object

          The object of the form

      Returns Promise<void>

    • Internal

      Delete an existing entry from the list

      Parameters

      • ...this: any
      • event: any

      Returns Promise<void>