Record Class DialogOption
java.lang.Object
java.lang.Record
com.botwithus.bot.api.dialog.DialogOption
- Record Components:
index- 1-based option number as shown in-game (the"N."cell, or the row's position when no number cell is present)text- the visible option label, color tags intactrow- the option-row component the selection targets
One selectable line of the multi-choice dialog (interface
DIALOG_OPTIONS).
The label is read from a TEXT leaf deep in the
row's subtree, but row() is the LAYER container the game
keys the selection on — the component the server expects. Selecting an option
targets row() via the DIALOGUE action, never the text leaf.
See Dialog for how the correlation is derived.
-
Constructor Summary
ConstructorsConstructorDescriptionDialogOption(int index, String text, ComponentNode row) Creates an instance of aDialogOptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintThe component id the server expects for this option (the row, not the label).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.intThe interface the row lives on.row()Returns the value of therowrecord component.voidselect()Queue the selection of this option.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
componentId
public int componentId()The component id the server expects for this option (the row, not the label). -
interfaceId
public int interfaceId()The interface the row lives on. -
select
public void select()Queue the selection of this option. Targetsrow()via theDIALOGUEaction (type 30) — seeComponentNode.selectDialogOption()for why a plain component click doesn't advance the dialogue. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
index
-
text
-
row
-