Fix ~~target, and add a command to disable your GM icon.

This commit is contained in:
Alexander 2015-08-21 15:28:46 -04:00
parent 55ace187c1
commit 1309f1a4ad
2 changed files with 21 additions and 2 deletions

View file

@ -67,6 +67,7 @@ class Avatar(Actor, ShadowCaster):
self.__chatSet = 0
self.__chatLocal = 0
self.__currentDialogue = None
self.wantAdminTag = True
def delete(self):
try:
@ -173,6 +174,12 @@ class Avatar(Actor, ShadowCaster):
def getType(self):
return self.avatarType
def setWantAdminTag(self, bool):
self.wantAdminTag = bool
def getWantAdminTag(self):
return self.wantAdminTag
def setName(self, name):
if hasattr(self, 'isDisguised') and self.isDisguised:
return
@ -194,7 +201,7 @@ class Avatar(Actor, ShadowCaster):
self.nametag.setName(name)
if hasattr(self, 'adminAccess') and self.isAdmin():
if hasattr(self, 'adminAccess') and self.isAdmin() and self.getWantAdminTag():
access = self.getAdminAccess()
if access in OTPLocalizer.AccessToString:
@ -553,7 +560,7 @@ class Avatar(Actor, ShadowCaster):
return sequence
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[])
@magicWord(category=CATEGORY_COMMUNITY_MANAGER)
def target():
"""
Returns the current Spellbook target.

View file

@ -2451,6 +2451,18 @@ def blackCat():
"""
base.cr.blackCatMgr.requestBlackCatTransformation()
@magicWord(category=CATEGORY_COMMUNITY_MANAGER)
def toggleGM():
invoker = spellbook.getInvoker()
if invoker.gmIcon:
invoker.setWantAdminTag(False)
invoker.removeGMIcon()
invoker.setNametagName()#setName(invoker.getName())
else:
invoker.setWantAdminTag(True)
invoker.setGMIcon(invoker.getAdminAccess())
invoker.setNametagName()#setName(invoker.getName())
@magicWord(category=CATEGORY_COMMUNITY_MANAGER, types=[str])
def showParticle(name):
"""