Custom Dialogs

Enums

Choose Dialog Outcome

class CommonChoiceOutcome

Bases: sims4communitylib.dialogs.common_choice_outcome.Int

The outcome of the player being given a choice.

CANCEL = 0
CHOICE_MADE = 1
ERROR = 2
static is_error_or_cancel(result)

Determine if an outcome is either ERROR or CANCEL.

Parameters:result (CommonChoiceOutcome) – The result to check.
Returns:True, if result is either an Error or Cancel. False, if not.
Return type:bool

Utilities

Dialog Utils

class CommonDialogUtils

Bases: object

Utilities for use with dialogs.

static get_chosen_item(dialog)

Retrieves the item chosen by the player from a dialog.

Parameters:dialog (Union[UiDialogObjectPicker, UiMultiPicker]) – The dialog to get the chosen item of.
Returns:The value of the chosen item.
Return type:Any
static get_chosen_items(dialog)

Retrieves the items chosen by the player from a dialog.

Parameters:dialog (Union[UiDialogObjectPicker, UiMultiPicker]) – The dialog to get the chosen items of.
Returns:A collection of chosen items.
Return type:Tuple[Any]
static get_input_value(dialog)

Retrieve the value entered by the player from an input dialog.

Parameters:dialog (UiDialogTextInput) – The dialog to get the chosen items of.
Returns:The value of the entered input.
Return type:Union[str, None]