standingCompositionEntry.py (1902B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\neocom\charsheet\standingsPanel\standingCompositionEntry.py 2 from carbonui import uiconst 3 from carbonui.primitives.sprite import Sprite 4 from eve.client.script.ui.control.baseListEntry import BaseListEntryCustomColumns 5 from eve.client.script.ui.shared.standings.standingsUtil import GetStandingChangeFormatted 6 from localization import GetByLabel 7 8 class StandingCompositionEntry(BaseListEntryCustomColumns): 9 10 def ApplyAttributes(self, attributes): 11 super(StandingCompositionEntry, self).ApplyAttributes(attributes) 12 self.composition = self.node.composition 13 self.ConstructLayout() 14 15 def ConstructLayout(self): 16 iconCont = self.AddColumnContainer() 17 texturePath = sm.GetService('photo').GetPortrait(self.composition.ownerID, 32) 18 Sprite(name='icon', parent=iconCont, align=uiconst.CENTER, texturePath=texturePath, pos=(0, 0, 32, 32)) 19 ownerName = cfg.eveowners.Get(self.composition.ownerID).ownerName 20 self.AddColumnText(ownerName) 21 self.AddColumnText(GetStandingChangeFormatted(round(self.composition.standing, 2))) 22 23 @staticmethod 24 def GetDynamicHeight(node, width): 25 return 30 26 27 @staticmethod 28 def GetDefaultColumnWidth(): 29 return {'': 32, 30 GetByLabel('UI/Common/Name'): 100, 31 GetByLabel('UI/Common/Standing'): 60} 32 33 @staticmethod 34 def GetColumnSortValues(composition): 35 return (None, composition.ownerID, composition.standing) 36 37 @staticmethod 38 def GetHeaders(): 39 return ('', GetByLabel('UI/Common/Name'), GetByLabel('UI/Common/Standing')) 40 41 @classmethod 42 def GetCopyData(cls, node): 43 textList = [cfg.eveowners.Get(node.composition.ownerID).ownerName, round(node.composition.standing, 2)] 44 return '\t'.join([ unicode(x) for x in textList ])