コード例 #1
0
ファイル: lot.py プロジェクト: johndpope/sims4-ai-engine
 def send_lot_display_info(self):
     persistence = services.get_persistence_service()
     lot_owner_data = persistence.get_lot_proto_buff(self.lot_id)
     lot_name = None
     if lot_owner_data is not None:
         zone_data = persistence.get_zone_proto_buff(
             lot_owner_data.zone_instance_id)
         if zone_data is not None:
             lot_name = zone_data.name
     household = self.get_household()
     if household is not None:
         owner_household_name = household.name
     else:
         owner_household_name = None
     msg = UI_pb2.LotDisplayInfo()
     if lot_name is not None:
         msg.lot_name = lot_name
     if owner_household_name is not None:
         msg.household_name = owner_household_name
     op = distributor.shared_messages.create_message_op(
         msg, Consts_pb2.MSG_UI_LOT_DISPLAY_INFO)
     Distributor.instance().add_op_with_no_owner(op)
コード例 #2
0
 def send_lot_display_info(self):
     lot_name = self.get_lot_name()
     household = self.get_household()
     if household is not None:
         owner_household_name = household.name
     else:
         owner_household_name = None
     msg = UI_pb2.LotDisplayInfo()
     if lot_name is not None:
         msg.lot_name = lot_name
     if owner_household_name is not None:
         msg.household_name = owner_household_name
     zone_modifier_display_infos = services.get_zone_modifier_service(
     ).get_zone_modifier_display_infos(self.zone_id)
     for display_info in zone_modifier_display_infos:
         msg.icon_infos.append(
             create_icon_info_msg(
                 IconInfoData(
                     icon_resource=display_info.zone_modifier_icon)))
     op = distributor.shared_messages.create_message_op(
         msg, Consts_pb2.MSG_UI_LOT_DISPLAY_INFO)
     Distributor.instance().add_op_with_no_owner(op)