NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

standingsHistoryScroll.py (1755B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\neocom\charsheet\standingsPanel\standingsHistoryScroll.py
      2 from carbonui.util.bunch import Bunch
      3 from eve.client.script.ui.control.eveScroll import Scroll
      4 from eve.client.script.ui.shared.neocom.charsheet.standingsPanel.standingsHistoryEntry import StandingsHistoryEntry
      5 from localization import GetByLabel
      6 
      7 class StandingsHistoryScroll(Scroll):
      8     default_name = 'StandingsHistoryScroll'
      9     default_id = 'StandingsHistoryScroll2'
     10     default_columnWidth = StandingsHistoryEntry.GetDefaultColumnWidth()
     11     __notifyevents__ = ['OnStandingsGraphHoverStateChange']
     12 
     13     def ApplyAttributes(self, attributes):
     14         Scroll.ApplyAttributes(self, attributes)
     15         sm.RegisterNotify(self)
     16         self.transactions = []
     17 
     18     def Update(self, transactions, ownerID):
     19         nodes = []
     20         self.transactions = transactions
     21         for transaction in self.transactions:
     22             node = Bunch(decoClass=StandingsHistoryEntry, sortValues=StandingsHistoryEntry.GetColumnSortValues(transaction), transaction=transaction)
     23             nodes.append(node)
     24 
     25         ownerName = cfg.eveowners.Get(ownerID).ownerName
     26         self.LoadContent(contentList=nodes, headers=StandingsHistoryEntry.GetHeaders(), noContentHint=GetByLabel('UI/Standings/NoStandingsTransactions', ownerName=ownerName))
     27 
     28     def OnStandingsGraphHoverStateChange(self, index):
     29         transaction = self.transactions[index - 1] if index else None
     30         for node in self.GetNodes():
     31             if not node.panel:
     32                 continue
     33             if node.transaction == transaction:
     34                 node.panel.ShowHilite()
     35             else:
     36                 node.panel.HideHilite()