feat: TP on top error fix & Manual Teleport & Infractions in player list & Max Performance (#1394)

This commit is contained in:
DayibBaba
2023-06-10 14:47:19 +02:00
committed by GitHub
parent 59f948c6fc
commit 5f7b3569d3
11 changed files with 220 additions and 141 deletions

View File

@ -35,6 +35,10 @@ namespace big
components::command_checkbox<"nophone">();
components::command_checkbox<"infoxy">();
components::command_checkbox<"fastrespawn">();
components::command_checkbox<"invis">();
if (g.self.invisibility)
components::command_checkbox<"localvis">(); // TODO: does nothing in SP
components::command_checkbox<"nocollision">();
ImGui::EndGroup();
ImGui::SameLine();
@ -49,22 +53,19 @@ namespace big
components::command_checkbox<"beastjump">();
if (!g.self.beast_jump)
components::command_checkbox<"superjump">();
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::command_checkbox<"invis">();
if (g.self.invisibility)
components::command_checkbox<"localvis">(); // TODO: does nothing in SP
components::command_checkbox<"cleanloop">();
components::command_checkbox<"nocollision">();
components::command_checkbox<"mobileradio">();
components::command_checkbox<"superman">();
ImGui::Checkbox("DANCE_MODE"_T.data(), &g.self.dance_mode);
components::command_checkbox<"orbitaldrone">();
components::options_modal("Orbital drone", []{
components::options_modal("Orbital drone", [] {
ImGui::Separator();
ImGui::BeginGroup();
ImGui::Text("ORBITAL_DRONE_USAGE_DESCR"_T.data());
@ -86,13 +87,47 @@ namespace big
ImGui::EndGroup();
});
ImGui::EndGroup();
ImGui::Checkbox("SETTINGS_CONTEXT_MENU"_T.data(), &g.context_menu.enabled);
components::options_modal("SETTINGS_CONTEXT_MENU"_T.data(), [] {
ImGui::Text("SETTINGS_CONTEXT_MENU_ENTITY_TYPES"_T.data());
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_OBJECT"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::OBJECT));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PED"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::PED));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PLAYER"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::PLAYER));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_VEHICLE"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::VEHICLE));
components::sub_title("PTFX Styles");
static ImVec4 selected_option_color = ImGui::ColorConvertU32ToFloat4(g.context_menu.selected_option_color);
ImGui::Text("SETTINGS_CONTEXT_MENU_COLOR"_T.data());
if (ImGui::ColorEdit4("###BSelected Option Color##cm_picker", (float*)&selected_option_color, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g.context_menu.selected_option_color = ImGui::ColorConvertFloat4ToU32(selected_option_color);
}
ImGui::Checkbox("SETTINGS_CONTEXT_MENU_BOUNDING_BOX"_T.data(), &g.context_menu.bounding_box_enabled);
if (g.context_menu.bounding_box_enabled)
{
static ImVec4 bounding_box_color = ImGui::ColorConvertU32ToFloat4(g.context_menu.bounding_box_color);
ImGui::Text("SETTINGS_CONTEXT_MENU_BOUNDING_BOX_COLOR"_T.data());
if (ImGui::ColorEdit4("###Bounding Box Color##cm_picker", (float*)&bounding_box_color, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g.context_menu.bounding_box_color = ImGui::ColorConvertFloat4ToU32(bounding_box_color);
}
}
});
components::command_checkbox<"ptfx">();
if (g.self.ptfx_effects.show)
{
components::options_modal("PTFX", [] {
ImGui::SliderFloat("PTFX Size", &g.self.ptfx_effects.size, 0.1f, 2.f);
if (ImGui::BeginCombo("Asset", ptfx_named[g.self.ptfx_effects.select].friendly_name))
{
@ -125,8 +160,26 @@ namespace big
ImGui::EndCombo();
}
}
});
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g.self.never_wanted);
components::options_modal("Police", [] {
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g.self.never_wanted);
components::command_button<"clearwantedlvl">();
if (!g.self.never_wanted)
{
ImGui::Checkbox("FORCE_WANTED_LVL"_T.data(), &g.self.force_wanted_level);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_WANTED_LVL_INFO"_T.data());
ImGui::Text("WANTED_LVL"_T.data());
if (ImGui::SliderInt("###wanted_level", &g.self.wanted_level, 0, 5) && !g.self.force_wanted_level && g_local_player != nullptr)
{
g_local_player->m_player_info->m_wanted_level = g.self.wanted_level;
}
}
});
ImGui::EndGroup();
ImGui::Separator();
@ -188,26 +241,6 @@ namespace big
ImGui::Separator();
components::sub_title("POLICE"_T);
components::command_button<"clearwantedlvl">();
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g.self.never_wanted);
if (!g.self.never_wanted)
{
ImGui::Checkbox("FORCE_WANTED_LVL"_T.data(), &g.self.force_wanted_level);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_WANTED_LVL_INFO"_T.data());
ImGui::Text("WANTED_LVL"_T.data());
if (ImGui::SliderInt("###wanted_level", &g.self.wanted_level, 0, 5) && !g.self.force_wanted_level && g_local_player != nullptr)
{
g_local_player->m_player_info->m_wanted_level = g.self.wanted_level;
}
}
ImGui::Separator();
components::sub_title("HUD"_T);
ImGui::BeginGroup();

View File

@ -10,21 +10,80 @@ namespace big
{
void view::teleport()
{
ImGui::Text("BLIPS"_T.data());
components::sub_title("BLIPS"_T.data());
ImGui::Spacing();
components::command_button<"waypointtp">({}, "Waypoint");
ImGui::SameLine();
components::command_button<"objectivetp">({}, "Objective");
components::command_checkbox<"autotptowp">();
ImGui::Text("VEHICLES"_T.data());
ImGui::Separator();
components::sub_title("Movement");
ImGui::Spacing();
static float new_location[3];
static float increment = 1;
components::small_text("Custom teleport");
ImGui::SetNextItemWidth(200);
ImGui::InputFloat3("##Customlocation", new_location);
ImGui::SameLine();
components::button("Teleport", [] {
teleport::teleport_player_to_coords(g_player_service->get_self(), {new_location[0], new_location[1], new_location[2]});
});
ImGui::Spacing();
components::small_text("Specific movement");
ImGui::SetNextItemWidth(200);
ImGui::InputFloat("Distance", &increment);
ImGui::BeginGroup();
components::button("Forward", [] {
teleport::teleport_player_to_coords(g_player_service->get_self(), ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0, increment, 0));
});
components::button("Backward", [] {
teleport::teleport_player_to_coords(g_player_service->get_self(), ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0, -increment, 0));
});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Left", [] {
teleport::teleport_player_to_coords(g_player_service->get_self(), ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, -increment, 0, 0));
});
components::button("Right", [] {
teleport::teleport_player_to_coords(g_player_service->get_self(), ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, increment, 0, 0));
});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Up", [] {
teleport::teleport_player_to_coords(g_player_service->get_self(), ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0, 0, increment));
});
components::button("Down", [] {
teleport::teleport_player_to_coords(g_player_service->get_self(), ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0, 0, -increment));
});
ImGui::EndGroup();
ImGui::Separator();
components::sub_title("VEHICLES"_T.data());
ImGui::Spacing();
components::command_button<"lastvehtp">();
ImGui::SameLine();
components::command_button<"bringpv">();
ImGui::SameLine();
components::command_button<"pvtp">();
components::title("GUI_TAB_IPL"_T.data());
ImGui::Separator();
components::sub_title("GUI_TAB_IPL"_T.data());
if (ImGui::BeginCombo("IPL_LOCATION"_T.data(), ipls[g.self.ipls.select].friendly_name))
{
@ -69,7 +128,9 @@ namespace big
selected_ipl.location.z);
}
components::sub_title("IPL_INFOS"_T.data());
ImGui::Spacing();
components::small_text("IPL_INFOS"_T.data());
ImGui::Text(std::vformat("IPL_CNT"_T, std::make_format_args(selected_ipl.ipl_names.size())).data());
ImGui::Text(std::vformat("IPL_POSITION"_T,
std::make_format_args(selected_ipl.location.x, selected_ipl.location.y, selected_ipl.location.z))

View File

@ -30,50 +30,48 @@ namespace big
components::command_checkbox<"rapidfire">();
ImGui::EndGroup();
ImGui::Separator();
ImGui::Checkbox("ENABLE_SPECIAL_AMMO"_T.data(), &g.weapons.ammo_special.toggle);
components::options_modal("Special ammo", [] {
eAmmoSpecialType selected_ammo = g.weapons.ammo_special.type;
eExplosionTag selected_explosion = g.weapons.ammo_special.explosion_tag;
eAmmoSpecialType selected_ammo = g.weapons.ammo_special.type;
eExplosionTag selected_explosion = g.weapons.ammo_special.explosion_tag;
if (ImGui::BeginCombo("SPECIAL_AMMO"_T.data(), SPECIAL_AMMOS[(int)selected_ammo].name))
{
for (const auto& special_ammo : SPECIAL_AMMOS)
if (ImGui::BeginCombo("SPECIAL_AMMO"_T.data(), SPECIAL_AMMOS[(int)selected_ammo].name))
{
if (ImGui::Selectable(special_ammo.name, special_ammo.type == selected_ammo))
for (const auto& special_ammo : SPECIAL_AMMOS)
{
g.weapons.ammo_special.type = special_ammo.type;
}
if (ImGui::Selectable(special_ammo.name, special_ammo.type == selected_ammo))
{
g.weapons.ammo_special.type = special_ammo.type;
}
if (special_ammo.type == selected_ammo)
{
ImGui::SetItemDefaultFocus();
if (special_ammo.type == selected_ammo)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
ImGui::EndCombo();
}
if (ImGui::BeginCombo("BULLET_IMPACT"_T.data(), BULLET_IMPACTS[selected_explosion]))
{
for (const auto& [type, name] : BULLET_IMPACTS)
if (ImGui::BeginCombo("BULLET_IMPACT"_T.data(), BULLET_IMPACTS[selected_explosion]))
{
if (ImGui::Selectable(name, type == selected_explosion))
for (const auto& [type, name] : BULLET_IMPACTS)
{
g.weapons.ammo_special.explosion_tag = type;
if (ImGui::Selectable(name, type == selected_explosion))
{
g.weapons.ammo_special.explosion_tag = type;
}
if (type == selected_explosion)
{
ImGui::SetItemDefaultFocus();
}
}
if (type == selected_explosion)
{
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
});
ImGui::EndCombo();
}
ImGui::EndGroup();
ImGui::Separator();