From 24c733f7cb473960a3c24ef57b159e46563aab74 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 22 Mar 2016 15:17:50 +0100 Subject: [PATCH] Made builders and above see #dbrefs in various admin commands. --- evennia/objects/objects.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index 640717050f..62f6e59f72 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -240,7 +240,31 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): # main methods - ## methods inherited from the database object (overload them here) + def get_display_name(self, looker, **kwargs): + """ + Displays the name of the object in a viewer-aware manner. + + Args: + looker (TypedObject): The object or player that is looking + at/getting inforamtion for this object. + + Returns: + name (str): A string containing the name of the object, + including the DBREF if this user is privileged to control + said object. + + Notes: + This function could be extended to change how object names + appear to users in character, but be wary. This function + does not change an object's keys or aliases when + searching, and is expected to produce something useful for + builders. + + """ + if self.locks.check_lockstring(looker, "pperm(Builders)"): + return "{}(#{})".format(self.name, self.id) + return self.name + def search(self, searchdata, global_search=False,