diff --git a/otp/avatar/Avatar.py b/otp/avatar/Avatar.py index d9db1a27..f604f309 100755 --- a/otp/avatar/Avatar.py +++ b/otp/avatar/Avatar.py @@ -67,6 +67,7 @@ class Avatar(Actor, ShadowCaster): self.__chatSet = 0 self.__chatLocal = 0 self.__currentDialogue = None + self.wantAdminTag = True def delete(self): try: @@ -172,6 +173,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: @@ -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. diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index f1264188..6abd26b5 100755 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -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): """