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

deploymentContUtil.py (5037B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\structure\deployment\deploymentContUtil.py
      2 from carbon.common.script.util.linkUtil import GetShowInfoLink
      3 from eve.common.script.sys.idCheckers import IsDockableStructure
      4 from evetypes import IsUpwellStargate
      5 from localization import GetByLabel
      6 from structures.deployment import GetStructureNamePrefix
      7 from utillib import KeyVal
      8 STEP_POSITION = 1
      9 STEP_EXTRA = 2
     10 STEP_SCHEDULE = 3
     11 COLOR_WARNING = '0xBFFF0000'
     12 COLOR_WARNING_FAINT = '0xFFFF5804'
     13 COLOR_VALID = '0xFF73BAFF'
     14 
     15 def GetDeploymentStepsLabelPath(structureTypeID):
     16     if IsUpwellStargate(structureTypeID):
     17         return 'UI/Structures/Deployment/DeploymentStepsStargate'
     18     if IsDockableStructure(structureTypeID):
     19         return 'UI/Structures/Deployment/DeploymentSteps'
     20     return 'UI/Structures/Deployment/DeploymentStepsNonDockable'
     21 
     22 
     23 def GetStepsForStructure(structureTypeID):
     24     if IsUpwellStargate(structureTypeID):
     25         return [STEP_POSITION, STEP_EXTRA, STEP_SCHEDULE]
     26     return [STEP_POSITION, STEP_SCHEDULE]
     27 
     28 
     29 def GetNextState(step, structureTypeID, forward = True):
     30     if HasExtraStep(structureTypeID):
     31         if step == STEP_POSITION:
     32             if forward:
     33                 return STEP_EXTRA
     34             else:
     35                 return None
     36         elif step == STEP_EXTRA:
     37             if forward:
     38                 return STEP_SCHEDULE
     39             else:
     40                 return STEP_POSITION
     41         elif step == STEP_SCHEDULE:
     42             if forward:
     43                 pass
     44             else:
     45                 return STEP_EXTRA
     46     elif step == STEP_POSITION:
     47         if forward:
     48             return STEP_SCHEDULE
     49         else:
     50             return None
     51     return STEP_POSITION
     52 
     53 
     54 def HasExtraStep(structureTypeID):
     55     return IsUpwellStargate(structureTypeID)
     56 
     57 
     58 ANCHOR_TOOLTIP = 'UI/Structures/Deployment/AnchorHint'
     59 ANCHOR_DISABLED_TOOLTIP = 'UI/Structures/Deployment/AnchorDisabledTooltip'
     60 POSITION_TOOLTIP = 'UI/Structures/Deployment/PositionHint'
     61 POSITION_DISABLED_TOOLTIP = 'UI/Structures/Deployment/PositionDisbabledHint'
     62 CANCEL_TOOLTIP = 'UI/Structures/Deployment/CancelHint'
     63 
     64 def GetRightBtnHints(structureTypeID, stepID):
     65     if stepID == STEP_POSITION:
     66         return (POSITION_TOOLTIP, POSITION_DISABLED_TOOLTIP)
     67     if stepID == STEP_EXTRA:
     68         if IsUpwellStargate(structureTypeID):
     69             return ('UI/Structures/Deployment/StargateHint', 'UI/Structures/Deployment/StargateDisabledHint')
     70         return ('', '')
     71     if stepID == STEP_SCHEDULE:
     72         return (ANCHOR_TOOLTIP, ANCHOR_DISABLED_TOOLTIP)
     73 
     74 
     75 def GetRightBtnLabel(structureTypeID, stepID):
     76     if stepID == STEP_POSITION:
     77         return 'UI/Structures/Deployment/Position'
     78     if stepID == STEP_EXTRA:
     79         if IsUpwellStargate(structureTypeID):
     80             return 'UI/Structures/Deployment/ConfirmStargateDest'
     81         return ''
     82     return ''
     83 
     84 
     85 def GetLeftBtnHints(stepID):
     86     if stepID == STEP_POSITION:
     87         return CANCEL_TOOLTIP
     88     return 'UI/Structures/Deployment/BackHint'
     89 
     90 
     91 def GetLeftBtnLabel(stepID):
     92     if stepID == STEP_POSITION:
     93         return 'UI/Common/Cancel'
     94     return 'UI/Commands/Back'
     95 
     96 
     97 def GetPrefixForDeployment(structureTypeID, destinationSolarsystemID):
     98     extraConfig = KeyVal(destinationSolarsystemID=destinationSolarsystemID)
     99     return GetStructureNamePrefix(structureTypeID, session.solarsystemid2, extraConfig)
    100 
    101 
    102 def GetDestinationText(destinationSolarsystemID):
    103     if destinationSolarsystemID:
    104         systemName = cfg.evelocations.Get(destinationSolarsystemID).name
    105         systemLink = GetShowInfoLink(const.typeSolarSystem, systemName, destinationSolarsystemID)
    106         stargateDestLabel = GetByLabel('UI/Structures/Deployment/SelectedDestination', systemLink=systemLink)
    107     else:
    108         stargateDestLabel = ''
    109     return stargateDestLabel
    110 
    111 
    112 def GetPrimeHourLabelPath(structureTypeIDs):
    113     if structureTypeIDs is None:
    114         return 'UI/Structures/Deployment/SetPrimeHourHint'
    115     for eachStructureTypeID in structureTypeIDs:
    116         if IsDockableStructure(eachStructureTypeID):
    117             return 'UI/Structures/Deployment/SetPrimeHourHint'
    118 
    119     return 'UI/Structures/Deployment/SetPrimeHourHintNonDockable'
    120 
    121 
    122 def GetPrimeHourSubtextLabelPath(structureTypeIDs):
    123     if structureTypeIDs is None:
    124         return 'UI/Structures/Deployment/SetPrimeHourSubtext'
    125     for eachStructureTypeID in structureTypeIDs:
    126         if IsDockableStructure(eachStructureTypeID):
    127             return 'UI/Structures/Deployment/SetPrimeHourSubtext'
    128 
    129     return 'UI/Structures/Deployment/SetPrimeHourSubtextNonDockable'
    130 
    131 
    132 def GetHourPickerLabelPath(structureTypeIDs):
    133     if structureTypeIDs is None:
    134         return 'UI/Structures/Deployment/SetPrimeHour'
    135     for eachStructureTypeID in structureTypeIDs:
    136         if IsDockableStructure(eachStructureTypeID):
    137             return 'UI/Structures/Deployment/SetPrimeHour'
    138 
    139     return 'UI/Structures/Deployment/SetPrimeHourFLEX'
    140 
    141 
    142 STRUC_DEPLOY_POINT_HERE = 'pointsToCurrent'
    143 STRUC_DEPLOY_STRUCTURINFO = 'structureInfo'