def _on_sim_change_gender(self, sim_info: SimInfo) -> bool:
     from sims4communitylib.utils.sims.common_gender_utils import CommonGenderUtils
     new_gender = CommonGenderUtils.get_gender(sim_info)
     if CommonGenderUtils.is_male_gender(new_gender):
         # If they are now Male, it means they used to be Female.
         old_gender = Gender.FEMALE
     else:
         # If they are now Female, it means they used to be Male.
         old_gender = Gender.MALE
     return CommonEventRegistry.get().dispatch(S4CLSimChangedGenderEvent(sim_info, old_gender, new_gender))
 def get_tags(self) -> Tuple[OCCASPartQueryTag]:
     result: Tuple[OCCASPartQueryTag] = (
         OCCASPartQueryTag(OCCASPartTagType.AGE, CommonAgeUtils.get_age(self._sim_info)),
         OCCASPartQueryTag(OCCASPartTagType.GENDER, CommonGenderUtils.get_gender(self._sim_info)),
         OCCASPartQueryTag(OCCASPartTagType.SPECIES, CommonSpecies.get_species(self._sim_info)),
     )
     return result
    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 __str__(self) -> str:
     return '{}: {}, Age: {}, Gender: {}, Species: {}'.format(
         self.__class__.__name__,
         CommonSimNameUtils.get_full_name(self._sim_info),
         CommonAgeUtils.get_age(self._sim_info),
         CommonGenderUtils.get_gender(self._sim_info),
         CommonSpecies.get_species(self._sim_info)
     )
Esempio n. 5
0
 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 get_tags(self) -> Tuple[CSFSliderQueryTag]:
     result: Tuple[CSFSliderQueryTag] = (
         CSFSliderQueryTag(CSFSliderTagType.GENDER,
                           CommonGenderUtils.get_gender(self._sim_info)),
         CSFSliderQueryTag(CSFSliderTagType.AGE,
                           CommonAgeUtils.get_age(self._sim_info)),
         CSFSliderQueryTag(CSFSliderTagType.SPECIES,
                           CommonSpecies.get_species(self._sim_info)),
     )
     return result
Esempio n. 7
0
 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 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
Esempio n. 9
0
    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 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_in_labor_buff(sim_info: SimInfo) -> Union[int, CommonBuffId]:
        """get_in_labor_buff(sim_info)

        Retrieve an In Labor buff appropriate for causing the Sim to go into labor (Give Birth).

        :param sim_info: An instance of a Sim.
        :type sim_info: SimInfo
        :return: The decimal identifier of a Buff that will cause the specified Sim to go into labor. If no appropriate Buff is found, -1 will be returned.
        :rtype: Union[int, CommonBuffId]
        """
        from sims4communitylib.utils.sims.common_gender_utils import CommonGenderUtils
        sim_name = CommonSimNameUtils.get_full_name(sim_info)
        log.debug(
            'Locating appropriate Buff for inducing labor in \'{}\'.'.format(
                sim_name))
        is_female = CommonGenderUtils.is_female(sim_info)
        if CommonSpeciesUtils.is_human(sim_info):
            log.debug('\'{}\' is Human.'.format(sim_name))
            if is_female:
                log.debug('\'{}\' is Female.'.format(sim_name))
                return CommonBuffId.PREGNANCY_IN_LABOR
            else:
                log.debug('\'{}\' is Male.'.format(sim_name))
                return CommonBuffId.PREGNANCY_IN_LABOR_MALE
        elif CommonSpeciesUtils.is_dog(sim_info):
            log.debug('\'{}\' is a Dog.'.format(sim_name))
            if is_female:
                log.debug('\'{}\' is Female.'.format(sim_name))
                return CommonBuffId.PREGNANCY_IN_LABOR_PET_DOG
        elif CommonSpeciesUtils.is_cat(sim_info):
            log.debug('\'{}\' is a Cat.'.format(sim_name))
            if is_female:
                log.debug('\'{}\' is Female.'.format(sim_name))
                return CommonBuffId.PREGNANCY_IN_LABOR_PET_CAT
        log.debug(
            'No appropriate Buff located to induce labor in \'{}\'.'.format(
                sim_name))
        return -1
    def has_preference_for(sim_info: SimInfo,
                           target_sim_info: SimInfo,
                           like_threshold: int = None,
                           love_threshold: int = None) -> bool:
        """has_preference_for(sim_info, target_sim_info, like_threshold=None, love_threshold=None)

        Determine if a Sim has a preference for another Sim.

        :param sim_info: An instance of a Sim.
        :type sim_info: SimInfo
        :param target_sim_info: An instance of a Sim.
        :type target_sim_info: SimInfo
        :param like_threshold: A value indicating a low amount of preference. Default is CommonSimGenderPreferenceUtils.LOW_PREFERENCE_THRESHOLD.
        :type like_threshold: int, optional
        :param love_threshold: A value indicating a high amount of preference. Default is CommonSimGenderPreferenceUtils.HIGH_PREFERENCE_THRESHOLD.
        :type love_threshold: int, optional
        :return: True, if the Sim has a preference for the Gender. False, if not.
        :rtype: bool
        """
        return CommonSimGenderPreferenceUtils.has_preference_for_gender(
            sim_info,
            CommonGenderUtils.get_gender(target_sim_info),
            like_threshold=like_threshold,
            love_threshold=love_threshold)
Esempio n. 14
0
 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)
Esempio n. 15
0
    def _settings_human(self, on_close: Callable[[], Any] = None) -> None:
        def _on_close() -> None:
            if on_close is not None:
                on_close()

        def _reopen():
            self._settings_human(on_close=on_close)

        option_dialog = CommonChooseObjectOptionDialog(
            CommonStringId.CUSTOM_GENDER_SETTINGS,
            CGSStringId.CGS_CUSTOM_GENDER_SETTINGS_DESCRIPTION,
            mod_identity=self.mod_identity,
            on_close=_on_close)

        option_dialog.add_option(
            CommonDialogActionOption(
                CommonDialogOptionContext(
                    CGSStringId.GLOBAL_SETTINGS_NAME,
                    CGSStringId.GLOBAL_SETTINGS_DESCRIPTION),
                on_chosen=CGSGlobalSettingsDialog(self._sim_info,
                                                  on_close=_reopen).open))

        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()

        option_dialog.add_option(
            CommonDialogActionOption(CommonDialogOptionContext(
                CGSStringId.CGS_SET_TO_VANILLA_GENDER_OPTIONS_NAME,
                CGSStringId.CGS_SET_TO_VANILLA_GENDER_OPTIONS_DESCRIPTION,
                icon=CommonIconUtils.load_arrow_right_icon()),
                                     on_chosen=_set_to_vanilla_gender_chosen))

        def _on_gender_chosen():
            CommonGenderUtils.swap_gender(self._sim_info,
                                          update_gender_options=False)
            _reopen()

        current_gender_string = CGSStringId.MALE
        if CommonGenderUtils.is_female(self._sim_info):
            current_gender_string = CGSStringId.FEMALE

        option_dialog.add_option(
            CommonDialogActionOption(CommonDialogOptionContext(
                CGSStringId.CGS_SWAP_GENDER_NAME,
                CGSStringId.CGS_SWAP_GENDER_DESCRIPTION,
                title_tokens=(current_gender_string, ),
                icon=CommonIconUtils.load_arrow_right_icon()),
                                     on_chosen=_on_gender_chosen))

        def _on_physical_frame_chosen():
            value = not CommonSimGenderOptionUtils.has_masculine_frame(
                self._sim_info)
            CommonSimGenderOptionUtils.update_body_frame(self._sim_info, value)
            _reopen()

        current_body_frame = CommonStringId.FEMININE
        if CommonSimGenderOptionUtils.has_masculine_frame(self._sim_info):
            current_body_frame = CommonStringId.MASCULINE

        option_dialog.add_option(
            CommonDialogActionOption(CommonDialogOptionContext(
                CommonStringId.PHYSICAL_FRAME,
                CGSStringId.CGS_CURRENT,
                description_tokens=(current_body_frame, ),
                icon=CommonIconUtils.load_arrow_right_icon()),
                                     on_chosen=_on_physical_frame_chosen))

        current_clothing = CommonStringId.FEMININE
        if CommonSimGenderOptionUtils.prefers_menswear(self._sim_info):
            current_clothing = CommonStringId.MASCULINE

        def _on_clothing_preference_chosen():
            value = not CommonSimGenderOptionUtils.prefers_menswear(
                self._sim_info)
            CommonSimGenderOptionUtils.update_clothing_preference(
                self._sim_info, value)
            _reopen()

        option_dialog.add_option(
            CommonDialogActionOption(CommonDialogOptionContext(
                CommonStringId.CLOTHING_PREFERENCE,
                CGSStringId.CGS_CURRENT,
                description_tokens=(current_clothing, ),
                icon=CommonIconUtils.load_arrow_right_icon()),
                                     on_chosen=_on_clothing_preference_chosen))

        def _on_toggle_breasts_chosen(option_identifier: str,
                                      has_breasts: bool):
            self.log.format(option_identifier=option_identifier,
                            has_breasts=has_breasts)

            def _on_acknowledged(_):
                _reopen()

            CommonSimGenderOptionUtils.update_has_breasts(
                self._sim_info, has_breasts)
            CommonOkDialog(
                CGSStringId.CGS_SETTING_SAVE_RELOAD_ALERT_NAME,
                CGSStringId.CGS_SETTING_SAVE_RELOAD_ALERT_DESCRIPTION).show(
                    on_acknowledged=_on_acknowledged)

        has_vanilla_breasts = False
        if CommonGenderUtils.is_female(self._sim_info):
            has_vanilla_breasts = not CommonTraitUtils.has_trait(
                self._sim_info, CommonTraitId.BREASTS_FORCE_OFF)

        option_dialog.add_option(
            CommonDialogToggleOption(
                'ToggleBreasts',
                CommonTraitUtils.has_trait(self._sim_info,
                                           CommonTraitId.BREASTS_FORCE_ON)
                or has_vanilla_breasts,
                CommonDialogOptionContext(
                    CGSStringId.CGS_TOGGLE_BREASTS_NAME,
                    CGSStringId.CGS_TOGGLE_BREASTS_DESCRIPTION),
                on_chosen=_on_toggle_breasts_chosen))

        option_dialog.add_option(
            CommonDialogActionOption(CommonDialogOptionContext(
                CGSStringId.CGS_PREGNANCY_OPTIONS_NAME,
                CGSStringId.CGS_PREGNANCY_OPTIONS_DESCRIPTION,
                icon=CommonIconUtils.load_arrow_navigate_into_icon()),
                                     on_chosen=lambda *_, **__: self.
                                     _pregnancy_options(on_close=_reopen)))

        title = CGSStringId.CGS_TOGGLE_CAN_USE_TOILET_STANDING_NAME
        if CommonSimGenderOptionUtils.uses_toilet_standing(self._sim_info):
            title = CommonLocalizationUtils.create_localized_string(
                title, text_color=CommonLocalizedStringColor.GREEN)
            icon = CommonIconUtils.load_checked_square_icon()
        else:
            icon = CommonIconUtils.load_unchecked_square_icon()
        text = CGSStringId.CGS_TOGGLE_CAN_USE_TOILET_STANDING_DESCRIPTION

        def _on_toilet_usage_chosen():
            value = not CommonSimGenderOptionUtils.uses_toilet_standing(
                self._sim_info)
            CommonSimGenderOptionUtils.update_toilet_usage(
                self._sim_info, value)
            _reopen()

        option_dialog.add_option(
            CommonDialogActionOption(CommonDialogOptionContext(title,
                                                               text,
                                                               icon=icon),
                                     on_chosen=_on_toilet_usage_chosen))

        option_dialog.show(sim_info=self._sim_info)
Esempio n. 16
0
 def _on_gender_chosen():
     CommonGenderUtils.swap_gender(self._sim_info,
                                   update_gender_options=False)
     _reopen()