agentConversationIcon.py (1290B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\station\agents\agentConversationIcon.py 2 import eveicon 3 from eve.client.script.ui import eveColor 4 from carbonui.control.buttonIcon import ButtonIcon 5 from eve.client.script.ui.station.agents.agentUtil import IsAgentAvailable, GetAgentStartConversationHint 6 from uthread2 import StartTasklet 7 COLOR_UNAVAILABLE = eveColor.DANGER_RED 8 9 class AgentConversationIcon(ButtonIcon): 10 default_name = 'AgentConversationIcon' 11 default_texturePath = eveicon.chat_bubble 12 default_width = 24 13 default_height = 24 14 15 def ApplyAttributes(self, attributes): 16 ButtonIcon.ApplyAttributes(self, attributes) 17 agentID = attributes.agentID 18 self.func = self.InteractWithAgent 19 self.SetAgentID(agentID) 20 21 def SetAgentID(self, agentID): 22 self.agentID = agentID 23 StartTasklet(self._SetColorForAgent, agentID) 24 25 def _SetColorForAgent(self, agentID): 26 color = self.default_iconColor if IsAgentAvailable(agentID) else COLOR_UNAVAILABLE 27 self.SetIconColor(color) 28 29 def InteractWithAgent(self): 30 return sm.GetService('agents').OpenDialogueWindow(self.agentID) 31 32 def GetHint(self): 33 return GetAgentStartConversationHint(self.agentID)