Package horizons :: Package gui :: Package widgets :: Module messagewidget :: Class _IngameMessage
[hide private]
[frames] | no frames]

Class _IngameMessage

source code

Represents a message that is to be displayed in the MessageWidget. The message is used as a string template, meaning it can contain placeholders like the following: {player}, {gold}. The *message_dict* needed to fill in these placeholders needs to be provided when creating _IngameMessages.

Instance Methods [hide private]
 
__init__(self, point, id, created, msg_type=None, read=False, display=None, message=None, message_dict=None, icon_id=None) source code
 
__repr__(self) source code
Method Details [hide private]

__init__(self, point, id, created, msg_type=None, read=False, display=None, message=None, message_dict=None, icon_id=None)
(Constructor)

source code 
Parameters:
  • point - Point position on the map where the action took place, or None.
  • id - message id string, needed to retrieve the message from the database.
  • created - tickid when the message was created. Keeps message order after load.
  • msg_type - messages coupled with logbook entries use this to link to pages
  • read - #TODO
  • display - #TODO
  • message - message text to display. Loads preset for `id` if None.
  • message_dict - dict with strings to replace in the message, e.g. {'player': 'Arthus'}
  • icon_id - which icon to display. Loads preset for `id` if None.