Exemplo n.º 1
0
def open_start_sex_animations_picker_dialog(pre_sex_handler):
    @exception_watch()
    def animations_picker_callback(dialog):
        if pre_sex_handler is None:
            return False
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            open_start_sex_animations_category_picker_dialog(pre_sex_handler)
            return False
        animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result(
            dialog)
        pre_sex_handler.set_animation_instance(animation_instance)
        start_sex_interaction_from_pre_sex_handler(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))
    animations_list = get_animations_with_params(
        pre_sex_handler.get_interaction_type(),
        pre_sex_handler.get_object_identifier(), genders_list)
    animations_rows = list()
    for animation in animations_list:
        animations_rows.append(animation.get_picker_row())
    if len(animations_rows) > 1:
        animations_rows.insert(
            0,
            ChoiceListRandomAnimationPickerRow(
                pre_sex_handler, pre_sex_handler.get_interaction_type()))
    if len(get_available_sex_animations()) <= 4:
        display_ok_dialog(text=1066517691, title=3113927949)
    display_picker_list_dialog(title=get_sex_category_animations_stbl_name(
        pre_sex_handler.get_interaction_type()),
                               picker_rows=animations_rows,
                               callback=animations_picker_callback)
Exemplo n.º 2
0
 def join_sims_picker_callback(dialog):
     if pre_sex_handler is None:
         return False
     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)
     for sim_info in picked_sims:
         pre_sex_handler.add_sim(sim_info)
     genders_list = list()
     for sim_info in pre_sex_handler.get_actors_sim_info_gen():
         genders_list.append(get_sim_sex_gender(sim_info))
     if sex_category_type is not None:
         sex_allowed = is_sim_allowed_for_animation(tuple(picked_sims),
                                                    sex_category_type,
                                                    is_joining=True)
         if not sex_allowed:
             display_not_allowed_message(sex_allowed)
             return False
         has_animations = False
         if has_animations_with_params(
                 sex_category_type, pre_sex_handler.get_object_identifier(),
                 genders_list):
             has_animations = True
         if has_animations is False:
             display_ok_dialog(text=2693069513,
                               title=get_sex_category_animations_stbl_name(
                                   sex_category_type))
             return False
         open_join_sex_animations_picker_dialog(pre_sex_handler,
                                                picked_sims,
                                                sex_category_type)
     else:
         random_animation = get_random_animation(
             pre_sex_handler.get_object_identifier(),
             tuple(pre_sex_handler.get_actors_sim_info_gen()))
         if random_animation is None:
             display_ok_dialog(text=2693069513, title=1890248379)
             return False
         pre_sex_handler.set_animation_instance(random_animation)
         join_sex_interaction_from_pre_sex_handler(pre_sex_handler,
                                                   picked_sims)
     return True
Exemplo n.º 3
0
def open_change_sex_location_animations_picker_dialog(
        active_sex_handler, sex_category_type, new_object_identifier,
        game_object_id, object_height, location_x, location_y, location_z,
        location_level, location_angle, route_x, route_y, route_z,
        route_level):
    @exception_watch()
    def change_sex_location_animation_picker_callback(dialog):
        if active_sex_handler is None:
            return False
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            return False
        animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result(
            dialog)
        active_sex_handler.set_animation_instance(animation_instance,
                                                  is_manual=True)
        active_sex_handler.set_object_identifier(new_object_identifier)
        active_sex_handler.set_game_object_id(game_object_id)
        active_sex_handler.set_object_height(object_height)
        active_sex_handler.set_location(location_x, location_y, location_z,
                                        location_level, location_angle)
        active_sex_handler.set_route_position(route_x, route_y, route_z,
                                              route_level)
        active_sex_handler.reassign_actors()
        active_sex_handler.restart()
        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))
    animations_list = get_animations_with_params(sex_category_type,
                                                 new_object_identifier,
                                                 genders_list)
    animations_rows = list()
    for animation in animations_list:
        animations_rows.append(animation.get_picker_row())
    if len(animations_rows) > 1:
        animations_rows.insert(
            0,
            ChoiceListRandomAnimationPickerRow(
                active_sex_handler,
                sex_category_type,
                object_identifier=new_object_identifier))
    display_picker_list_dialog(
        title=get_sex_category_animations_stbl_name(sex_category_type),
        picker_rows=animations_rows,
        callback=change_sex_location_animation_picker_callback)
Exemplo n.º 4
0
def open_change_sex_animations_picker_dialog(active_sex_handler,
                                             sex_category_type):
    @exception_watch()
    def animation_picker_callback(dialog):
        if active_sex_handler is None:
            return False
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            open_change_sex_animations_category_picker_dialog(
                active_sex_handler)
            return False
        animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result(
            dialog)
        if animation_instance is not None and animation_instance is not active_sex_handler.get_animation_instance(
        ):
            active_sex_handler.set_animation_instance(animation_instance,
                                                      is_animation_change=True,
                                                      is_manual=True)
            active_sex_handler.play(is_animation_change=True)
            return True
        return False

    genders_list = list()
    for sim_info in active_sex_handler.get_actors_sim_info_gen():
        genders_list.append(get_sim_sex_gender(sim_info))
    animations_list = get_animations_with_params(
        sex_category_type, active_sex_handler.get_object_identifier(),
        genders_list)
    animations_rows = list()
    for animation in animations_list:
        animations_rows.append(
            animation.get_picker_row(
                display_selected=animation.get_animation_id() ==
                active_sex_handler.get_animation_instance().get_animation_id())
        )
    if len(animations_rows) > 1:
        animations_rows.insert(
            0,
            ChoiceListRandomAnimationPickerRow(active_sex_handler,
                                               sex_category_type))
    display_picker_list_dialog(
        title=get_sex_category_animations_stbl_name(sex_category_type),
        picker_rows=animations_rows,
        callback=animation_picker_callback)
Exemplo n.º 5
0
def open_join_sex_animations_picker_dialog(pre_sex_handler,
                                           joining_sims_list,
                                           sex_category_type,
                                           flip_relationship_check=False):
    @exception_watch()
    def join_sex_animation_picker_callback(dialog):
        if pre_sex_handler is None:
            return False
        if not TurboUIUtil.ObjectPickerDialog.get_response_result(dialog):
            return False
        animation_instance = TurboUIUtil.ObjectPickerDialog.get_tag_result(
            dialog)
        pre_sex_handler.set_animation_instance(animation_instance)
        join_sex_interaction_from_pre_sex_handler(
            pre_sex_handler,
            joining_sims_list,
            flip_relationship_check=flip_relationship_check)
        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))
    animations_list = get_animations_with_params(
        sex_category_type, pre_sex_handler.get_object_identifier(),
        genders_list)
    animations_rows = list()
    for animation in animations_list:
        animations_rows.append(animation.get_picker_row())
    if len(animations_list) > 1:
        animations_rows.insert(
            0,
            ChoiceListRandomAnimationPickerRow(pre_sex_handler,
                                               sex_category_type))
    display_picker_list_dialog(
        title=get_sex_category_animations_stbl_name(sex_category_type),
        picker_rows=animations_rows,
        sim=pre_sex_handler.get_creator_sim_id(),
        callback=join_sex_animation_picker_callback)
Exemplo n.º 6
0
def open_start_sex_sims_picker_dialog(origin_position, pre_sex_handler):
    @exception_watch()
    def sim_picker_callback(dialog):
        if pre_sex_handler is None:
            return False
        if not TurboUIUtil.SimPickerDialog.get_response_result(dialog):
            clear_sims_sex_extra_data(
                tuple(pre_sex_handler.get_actors_sim_info_gen()))
            return False
        selected_sim_id = TurboUIUtil.SimPickerDialog.get_tag_result(dialog)
        if not selected_sim_id:
            clear_sims_sex_extra_data(
                tuple(pre_sex_handler.get_actors_sim_info_gen()))
            return False
        selected_sim_info = TurboManagerUtil.Sim.get_sim_info(
            int(selected_sim_id))
        if selected_sim_info is None:
            clear_sims_sex_extra_data(
                tuple(pre_sex_handler.get_actors_sim_info_gen()))
            return False
        is_sim_sex_allowed = is_sim_allowed_for_animation(
            tuple(pre_sex_handler.get_actors_sim_info_gen()) +
            (selected_sim_info, ), pre_sex_handler.get_interaction_type())
        if not is_sim_sex_allowed:
            display_not_allowed_message(is_sim_sex_allowed)
            clear_sims_sex_extra_data(
                tuple(pre_sex_handler.get_actors_sim_info_gen()))
            return False
        pre_sex_handler.add_sim(selected_sim_id)
        open_start_sex_animations_picker_dialog(pre_sex_handler)
        return True

    creator_sim_info = TurboManagerUtil.Sim.get_sim_info(
        pre_sex_handler.get_creator_sim_id())
    test_incest_of_sims = () if get_relationship_setting(
        RelationshipSetting.INCEST_STATE,
        variable_type=bool) else (creator_sim_info, )
    (min_age_limit, max_age_limit) = get_age_limits_for_sex(
        (creator_sim_info, ))
    skip_males = not has_animations_with_params(
        pre_sex_handler.get_interaction_type(),
        pre_sex_handler.get_object_identifier(),
        (get_sim_sex_gender(creator_sim_info), SexGenderType.MALE))
    skip_females = not has_animations_with_params(
        pre_sex_handler.get_interaction_type(),
        pre_sex_handler.get_object_identifier(),
        (get_sim_sex_gender(creator_sim_info), SexGenderType.FEMALE))
    skip_cmales = not has_animations_with_params(
        pre_sex_handler.get_interaction_type(),
        pre_sex_handler.get_object_identifier(),
        (get_sim_sex_gender(creator_sim_info), SexGenderType.CMALE))
    skip_cfemales = not has_animations_with_params(
        pre_sex_handler.get_interaction_type(),
        pre_sex_handler.get_object_identifier(),
        (get_sim_sex_gender(creator_sim_info), SexGenderType.CFEMALE))
    sims_list = list(
        get_nearby_sims_for_sex(
            origin_position,
            radius=16,
            relative_sims=test_incest_of_sims,
            min_sims_age=min_age_limit,
            max_sims_age=max_age_limit,
            skip_males=skip_males,
            skip_females=skip_females,
            skip_cmales=skip_cmales,
            skip_cfemales=skip_cfemales,
            skip_sims_ids=(pre_sex_handler.get_creator_sim_id(), )))
    if has_animations_with_params(pre_sex_handler.get_interaction_type(),
                                  pre_sex_handler.get_object_identifier(),
                                  (get_sim_sex_gender(creator_sim_info), )):
        sims_list.insert(0, pre_sex_handler.get_creator_sim_id())
    if not sims_list:
        display_ok_dialog(text=780195446,
                          text_tokens=(get_sex_category_stbl_name(
                              pre_sex_handler.get_interaction_type()),
                                       creator_sim_info),
                          title=get_sex_category_animations_stbl_name(
                              pre_sex_handler.get_interaction_type()))
        clear_sims_sex_extra_data(
            tuple(pre_sex_handler.get_actors_sim_info_gen()))
        return
    display_sim_picker_dialog(text=906772330,
                              title=get_sex_category_animations_stbl_name(
                                  pre_sex_handler.get_interaction_type()),
                              sims_id_list=sims_list,
                              callback=sim_picker_callback)
Exemplo n.º 7
0
def open_join_sims_picker_dialog(pre_sex_handler,
                                 sex_category_type,
                                 selected_sims_ids=()):
    @exception_watch()
    def join_sims_picker_callback(dialog):
        if pre_sex_handler is None:
            return False
        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)
        for sim_info in picked_sims:
            pre_sex_handler.add_sim(sim_info)
        genders_list = list()
        for sim_info in pre_sex_handler.get_actors_sim_info_gen():
            genders_list.append(get_sim_sex_gender(sim_info))
        if sex_category_type is not None:
            sex_allowed = is_sim_allowed_for_animation(tuple(picked_sims),
                                                       sex_category_type,
                                                       is_joining=True)
            if not sex_allowed:
                display_not_allowed_message(sex_allowed)
                return False
            has_animations = False
            if has_animations_with_params(
                    sex_category_type, pre_sex_handler.get_object_identifier(),
                    genders_list):
                has_animations = True
            if has_animations is False:
                display_ok_dialog(text=2693069513,
                                  title=get_sex_category_animations_stbl_name(
                                      sex_category_type))
                return False
            open_join_sex_animations_picker_dialog(pre_sex_handler,
                                                   picked_sims,
                                                   sex_category_type)
        else:
            random_animation = get_random_animation(
                pre_sex_handler.get_object_identifier(),
                tuple(pre_sex_handler.get_actors_sim_info_gen()))
            if random_animation is None:
                display_ok_dialog(text=2693069513, title=1890248379)
                return False
            pre_sex_handler.set_animation_instance(random_animation)
            join_sex_interaction_from_pre_sex_handler(pre_sex_handler,
                                                      picked_sims)
        return True

    if sex_category_type is not None:
        max_amount_of_actors = max(
            get_animation_max_amount_of_actors(
                sex_category_type,
                pre_sex_handler.get_object_identifier()[0]),
            get_animation_max_amount_of_actors(
                sex_category_type,
                pre_sex_handler.get_object_identifier()[1]))
    else:
        max_amount_of_actors = 48
    if max_amount_of_actors <= 0:
        if sex_category_type is not None:
            display_ok_dialog(
                text=443330929,
                text_tokens=(get_sex_category_animations_stbl_name(
                    sex_category_type), ),
                title=get_sex_category_animations_stbl_name(sex_category_type))
        else:
            display_ok_dialog(text=3121278879, title=1890248379)
        return
    creator_sim = TurboManagerUtil.Sim.get_sim_info(
        pre_sex_handler.get_creator_sim_id())
    test_incest_of_sims = () if get_relationship_setting(
        RelationshipSetting.INCEST_STATE, variable_type=bool) else tuple(
            pre_sex_handler.get_actors_sim_info_gen())
    (min_age_limit, max_age_limit) = get_age_limits_for_sex(
        tuple(pre_sex_handler.get_actors_sim_info_gen()))
    skip_sims_ids = [
        TurboManagerUtil.Sim.get_sim_id(actor_sim_info)
        for actor_sim_info in pre_sex_handler.get_actors_sim_info_gen()
    ]
    sims_list = tuple(
        get_nearby_sims_for_sex(pre_sex_handler.get_los_position(),
                                radius=16,
                                relative_sims=test_incest_of_sims,
                                min_sims_age=min_age_limit,
                                max_sims_age=max_age_limit,
                                skip_sims_ids=skip_sims_ids))
    if not sims_list:
        display_ok_dialog(
            text=2721401338,
            text_tokens=(get_sex_category_stbl_name(sex_category_type),
                         creator_sim),
            title=get_sex_category_animations_stbl_name(sex_category_type))
        return
    display_sim_picker_dialog(
        text=747723284,
        title=get_sex_category_animations_stbl_name(sex_category_type),
        sims_id_list=sims_list,
        selected_sims_id_list=selected_sims_ids,
        selectable_amount=max_amount_of_actors -
        pre_sex_handler.get_sims_amount(),
        sim=creator_sim,
        callback=join_sims_picker_callback)
Exemplo n.º 8
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)