Class Dialog
DIALOG_OPTIONS, 1188 — "select an option") and advances a
text-only NPC-chat page (interface DIALOG_NPC, 1184).
The text→component correlation
The dialog is laid out as a fixed set of option rows (LAYER
components) hanging directly off the options container (component
OPTIONS_CONTAINER). The visible text is not on the row: each
row's subtree carries two TEXT leaves — the option label
("What's wrong?") and a number cell ("1."). The number cell yields the
1-based option index directly, so the row→index mapping is read from the
game rather than assumed.
Crucially, selection targets the row (component 8/13/18/23/28…) via
the DIALOGUE action (type 30, the engine's resume / pausebutton path)
— not the text leaf that carries the label, and not a COMPONENT click
(which dispatches but the server ignores, leaving the dialogue stuck). This
class walks label→row so callers select by text or index and the right
component is driven the right way. Verified live against interface 1188: label
"What's wrong?" lives on component 6, three levels under row component 8, and
a DIALOGUE action on row 8 advances the dialogue.
if (Dialog.isOpen(api)) {
Dialog.select(api, "What's wrong?"); // clicks row component 8
}
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe multi-choice dialog interface ("select an option").static final intThe text-only NPC-chat dialog interface (no options, just a continue button). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontinueChat(GameAPI api) Advances a text-only NPC-chat page (interface 1184) by driving its continue / next button (component 15) with theDIALOGUEaction.static booleanisChatOpen(GameAPI api) True when the text-only NPC-chat dialog (1184) is open.static booleanTrue when the multi-choice dialog is open with at least one selectable option.static List<DialogOption> The selectable options currently shown, in display order.static booleanSelects the option with the given 1-based index (as shown by its "N." cell).static booleanSelects the first option whose label containstext(case-insensitive, markup-stripped, whitespace-normalized).
-
Field Details
-
MULTI_CHOICE_INTERFACE
public static final int MULTI_CHOICE_INTERFACEThe multi-choice dialog interface ("select an option").- See Also:
-
NPC_CHAT_INTERFACE
public static final int NPC_CHAT_INTERFACEThe text-only NPC-chat dialog interface (no options, just a continue button).- See Also:
-
-
Method Details
-
isOpen
True when the multi-choice dialog is open with at least one selectable option. -
options
The selectable options currently shown, in display order. Empty when the multi-choice dialog isn't open. Oneget_interface_treeround-trip; the row/label/number walk is then in-memory. -
select
-
select
Selects the option with the given 1-based index (as shown by its "N." cell). Clicks the option row.- Returns:
truewhen an option with that index was found and clicked
-
isChatOpen
True when the text-only NPC-chat dialog (1184) is open. 1184 fully unloads when the page closes, so its root component resolving is an exact gate. (Note: walking its tree from the root misses the content — the NPC line is a flat sibling under a different parent, not a descendant of component 0.) -
continueChat
Advances a text-only NPC-chat page (interface 1184) by driving its continue / next button (component 15) with theDIALOGUEaction.A manual click on that button emits exactly this action — verified via the agent's DoAction hook:
action=30 p1=0 p2=-1 p3=(1184<<16)|15. Spacebar is the keyboard equivalent, routed through the button's type-10 key trigger. ACOMPONENTclick would dispatch but not advance.- Returns:
truewhen the NPC-chat dialog was open and a continue was queued;falsewhen it isn't open
-