MATT Show Dialog - ironmonk88/monks-module-wiki GitHub Wiki

Show Dialog

When triggered, prompts the selected user with a dialog box; following their input, the tile will jump to the appropriate landing.

Dialog Type

Confirm

Displays dialog with yes/no boxes. This one can be customized to have additional buttons with custom HTML; once an option has been selected the yes button still needs to be pressed to confirm it.

The yes/no buttons can only be removed from this dialog type by using a custom HTML file (see MATT-Show-Dialog#custom-html below.

Alert

Displays a message box with a check-mark that needs to be pressed before the tile will continue down the action list.

Custom

Allows custom button layouts to be made without using custom HTML. This option does not include the confirmation, so users must choose their options carefully.

ID

A unique identifier for the dialog window; this is used with the Close Dialog action to remotely close the dialog window.

Title

Text that displays in the header of the confirmation window.

Closing Dialog Triggers No Go To (Confirm Dialog Type Only)

If checked, a player closing the window will jump the action thread to the landing specified in the On No Go To field.

Content

Text that appears in the body of the confirmation window.

The text field here accepts handlebar expressions, which can be used to customize the message based on existing data.

  • {{actor.name}} Sends the name of the actor of the current token to the dialog.
  • {{scene.name}} Sends the name of the scene to the dialog.
  • {{token.name}} Sends the name of the current token to the dialog.
  • {{user.name}} Sends the name of the current user to the dialog.
  • {{value.items.0.name}} If used following an Add Item action, it will send the item name to the dialog.
  • {{variable.valuename}} References a stored variable.

Custom HTML

This field accepts HTML that can be used to customize the dialog and display more choices. Just place the HTML in the content field.

  • The user being prompted with the dialog must select one of the choices and then click yes; the tile will then continue to the appropriate landing.
  • Several examples of some HTML will be provided below.
  • If using "row" or "column", replace them with "flexrow" or "flexcol" respectively. See Example 3.

The three examples below were all made to work with the Confirm type, and will not work with the other types without modification.

Example 01

Click here to view HTML

   <form>
  Choose your favorite dessert:
<input type="hidden" id="dialog-redirect" name="goto" />
  <button type="button" onclick="$('#dialog-redirect').val('Cake');">Cake</button>
  <button type="button" onclick="$('#dialog-redirect').val('Pie');">Pie</button>
</form>

Example 02

Click here to view HTML

   <form>
  Choose your favorite anchor:
<input type="radio" name="goto" value="anchor1" />
<label>Anchor1</label><br>
<input type="radio" name="goto" value="anchor2" />
<label>Anchor2</label><br>
<input type="radio" name="goto" value="anchor3" />
<label>Anchor3</label><br>
</form>

Example 03

Click here to view HTML

   <form>
  Choose your favorite dessert:
<input type="hidden" id="dialog-redirect" name="goto" />
        <div class="flexrow" style="background-color:#FFB695;">
  <button type="button" onclick="$('#dialog-redirect').val('Cake');">Cake</button>
  <button type="button" onclick="$('#dialog-redirect').val('Ice Cream');">Ice Cream</button>
        </div>
        <div class="flexrow" style="background-color:#96D1CD;">
  <button type="button" onclick="$('#dialog-redirect').val('Pie');">Pie</button>
 <button type="button" onclick="$('#dialog-redirect').val('Cookies');">Cookies</button>
	</div>
</form>

HTML File

Accepts an HTML file to further customize the dialog window.

The yes/no buttons can be removed from the Confirm type dialog by excluding them from your HTML file. Make sure its wrapped in a form tag, and use Javascript to submit that form. MATT will listen for a submit call to the form and use that instead of a button click.

Options (Custom Dialog Type Only)

Additional HTML options for the dialog window.

Width (Custom Dialog Type Only)

Use this to set the width of the dialog window in pixels.

Height (Custom Dialog Type Only)

Use this to set the height of the dialog window in pixels.

Buttons (Custom Dialog Type Only)

Click Add Button to create a new button for the dialog. Name is the text displayed on the dialog, while Landing is the name of a Landing within the tile to jump to when the button is clicked. The Landing field is optional, and can be used to create "Do Nothing" buttons.

The Name fields here also accept HTML.

For

Who gets to see the dialog when the action is run.

  • Everyone
  • Players Only
  • GM Only
  • Triggering Player
  • Triggering Token Owner
  • Current Tokens Owner
  • Current Users

Use this to directly target a user in the player list to have them see the dialog.

On Yes Go To (Confirm Dialog Type Only)

Put the name of a landing within the same tile here (leave this blank if you are using custom HTML).

On No Go To (Confirm Dialog Type Only)

Optionally, put the name of a landing within the same tile here.

Notes

  • This action continues to store its text information when swapped into another action, even if that action does not contain a text field. It's recommended just deleting this action instead if you need to replace it with something else to help keep data sizes down.
  • The input window doesn't resize. I suggest copying your custom HTML to another text editor, then copying it back in after editing.

Sample Tiles That Use This Action

Page Last Updated

  • Foundry 12.327
  • MATT 12.01
⚠️ **GitHub.com Fallback** ⚠️