The character creation screen (fl_char_create), a fullscreen frame that takes the player through a list of stages and then asks the server to create the character. A stage is the ID of a theme panel, added with add_stage from the AddCharacterCreationMenuStages hook. A stage panel may define on_open(parent), on_close(parent) and on_validate(); it hands over what the player has entered with collect_data, and the collected char_data is what is sent to the server, together with the extra_data table that whoever opened the screen may set on it.

Summary

Methods

Adds a stage to character creation.
Empties the collected character data.
Removes the panel, then calls the callback.
Merges the data of a stage into the collected character data.
Steps forward or backward one stage at a time until the given stage is reached.
Init()client
Builds the character creation screen: collects the stages from the AddCharacterCreationMenuStages hook, opens the first one and creates the navigation.
Validates the current stage and moves on to the next one.
Slides the current stage panel out, then creates the theme panel with the given ID and slides it in.
Draws the panel through the theme's PaintCharCreationMainPanel hook.
Draws a dark overlay with a spinner, and a warning once the wait gets long, while a character creation request is pending.
Goes back one stage, or to the main menu from the first stage.
rebuild()client
Recreates the stage buttons at the bottom and highlights the current stage.
Sets the extra data that is sent with the creation request on top of what the stages collect, and opens the current stage again so that it can take the data into account.
Opens the panel of a stage and updates the stage buttons and the back and next titles.

Methods

Adds a stage to character creation.

Parameters

  • id String theme panel ID of the stage, also used as its title phrase
  • index Number optional, defaults to nil position to insert the stage at; added last when omitted

Empties the collected character data.

Removes the panel, then calls the callback.

Parameters

  • callback Function optional, defaults to nil called without arguments

Merges the data of a stage into the collected character data.

Parameters

  • new_data Map

Steps forward or backward one stage at a time until the given stage is reached.

Parameters

  • stage Number stage index

Builds the character creation screen: collects the stages from the AddCharacterCreationMenuStages hook, opens the first one and creates the navigation.

Validates the current stage and moves on to the next one. On the last stage it asks for confirmation and sends the character creation request to the server. Does nothing while the server has not responded to a creation request that was already sent.

Returns

  • Boolean false when validation failed or a request is pending, otherwise nil

Slides the current stage panel out, then creates the theme panel with the given ID and slides it in. Runs the 'CharPanelCreated' hook with the ID and the new panel afterward.

Parameters

  • id String ID of one of the added stages

Draws the panel through the theme's PaintCharCreationMainPanel hook.

Parameters

  • w Number
  • h Number

Draws a dark overlay with a spinner, and a warning once the wait gets long, while a character creation request is pending.

Parameters

  • w Number
  • h Number

Returns

  • Boolean true while a request is pending, otherwise nil

Goes back one stage, or to the main menu from the first stage.

Recreates the stage buttons at the bottom and highlights the current stage.

Sets the extra data that is sent with the creation request on top of what the stages collect, and opens the current stage again so that it can take the data into account. Meant for whoever opens the screen, right after creating it.

Parameters

  • data Map extra request data, nil to send none

Opens the panel of a stage and updates the stage buttons and the back and next titles.

Parameters

  • stage Number stage index

Defined in