buddyOnlineIndicator.py (1726B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\neocom\addressBook\buddyOnlineIndicator.py 2 from carbonui import uiconst 3 from carbonui.primitives.container import Container 4 from carbonui.primitives.sprite import Sprite 5 from eve.client.script.ui import eveColor 6 from localization import GetByLabel 7 STATUS_ICON_SIZE = 12 8 TEXTUREPATH_BLOCKED = 'res:/UI/Texture/Classes/Contacts/blockedWhite.png' 9 TEXTUREPATH_ONLINESTATUS = 'res:/UI/Texture/Classes/Contacts/onlineIcon.png' 10 COLOR_ONLINE = eveColor.SUCCESS_GREEN 11 COLOR_OFFLINE = eveColor.DANGER_RED 12 COLOR_BLOCKED = eveColor.WHITE 13 14 class BuddyOnlineIndicator(Container): 15 default_state = uiconst.UI_NORMAL 16 17 def ApplyAttributes(self, attributes): 18 super(BuddyOnlineIndicator, self).ApplyAttributes(attributes) 19 self.icon = Sprite(parent=self, align=uiconst.CENTER, pos=(0, 20 0, 21 STATUS_ICON_SIZE, 22 STATUS_ICON_SIZE), state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/classes/Contacts/onlineIcon.png', outputMode=uiconst.OUTPUT_COLOR_AND_GLOW, glowBrightness=0.25, idx=0) 23 24 def SetOnline(self): 25 self.Show() 26 self.icon.SetRGBA(*COLOR_ONLINE) 27 self.icon.SetTexturePath(TEXTUREPATH_ONLINESTATUS) 28 self.hint = GetByLabel('UI/Common/Online') 29 30 def SetOffline(self): 31 self.Show() 32 self.icon.SetRGBA(*COLOR_OFFLINE) 33 self.icon.SetTexturePath(TEXTUREPATH_ONLINESTATUS) 34 self.hint = GetByLabel('UI/Common/Offline') 35 36 def SetBlocked(self): 37 self.Show() 38 self.icon.SetTexturePath(TEXTUREPATH_BLOCKED) 39 40 def SetNotBlocked(self): 41 self.Show() 42 self.icon.SetTexturePath(TEXTUREPATH_ONLINESTATUS)