OPX//77
opx_infinityform

form

Last updated on

The modal that asks the player for typed text, a choice or a slider value, opened by other client modules through the form contract.

One modal box asking the player for values: up to eight fields of typed text, a choice list or a slider, answered together with Enter or cancelled with Escape. Other client modules open it through the form contract and get one callback with every answer. Lua holds the real text of each field and checks length, character set, pattern and required fields itself; the page only proposes keystrokes. Use it when a module needs the player to type an amount, a name or a code.

Sideclient
Requiresnone
Optionaldowned (no form opens over a downed player)
Contractform v1 — client
Configconfig/form.lua (shared)
Datanone

Keys: Up/Down move between fields, Left/Right change a choice or slider, typing edits a text field, Enter submits, Escape cancels. Escape reaches the form only when it is the top layer: a form over a menu closes and leaves the menu open.

Configuration

config/form.lua sets OPX.Config.MODULES.form. Shared.

KeyDefaultEffect
enabledtruefalse switches the module off.
ANCHOR'center'center, top-left, top-right, left or right.
WIDTH420Box width in pixels.
DIMtrueDim the scene behind an open form.
STATUS_MS6000Milliseconds the status line stays up.
WHILE_DOWN{ admin = true }Owners whose form may open, and stays open, while the player is down.

Refusal codes

CodeMeaning
spec_must_be_a_table, invalid_owner, callback_requiredBad spec basics.
no_surfaceThe interactive WebUI surface does not exist.
player_downThe player is down and the owner is not in WHILE_DOWN.
form_busyAnother owner's form is open.
invalid_form_id, invalid_description, invalid_statusSpec field malformed or too long.
invalid_form_data, form_data_too_largedata not a table, or over 64 nodes / 4 levels.
fields_must_be_a_table, empty_form, too_many_fields, duplicate_field_idThe field list is wrong.
field_must_be_a_table, invalid_field_id, invalid_field_label, invalid_field_descriptionA field is malformed.
invalid_options, empty_options, too_many_options, invalid_option, invalid_option_value, invalid_selectedA choice field is malformed.
invalid_slider, invalid_slider_range, invalid_slider_suffixA slider field is malformed.
invalid_max_length, invalid_placeholder, invalid_charset, unknown_charset, invalid_pattern, invalid_valueA text field is malformed, or its initial value breaks its own rules.
handle_required, no_form_open, stale_handleClose/SetStatus on nothing or on an old handle.

Player-facing locale keys: form.refuse.required, form.refuse.format, form.refuse.character, form.refuse.tooLong, and the key caps form.key.*.

On this page