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

fitting.py (1392B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\cosmetics\client\structures\fitting.py
      2 from cosmetics.common.structures.const import StructurePaintSlot
      3 from cosmetics.common.structures.fitting import StructurePaintwork
      4 from eveProto.generated.eve_public.cosmetic.structure.paintwork.paintwork_pb2 import SlotConfiguration, Slot
      5 
      6 def create_structure_paintwork_from_proto_slot_config(slot_config):
      7     paintwork = StructurePaintwork()
      8     if slot_config.primary.HasField('paint'):
      9         paintwork.set_slot(StructurePaintSlot.PRIMARY, slot_config.primary.paint)
     10     if slot_config.secondary.HasField('paint'):
     11         paintwork.set_slot(StructurePaintSlot.SECONDARY, slot_config.secondary.paint)
     12     if slot_config.detailing.HasField('paint'):
     13         paintwork.set_slot(StructurePaintSlot.DETAILING, slot_config.detailing.paint)
     14     return paintwork
     15 
     16 
     17 def create_proto_slot_config_from_structure_paintwork(structure_paintwork):
     18 
     19     def _make_slot(slot_index):
     20         slot_value = structure_paintwork.get_slot(slot_index)
     21         if not slot_value:
     22             return Slot(empty=True)
     23         else:
     24             return Slot(paint=slot_value)
     25 
     26     slot_config = SlotConfiguration(primary=_make_slot(StructurePaintSlot.PRIMARY), secondary=_make_slot(StructurePaintSlot.SECONDARY), detailing=_make_slot(StructurePaintSlot.DETAILING))
     27     return slot_config