planetUtil.py (2862B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\planet\planetUtil.py 2 import appConst 3 import evetypes 4 from eveprefs import boot 5 from eve.client.script.ui.shared.planet.planetConst import TYPEIDS_PROCESSORS_HIGHTECH, TYPEIDS_PROCESSORS_ADVANCED, TYPEIDS_PROCESSORS_BASIC, PIN_ADV, PIN_HIGH, PIN_BASIC, PLANET_TYPE_TO_PIN 6 7 def IsTypeBasicProcessor(pinType): 8 basic = pinType in TYPEIDS_PROCESSORS_BASIC 9 return basic 10 11 12 def IsTypeAdvancedProcessor(pinType): 13 advanced = pinType in TYPEIDS_PROCESSORS_ADVANCED 14 return advanced 15 16 17 def IsTypeHighTechProcessor(pinType): 18 hightech = pinType in TYPEIDS_PROCESSORS_HIGHTECH 19 return hightech 20 21 22 def GetTexturePath(pinGrouping, groupID = None): 23 if pinGrouping == PIN_ADV: 24 return 'res:/UI/Texture/Planet/icons/processorAdvanced.png' 25 if pinGrouping == PIN_HIGH: 26 return 'res:/UI/Texture/Planet/icons/processorHighTech.png' 27 if pinGrouping == PIN_BASIC: 28 return 'res:/UI/Texture/Planet/icons/processor.png' 29 try: 30 return iconsByGroupID[groupID] 31 except Exception: 32 return '' 33 34 35 def ConvertPinType(pinType, planetType): 36 if IsTypeBasicProcessor(pinType): 37 return PLANET_TYPE_TO_PIN[planetType][PIN_BASIC] 38 if IsTypeAdvancedProcessor(pinType): 39 return PLANET_TYPE_TO_PIN[planetType][PIN_ADV] 40 if IsTypeHighTechProcessor(pinType): 41 if PIN_HIGH not in PLANET_TYPE_TO_PIN[planetType]: 42 return None 43 return PLANET_TYPE_TO_PIN[planetType][PIN_HIGH] 44 try: 45 return PLANET_TYPE_TO_PIN[planetType][evetypes.GetGroupID(pinType)] 46 except: 47 return None 48 49 50 iconsByGroupID = {appConst.groupExtractionControlUnitPins: 'res:/UI/Texture/Planet/icons/ecu.png', 51 appConst.groupProcessPins: 'res:/UI/Texture/Planet/icons/processor.png', 52 appConst.groupStoragePins: 'res:/UI/Texture/Planet/icons/storage.png', 53 appConst.groupSpaceportPins: 'res:/UI/Texture/Planet/icons/spaceport.png', 54 appConst.groupPlanetaryLinks: 'res:/UI/Texture/Planet/icons/link.png', 55 appConst.groupCommandPins: 'res:/UI/Texture/Planet/icons/commandCenter.png'} 56 backgroundTexturePath = {appConst.typePlanetEarthlike: 'res:/UI/Texture/Planet/entryBackground/temperate.png', 57 appConst.typePlanetIce: 'res:/UI/Texture/Planet/entryBackground/ice.png', 58 appConst.typePlanetGas: 'res:/UI/Texture/Planet/entryBackground/gas.png', 59 appConst.typePlanetPlasma: 'res:/UI/Texture/Planet/entryBackground/plasma.png', 60 appConst.typePlanetOcean: 'res:/UI/Texture/Planet/entryBackground/oceanic.png', 61 appConst.typePlanetLava: 'res:/UI/Texture/Planet/entryBackground/lava.png', 62 appConst.typePlanetSandstorm: 'res:/UI/Texture/Planet/entryBackground/barren.png', 63 appConst.typePlanetThunderstorm: 'res:/UI/Texture/Planet/entryBackground/storm.png'} 64 65 def IsSerenity(): 66 return boot.region == 'optic'