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)
Esempio n. 2
0
def _open_settings_import_export_menu():
    export_option = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        1,
        128859011,
        1330537389,
        icon=get_action_icon(),
        tag=_export_current_settings)
    import_option = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        2,
        3126397785,
        543237095,
        icon=get_arrow_icon(),
        tag=_import_settings_menu)
    delete_option = TurboUIUtil.ObjectPickerDialog.ListPickerRow(
        3,
        4268061051,
        645194174,
        icon=get_arrow_icon(),
        tag=_delete_settings_menu)

    def import_export_menu_callback(dialog):
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            from wickedwhims.main.settings.main_settings import open_main_settings
            open_main_settings()
            return False
        result_option = TurboUIUtil.ObjectPickerDialog.get_tag_result(dialog)
        result_option()
        clear_menu_sim()
        return True

    display_picker_list_dialog(title=237356084,
                               picker_rows=(export_option, import_option,
                                            delete_option),
                               sim=get_menu_sim(),
                               callback=import_export_menu_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)
Esempio n. 4
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)
Esempio n. 5
0
 def open_window(self,
                 allow_open_callback=True,
                 allow_change_callback=False):
     display_picker_list_dialog(title=self.window_title,
                                picker_rows=self.window_picker_rows,
                                sim=get_menu_sim(),
                                callback=self._window_callback)
     if allow_open_callback and self.open_callback is not None:
         self.open_callback()
     if allow_change_callback and self.change_callback is not None:
         self.change_callback()
Esempio n. 6
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)
Esempio n. 7
0
def open_sex_npc_sims_picker_dialog(origin_position,
                                    sex_category_type,
                                    location_identifier,
                                    game_object_id,
                                    object_height,
                                    lot_id,
                                    location_position,
                                    location_level,
                                    location_angle,
                                    location_route_position,
                                    route_level,
                                    is_manual=False):
    @exception_watch()
    def npc_sims_picker_callback(dialog):
        clear_menu_sim()
        if not TurboUIUtil.SimPickerDialog.get_response_result(dialog):
            return False
        picked_sims_ids = TurboUIUtil.SimPickerDialog.get_tag_results(dialog)
        if not picked_sims_ids:
            return False
        picked_sims = list()
        for sim_id in picked_sims_ids:
            sim_info = TurboManagerUtil.Sim.get_sim_info(int(sim_id))
            if sim_info is None:
                return False
            picked_sims.append(sim_info)
        is_sim_sex_allowed = is_sim_allowed_for_animation(
            picked_sims, sex_category_type)
        if not is_sim_sex_allowed:
            display_not_allowed_message(is_sim_sex_allowed)
            return False
        pre_sex_handler = PreSexInteractionHandler(
            sex_category_type,
            TurboManagerUtil.Sim.get_sim_id(next(iter(picked_sims))),
            location_identifier,
            game_object_id,
            object_height,
            lot_id,
            location_position.x,
            location_position.y,
            location_position.z,
            location_level,
            location_angle,
            location_route_position.x,
            location_route_position.y,
            location_route_position.z,
            route_level,
            is_manual=is_manual)
        for sim_info in picked_sims:
            pre_sex_handler.add_sim(sim_info)
            sim_ev(sim_info).active_pre_sex_handler = pre_sex_handler
        open_start_npc_sex_animations_picker_dialog(pre_sex_handler)
        return True

    max_amount_of_actors = get_animation_max_amount_of_actors(
        sex_category_type,
        location_identifier[0]) or get_animation_max_amount_of_actors(
            sex_category_type, location_identifier[1])
    if max_amount_of_actors <= 0:
        display_ok_dialog(
            text=2459296019,
            title=get_sex_category_animations_stbl_name(sex_category_type))
        return
    sims_list = tuple(
        get_nearby_sims_for_sex(origin_position, radius=32, only_npc=True))
    if not sims_list:
        display_ok_dialog(
            text=3288282583,
            text_tokens=(get_sex_category_stbl_name(sex_category_type), ),
            title=get_sex_category_animations_stbl_name(sex_category_type))
        return
    display_sim_picker_dialog(
        text=389626746,
        title=get_sex_category_animations_stbl_name(sex_category_type),
        sims_id_list=sims_list,
        selectable_amount=max_amount_of_actors,
        sim=get_menu_sim(),
        callback=npc_sims_picker_callback)
Esempio n. 8
0
def open_random_sex_npc_sims_picker_dialog(origin_position,
                                           location_identifier,
                                           game_object_id,
                                           object_height,
                                           lot_id,
                                           location_position,
                                           location_level,
                                           location_angle,
                                           location_route_position,
                                           route_level,
                                           is_manual=False):
    @exception_watch()
    def random_sex_npc_sims_picker_callback(dialog):
        clear_menu_sim()
        if not TurboUIUtil.SimPickerDialog.get_response_result(dialog):
            return False
        picked_sims_ids = TurboUIUtil.SimPickerDialog.get_tag_results(dialog)
        if not picked_sims_ids:
            return False
        picked_sims = list()
        for sim_id in picked_sims_ids:
            sim_info = TurboManagerUtil.Sim.get_sim_info(int(sim_id))
            if sim_info is None:
                return False
            picked_sims.append(sim_info)
        random_animation = get_random_animation(location_identifier,
                                                picked_sims)
        if random_animation is None:
            display_ok_dialog(text=2693069513, title=1890248379)
            return False
        pre_sex_handler = PreSexInteractionHandler(
            random_animation.get_sex_category(),
            TurboManagerUtil.Sim.get_sim_id(next(iter(picked_sims))),
            location_identifier,
            game_object_id,
            object_height,
            lot_id,
            location_position.x,
            location_position.y,
            location_position.z,
            location_level,
            location_angle,
            location_route_position.x,
            location_route_position.y,
            location_route_position.z,
            route_level,
            is_manual=is_manual)
        pre_sex_handler.set_animation_instance(random_animation)
        for sim_info in picked_sims:
            pre_sex_handler.add_sim(sim_info)
            sim_ev(sim_info).active_pre_sex_handler = pre_sex_handler
        start_sex_interaction_from_pre_sex_handler(pre_sex_handler)
        return True

    sims_list = tuple(
        get_nearby_sims_for_sex(origin_position, radius=32, only_npc=True))
    if not sims_list:
        display_ok_dialog(text=3288282583, title=1890248379)
        return
    display_sim_picker_dialog(text=389626746,
                              title=1890248379,
                              sims_id_list=sims_list,
                              selectable_amount=48,
                              sim=get_menu_sim(),
                              callback=random_sex_npc_sims_picker_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)