diff --git a/scripts/gtav-classes.cmake b/scripts/gtav-classes.cmake index d2e20725..9d71f5a7 100644 --- a/scripts/gtav-classes.cmake +++ b/scripts/gtav-classes.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( gtav_classes GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git - GIT_TAG 4f76d41ff4c39c296606238cbfa9fd4bceee3a54 + GIT_TAG 57548ccd8742f0355fc674e8f4dedee119d640e5 GIT_PROGRESS TRUE CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/src/backend/backend.cpp b/src/backend/backend.cpp index aee5321c..461a6d16 100644 --- a/src/backend/backend.cpp +++ b/src/backend/backend.cpp @@ -7,6 +7,7 @@ #include "services/context_menu/context_menu_service.hpp" #include "services/orbital_drone/orbital_drone.hpp" #include "services/vehicle/vehicle_control_service.hpp" +#include "services/squad_spawner/squad_spawner.hpp" #include "thread_pool.hpp" @@ -217,4 +218,14 @@ namespace big script::get_current()->yield(); } } + + void backend::squad_spawner() + { + while (true) + { + g_squad_spawner_service.tick(); + + script::get_current()->yield(); + } + } } diff --git a/src/backend/backend.hpp b/src/backend/backend.hpp index 63683295..f8d9ac81 100644 --- a/src/backend/backend.hpp +++ b/src/backend/backend.hpp @@ -20,5 +20,6 @@ namespace big static void world_loop(); static void orbital_drone(); static void vehicle_control(); + static void squad_spawner(); }; } diff --git a/src/gta/enums.hpp b/src/gta/enums.hpp index e8f33866..321b8975 100644 --- a/src/gta/enums.hpp +++ b/src/gta/enums.hpp @@ -1919,3 +1919,16 @@ enum class eVehicleSeats OUTSIDE_LEFT, OUTSIDE_RIGHT, }; + +enum class eCombatAbilityLevel{ + POOR, + AVERAGE, + PROFESSIONAL +}; + +NLOHMANN_JSON_SERIALIZE_ENUM(eCombatAbilityLevel, + { + {eCombatAbilityLevel::POOR, "poor"}, + {eCombatAbilityLevel::AVERAGE, "average"}, + {eCombatAbilityLevel::PROFESSIONAL, "professional"} + }) diff --git a/src/gui/components/components.hpp b/src/gui/components/components.hpp index 581e0134..d8030b4d 100644 --- a/src/gui/components/components.hpp +++ b/src/gui/components/components.hpp @@ -22,6 +22,8 @@ namespace big static void nav_item(std::pair&, int); static void input_text_with_hint(const std::string_view label, const std::string_view hint, char* buf, size_t buf_size, ImGuiInputTextFlags_ flag = ImGuiInputTextFlags_None, std::function cb = nullptr); + static void input_text_with_hint(const std::string_view label, const std::string_view hint, std::string* buf, ImGuiInputTextFlags_ flag = ImGuiInputTextFlags_None, std::function cb = nullptr); + static void input_text(const std::string_view label, char* buf, size_t buf_size, ImGuiInputTextFlags_ flag = ImGuiInputTextFlags_None, std::function cb = nullptr); static bool selectable(const std::string_view, bool); diff --git a/src/gui/components/input_text_with_hint.cpp b/src/gui/components/input_text_with_hint.cpp index 19ad01ec..985cfa84 100644 --- a/src/gui/components/input_text_with_hint.cpp +++ b/src/gui/components/input_text_with_hint.cpp @@ -1,5 +1,6 @@ #include "fiber_pool.hpp" #include "gui/components/components.hpp" +#include "misc/cpp/imgui_stdlib.h" #include "natives.hpp" namespace big @@ -15,4 +16,16 @@ namespace big PAD::DISABLE_ALL_CONTROL_ACTIONS(0); }); } + + void components::input_text_with_hint(const std::string_view label, const std::string_view hint, std::string* buf, ImGuiInputTextFlags_ flag, std::function cb) + { + if (ImGui::InputTextWithHint(label.data(), hint.data(), buf, flag)) + if (cb) + g_fiber_pool->queue_job(std::move(cb)); + + if (ImGui::IsItemActive()) + g_fiber_pool->queue_job([] { + PAD::DISABLE_ALL_CONTROL_ACTIONS(0); + }); + } } \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 85b2a89b..09f3aa25 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,8 +26,10 @@ #include "services/player_database/player_database_service.hpp" #include "services/players/player_service.hpp" #include "services/script_patcher/script_patcher_service.hpp" +#include "services/squad_spawner/squad_spawner.hpp" #include "services/vehicle/handling_service.hpp" #include "services/vehicle/vehicle_control_service.hpp" +#include "services/squad_spawner/squad_spawner.hpp" #include "thread_pool.hpp" #include "version.hpp" @@ -121,6 +123,7 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID) g_script_mgr.add_script(std::make_unique