Skip to content

The comms system

comms(path=None, buttons=None, timeout=None)

Present the comms buttons. and wait for a choice. The timeout can be any promise, but typically is a made using the timeout function.

Parameters:

Name Type Description Default
buttons dict

An dict of button dat key = button properties value label to process button press

None
timeout Promise

The comms will end if this promise finishes. Defaults to None.

None

Returns:

Name Type Description
Promise CommsPromise

A Promise that finishes when a comms button is selected

comms_broadcast(ids_or_obj, msg, color='#fff')

Send text to the text waterfall The ids can be player ship ids or client/console ids

Parameters:

Name Type Description Default
ids_or_obj id or objecr

A set or single id or object to send to,

required
msg str

The text to send

required
color str

The Color for the text. Defaults to "#fff".

'#fff'

comms_info(name, face=None, color=None)

Set the communication information status in the comms console

Parameters:

Name Type Description Default
name str

The name to present

required
face str

The face string of the face. Defaults to None.

None
color str

The colot of the text. Defaults to None.

None

comms_message(msg, from_ids_or_obj, to_ids_or_obj, title=None, face=None, color='#fff', title_color=None, is_receive=True, from_name=None)

Send a Comms message This is a lower level function that lets you have more control the sender and receiver

Parameters:

Name Type Description Default
msg str

The message to send

required
from_ids_or_obj idset

The senders of the message

required
to_ids_or_obj idset

The set or receivers

required
title str

The title text. Defaults to None.

None
face str

The face string to use. Defaults to None.

None
color str

The color of the body text. Defaults to "#fff".

'#fff'
title_color str

The color of the title text. Defaults to None.

None

comms_receive(msg, title=None, face=None, color='#fff', title_color=None)

Receive a message on a player ship from another ship It uses the current context to determine the sender and receiver. typically from the event that it being handled provide the context.

Parameters:

Name Type Description Default
msg str

The message to send

required
title str

The title text. Defaults to None.

None
face str

The face string of the face to use. Defaults to None.

None
color str

The body text color. Defaults to "#fff".

'#fff'
title_color str

The title text color. Defaults to None.

None

comms_receive_internal(msg, ids_or_obj=None, from_name=None, title=None, face=None, color='#fff', title_color=None)

Receiver a message within a player ship It uses the current context to determine the sender and receiver. typically from the event that it being handled provide the context.

Parameters:

Name Type Description Default
msg str

The message to send

required
title str

The title text. Defaults to None.

None
face str

The face string of the face to use. Defaults to None.

None
color str

The body text color. Defaults to "#fff".

'#fff'
title_color str

The title text color. Defaults to None.

None

comms_speech_bubble(msg, seconds=3, color='#fff', client_id=None, selected_id=None)

Transmits a message from a player ship It uses the current context to determine the sender and receiver. typically from the event that it being handled provide the context.

Parameters:

Name Type Description Default
msg str

The message to send

required
title str

The title text. Defaults to None.

required
face str

The face string of the face to use. Defaults to None.

required
color str

The body text color. Defaults to "#fff".

'#fff'
title_color str

The title text color. Defaults to None.

required

comms_transmit(msg, title=None, face=None, color='#fff', title_color=None)

Transmits a message from a player ship It uses the current context to determine the sender and receiver. typically from the event that it being handled provide the context.

Parameters:

Name Type Description Default
msg str

The message to send

required
title str

The title text. Defaults to None.

None
face str

The face string of the face to use. Defaults to None.

None
color str

The body text color. Defaults to "#fff".

'#fff'
title_color str

The title text color. Defaults to None.

None

comms_transmit_internal(msg, ids_or_obj=None, to_name=None, title=None, face=None, color='#fff', title_color=None)

Transmits a message within a player ship It uses the current context to determine the sender and receiver. typically from the event that it being handled provide the context.

Parameters:

Name Type Description Default
msg str

The message to send

required
title str

The title text. Defaults to None.

None
face str

The face string of the face to use. Defaults to None.

None
color str

The body text color. Defaults to "#fff".

'#fff'
title_color str

The title text color. Defaults to None.

None