Ejemplo n.º 1
0
def _common_testing_show_choose_item_dialog(_connection: int=None):
    output = sims4.commands.CheatOutput(_connection)
    output('Showing test choose item dialog.')

    def _item_chosen(chosen_item: str, result: CommonChooseItemResult):
        output('Item chosen {} with result: {}.'.format(pformat(chosen_item), pformat(result)))

    try:
        # LocalizedStrings within other LocalizedStrings
        title_tokens = (CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_SOME_TEXT_FOR_TESTING, text_color=CommonLocalizedStringColor.GREEN),)
        description_tokens = (CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_TEXT_WITH_SIM_FIRST_AND_LAST_NAME, tokens=(CommonSimUtils.get_active_sim_info(),), text_color=CommonLocalizedStringColor.BLUE),)
        from sims4communitylib.utils.common_icon_utils import CommonIconUtils
        options = [ObjectPickerRow(option_id=1, name=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_SOME_TEXT_FOR_TESTING),
                                   row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_ONE),
                                   row_tooltip=None,
                                   icon=CommonIconUtils.load_checked_square_icon(),
                                   tag='Value 1'),
                   ObjectPickerRow(option_id=2, name=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_SOME_TEXT_FOR_TESTING),
                                   row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_TWO),
                                   row_tooltip=None,
                                   icon=CommonIconUtils.load_arrow_navigate_into_icon(),
                                   tag='Value 2')]
        dialog = CommonChooseItemDialog(CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
                                        CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
                                        tuple(options),
                                        title_tokens=title_tokens,
                                        description_tokens=description_tokens)
        dialog.show(on_item_chosen=_item_chosen)
    except Exception as ex:
        log.format_error_with_message('Failed to show dialog', exception=ex)
        output('Failed to show dialog, please locate your exception log file.')
    output('Done showing.')
Ejemplo n.º 2
0
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     for buff_type in cls._buff_type_selection_gen(target):
         is_enable = True
         if cls.is_add:
             is_enable = buff_type.can_add(target.sim_info)
         row = ObjectPickerRow(is_enable=is_enable, name=buff_type.buff_name, icon=buff_type.icon, row_description=buff_type.buff_description, tag=buff_type)
         yield row
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     for bit in cls._bit_selection_gen(target, context):
         row = ObjectPickerRow(name=bit.display_name,
                               icon=bit.icon,
                               row_description=bit.bit_description,
                               tag=bit)
         yield row
Ejemplo n.º 4
0
 def create_picker_row(cls, description, owner=None, **kwargs):
     row_tooltip = None if cls.display_description is None else lambda *_: cls.display_description(
         owner)
     row = ObjectPickerRow(name=cls.display_name(owner),
                           icon=cls.display_icon,
                           row_description=description,
                           row_tooltip=row_tooltip)
     return row
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     for career in cls._valid_careers_gen(context.sim):
         track = career.current_track_tuning
         row = ObjectPickerRow(name=track.career_name(context.sim),
                               icon=track.icon,
                               row_description=track.career_description,
                               tag=career)
         yield row
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     for career in target.sim_info.career_tracker.careers.values():
         if not career.can_change_level(demote=cls.demote):
             pass
         track = career.current_track_tuning
         row = ObjectPickerRow(name=track.career_name(target.sim_info),
                               icon=track.icon,
                               row_description=track.career_description,
                               tag=career)
         yield row
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     inst_or_cls = inst if inst is not None else cls
     selected_logo = None
     tracker = inst_or_cls.sim.sim_info.lifestyle_brand_tracker
     selected_logo = tracker.logo
     for logo in inst_or_cls.logos:
         yield ObjectPickerRow(
             icon_info=IconInfoData(icon_resource=logo.key),
             tag=logo.key,
             is_selected=selected_logo == logo.key)
Ejemplo n.º 8
0
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     inst_or_cls = inst if inst is not None else cls
     for career in inst_or_cls._valid_careers_gen(target, context,
                                                  **kwargs):
         track = career.current_track_tuning
         row = ObjectPickerRow(name=track.get_career_name(context.sim),
                               icon=track.icon,
                               row_description=track.get_career_description(
                                   context.sim),
                               tag=career)
         yield row
Ejemplo n.º 9
0
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     skill_manager = services.get_instance_manager(
         sims4.resources.Types.STATISTIC)
     for skill in skill_manager.get_ordered_types(only_subclasses_of=Skill):
         if not skill.can_add(target):
             continue
         row = ObjectPickerRow(name=skill.stat_name,
                               icon=skill.icon,
                               row_description=skill.skill_description,
                               tag=skill)
         yield row
Ejemplo n.º 10
0
 def get_object_picker_row(self):
     return ObjectPickerRow(
         count=0,
         option_id=self.get_option_id(),
         name=self.get_name(),
         row_description=self.get_description(),
         row_tooltip=None if self.skip_tooltip else
         TunableLocalizedStringFactory._Wrapper(
             self.get_description().hash),
         icon=self.get_icon(),
         tag=self.get_tag())
Ejemplo n.º 11
0
 def create_row(cls, inst, row_obj, context=DEFAULT, target=DEFAULT):
     inst_or_cls = inst if inst is not None else cls
     icon_info = IconInfoData(obj_def_id=row_obj.id,
                              obj_geo_hash=row_obj.thumbnail_geo_state_hash,
                              obj_material_hash=row_obj.material_variant)
     row = ObjectPickerRow(
         object_id=row_obj.id,
         def_id=row_obj.id,
         icon_info=icon_info,
         tag=row_obj,
         name=LocalizationHelperTuning.get_object_name(row_obj))
     inst_or_cls._test_continuation(row, context=context, target=target)
     return row
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     inst_or_cls = inst if inst is not None else cls
     for state_value in inst_or_cls._get_valid_state_values_gen():
         if state_value._display_data is not None:
             state_name = state_value.display_name or LocalizationHelperTuning.get_raw_text(
                 state_value.__name__)
             row_tooltip = None if state_value.display_description is None else lambda *_, tooltip=state_value.display_description: tooltip
             yield ObjectPickerRow(
                 name=state_name,
                 row_description=state_value.display_description,
                 icon=state_value.display_icon,
                 tag=state_value,
                 row_tooltip=row_tooltip)
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     inst_or_cls = inst if inst is not None else cls
     selected_target_market = None
     tracker = inst_or_cls.sim.sim_info.lifestyle_brand_tracker
     selected_target_market = tracker.target_market
     for target_market in inst_or_cls.target_markets:
         name = target_market.name
         yield ObjectPickerRow(
             name=name,
             icon_info=IconInfoData(icon_resource=target_market.icon.key),
             tag=target_market.target_type,
             is_selected=selected_target_market ==
             target_market.target_type)
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     inst_or_cls = inst if inst is not None else cls
     for stat in inst_or_cls._get_object_stats_gen(target):
         stat_name = cls._get_displayable_stat_name(cls, stat)
         if stat_name is not None:
             stat_tracker = target.get_tracker(stat)
             stat_value = inst_or_cls.stat_value_text(
                 stat_tracker.get_value(stat.stat_type))
             stat_icon = inst_or_cls._get_stat_icon(stat.stat_type)
             yield ObjectPickerRow(name=stat_name,
                                   row_description=stat_value,
                                   tag=stat.stat_type,
                                   icon=stat_icon)
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     inst_or_cls = inst if inst is not None else cls
     selected_product = None
     tracker = inst_or_cls.sim.sim_info.lifestyle_brand_tracker
     selected_product = tracker.product_choice
     for product in inst_or_cls.products:
         name = product.name
         description = product.description_text
         yield ObjectPickerRow(
             name=name,
             row_description=description,
             icon_info=IconInfoData(icon_resource=product.icon.key),
             tag=product.product_type,
             is_selected=selected_product == product.product_type)
Ejemplo n.º 16
0
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     for item in cls._items_gen():
         display_name = LocalizationHelperTuning.get_raw_text(
             str(item.__name__)
         ) if item.display_name is None else item.display_name
         row_tooltip = None if item.display_tooltip is None else lambda *_, tooltip=item.display_tooltip: tooltip
         row = ObjectPickerRow(name=display_name,
                               icon=item.display_icon,
                               def_id=item.decoration_resource,
                               row_tooltip=row_tooltip,
                               row_description=item.display_description,
                               tag_list=item.picker_categories,
                               tag=item,
                               use_catalog_product_thumbnails=False)
         yield row
    def as_row(self, option_id: int) -> ObjectPickerRow:
        """as_row(option_id)

        Convert the option into a picker row.

        :param option_id: The index of the option.
        :type option_id: int
        :return: The option as a Picker Row
        :rtype: ObjectPickerRow
        """
        return ObjectPickerRow(option_id=option_id,
                               name=self.title,
                               row_description=self.description,
                               row_tooltip=self.tooltip,
                               icon=self.icon,
                               tag=self)
Ejemplo n.º 18
0
 def create_row(cls, inst, row_obj, context=DEFAULT, target=DEFAULT):
     inst_or_cls = inst if inst is not None else cls
     is_disabled = inst_or_cls._selected_definition_id is not None and row_obj.id == inst_or_cls._selected_definition_id.id
     icon_info = IconInfoData(obj_def_id=row_obj.id,
                              obj_geo_hash=row_obj.thumbnail_geo_state_hash,
                              obj_material_hash=row_obj.material_variant)
     row = ObjectPickerRow(
         object_id=row_obj.id,
         def_id=row_obj.id,
         icon_info=icon_info,
         tag=row_obj,
         is_enable=not is_disabled,
         row_tooltip=inst_or_cls.disabled_toolip if is_disabled else None,
         name=LocalizationHelperTuning.get_object_name(row_obj))
     inst_or_cls._test_continuation(row, context=context, target=target)
     return row
Ejemplo n.º 19
0
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     trait_tracker = target.sim_info.trait_tracker
     for trait in cls._trait_selection_gen(target):
         if trait.display_name:
             display_name = trait.display_name(target)
             is_enabled = True
             row_tooltip = None
             is_enabled = not trait_tracker.has_trait(trait)
             row_tooltip = None if is_enabled or cls.already_equipped_tooltip is None else lambda *_: cls.already_equipped_tooltip(
                 target)
             row = ObjectPickerRow(
                 name=display_name,
                 row_description=trait.trait_description(target),
                 icon=trait.icon,
                 tag=trait,
                 is_enable=is_enabled,
                 row_tooltip=row_tooltip)
             yield row
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     trait_tracker = target.sim_info.trait_tracker
     for trait in cls._trait_selection_gen(target):
         is_selected = trait_tracker.has_trait(trait)
         if not not is_selected and inst is not None:
             inst._equipped_traits.add(trait)
         is_enabled = True
         is_enabled = trait_tracker.can_add_trait(trait)
         row_tooltip = None
         row_tooltip = cls.disabled_row_tooltip
         row = ObjectPickerRow(
             name=trait.display_name(target),
             row_description=trait.trait_description(target),
             icon=trait.icon,
             tag=trait,
             is_selected=is_selected,
             is_enable=is_enabled,
             row_tooltip=row_tooltip)
         yield row
Ejemplo n.º 21
0
 def create_picker_row(cls,
                       description=None,
                       scheduled_time=None,
                       owner=None,
                       gig_customer=None,
                       enabled=True,
                       **kwargs):
     tip = cls.tip
     description = cls.gig_picker_localization_format(
         cls.gig_pay.lower_bound, cls.gig_pay.upper_bound, scheduled_time,
         tip.tip_title(), tip.tip_text(), gig_customer)
     if not enabled and cls.disabled_tooltip is not None:
         row_tooltip = lambda *_: cls.disabled_tooltip(owner)
     elif cls.display_description is None:
         row_tooltip = None
     else:
         row_tooltip = lambda *_: cls.display_description(owner)
     if cls.odd_job_tuning is not None:
         customer_description = cls.odd_job_tuning.customer_description(
             gig_customer)
         row = OddJobPickerRow(customer_id=gig_customer.id,
                               customer_description=customer_description,
                               tip_title=tip.tip_title(),
                               tip_text=tip.tip_text(),
                               tip_icon=tip.tip_icon,
                               name=cls.display_name(owner),
                               icon=cls.display_icon,
                               row_description=description,
                               row_tooltip=row_tooltip,
                               is_enable=enabled)
     else:
         row = ObjectPickerRow(name=cls.display_name(owner),
                               icon=cls.display_icon,
                               row_description=description,
                               row_tooltip=row_tooltip,
                               is_enable=enabled)
     return row
Ejemplo n.º 22
0
 def picker_rows_gen(cls, inst, target, context, **kwargs):
     trait_tracker = target.sim_info.trait_tracker
     for trait in cls._trait_selection_gen(target):
         row = ObjectPickerRow(is_enable=not trait_tracker.is_conflicting(trait), name=trait.display_name(target), icon=trait.icon, row_description=trait.trait_description, tag=trait)
         yield row
    def show(self,
             on_chosen: Callable[[Any, CommonChoiceOutcome],
                                 Any] = CommonFunctionUtils.noop,
             picker_type: UiObjectPicker.
             UiObjectPickerObjectPickerType = UiObjectPicker.
             UiObjectPickerObjectPickerType.OBJECT,
             page: int = 1):
        """
            Show the dialog and invoke the callbacks upon the player making a choice.
        :param on_chosen: A callback invoked upon the player choosing something from the list.
        :param picker_type: The layout of the dialog.
        :param page: The page to display. Ignored if there is only one page of choices.
        """
        log.format_with_message('Attempting to display choices.', page=page)
        _dialog = self._create_dialog(picker_type=picker_type)
        if _dialog is None:
            log.error('_dialog was None for some reason.')
            return

        if on_chosen is None:
            raise ValueError('on_chosen was None.')

        if len(self._choices) == 0:
            raise AssertionError(
                'No rows have been provided. Add rows to the dialog before attempting to display it.'
            )

        if page < 0:
            raise AssertionError('page cannot be less than zero.')

        @CommonExceptionHandler.catch_exceptions(ModInfo.get_identity().name)
        def _on_chosen(dialog: UiObjectPicker):
            if not dialog.accepted:
                log.debug('Dialog cancelled.')
                return on_chosen(None, CommonChoiceOutcome.CANCEL)
            choice = CommonDialogUtils.get_chosen_item(dialog)
            if choice == 'S4CL_NEXT':
                log.debug('Next chosen.')
                self.show(on_chosen=on_chosen,
                          picker_type=picker_type,
                          page=page + 1)
                return True
            elif choice == 'S4CL_PREVIOUS':
                log.debug('Previous chosen.')
                self.show(on_chosen=on_chosen,
                          picker_type=picker_type,
                          page=page - 1)
                return True
            log.format_with_message('Choice made.', choice=choice)
            result = on_chosen(choice, CommonChoiceOutcome.CHOICE_MADE)
            log.format_with_message('Finished handling choice.', result=result)
            return result

        number_of_rows = len(self._choices)
        log.format(number_of_rows=number_of_rows, per_page=self._per_page)
        if number_of_rows > self._per_page:
            number_of_pages = math.ceil(number_of_rows / self._per_page)

            if page > number_of_pages:
                raise AssertionError(
                    'page was out of range. Number of Pages: {}, Requested Page: {}'
                    .format(str(number_of_pages), str(page)))

            start_index = (page - 1) * self._per_page
            end_index = page * self._per_page
            log.format(start_index=start_index, end_index=end_index)
            current_choices = self._choices[start_index:end_index]
            log.format(current_rows=current_choices)
            for row in current_choices:
                _dialog.add_row(row)

            if page < number_of_pages:
                log.format_with_message('Adding Next.',
                                        page=page,
                                        number_of_pages=number_of_pages)
                next_choice = ObjectPickerRow(
                    option_id=len(self._choices) + 1,
                    name=CommonLocalizationUtils.create_localized_string(
                        CommonStringId.NEXT),
                    row_description=None,
                    row_tooltip=None,
                    icon=CommonIconUtils.load_arrow_right_icon(),
                    tag='S4CL_NEXT')
                _dialog.add_row(next_choice)
            else:
                log.format_with_message('Not adding Next.',
                                        page=page,
                                        number_of_pages=number_of_pages)
            if page > 1:
                log.format_with_message('Adding Previous.',
                                        page=page,
                                        number_of_pages=number_of_pages)
                previous_choice = ObjectPickerRow(
                    option_id=len(self._choices) + 2,
                    name=CommonLocalizationUtils.create_localized_string(
                        CommonStringId.PREVIOUS),
                    row_description=None,
                    row_tooltip=None,
                    icon=CommonIconUtils.load_arrow_right_icon(),
                    tag='S4CL_PREVIOUS')
                _dialog.add_row(previous_choice)
            else:
                log.format_with_message('Not adding Previous.', page=page)
        else:
            log.debug('Adding all choices')
            for row in self._choices:
                _dialog.add_row(row)

        _dialog.add_listener(_on_chosen)
        _dialog.show_dialog()
def _common_testing_show_choose_objects_dialog(_connection: int = None):
    output = sims4.commands.CheatOutput(_connection)
    output('Showing test choose objects dialog.')

    def _on_chosen(choices: Tuple[str], outcome: CommonChoiceOutcome):
        output('Chose {} with result: {}.'.format(pformat(choices),
                                                  pformat(outcome)))

    try:
        # LocalizedStrings within other LocalizedStrings
        title_tokens = (CommonLocalizationUtils.create_localized_string(
            CommonStringId.TESTING_SOME_TEXT_FOR_TESTING,
            text_color=CommonLocalizedStringColor.GREEN), )
        description_tokens = (CommonLocalizationUtils.create_localized_string(
            CommonStringId.TESTING_TEST_TEXT_WITH_SIM_FIRST_AND_LAST_NAME,
            tokens=(CommonSimUtils.get_active_sim_info(), ),
            text_color=CommonLocalizedStringColor.BLUE), )
        from sims4communitylib.utils.common_icon_utils import CommonIconUtils
        options = [
            ObjectPickerRow(
                option_id=1,
                name=CommonLocalizationUtils.create_localized_string(
                    CommonStringId.TESTING_SOME_TEXT_FOR_TESTING),
                row_description=CommonLocalizationUtils.
                create_localized_string(
                    CommonStringId.TESTING_TEST_BUTTON_ONE),
                row_tooltip=None,
                icon=CommonIconUtils.load_checked_square_icon(),
                tag='Value 1'),
            ObjectPickerRow(
                option_id=2,
                name=CommonLocalizationUtils.create_localized_string(
                    CommonStringId.TESTING_SOME_TEXT_FOR_TESTING),
                row_description=CommonLocalizationUtils.
                create_localized_string(
                    CommonStringId.TESTING_TEST_BUTTON_TWO),
                row_tooltip=None,
                icon=CommonIconUtils.load_arrow_navigate_into_icon(),
                tag='Value 2'),
            ObjectPickerRow(
                option_id=3,
                name=CommonLocalizationUtils.create_localized_string(
                    'Value 3'),
                row_description=CommonLocalizationUtils.
                create_localized_string(
                    CommonStringId.TESTING_TEST_BUTTON_TWO),
                row_tooltip=None,
                icon=CommonIconUtils.load_arrow_navigate_into_icon(),
                tag='Value 3')
        ]
        dialog = CommonChooseObjectsDialog(
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            tuple(options),
            title_tokens=title_tokens,
            description_tokens=description_tokens,
            per_page=2)
        dialog.show(on_chosen=_on_chosen, min_selectable=1, max_selectable=2)
    except Exception as ex:
        CommonExceptionHandler.log_exception(ModInfo.get_identity(),
                                             'Failed to show dialog',
                                             exception=ex)
        output('Failed to show dialog, please locate your exception log file.')
    output('Done showing.')
Ejemplo n.º 25
0
    def _setup_dialog_rows(
        self,
        _dialog: UiObjectPicker,
        page: int=1,
        categories: Iterator[CommonDialogObjectOptionCategory]=()
    ):
        if page < 0:
            raise AssertionError('page cannot be less than zero.')

        number_of_rows = len(self.rows)
        self.log.format(number_of_rows=number_of_rows, per_page=self._per_page)
        if number_of_rows > self._per_page:
            number_of_pages = math.ceil(number_of_rows / self._per_page)

            if page > number_of_pages:
                raise AssertionError('page was out of range. Number of Pages: {}, Requested Page: {}'.format(str(number_of_pages), str(page)))
            # Add the rows that are always visible.
            for always_visible_rows in self.always_visible_rows:
                _dialog.add_row(always_visible_rows)

            # Add the rows that should show on the current page.
            start_index = (page - 1) * self._per_page
            end_index = page * self._per_page
            self.log.format(start_index=start_index, end_index=end_index)
            current_choices = self.rows[start_index:end_index]
            self.log.format(current_rows=current_choices)
            for row in current_choices:
                _dialog.add_row(row)

            tag_list = [(abs(hash(category.object_category)) % (10 ** 8)) for category in categories]
            self.log.format_with_message('Found tags.', tag_list=tag_list)

            if page > 1:
                self.log.format_with_message('Adding Previous row.', page=page, number_of_pages=number_of_pages)
                previous_choice = ObjectPickerRow(
                    option_id=len(self.rows) + 2,
                    name=CommonLocalizationUtils.create_localized_string(CommonStringId.PREVIOUS),
                    row_description=None,
                    row_tooltip=CommonLocalizationUtils.create_localized_tooltip(CommonStringId.PREVIOUS),
                    icon=CommonIconUtils.load_arrow_left_icon(),
                    tag_list=tag_list,
                    tag=CommonDialogNavigationButtonTag.PREVIOUS
                )
                _dialog.add_row(previous_choice)
            else:
                self.log.format_with_message('Not adding Previous row.', page=page)
            if page < number_of_pages:
                self.log.format_with_message('Adding Next row.', page=page, number_of_pages=number_of_pages)
                next_choice = ObjectPickerRow(
                    option_id=len(self.rows) + 1,
                    name=CommonLocalizationUtils.create_localized_string(CommonStringId.NEXT),
                    row_description=None,
                    row_tooltip=CommonLocalizationUtils.create_localized_tooltip(CommonStringId.NEXT),
                    icon=CommonIconUtils.load_arrow_right_icon(),
                    tag_list=tag_list,
                    tag=CommonDialogNavigationButtonTag.NEXT
                )
                _dialog.add_row(next_choice)
            else:
                self.log.format_with_message('Not adding Next.', page=page, number_of_pages=number_of_pages)
        else:
            self.log.debug('Adding always visible rows.')
            for always_visible_rows in self.always_visible_rows:
                _dialog.add_row(always_visible_rows)
            self.log.debug('Adding rows.')
            for row in self.rows:
                _dialog.add_row(row)
def _common_testing_show_multi_pane_choose_dialog(_connection: int=None):
    output = sims4.commands.CheatOutput(_connection)
    output('Showing test multi-pane choose dialog.')

    def _on_submit(choices_made: Dict[int, Any], outcome: CommonChoiceOutcome) -> None:
        output('On Submit choices_made: {} and outcome: {}'.format(pformat(choices_made), pformat(outcome)))

    def _on_sub_dialog_one_chosen(choice: Any, outcome: CommonChoiceOutcome) -> None:
        output('Sub Dialog one choice made: {} outcome: {}'.format(pformat(choice), pformat(outcome)))

    def _on_sub_dialog_two_chosen(choice: Any, outcome: CommonChoiceOutcome) -> None:
        output('Sub Dialog two choice made: {} outcome: {}'.format(pformat(choice), pformat(outcome)))

    sim_info = CommonSimUtils.get_active_sim_info()

    try:
        # LocalizedStrings within other LocalizedStrings
        title_tokens = (CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_SOME_TEXT_FOR_TESTING, text_color=CommonLocalizedStringColor.GREEN),)
        description_tokens = (CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_TEXT_WITH_SIM_FIRST_AND_LAST_NAME, tokens=(CommonSimUtils.get_active_sim_info(),), text_color=CommonLocalizedStringColor.BLUE),)
        from sims4communitylib.utils.common_icon_utils import CommonIconUtils
        # Create the dialog.
        dialog = CommonMultiPaneChooseDialog(
            ModInfo.get_identity(),
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            title_tokens=title_tokens,
            description_tokens=description_tokens
        )

        sub_dialog_one_options = [
            ObjectPickerRow(
                option_id=1,
                name=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_SOME_TEXT_FOR_TESTING),
                row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_ONE),
                row_tooltip=None,
                icon=CommonIconUtils.load_checked_square_icon(),
                tag='Value 1'
            ),
            ObjectPickerRow(
                option_id=2,
                name=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_SOME_TEXT_FOR_TESTING),
                row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_TWO),
                row_tooltip=None,
                icon=CommonIconUtils.load_arrow_navigate_into_icon(),
                tag='Value 2'
            ),
            ObjectPickerRow(
                option_id=3,
                name=CommonLocalizationUtils.create_localized_string('Value 3'),
                row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_TWO),
                row_tooltip=None,
                icon=CommonIconUtils.load_arrow_navigate_into_icon(),
                tag='Value 3'
            )
        ]

        # Add sub dialog one.
        sub_dialog_one = CommonChooseObjectDialog(
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            tuple(sub_dialog_one_options),
            title_tokens=title_tokens,
            description_tokens=description_tokens
        )
        dialog.add_sub_dialog(sub_dialog_one, on_chosen=_on_sub_dialog_one_chosen, sim_info=sim_info)

        # Add sub dialog two.
        sub_dialog_two_options = [
            ObjectPickerRow(
                option_id=4,
                name=CommonLocalizationUtils.create_localized_string('Value 4'),
                row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_ONE),
                row_tooltip=None,
                icon=CommonIconUtils.load_checked_square_icon(),
                tag='Value 4'
            ),
            ObjectPickerRow(
                option_id=5,
                name=CommonLocalizationUtils.create_localized_string('Value 5'),
                row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_TWO),
                row_tooltip=None,
                icon=CommonIconUtils.load_arrow_navigate_into_icon(),
                tag='Value 5'
            ),
            ObjectPickerRow(
                option_id=6,
                name=CommonLocalizationUtils.create_localized_string('Value 6'),
                row_description=CommonLocalizationUtils.create_localized_string(CommonStringId.TESTING_TEST_BUTTON_TWO),
                row_tooltip=None,
                icon=CommonIconUtils.load_arrow_navigate_into_icon(),
                tag='Value 6'
            )
        ]

        sub_dialog_two = CommonChooseObjectDialog(
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            CommonStringId.TESTING_TEST_TEXT_WITH_STRING_TOKEN,
            tuple(sub_dialog_two_options),
            title_tokens=title_tokens,
            description_tokens=description_tokens
        )

        dialog.add_sub_dialog(sub_dialog_two, on_chosen=_on_sub_dialog_two_chosen, include_pagination=True)

        # Show the dialog.
        dialog.show(on_submit=_on_submit)
    except Exception as ex:
        CommonExceptionHandler.log_exception(ModInfo.get_identity(), 'Failed to show dialog', exception=ex)
        output('Failed to show dialog, please locate your exception log file.')
    output('Done showing.')