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=None)

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".

None

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=None, 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".

None
title_color str

The color of the title text. Defaults to None.

None

comms_navigate(path, face=None, comms_badge=None)

Change the comms path for what buttons to present

Parameters:

Name Type Description Default
path str

description

required
face str

description. Defaults to None.

None

comms_navigate_override(ids_or_obj, sel_ids_or_obj, path=None, path_must_match=True)

Change the comms path for what buttons to present for specific comms pair. You need the two things in the relationship. If the things are selected in comms, this is a way to refresh the buttons. If the code is in the comms for the things involved, just use comms_navigate This is for a non comms task

Parameters:

Name Type Description Default
ids_or_obj id | set | list

The id, set of ids, or list of objects of player ships

required
sel_ids_or_obj id | set | list

The id, set of ids, or list of objects of other ship

required
path str

if none it will use the current path

None
path_must_match bool

Typically the path must match to avoid player confusion

True

comms_receive(msg, title=None, face=None, color=None, 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".

None
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=None, 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".

None
title_color str

The title text color. Defaults to None.

None

comms_speech_bubble(msg, seconds=3, color=None, 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".

None
title_color str

The title text color. Defaults to None.

required

comms_transmit(msg, title=None, face=None, color=None, 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".

None
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=None, 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".

None
title_color str

The title text color. Defaults to None.

None