예제 #1
0
 def display(text,
             title,
             sim_identifier,
             outfits=(),
             sim=None,
             callback=None):
     sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
     text = TurboL18NUtil.get_localized_string(text)
     title = TurboL18NUtil.get_localized_string(title)
     outfit_picker_dialog = UiOutfitPicker.TunableFactory().default(
         sim or TurboUIUtil._get_client_sim(),
         text=lambda *args, **kwargs: text,
         title=lambda *args, **kwargs: title)
     (current_outfit_category,
      current_outfit_index) = sim_info.get_current_outfit()
     for (outfit_category, outfit_index) in outfits:
         is_enabled = outfit_category == current_outfit_category and outfit_index == current_outfit_index
         outfit_picker_dialog.add_row(
             OutfitPickerRow(
                 outfit_sim_id=TurboManagerUtil.Sim.get_sim_id(
                     sim_info),
                 outfit_category=outfit_category,
                 outfit_index=outfit_index,
                 is_enable=not is_enabled,
                 tag=(outfit_category, outfit_index)))
     if callback is not None:
         outfit_picker_dialog.add_listener(callback)
     outfit_picker_dialog.show_dialog()
예제 #2
0
 def display(text,
             title,
             sims_ids,
             selected_sims_ids=(),
             min_selectable=1,
             max_selectable=1,
             should_show_names=True,
             hide_row_description=False,
             sim=None,
             callback=None):
     text = TurboL18NUtil.get_localized_string(text)
     title = TurboL18NUtil.get_localized_string(title)
     sim_picker_dialog = UiSimPicker.TunableFactory().default(
         sim or TurboUIUtil._get_client_sim(),
         text=lambda *args, **kwargs: text,
         title=lambda *args, **kwargs: title,
         min_selectable=min_selectable,
         max_selectable=max_selectable,
         should_show_names=should_show_names,
         hide_row_description=hide_row_description)
     for sim_id in sims_ids:
         sim_picker_dialog.add_row(
             SimPickerRow(sim_id,
                          select_default=sim_id in selected_sims_ids,
                          tag=sim_id))
     if callback is not None:
         sim_picker_dialog.add_listener(callback)
     sim_picker_dialog.show_dialog()
def _open_animation_category_picker(author_name, autonomy=False):
    global _CURRENT_AUTHOR_NAME
    _CURRENT_AUTHOR_NAME = author_name

    @exception_watch()
    def animation_categories_callback(dialog):
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            _open_animation_authors_picker(autonomy=autonomy)
            return False
        (result_author_name, result_category_type) = TurboUIUtil.ObjectPickerDialog.get_tag_result(dialog)
        _open_animations_picker(result_author_name, result_category_type, autonomy=autonomy)
        return True

    category_picker_rows = list()
    animation_categories = ((0, SexCategoryType.TEASING, 1782200665), (1, SexCategoryType.HANDJOB, 2036049244), (3, SexCategoryType.FOOTJOB, 122220731), (4, SexCategoryType.ORALJOB, 1133298919), (5, SexCategoryType.VAGINAL, 2874903428), (6, SexCategoryType.ANAL, 3553429146), (7, SexCategoryType.CLIMAX, 1579105152))
    for (index, animation_category_type, animation_category_name) in animation_categories:
        overall_animations_count = 0
        enabled_animations_count = 0
        for animation_instance in get_all_sex_animations():
            while animation_instance.get_sex_category() == animation_category_type and animation_instance.get_author() == author_name:
                overall_animations_count += 1
                if not is_sex_animation_disabled(animation_instance.get_identifier(), autonomy=autonomy):
                    enabled_animations_count += 1
        if overall_animations_count <= 0:
            pass
        picker_row = TurboUIUtil.ObjectPickerDialog.ListPickerRow(index, animation_category_name, TurboL18NUtil.get_localized_string(583685786, (str(enabled_animations_count) + '/' + str(overall_animations_count), author_name)), skip_tooltip=True, icon=get_arrow_icon(), tag=(author_name, animation_category_type))
        category_picker_rows.append(picker_row)
    if autonomy is False:
        title = TurboL18NUtil.get_localized_string(2380367292, (author_name,))
    else:
        title = TurboL18NUtil.get_localized_string(3773354670, (author_name,))
    display_picker_list_dialog(title=title, picker_rows=category_picker_rows, sim=get_menu_sim(), callback=animation_categories_callback)
def _open_animations_picker(author_name, animation_category, autonomy=False):

    @exception_watch()
    def _get_animations_list():
        animations_list = list()
        for animation_instance_x in get_all_sex_animations():
            while animation_instance_x.get_sex_category() == animation_category and animation_instance_x.get_author() == author_name:
                is_disabled_x = is_sex_animation_disabled(animation_instance_x.get_identifier(), autonomy=autonomy)
                animations_list.append((animation_instance_x, is_disabled_x))
        return animations_list

    @exception_watch()
    def animations_callback(dialog):
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            if _CURRENT_AUTHOR_NAME is None:
                _open_animation_authors_picker(autonomy=autonomy)
            else:
                _open_animation_category_picker(_CURRENT_AUTHOR_NAME, autonomy=autonomy)
            return False
        (result_author_name, result_animation_category, result_animation_identifier) = TurboUIUtil.ObjectPickerDialog.get_tag_result(dialog)
        if result_animation_identifier is None:
            animations_to_toggle = _get_animations_list()
            has_disabled_animations = False
            for (_, is_disabled_y) in animations_to_toggle:
                while is_disabled_y is True:
                    has_disabled_animations = True
                    break
            for (animation_instance_y, is_disabled_y) in animations_to_toggle:
                if has_disabled_animations is True and is_disabled_y is True:
                    switch_disabled_sex_animation(animation_instance_y.get_identifier(), autonomy=autonomy)
                else:
                    while has_disabled_animations is False and is_disabled_y is False:
                        switch_disabled_sex_animation(animation_instance_y.get_identifier(), autonomy=autonomy)
        else:
            switch_disabled_sex_animation(result_animation_identifier, autonomy=autonomy)
        _open_animations_picker(result_author_name, result_animation_category, autonomy=autonomy)
        return True

    animation_picker_rows = list()
    toggle_select = TurboUIUtil.ObjectPickerDialog.ListPickerRow(0, 4201638866, 1537618859, icon=get_action_icon(), tag=(author_name, animation_category, None))
    animation_picker_rows.append(toggle_select)
    index = 1
    for (animation_instance, is_disabled) in _get_animations_list():
        animation_locations = list()
        for animation_location in animation_instance.get_locations():
            animation_locations.append(SexLocationType.get_user_name(animation_location))
        if animation_instance.get_custom_locations():
            animation_locations.append('Custom Locations')
        picker_row = TurboUIUtil.ObjectPickerDialog.ListPickerRow(index, animation_instance.get_display_name(), TurboL18NUtil.get_localized_string(708866741, (', '.join(animation_locations),)), skip_tooltip=True, icon=get_unselected_icon() if is_disabled is True else get_selected_icon(), tag=(author_name, animation_category, animation_instance.get_identifier()))
        animation_picker_rows.append(picker_row)
        index += 1
    if autonomy is False:
        title = TurboL18NUtil.get_localized_string(2380367292, (author_name,))
    else:
        title = TurboL18NUtil.get_localized_string(3773354670, (author_name,))
    display_picker_list_dialog(title=title, picker_rows=animation_picker_rows, sim=get_menu_sim(), callback=animations_callback)
예제 #5
0
 def __init__(self, sex_handler, sex_category_type, object_identifier=None):
     self.sex_handler = sex_handler
     self.sex_category_type = sex_category_type
     self.object_identifier = object_identifier
     super().__init__(0,
                      TurboL18NUtil.get_localized_string(1890248379),
                      TurboL18NUtil.get_localized_string(0),
                      icon=get_random_icon(),
                      is_random=True,
                      tag_itself=True)
예제 #6
0
 def get_interaction_name(cls, interaction_instance):
     sim = TurboInteractionUtil.get_interaction_sim(interaction_instance)
     active_sex_handler = sim_ev(sim).active_sex_handler
     if active_sex_handler is None:
         return TurboL18NUtil.get_localized_string(2175203501)
     return TurboL18NUtil.get_localized_string(
         2667173688,
         tokens=(
             active_sex_handler.get_animation_instance().get_display_name(
                 string_hash=True),
             active_sex_handler.get_animation_instance().get_author()))
예제 #7
0
 def display(text, title, ok_text=3648501874, callback=None):
     text = TurboL18NUtil.get_localized_string(text)
     title = TurboL18NUtil.get_localized_string(title)
     ok_text = TurboL18NUtil.get_localized_string(ok_text)
     ok_dialog = UiDialogOk.TunableFactory().default(
         TurboUIUtil._get_client_sim(),
         text=lambda *args, **kwargs: text,
         title=lambda *args, **kwargs: title,
         text_ok=lambda *args, **kwargs: ok_text)
     if callback is not None:
         ok_dialog.add_listener(callback)
     ok_dialog.show_dialog()
예제 #8
0
 def display(text, title, initial_text=None, callback=None):
     text = TurboL18NUtil.get_localized_string(text)
     title = TurboL18NUtil.get_localized_string(title)
     text_input_dialog = TurboUIUtil.TextInputDialog.CustomUiDialogTextInputOkCancel.TunableFactory(
     ).default(TurboUIUtil._get_client_sim(),
               text=lambda *args, **kwargs: text,
               title=lambda *args, **kwargs: title)
     if callback is not None:
         text_input_dialog.add_listener(callback)
     if initial_text is not None:
         text_input_dialog.show_dialog(
             additional_tokens=(initial_text, ))
     else:
         text_input_dialog.show_dialog()
예제 #9
0
 def __init__(self,
              option_id,
              name,
              description,
              skip_tooltip=False,
              icon=None,
              tag=None,
              tag_itself=False):
     self.option_id = option_id
     self.name = TurboL18NUtil.get_localized_string(name)
     self.description = TurboL18NUtil.get_localized_string(
         description)
     self.skip_tooltip = skip_tooltip
     self.icon = icon
     self.tag = tag
     self.tag_itself = tag_itself
def display_notification(text=None, text_tokens=(), title=None, title_tokens=(), primary_icon=None, secondary_icon=None, is_safe=False, **kwargs):
    if text is None and title is None:
        return
    if not (is_safe is True and has_game_loaded()):
        return
    localized_text = TurboL18NUtil.get_localized_string(text, text_tokens)
    localized_title = TurboL18NUtil.get_localized_string(title, title_tokens)
    if primary_icon is not None:
        secondary_icon = TurboManagerUtil.Sim.get_sim_info(primary_icon) or primary_icon
    if secondary_icon is not None:
        secondary_icon = TurboManagerUtil.Sim.get_sim_info(secondary_icon) or secondary_icon
    if primary_icon or secondary_icon:
        icon_data = (primary_icon, secondary_icon)
    else:
        icon_data = None
    TurboUIUtil.Notification.display(text=localized_text, title=localized_title, icons=icon_data, **kwargs)
예제 #11
0
def add_sim_buff(sim_identifier, sim_buff, reason=None):
    buff_instance = _get_buff_instance(int(sim_buff))
    if buff_instance is None:
        return False
    if reason is not None:
        reason = TurboL18NUtil.get_localized_string(reason)
    return TurboSimUtil.Buff.add(sim_identifier,
                                 buff_instance,
                                 buff_reason=reason)
예제 #12
0
def _import_settings_menu():
    def _import_done_dialog_callback(_):
        _open_settings_import_export_menu()

    def _import_settings_callback(dialog):
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            _open_settings_import_export_menu()
            return False
        result_save_name = TurboUIUtil.ObjectPickerDialog.get_tag_result(
            dialog)
        save_file_path = _get_settings_import_export_dir()
        load_basic_save_data(
            load_file_path_override=''.join((save_file_path, result_save_name,
                                             '_general.json')))
        load_disabled_animations_save_data(
            load_file_path_override=''.join((save_file_path, result_save_name,
                                             '_disabled_animations.json')))
        apply_nudity_settings_from_basic_save_data()
        apply_relationship_settings_from_basic_save_data()
        apply_sex_settings_from_basic_save_data()
        apply_disabled_sex_animations_from_dict(
            get_disabled_animations_save_data())
        recollect_sex_animation_packages()
        display_ok_dialog(text=3165307094,
                          text_tokens=(result_save_name, ),
                          title=3126397785,
                          callback=_import_done_dialog_callback)
        return True

    save_export_dict = _get_settings_export_dict()
    if not save_export_dict:
        display_ok_dialog(text=4228795842,
                          title=3126397785,
                          callback=_import_done_dialog_callback)
        return
    picker_rows = list()
    i = 0
    for (save_name, save_data) in save_export_dict.items():
        save_time = save_data[1]
        save_date_time = datetime.datetime.fromtimestamp(save_time).strftime(
            '%Y-%m-%d %H:%M')
        picker_rows.append(
            TurboUIUtil.ObjectPickerDialog.ListPickerRow(
                i,
                save_name,
                TurboL18NUtil.get_localized_string(2878507029,
                                                   tokens=(save_date_time, )),
                skip_tooltip=True,
                icon=get_action_icon(),
                tag=save_name))
        i += 1
    display_picker_list_dialog(title=3126397785,
                               picker_rows=picker_rows,
                               sim=get_menu_sim(),
                               callback=_import_settings_callback)
예제 #13
0
 def build_msg(self,
               text_input_overrides=None,
               additional_tokens=(),
               **kwargs):
     msg = super().build_msg(additional_tokens=(), **kwargs)
     text_input_msg = msg.text_input.add()
     text_input_msg.text_input_name = 'text_input'
     if additional_tokens and additional_tokens[0] is not None:
         text_input_msg.initial_value = TurboL18NUtil.get_localized_string(
             additional_tokens[0])
     return msg
예제 #14
0
def open_change_sex_animations_category_picker_dialog(active_sex_handler):
    @exception_watch()
    def animation_categories_picker_callback(dialog):
        if active_sex_handler is None:
            return False
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            return False
        result_sex_category_type = TurboUIUtil.ObjectPickerDialog.get_tag_result(
            dialog)
        open_change_sex_animations_picker_dialog(active_sex_handler,
                                                 result_sex_category_type)
        return True

    genders_list = list()
    for sim_info in active_sex_handler.get_actors_sim_info_gen():
        genders_list.append(get_sim_sex_gender(sim_info))
    category_picker_rows = list()
    animation_categories = ((0, SexCategoryType.TEASING, 77458156),
                            (1, SexCategoryType.HANDJOB, 1425559843),
                            (3, SexCategoryType.FOOTJOB, 223939754),
                            (4, SexCategoryType.ORALJOB, 2747124438),
                            (5, SexCategoryType.VAGINAL,
                             574589211), (6, SexCategoryType.ANAL, 1610085053),
                            (7, SexCategoryType.CLIMAX, 3986970407))
    for (index, animation_sex_category_type,
         animation_sex_category_name) in animation_categories:
        if not active_sex_handler.is_at_climax and animation_sex_category_type == SexCategoryType.CLIMAX:
            pass
        if not has_animations_with_params(
                animation_sex_category_type,
                active_sex_handler.get_object_identifier(), genders_list):
            pass
        animations_list = get_animations_with_params(
            animation_sex_category_type,
            active_sex_handler.get_object_identifier(), genders_list)
        if not animations_list:
            pass
        picker_row = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
            index,
            animation_sex_category_name,
            TurboL18NUtil.get_localized_string(3166569584,
                                               tokens=(str(
                                                   len(animations_list)), )),
            skip_tooltip=True,
            icon=get_arrow_icon(),
            tag=animation_sex_category_type)
        category_picker_rows.append(picker_row)
    if len(category_picker_rows) <= 1:
        return
    display_picker_list_dialog(title=2301874612,
                               picker_rows=category_picker_rows,
                               callback=animation_categories_picker_callback)
예제 #15
0
 def get_picker_row(self, display_selected=False):
     display_icon = get_unselected_icon()
     if display_selected is True:
         display_icon = get_selected_icon()
     from wickedwhims.sex.animations.animations_operator import ListAnimationPickerRow
     return ListAnimationPickerRow(self.get_animation_id(),
                                   self.get_display_name(),
                                   TurboL18NUtil.get_localized_string(
                                       881372436,
                                       tokens=(self.get_author(), )),
                                   icon=display_icon,
                                   skip_tooltip=True,
                                   tag=self)
예제 #16
0
 def display(text,
             title,
             visual_type=None,
             urgency=None,
             information_level=None,
             icons=None):
     text = TurboL18NUtil.get_localized_string(text)
     title = TurboL18NUtil.get_localized_string(title)
     if visual_type is None:
         visual_type = TurboUIUtil.Notification.UiDialogNotificationVisualType.INFORMATION
     if urgency is None:
         urgency = TurboUIUtil.Notification.UiDialogNotificationUrgency.DEFAULT
     if information_level is None:
         information_level = TurboUIUtil.Notification.UiDialogNotificationLevel.SIM
     notification = UiDialogNotification.TunableFactory().default(
         None,
         text=lambda *args, **kwargs: text,
         title=lambda *args, **kwargs: title,
         visual_type=visual_type,
         urgency=urgency,
         information_level=information_level)
     notification.show_dialog(icon_override=icons)
예제 #17
0
 def display(sim_identifier,
             target_sim_identifier,
             text,
             ok_text,
             cancel_text,
             callback=None):
     sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
     target_sim_info = TurboManagerUtil.Sim.get_sim_info(
         target_sim_identifier)
     text = TurboL18NUtil.get_localized_string(text)
     ok_text = TurboL18NUtil.get_localized_string(ok_text)
     cancel_text = TurboL18NUtil.get_localized_string(cancel_text)
     resolver = DoubleSimResolver(sim_info, target_sim_info)
     drama_dialog = UiDialogOkCancel.TunableFactory().default(
         sim_info,
         text=lambda *args, **kwargs: text,
         text_cancel=lambda *args, **kwargs: cancel_text,
         text_ok=lambda *args, **kwargs: ok_text,
         target_sim_id=target_sim_info.id,
         resolver=resolver)
     if callback is not None:
         drama_dialog.add_listener(callback)
     drama_dialog.show_dialog()
예제 #18
0
def _delete_settings_menu():
    save_export_dict = _get_settings_export_dict()

    def _delete_done_dialog_callback(_):
        _open_settings_import_export_menu()

    def _delete_settings_callback(dialog):
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            _open_settings_import_export_menu()
            return False
        (result_save_name, result_save_time
         ) = TurboUIUtil.ObjectPickerDialog.get_tag_result(dialog)
        for (_save_name, _save_data) in save_export_dict.items():
            _save_time = _save_data[1]
            while _save_name == result_save_name and _save_time == result_save_time:
                save_export_dict.pop(_save_name)
                break
        _save_settings_export_dict(save_export_dict)
        display_ok_dialog(text=3421488172,
                          text_tokens=(result_save_name, ),
                          title=4268061051,
                          callback=_delete_done_dialog_callback)
        return True

    if not save_export_dict:
        display_ok_dialog(text=294911225,
                          title=4268061051,
                          callback=_delete_done_dialog_callback)
        return
    picker_rows = list()
    i = 0
    for (save_name, save_data) in save_export_dict.items():
        save_time = save_data[1]
        save_date_time = datetime.datetime.fromtimestamp(save_time).strftime(
            '%Y-%m-%d %H:%M')
        picker_rows.append(
            TurboUIUtil.ObjectPickerDialog.ListPickerRow(
                i,
                save_name,
                TurboL18NUtil.get_localized_string(2878507029,
                                                   tokens=(save_date_time, )),
                skip_tooltip=True,
                icon=get_action_icon(),
                tag=(save_name, save_time)))
        i += 1
    display_picker_list_dialog(title=4268061051,
                               picker_rows=picker_rows,
                               sim=get_menu_sim(),
                               callback=_delete_settings_callback)
예제 #19
0
def open_start_sex_animations_category_picker_dialog(pre_sex_handler):
    @exception_watch()
    def animation_categories_picker_callback(dialog):
        if pre_sex_handler is None:
            return False
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            clear_sims_sex_extra_data(
                tuple(pre_sex_handler.get_actors_sim_info_gen()))
            return False
        result_sex_category_type = TurboUIUtil.ObjectPickerDialog.get_tag_result(
            dialog)
        pre_sex_handler.set_interaction_type(result_sex_category_type)
        open_start_sex_animations_picker_dialog(pre_sex_handler)
        return True

    genders_list = list()
    for sim_info in pre_sex_handler.get_actors_sim_info_gen():
        genders_list.append(get_sim_sex_gender(sim_info))
    category_picker_rows = list()
    animation_categories = ((0, SexCategoryType.TEASING, 77458156),
                            (1, SexCategoryType.HANDJOB, 1425559843),
                            (3, SexCategoryType.FOOTJOB, 223939754),
                            (4, SexCategoryType.ORALJOB, 2747124438),
                            (5, SexCategoryType.VAGINAL,
                             574589211), (6, SexCategoryType.ANAL, 1610085053))
    for (index, animation_sex_category_type,
         animation_sex_category_name) in animation_categories:
        animations_list = get_animations_with_params(
            animation_sex_category_type,
            pre_sex_handler.get_object_identifier(), genders_list)
        if not animations_list:
            continue
        picker_row = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
            index,
            animation_sex_category_name,
            TurboL18NUtil.get_localized_string(3166569584,
                                               tokens=(str(
                                                   len(animations_list)), )),
            skip_tooltip=True,
            icon=get_arrow_icon(),
            tag=animation_sex_category_type)
        category_picker_rows.append(picker_row)
    display_picker_list_dialog(title=2301874612,
                               picker_rows=category_picker_rows,
                               callback=animation_categories_picker_callback)
예제 #20
0
 def get_display_name(self, string_hash=False):
     if string_hash is True and not isinstance(self.display_name, str):
         return TurboL18NUtil.get_localized_string_id(self.display_name)
     return self.display_name
def display_okcancel_dialog(text=None, text_tokens=(), title=None, title_tokens=(), ok_text=3648501874, ok_text_tokens=(), cancel_text=3497542682, cancel_text_tokens=(), callback=None):
    localized_text = TurboL18NUtil.get_localized_string(text, text_tokens)
    localized_title = TurboL18NUtil.get_localized_string(title, title_tokens)
    localized_ok_text = TurboL18NUtil.get_localized_string(ok_text, ok_text_tokens)
    localized_cancel_text = TurboL18NUtil.get_localized_string(cancel_text, cancel_text_tokens)
    TurboUIUtil.OkCancelDialog.display(localized_text, localized_title, ok_text=localized_ok_text, cancel_text=localized_cancel_text, callback=callback)
def display_drama_dialog(sim_identifier, target_sim_identifier, text=None, text_tokens=(), ok_text=None, ok_text_tokens=(), cancel_text=None, cancel_text_tokens=(), callback=None):
    localized_text = TurboL18NUtil.get_localized_string(text, text_tokens)
    localized_ok_text = TurboL18NUtil.get_localized_string(ok_text, ok_text_tokens)
    localized_cancel_text = TurboL18NUtil.get_localized_string(cancel_text, cancel_text_tokens)
    TurboUIUtil.DramaDialog.display(sim_identifier, target_sim_identifier, localized_text, localized_ok_text, localized_cancel_text, callback=callback)
def _open_animation_authors_picker(autonomy=False):
    global _CURRENT_AUTHOR_NAME
    _CURRENT_AUTHOR_NAME = None

    @exception_watch()
    def animation_authors_callback(dialog):
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            update_disabled_sex_animation_data()
            recollect_sex_animation_packages()
            from wickedwhims.sex.settings.sex_settings import _open_sex_settings, _open_sex_autonomy_settings
            if autonomy is False:
                _open_sex_settings()
            else:
                _open_sex_autonomy_settings()
            return False
        result_author_name = str(TurboUIUtil.ObjectPickerDialog.get_tag_result(dialog))
        _open_animation_category_picker(result_author_name, autonomy=autonomy)
        return True

    animation_author_picker_rows = list()
    animation_authors = OrderedDict()
    for animation_instance in get_all_sex_animations():
        is_enabled = not is_sex_animation_disabled(animation_instance.get_identifier(), autonomy=autonomy)
        if animation_instance.get_author() not in animation_authors:
            animation_authors[animation_instance.get_author()] = (1, 1 if is_enabled else 0)
        else:
            (overall_animations, enabled_animations) = animation_authors[animation_instance.get_author()]
            animation_authors[animation_instance.get_author()] = (overall_animations + 1, enabled_animations + (1 if is_enabled else 0))
    index = 0
    for (animation_author_name, (overall_animations_count, enabled_animations_count)) in animation_authors.items():
        picker_row = TurboUIUtil.ObjectPickerDialog.ListPickerRow(index, animation_author_name, TurboL18NUtil.get_localized_string(2223654951, (str(enabled_animations_count) + '/' + str(overall_animations_count),)), skip_tooltip=True, icon=get_arrow_icon(), tag=animation_author_name)
        animation_author_picker_rows.append(picker_row)
        index += 1
    display_picker_list_dialog(text=4285227430, title=1853900111 if autonomy is False else 2284702213, picker_rows=animation_author_picker_rows, sim=get_menu_sim(), callback=animation_authors_callback)
def display_outfit_picker_dialog(text=None, text_tokens=(), title=None, title_tokens=(), outfits=(), sim=None, callback=None):
    localized_text = TurboL18NUtil.get_localized_string(text, text_tokens)
    localized_title = TurboL18NUtil.get_localized_string(title, title_tokens)
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim)
    TurboUIUtil.OutfitPickerDialog.display(localized_text, localized_title, sim_info, outfits=outfits, sim=sim_info, callback=callback)
def display_sim_picker_dialog(text=None, text_tokens=(), title=None, title_tokens=(), sims_id_list=(), selected_sims_id_list=(), selectable_amount=1, sim=None, callback=None):
    localized_text = TurboL18NUtil.get_localized_string(text, text_tokens)
    localized_title = TurboL18NUtil.get_localized_string(title, title_tokens)
    TurboUIUtil.SimPickerDialog.display(localized_text, localized_title, sims_id_list, selected_sims_ids=selected_sims_id_list, max_selectable=selectable_amount, sim=TurboManagerUtil.Sim.get_sim_info(sim), callback=callback)
def display_text_input_dialog(text=None, text_tokens=(), title=None, title_tokens=(), initial_text=None, callback=None):
    localized_text = TurboL18NUtil.get_localized_string(text, text_tokens)
    localized_title = TurboL18NUtil.get_localized_string(title, title_tokens)
    TurboUIUtil.TextInputDialog.display(localized_text, localized_title, initial_text=initial_text, callback=callback)
예제 #27
0
def open_penis_settings(sim_identifier):
    sim_info = TurboManagerUtil.Sim.get_sim_info(sim_identifier)
    sim_soft_penis = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        10,
        TurboL18NUtil.get_localized_string(2898758693),
        TurboL18NUtil.get_localized_string(0),
        icon=get_arrow_icon())
    sim_hard_penis = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        11,
        TurboL18NUtil.get_localized_string(1072923186),
        TurboL18NUtil.get_localized_string(0),
        icon=get_arrow_icon())
    all_sims_soft_penis = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        20,
        TurboL18NUtil.get_localized_string(2966523311),
        TurboL18NUtil.get_localized_string(0),
        icon=get_arrow_icon())
    all_sims_hard_penis = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        21,
        TurboL18NUtil.get_localized_string(4002037116),
        TurboL18NUtil.get_localized_string(0),
        icon=get_arrow_icon())
    randomize_all_sims_penis = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        30,
        TurboL18NUtil.get_localized_string(1952075710),
        TurboL18NUtil.get_localized_string(0),
        icon=get_selected_icon() if PENIS_SETTING_RANDOM is True
        and PENIS_SETTING_RANDOM_INCLUDE_DEFAULT is True else
        get_unselected_icon())
    randomize_all_sims_penis_non_default = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        31,
        TurboL18NUtil.get_localized_string(1952075710),
        TurboL18NUtil.get_localized_string(1490222904),
        icon=get_selected_icon() if PENIS_SETTING_RANDOM is True
        and PENIS_SETTING_RANDOM_INCLUDE_DEFAULT is False else
        get_unselected_icon())

    @exception_watch()
    def set_callback(dialog):
        if not dialog.accepted:
            return
        result = dialog.get_result_tags()[-1]
        if result == 10:
            open_sim_soft_penis_picker(sim_info)
        elif result == 11:
            open_sim_hard_penis_picker(sim_info)
        elif result == 20:
            open_all_sims_soft_penis_picker(sim_info)
        elif result == 21:
            open_all_sims_hard_penis_picker(sim_info)
        elif result == 30:
            randomized_all_sims_penis_models(sim_info,
                                             include_default_penis=True)
        elif result == 31:
            randomized_all_sims_penis_models(sim_info)

    display_picker_list_dialog(title=253781263,
                               picker_rows=[
                                   sim_soft_penis, sim_hard_penis,
                                   all_sims_soft_penis, all_sims_hard_penis,
                                   randomize_all_sims_penis,
                                   randomize_all_sims_penis_non_default
                               ],
                               callback=set_callback)
def display_picker_list_dialog(text=None, text_tokens=(), title=None, title_tokens=(), picker_rows=(), sim=None, callback=None):
    localized_text = TurboL18NUtil.get_localized_string(text, text_tokens)
    localized_title = TurboL18NUtil.get_localized_string(title, title_tokens)
    TurboUIUtil.ObjectPickerDialog.display(localized_text, localized_title, picker_rows, sim=TurboManagerUtil.Sim.get_sim_info(sim), callback=callback)