messages.base module¶
Provides user messages.
-
class
messages.base.
AttrDict
[source]¶ Bases:
dict
A dictionary that redirects __getattr__ and __setattr__.
-
class
messages.base.
Fade
(duration, hold_time, color=Color(255, 255, 255, 255), flags=_messages.FadeFlags.IN)[source]¶ Bases:
messages.base.UserMessageCreator
Create a Fade.
-
__init__
(duration, hold_time, color=Color(255, 255, 255, 255), flags=_messages.FadeFlags.IN)[source]¶ Initialize the Fade instance.
-
message_name
= 'Fade'¶
-
moved_frac_bits
= 512¶
-
translatable_fields
= []¶
-
-
class
messages.base.
HintText
(message)[source]¶ Bases:
messages.base.UserMessageCreator
Create a HintText.
-
message_name
= 'HintText'¶
-
translatable_fields
= ['message']¶
-
-
class
messages.base.
HudMsg
(message, x=-1, y=-1, color1=Color(255, 255, 255, 255), color2=Color(255, 255, 255, 255), effect=0, fade_in=0, fade_out=0, hold_time=4, fx_time=0, channel=0)[source]¶ Bases:
messages.base.UserMessageCreator
Create a HudMsg.
-
__init__
(message, x=-1, y=-1, color1=Color(255, 255, 255, 255), color2=Color(255, 255, 255, 255), effect=0, fade_in=0, fade_out=0, hold_time=4, fx_time=0, channel=0)[source]¶ Initialize the HudMsg instance.
-
message_name
= 'HudMsg'¶
-
translatable_fields
= ['message']¶
-
-
class
messages.base.
KeyHintText
(*hints)[source]¶ Bases:
messages.base.UserMessageCreator
Create a KeyHintText.
-
message_name
= 'KeyHintText'¶
-
-
class
messages.base.
ResetHUD
(reset=True)[source]¶ Bases:
messages.base.UserMessageCreator
Create a ResetHUD.
-
message_name
= 'ResetHud'¶
-
translatable_fields
= []¶
-
-
class
messages.base.
SayText
(message, index=0, chat=False, color='x01')[source]¶ Bases:
messages.base.UserMessageCreator
Create a SayText.
-
message_name
= 'SayText'¶
-
reliable
= True¶
-
translatable_fields
= ['message']¶
-
-
class
messages.base.
SayText2
(message, index=0, chat=False, param1='', param2='', param3='', param4='', color='x01')[source]¶ Bases:
messages.base.UserMessageCreator
Create a SayText2.
-
__init__
(message, index=0, chat=False, param1='', param2='', param3='', param4='', color='\x01')[source]¶ Initialize the SayText2 instance.
-
message_name
= 'SayText2'¶
-
reliable
= True¶
-
translatable_fields
= ['message', 'param1', 'param2', 'param3', 'param4']¶
-
-
class
messages.base.
Shake
(amplitude, duration, frequency=1, shake_command=_messages.ShakeCommand.START)[source]¶ Bases:
messages.base.UserMessageCreator
Create a Shake.
-
__init__
(amplitude, duration, frequency=1, shake_command=_messages.ShakeCommand.START)[source]¶ Initialize the Shake instance.
-
message_name
= 'Shake'¶
-
translatable_fields
= []¶
-
-
class
messages.base.
ShowMenu
(menu_string, valid_slots=1023, display_time=4)[source]¶ Bases:
messages.base.UserMessageCreator
Create a radio menu.
-
chunk_size
= 62¶
-
message_name
= 'ShowMenu'¶
-
translatable_fields
= []¶
-
-
class
messages.base.
TextMsg
(message, destination=_messages.HudDestination.CENTER, param1='', param2='', param3='', param4='')[source]¶ Bases:
messages.base.UserMessageCreator
Create a TextMsg.
-
__init__
(message, destination=_messages.HudDestination.CENTER, param1='', param2='', param3='', param4='')[source]¶ Initialize the TextMsg instance.
-
message_name
= 'TextMsg'¶
-
reliable
= True¶
-
translatable_fields
= ['message', 'param1', 'param2', 'param3', 'param4']¶
-
-
class
messages.base.
UserMessageCreator
(**kwargs)[source]¶ Bases:
messages.base.AttrDict
Provide an easy interface to create user messages.
Attr bool reliable: Whether to send message using reliable channel. -
__init__
(**kwargs)[source]¶ Initialize the usermessage creator.
Parameters: kwargs (dict) – All valid fields.
-
message_name
¶ Return the user message name.
-
reliable
= False¶
-
translatable_fields
¶ Return a list of translatable fields.
-