Styles & Dialogs

1file
1min read
Sheet 18 of 47 · Scenarios

Filesscenarios/arena-styles.yml

Filescenarios/arena-styles.ymlA menu can have the right words in the wrong colour, or a name that lost its bold. Style checks look at colours, bold, italic and glint on titles, item names and lore. Dialogs get their own pair of steps: one checks what the dialog shows, the other fills it in and presses a button.

scenarios/arena-styles.yml
- do: expectTitle
  title: "ᴀʀᴇɴᴀ"            # regex on the title text
  color: "#ff3b3b"
- do: expectSlot
  slot: 12
  material: player_head
  count: 1
  glint: false
  nameRuns: {text: "Max Players", color: "#7ee081", bold: true, italic: false}
  lore: {line: 1, text: "4 players", color: white}
- do: expectDialog
  title: {text: "Rename arena", color: gold}
  type: multi_action
  inputs: {name: text}       # or a list of keys
  buttons: [Save, Cancel]    # label regexes that must exist
- do: answerDialog
  button: Save
  inputs: {name: Nacht}
  expectWindow: "Arena"      # optional

How a style check matches

  • A style check picks the part of the text its text regex matches.
  • color passes when any run in that part has the color, so a gradient passes with any of its colors.
  • bold, italic, underlined and strikethrough must hold for every visible run there. A flag the item does not set counts as false.
  • Colors can be names (gold) or hex, in any case.

Text is matched as written and with small caps read as plain letters, so title: zombies finds a menu called ᴢᴏᴍʙɪᴇꜱ │ ᴀʀᴇɴᴀꜱ.

Slots

ParameterChecks
slotWhich slot
materialThe item type
countThe stack size
glintThe enchantment glint, true or false
nameRunsThe style of the part of the name that text matches
loreA plain regex, or a map that checks one line (1-based) or any line
item, customStill work as before

The first slot that passes wins, and a failure says which check failed on which slot. With absent: true the step passes once no slot of the open window matches.

Dialogs

StepParameters
expectDialogtitle (text or a style map), type, inputs (a map like {name: text}, or a list of keys), buttons (label regexes that must exist)
answerDialogbutton, inputs (by key, like {name: Nacht}), expectWindow (optional)

Every other step is on the Step Reference.

Loading the index

Enter openUp Down moveEsc close