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

pointerChains.py (1680B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\pointerTool\pointerChains.py
      2 import eve.client.script.ui.shared.pointerTool.pointerToolConst as pConst
      3 from eve.client.script.ui.shared.agencyNew.contentGroups.contentGroupProvider import GetRootContentGroup
      4 from uihighlighting.uniqueNameChains import FindChainForUniqueName
      5 from neocom2.btnIDs import AGENCY_ID
      6 
      7 def FindChainForPointer(pointerName):
      8     if pointerName.startswith(pConst.AGENCY_TAB_PREFIX) or pointerName.startswith(pConst.AGENCY_CARD_PREFIX):
      9         contentGroupID = pointerName.replace(pConst.AGENCY_TAB_PREFIX, '').replace(pConst.AGENCY_CARD_PREFIX, '')
     10         pointerChain = FindAgencyChainForGroupID(int(contentGroupID))
     11         if pointerChain:
     12             pointers = [pConst.GetUniqueNeocomPointerName(AGENCY_ID), pConst.GetUniqueAgencyTabName(pointerChain[0])]
     13             for x in pointerChain[1:]:
     14                 pointers.append(pConst.GetUniqueAgencyCardName(x))
     15 
     16             return pointers
     17     chain = FindChainForUniqueName(pointerName)
     18     if len(chain) > 1:
     19         chain.reverse()
     20         return chain
     21     return []
     22 
     23 
     24 def FindAgencyChainForGroupID(groupIdToFind):
     25     resultList = []
     26 
     27     def WasGroupFound(children):
     28         for child in children:
     29             if child.contentGroupID == groupIdToFind:
     30                 resultList.insert(0, child.contentGroupID)
     31                 return True
     32             if child.children:
     33                 if WasGroupFound(child.children):
     34                     resultList.insert(0, child.contentGroupID)
     35                     return True
     36 
     37     WasGroupFound(GetRootContentGroup().children)
     38     return resultList