def _set_to_vanilla_gender_chosen(): if CommonGenderUtils.is_male(self._sim_info): CommonSimGenderOptionUtils.update_gender_options_to_vanilla_male( self._sim_info) else: CommonSimGenderOptionUtils.update_gender_options_to_vanilla_female( self._sim_info) _reopen()
def _set_all_to_vanilla_gender_options_chosen(): for sim_info in CommonSimUtils.get_instanced_sim_info_for_all_sims_generator( ): if CommonGenderUtils.is_male(sim_info): CommonSimGenderOptionUtils.update_gender_options_to_vanilla_male( sim_info) else: CommonSimGenderOptionUtils.update_gender_options_to_vanilla_female( sim_info) _reopen()
def get_default_preferred_genders(sim_info: SimInfo) -> Tuple[Gender]: """get_default_preferred_genders(sim_info) Retrieve a collection of default gender preferences. .. note:: By default Male Sims prefer Female Sims and Female Sims prefer Male Sims. :param sim_info: An instance of a Sim. :type sim_info: SimInfo :return: A collection of preferred Genders. :rtype: Tuple[Gender] """ if CommonGenderUtils.is_male(sim_info): return Gender.FEMALE, return Gender.MALE,
def get_gender(sim_info: SimInfo) -> 'CommonGender': """get_gender(sim_info) Retrieve the CommonGender of a Sim. :param sim_info: An instance of a Sim. :type sim_info: SimInfo :return: The CommonGender that represents what gender a Sim is or CommonGender.INVALID if their gender cannot be determined. :rtype: CommonGender """ from sims4communitylib.utils.sims.common_gender_utils import CommonGenderUtils if CommonGenderUtils.is_male(sim_info): return CommonGender.MALE elif CommonGenderUtils.is_female(sim_info): return CommonGender.FEMALE return CommonGender.INVALID
def has_breasts(sim_info: SimInfo) -> bool: """has_breasts(sim_info) Determine if a Sim has breasts. .. note:: This will True if breasts are being forced on the Sim. :param sim_info: An instance of a Sim. :type sim_info: SimInfo :return: True, if the Sim has breasts. False, if not. :rtype: bool """ if CommonGenderUtils.is_female( sim_info) and not CommonTraitUtils.has_trait( sim_info, CommonTraitId.BREASTS_FORCE_OFF): return True if CommonGenderUtils.is_male(sim_info) and CommonTraitUtils.has_trait( sim_info, CommonTraitId.BREASTS_FORCE_ON): return True return False
def get_body_frame(sim_info: SimInfo) -> 'CommonBodyFrame': """get_body_frame(sim_info) Retrieve the CommonBodyFrame of a sim. :param sim_info: An instance of a Sim. :type sim_info: SimInfo :return: The body frame of the Sim or CommonBodyFrame.INVALID if their current body frame cannot be determined. :rtype: CommonBodyFrame """ from sims4communitylib.utils.sims.common_sim_gender_option_utils import CommonSimGenderOptionUtils if CommonSpeciesUtils.is_pet(sim_info): if CommonGenderUtils.is_male(sim_info): return CommonBodyFrame.MASCULINE if CommonGenderUtils.is_female(sim_info): return CommonBodyFrame.FEMININE return CommonBodyFrame.INVALID if CommonSimGenderOptionUtils.has_masculine_frame(sim_info): return CommonBodyFrame.MASCULINE if CommonSimGenderOptionUtils.has_feminine_frame(sim_info): return CommonBodyFrame.FEMININE return CommonBodyFrame.INVALID
def update_has_breasts(sim_info: SimInfo, has_breasts: bool) -> bool: """update_has_breasts(sim_info, has_breasts) Give or Take Away the breasts of a Sim. .. note:: Will only update Human Sims. :param sim_info: An instance of a Sim. :type sim_info: SimInfo :param has_breasts: If True, the Sim will be given breasts.\ If False, the Sim will not longer have breasts. :type has_breasts: bool :return: True, if the state of a Sim having breasts or not was changed. False, if not. :rtype: bool """ if sim_info is None: return False from sims4communitylib.events.sim.common_sim_event_dispatcher import CommonSimEventDispatcherService CommonTraitUtils.remove_trait(sim_info, CommonTraitId.BREASTS_FORCE_OFF) CommonTraitUtils.remove_trait(sim_info, CommonTraitId.BREASTS_FORCE_ON) if has_breasts: if CommonGenderUtils.is_male(sim_info): CommonTraitUtils.add_trait(sim_info, CommonTraitId.BREASTS_FORCE_ON) CommonSimEventDispatcherService( )._on_sim_change_gender_options_breasts(sim_info) return True else: if CommonGenderUtils.is_female(sim_info): CommonTraitUtils.add_trait(sim_info, CommonTraitId.BREASTS_FORCE_OFF) CommonSimEventDispatcherService( )._on_sim_change_gender_options_breasts(sim_info) return True return False
def _update_gender_options(self, sim_info: SimInfo): update_outfits = False if self._setting_utils.force_all_sims_to_male( ) and not CommonGenderUtils.is_male(sim_info): CommonGenderUtils.swap_gender(sim_info, update_gender_options=False) update_outfits = True elif self._setting_utils.force_all_sims_to_female( ) and not CommonGenderUtils.is_female(sim_info): CommonGenderUtils.swap_gender(sim_info, update_gender_options=False) update_outfits = True if CommonGenderUtils.is_male(sim_info): if CommonSpeciesUtils.is_pet(sim_info): if self._setting_utils.all_male_options.can_reproduce( ) and not CommonSimGenderOptionUtils.can_reproduce(sim_info): CommonSimGenderOptionUtils.update_can_reproduce( sim_info, True) if self._setting_utils.all_male_options.cannot_reproduce( ) and not CommonSimGenderOptionUtils.can_not_reproduce( sim_info): CommonSimGenderOptionUtils.update_can_reproduce( sim_info, False) elif CommonSpeciesUtils.is_human(sim_info): if self._setting_utils.all_male_options.use_toilet_standing( ) and not CommonSimGenderOptionUtils.uses_toilet_standing( sim_info): CommonSimGenderOptionUtils.update_toilet_usage( sim_info, True) update_outfits = True if self._setting_utils.all_male_options.use_toilet_sitting( ) and not CommonSimGenderOptionUtils.uses_toilet_sitting( sim_info): CommonSimGenderOptionUtils.update_toilet_usage( sim_info, False) update_outfits = True if self._setting_utils.all_male_options.prefer_menswear( ) and not CommonSimGenderOptionUtils.prefers_menswear( sim_info): CommonSimGenderOptionUtils.update_clothing_preference( sim_info, True) if self._setting_utils.all_male_options.prefer_womenswear( ) and not CommonSimGenderOptionUtils.prefers_womenswear( sim_info): CommonSimGenderOptionUtils.update_clothing_preference( sim_info, False) if self._setting_utils.all_male_options.force_masculine_body_frame( ) and not CommonSimGenderOptionUtils.has_masculine_frame( sim_info): CommonSimGenderOptionUtils.update_body_frame( sim_info, True) if self._setting_utils.all_male_options.force_feminine_body_frame( ) and not CommonSimGenderOptionUtils.has_feminine_frame( sim_info): CommonSimGenderOptionUtils.update_body_frame( sim_info, False) if self._setting_utils.all_male_options.can_impregnate( ) and not CommonSimGenderOptionUtils.can_impregnate(sim_info): CommonSimGenderOptionUtils.update_can_impregnate( sim_info, True) if self._setting_utils.all_male_options.cannot_impregnate( ) and not CommonSimGenderOptionUtils.can_not_impregnate( sim_info): CommonSimGenderOptionUtils.update_can_impregnate( sim_info, False) if self._setting_utils.all_male_options.can_be_impregnated( ) and not CommonSimGenderOptionUtils.can_be_impregnated( sim_info): CommonSimGenderOptionUtils.update_can_be_impregnated( sim_info, True) if self._setting_utils.all_male_options.cannot_be_impregnated( ) and not CommonSimGenderOptionUtils.can_not_be_impregnated( sim_info): CommonSimGenderOptionUtils.update_can_be_impregnated( sim_info, False) if self._setting_utils.all_male_options.force_breasts_on( ) and not CommonSimGenderOptionUtils.has_breasts(sim_info): CommonSimGenderOptionUtils.update_has_breasts( sim_info, True) update_outfits = True if self._setting_utils.all_male_options.force_breasts_off( ) and CommonSimGenderOptionUtils.has_breasts(sim_info): CommonSimGenderOptionUtils.update_has_breasts( sim_info, False) update_outfits = True elif CommonGenderUtils.is_female(sim_info): if CommonSpeciesUtils.is_pet(sim_info): if self._setting_utils.all_female_options.can_reproduce( ) and not CommonSimGenderOptionUtils.can_reproduce(sim_info): CommonSimGenderOptionUtils.update_can_reproduce( sim_info, True) if self._setting_utils.all_female_options.cannot_reproduce( ) and not CommonSimGenderOptionUtils.can_not_reproduce( sim_info): CommonSimGenderOptionUtils.update_can_reproduce( sim_info, False) elif CommonSpeciesUtils.is_human(sim_info): if self._setting_utils.all_female_options.use_toilet_standing( ) and not CommonSimGenderOptionUtils.uses_toilet_standing( sim_info): CommonSimGenderOptionUtils.update_toilet_usage( sim_info, True) update_outfits = True if self._setting_utils.all_female_options.use_toilet_sitting( ) and not CommonSimGenderOptionUtils.uses_toilet_sitting( sim_info): CommonSimGenderOptionUtils.update_toilet_usage( sim_info, False) update_outfits = True if self._setting_utils.all_female_options.prefer_menswear( ) and not CommonSimGenderOptionUtils.prefers_menswear( sim_info): CommonSimGenderOptionUtils.update_clothing_preference( sim_info, True) if self._setting_utils.all_female_options.prefer_womenswear( ) and not CommonSimGenderOptionUtils.prefers_womenswear( sim_info): CommonSimGenderOptionUtils.update_clothing_preference( sim_info, False) if self._setting_utils.all_female_options.force_masculine_body_frame( ) and not CommonSimGenderOptionUtils.has_masculine_frame( sim_info): CommonSimGenderOptionUtils.update_body_frame( sim_info, True) if self._setting_utils.all_female_options.force_feminine_body_frame( ) and not CommonSimGenderOptionUtils.has_feminine_frame( sim_info): CommonSimGenderOptionUtils.update_body_frame( sim_info, False) if self._setting_utils.all_female_options.can_impregnate( ) and not CommonSimGenderOptionUtils.can_impregnate(sim_info): CommonSimGenderOptionUtils.update_can_impregnate( sim_info, True) if self._setting_utils.all_female_options.cannot_impregnate( ) and not CommonSimGenderOptionUtils.can_not_impregnate( sim_info): CommonSimGenderOptionUtils.update_can_impregnate( sim_info, False) if self._setting_utils.all_female_options.can_be_impregnated( ) and not CommonSimGenderOptionUtils.can_be_impregnated( sim_info): CommonSimGenderOptionUtils.update_can_be_impregnated( sim_info, True) if self._setting_utils.all_female_options.cannot_be_impregnated( ) and not CommonSimGenderOptionUtils.can_not_be_impregnated( sim_info): CommonSimGenderOptionUtils.update_can_be_impregnated( sim_info, False) if self._setting_utils.all_female_options.force_breasts_on( ) and not CommonSimGenderOptionUtils.has_breasts(sim_info): CommonSimGenderOptionUtils.update_has_breasts( sim_info, True) update_outfits = True if self._setting_utils.all_female_options.force_breasts_off( ) and CommonSimGenderOptionUtils.has_breasts(sim_info): CommonSimGenderOptionUtils.update_has_breasts( sim_info, False) update_outfits = True if update_outfits: CommonOutfitUtils.update_outfits(sim_info)