chainsol

Untitled

Feb 15th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. # base typeclass ( e.g. typeclasses/objects/Object )
  2. def get_display_name(self, looker, **kwargs):
  3.     # grab the color code stored in db.color_code,
  4.     # or default to "|w"
  5.     color = self.db.color_code or "|w"
  6.     # use the original get_display_name hook to get our name
  7.     name = super(Object, self).get_display_name(looker, **kwargs)
  8.     # either create a string based on self.db.modifiers, or default to an
  9.     # empty string
  10.     modifiers = " " + " ".join(self.db.modifiers) or ""
  11.     return("{color}{name}|n{modifiers}".format(color=color, name=name, modifiers=modifiers))
Advertisement
Add Comment
Please, Sign In to add comment