standingsAssociationsTooltip.py (1762B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\neocom\charsheet\standingsPanel\standingsAssociationsTooltip.py 2 import localization 3 from carbonui import uiconst 4 from eve.client.script.ui.control import tooltips 5 from eve.client.script.ui.control.eveIcon import OwnerIconAndLabel 6 from eve.client.script.ui.tooltips.tooltipsWrappers import TooltipBaseWrapper 7 8 class StandingsAssociationTooltip(TooltipBaseWrapper): 9 10 def __init__(self, agent_id = None): 11 super(TooltipBaseWrapper, self).__init__() 12 self.agent_id = agent_id 13 14 def CreateTooltip(self, parent, owner, idx): 15 self.tooltipPanel = tooltips.TooltipPanel(parent=parent, owner=owner, idx=idx) 16 self.tooltipPanel.state = uiconst.UI_NORMAL 17 self.tooltipPanel.LoadGeneric2ColumnTemplate() 18 factionID, corpID = self.GetAssociations(self.agent_id) 19 self.tooltipPanel.AddSpacer(0, 4, 2) 20 self.tooltipPanel.AddLabelMedium(text=localization.GetByLabel('UI/Common/Faction'), colSpan=2, bold=True) 21 self.CreateAssociationRow(ownerID=factionID) 22 self.tooltipPanel.AddSpacer(0, 4, 2) 23 self.tooltipPanel.AddLabelMedium(text=localization.GetByLabel('UI/Agents/Dialogue/Corporation'), colSpan=2, bold=True) 24 self.CreateAssociationRow(corpID) 25 return self.tooltipPanel 26 27 def CreateAssociationRow(self, ownerID): 28 iconAndLabel = OwnerIconAndLabel(height=32, align=uiconst.TOPLEFT, iconSize=32, ownerID=ownerID, left=5, iconAlign=uiconst.TOLEFT) 29 self.tooltipPanel.AddCell(iconAndLabel, colSpan=2) 30 31 def GetAssociations(self, agentID): 32 agent = sm.GetService('agents').GetAgentByID(agentID) 33 return (agent.factionID, agent.corporationID)