From a3905882f7bacb6df88e3d58daa3ad7086d63199 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 3 Jun 2015 21:00:04 +0300 Subject: [PATCH] DANIEL: Nametag access shit --- otp/avatar/Avatar.py | 17 ++++++++++-- otp/otpbase/OTPLocalizerEnglish.py | 42 +++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/otp/avatar/Avatar.py b/otp/avatar/Avatar.py index 95191d1b..55a88c73 100755 --- a/otp/avatar/Avatar.py +++ b/otp/avatar/Avatar.py @@ -130,6 +130,7 @@ class Avatar(Actor, ShadowCaster): self.nametag.setNametagColor(nametagColor) chatColor = NametagGlobals.ChatColors[NametagGlobals.CCNonPlayer] self.nametag.setChatColor(chatColor) + self.setNametagName() self.nametag.updateAll() def considerUnderstandable(self): @@ -221,13 +222,25 @@ class Avatar(Actor, ShadowCaster): return self.name = name if hasattr(self, 'nametag'): - self.nametag.setText(name) + self.setNametagName() def setDisplayName(self, str): if hasattr(self, 'isDisguised'): if self.isDisguised: return - self.nametag.setText(str) + self.setNametagName(str) + + def setNametagName(self, name=None): + if not name: + name = self.name + + if hasattr(self, 'adminAccess') and self.isAdmin(): + access = self.getAdminAccess() + + if access in OTPLocalizer.AccessToString: + name += '\n\x01shadow\x01%s\x02' % OTPLocalizer.AccessToString[access] + + self.nametag.setText(name) def getFont(self): return self.__font diff --git a/otp/otpbase/OTPLocalizerEnglish.py b/otp/otpbase/OTPLocalizerEnglish.py index 988f520a..4e8aed44 100755 --- a/otp/otpbase/OTPLocalizerEnglish.py +++ b/otp/otpbase/OTPLocalizerEnglish.py @@ -89,6 +89,38 @@ TextPropertiesManager.getGlobalPtr().setProperties('black', black) grey = TextProperties() grey.setTextColor(0.5, 0.5, 0.5, 1) TextPropertiesManager.getGlobalPtr().setProperties('grey', grey) + +# New colors: +# Orange +amber = TextProperties() +amber.setTextColor(1, 0.75, 0, 1) +TextPropertiesManager.getGlobalPtr().setProperties('amber', amber) + +# Pink +amaranth = TextProperties() +amaranth.setTextColor(0.9, 0.17, 0.31, 1) +TextPropertiesManager.getGlobalPtr().setProperties('amaranth', amaranth) + +# Green +androidGreen = TextProperties() +androidGreen.setTextColor(0.64, 0.78, 0.22, 1) +TextPropertiesManager.getGlobalPtr().setProperties('androidGreen', androidGreen) + +# Turquoise-green +caribbeanGreen = TextProperties() +caribbeanGreen.setTextColor(0, 0.8, 0.6, 1) +TextPropertiesManager.getGlobalPtr().setProperties('caribbeanGreen', caribbeanGreen) + +# Blue +azure = TextProperties() +azure.setTextColor(0, 0.5, 1, 1) +TextPropertiesManager.getGlobalPtr().setProperties('azure', azure) + +# Cobalt-blue +cobalt = TextProperties() +cobalt.setTextColor(0, 0.28, 0.67, 1) +TextPropertiesManager.getGlobalPtr().setProperties('cobalt', cobalt) + CRConnecting = 'Connecting...' CRNoConnectTryAgain = 'Could not connect to %s:%s. Try again?' CRNoConnectProxyNoPort = 'Could not connect to %s:%s.\n\nYou are communicating to the internet via a proxy, but your proxy does not permit connections on port %s.\n\nYou must open up this port, or disable your proxy, in order to play. If your proxy has been provided by your ISP, you must contact your ISP to request them to open up this port.' @@ -2320,4 +2352,12 @@ def timeElapsedString(timeDelta): else: return '%s minutes ago' % (timeDelta.seconds / 60) -AsciiNotSupported = 'Sorry, but Toontown United does not support non-ASCII characters.' +AsciiNotSupported = 'Sorry, but Toontown Stride does not support non-ASCII characters.' +AccessToString = { + 200: '\x01amaranth\x01Community Manager\x02', + 300: '\x01caribbeanGreen\x01Moderator\x02', + 400: '\x01amber\x01Artist\x02', + 500: '\x01androidGreen\x01Developer\x02', + 600: '\x01cobalt\x01Admin\x02', + 700: '\x01azure\x01System Admin\x02' +}