chainsol icon

Untitled

chainsol | PRO | 02/15/18 03:59:52 PM UTC | 0 ⭐ | 519 👁️ | Never ⏰ | []
Python |

580 B

|

None

|

0 👍

/

0 👎

# base typeclass ( e.g. typeclasses/objects/Object )
def get_display_name(self, looker, **kwargs):
    # grab the color code stored in db.color_code,
    # or default to "|w"
    color = self.db.color_code or "|w"
    # use the original get_display_name hook to get our name
    name = super(Object, self).get_display_name(looker, **kwargs)
    # either create a string based on self.db.modifiers, or default to an
    # empty string
    modifiers = " " + " ".join(self.db.modifiers) or ""
    return("{color}{name}|n{modifiers}".format(color=color, name=name, modifiers=modifiers))

Comments