CommandButton.DisplayConstraints.Builder


class CommandButton.DisplayConstraints.Builder


A builder for DisplayConstraints.

Summary

Public constructors

Creates the builder.

Public functions

CommandButton.DisplayConstraints!

Builds the display constraints.

CommandButton.DisplayConstraints.Builder!

Sets whether custom session commands are allowed for buttons in the given slot.

CommandButton.DisplayConstraints.Builder!

Sets the allowed Player.Commands for buttons in the given slot.

CommandButton.DisplayConstraints.Builder!

Sets the allowed non-custom SessionCommands for buttons in the given slot.

CommandButton.DisplayConstraints.Builder!

Sets the maximum number of buttons that can be displayed in a slot.

Public constructors

Builder

Builder()

Creates the builder.

Public functions

build

fun build(): CommandButton.DisplayConstraints!

Builds the display constraints.

setAllowCustomCommandsForSlot

@CanIgnoreReturnValue
fun setAllowCustomCommandsForSlot(
    @CommandButton.Slot slot: Int,
    allowCustomCommands: Boolean
): CommandButton.DisplayConstraints.Builder!

Sets whether custom session commands are allowed for buttons in the given slot.

The default value is true.

Parameters
@CommandButton.Slot slot: Int

The Slot.

allowCustomCommands: Boolean

Whether custom session commands are allowed for buttons in this slot.

setAllowedPlayerCommandsForSlot

@CanIgnoreReturnValue
fun setAllowedPlayerCommandsForSlot(
    @CommandButton.Slot slot: Int,
    allowedPlayerCommands: Player.Commands?
): CommandButton.DisplayConstraints.Builder!

Sets the allowed Player.Commands for buttons in the given slot.

The default value (null) does not restrict the allowed Player.Commands.

Parameters
@CommandButton.Slot slot: Int

The Slot.

allowedPlayerCommands: Player.Commands?

The allowed Player.Commands for buttons in this slot, or null to allow all Player.Commands .

setAllowedSessionCommandsForSlot

@CanIgnoreReturnValue
fun setAllowedSessionCommandsForSlot(
    @CommandButton.Slot slot: Int,
    allowedSessionCommands: SessionCommands?
): CommandButton.DisplayConstraints.Builder!

Sets the allowed non-custom SessionCommands for buttons in the given slot.

The default value (null) does not restrict the allowed SessionCommands.

This setting has no effect on whether custom session commands are allowed. Use setAllowCustomCommandsForSlot instead.

Parameters
@CommandButton.Slot slot: Int

The Slot.

allowedSessionCommands: SessionCommands?

The allowed SessionCommands for buttons in this slot, or null to allow all SessionCommands.

setMaxButtonsForSlot

@CanIgnoreReturnValue
fun setMaxButtonsForSlot(@CommandButton.Slot slot: Int, maxButtons: Int): CommandButton.DisplayConstraints.Builder!

Sets the maximum number of buttons that can be displayed in a slot.

The default values are:

Parameters
@CommandButton.Slot slot: Int

The Slot.

maxButtons: Int

The maximum number of buttons that can be displayed in this slot.