feat(world): load ipl's (#1283)

This commit is contained in:
Johann 2023-04-29 13:29:28 +02:00 committed by GitHub
parent 4422655b32
commit 68435ebd6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 123 additions and 3 deletions

62
src/core/data/ipls.hpp Normal file

File diff suppressed because one or more lines are too long

View File

@ -262,6 +262,12 @@ namespace big
NLOHMANN_DEFINE_TYPE_INTRUSIVE(ptfx_effects, show, size) NLOHMANN_DEFINE_TYPE_INTRUSIVE(ptfx_effects, show, size)
} ptfx_effects{}; } ptfx_effects{};
struct ipls
{
int select = 0;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(ipls, select)
} ipls{};
bool clean_player = false; bool clean_player = false;
bool force_wanted_level = false; bool force_wanted_level = false;
bool free_cam = false; bool free_cam = false;
@ -315,7 +321,7 @@ namespace big
// do not save below entries // do not save below entries
bool dance_mode = false; bool dance_mode = false;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ptfx_effects, clean_player, force_wanted_level, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman, custom_weapon_stop) NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ipls, ptfx_effects, clean_player, force_wanted_level, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman, custom_weapon_stop)
} self{}; } self{};
struct session struct session

View File

@ -117,7 +117,7 @@ namespace big
view::world, view::world,
{ {
{tabs::SPAWN_PED, {"GUI_TAB_SPAWN_PED", view::spawn_ped}}, {tabs::SPAWN_PED, {"GUI_TAB_SPAWN_PED", view::spawn_ped}},
{tabs::SQUAD_SPAWNER, {"Squad spawner", view::squad_spawner}}, {tabs::SQUAD_SPAWNER, {"Squad spawner", view::squad_spawner}},
{tabs::CREATOR, {"GUI_TAB_CREATOR", view::creator}}, {tabs::CREATOR, {"GUI_TAB_CREATOR", view::creator}},
{tabs::TRAIN, {"GUI_TAB_TRAIN", view::train}}, {tabs::TRAIN, {"GUI_TAB_TRAIN", view::train}},
{tabs::BLACKHOLE, {"GUI_TAB_BLACKHOLE", view::blackhole}}, {tabs::BLACKHOLE, {"GUI_TAB_BLACKHOLE", view::blackhole}},
@ -150,7 +150,7 @@ namespace big
{ {
{tabs::CONTEXT_MENU_SETTINGS, {"GUI_TAB_CONTEXT_MENU", view::context_menu_settings}}, {tabs::CONTEXT_MENU_SETTINGS, {"GUI_TAB_CONTEXT_MENU", view::context_menu_settings}},
{tabs::ESP_SETTINGS, {"GUI_TAB_ESP", view::esp_settings}}, {tabs::ESP_SETTINGS, {"GUI_TAB_ESP", view::esp_settings}},
{tabs::GTA_CACHE_SETTINGS, {"GTA Cache", view::gta_cache}}, {tabs::GTA_CACHE_SETTINGS, {"GTA Cache", view::gta_cache}},
{tabs::GUI_SETTINGS, {"GUI_TAB_GUI", view::gui_settings}}, {tabs::GUI_SETTINGS, {"GUI_TAB_GUI", view::gui_settings}},
{tabs::HOTKEY_SETTINGS, {"GUI_TAB_HOTKEYS", view::hotkey_settings}}, {tabs::HOTKEY_SETTINGS, {"GUI_TAB_HOTKEYS", view::hotkey_settings}},
{tabs::REACTION_SETTINGS, {"GUI_TAB_REACTIONS", view::reaction_settings}}, {tabs::REACTION_SETTINGS, {"GUI_TAB_REACTIONS", view::reaction_settings}},

View File

@ -1,3 +1,4 @@
#include "core/data/ipls.hpp"
#include "fiber_pool.hpp" #include "fiber_pool.hpp"
#include "util/globals.hpp" #include "util/globals.hpp"
#include "util/mobile.hpp" #include "util/mobile.hpp"
@ -22,5 +23,56 @@ namespace big
components::command_button<"bringpv">(); components::command_button<"bringpv">();
ImGui::SameLine(); ImGui::SameLine();
components::command_button<"pvtp">(); components::command_button<"pvtp">();
components::title("GUI_TAB_IPL"_T.data());
if (ImGui::BeginCombo("IPL_LOCATION"_T.data(), ipls[g.self.ipls.select].friendly_name))
{
for (int i = 0; i < IM_ARRAYSIZE(ipls); i++)
{
if (ImGui::Selectable(ipls[i].friendly_name, i == g.self.ipls.select))
g.self.ipls.select = i;
if (i == g.self.ipls.select)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
auto selected_ipl = ipls[g.self.ipls.select];
if (components::button("LOAD_IPL"_T.data()))
{
//unload all previous ipls
for (auto& ipl : ipls)
for (auto& ipl_name : ipl.ipl_names)
{
if (STREAMING::IS_IPL_ACTIVE(ipl_name))
{
LOG(INFO) << "unloading existing ipl " << ipl_name;
STREAMING::REMOVE_IPL(ipl_name);
}
}
//load the new ipl
for (auto& ipl_name : selected_ipl.ipl_names)
STREAMING::REQUEST_IPL(ipl_name);
}
ImGui::SameLine();
if (components::button("TP_TO_IPL"_T.data()))
{
PED::SET_PED_COORDS_KEEP_VEHICLE(self::ped,
selected_ipl.location.x,
selected_ipl.location.y,
selected_ipl.location.z);
}
components::sub_title("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))
.data());
} }
} }