standingsHistoryEntry.py (2817B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\neocom\charsheet\standingsPanel\standingsHistoryEntry.py 2 from carbon.common.script.util.format import FmtDate 3 from carbonui import uiconst 4 from carbonui.primitives.sprite import Sprite 5 from eve.client.script.ui.control.baseListEntry import BaseListEntryCustomColumns 6 from eve.client.script.ui.control.themeColored import SpriteThemeColored 7 from eve.client.script.ui.shared.standings.standingsUIUtil import GetStandingEventIcon 8 from eve.client.script.ui.shared.standings.standingsUtil import GetStandingChangeFormatted 9 from eve.common.script.util.eveFormat import FmtStandingTransaction 10 from eve.common.script.util.standingUtil import RoundStandingChange 11 from localization import GetByLabel 12 13 class StandingsHistoryEntry(BaseListEntryCustomColumns): 14 15 def ApplyAttributes(self, attributes): 16 BaseListEntryCustomColumns.ApplyAttributes(self, attributes) 17 self.transaction = self.node.transaction 18 iconCont = self.AddColumnContainer() 19 texturePath = GetStandingEventIcon(self.transaction.eventTypeID) 20 iconSize = 26 21 SpriteThemeColored(name='icon', parent=iconCont, align=uiconst.CENTER, state=uiconst.UI_DISABLED, texturePath=texturePath, pos=(0, 22 0, 23 iconSize, 24 iconSize), colorType=uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.85) 25 dateTime = FmtDate(self.transaction.eventDateTime, 'sn') 26 self.AddColumnText(dateTime) 27 change = RoundStandingChange(self.transaction.modification) 28 self.AddColumnText(GetStandingChangeFormatted(change)) 29 subject, self.node.hint = FmtStandingTransaction(self.transaction) 30 self.AddColumnText(subject) 31 32 def OnMouseEnter(self, *args): 33 BaseListEntryCustomColumns.OnMouseEnter(self, *args) 34 sm.ScatterEvent('OnStandingHistoryEntryMouseEnter', self.transaction) 35 36 def OnMouseExit(self, *args): 37 BaseListEntryCustomColumns.OnMouseExit(self, *args) 38 sm.ScatterEvent('OnStandingHistoryEntryMouseExit', self.transaction) 39 40 @classmethod 41 def GetDynamicHeight(cls, node, width = None): 42 return 30 43 44 @staticmethod 45 def GetDefaultColumnWidth(): 46 return {'': 40, 47 GetByLabel('UI/Common/Date'): 70, 48 GetByLabel('UI/Common/Change'): 55, 49 GetByLabel('UI/Common/Reason'): 300} 50 51 @staticmethod 52 def GetColumnSortValues(transaction): 53 reason, _ = FmtStandingTransaction(transaction) 54 return (transaction.eventTypeID, 55 transaction.eventDateTime, 56 transaction.modification, 57 reason) 58 59 @staticmethod 60 def GetHeaders(): 61 return ('', 62 GetByLabel('UI/Common/Date'), 63 GetByLabel('UI/Common/Change'), 64 GetByLabel('UI/Common/Reason'))