diff --git a/.clang-format b/.clang-format index 8c858c5..a0ec550 100644 --- a/.clang-format +++ b/.clang-format @@ -19,7 +19,6 @@ AlwaysBreakTemplateDeclarations: 'Yes' BinPackArguments: 'false' BinPackParameters: 'true' BreakBeforeBinaryOperators: NonAssignment -BreakBeforeBraces: Allman BreakBeforeTernaryOperators: 'false' BreakConstructorInitializers: AfterColon BreakInheritanceList: AfterColon diff --git a/CMakeLists.txt b/CMakeLists.txt index 479d534..b7aa849 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,6 @@ include(cmake/async-logger.cmake) include(cmake/imgui.cmake) include(cmake/json.cmake) include(cmake/minhook.cmake) -include(cmake/gtav-classes.cmake) # source set(SRC_DIR "${PROJECT_SOURCE_DIR}/src") @@ -21,13 +20,21 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 23) target_precompile_headers(${PROJECT_NAME} PUBLIC "${SRC_DIR}/common.hpp") +add_compile_definitions( + _CRT_SECURE_NO_WARNINGS + WIN32_LEAN_AND_MEAN + NOMINMAX + IMGUI_DEFINE_MATH_OPERATORS +) + message(STATUS "Setting up include directories.") target_include_directories(${PROJECT_NAME} PRIVATE "${SRC_DIR}" "${imgui_SOURCE_DIR}" "${minhook_SOURCE_DIR}/include" + "${minhook_SOURCE_DIR}/src/hde" "${gtav_classes_SOURCE_DIR}" ) message(STATUS "Setting up linked libraries") -target_link_libraries(${PROJECT_NAME} PRIVATE AsyncLogger imgui minhook nlohmann_json::nlohmann_json) \ No newline at end of file +target_link_libraries(${PROJECT_NAME} PRIVATE AsyncLogger imgui minhook nlohmann_json::nlohmann_json dbghelp) \ No newline at end of file diff --git a/CMakeSettings.json b/CMakeSettings.json index 0b209e3..91d88ca 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -1,18 +1,7 @@ { "configurations": [ { - "name": "x64-Debug", - "generator": "Ninja", - "configurationType": "Debug", - "inheritEnvironments": [ "msvc_x64_x64" ], - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}\\out\\install\\${name}", - "cmakeCommandArgs": "", - "buildCommandArgs": "", - "ctestCommandArgs": "" - }, - { - "name": "x64-Release", + "name": "x64-Release-MSVC", "generator": "Ninja", "configurationType": "RelWithDebInfo", "buildRoot": "${projectDir}\\out\\build\\${name}", @@ -20,8 +9,18 @@ "cmakeCommandArgs": "", "buildCommandArgs": "", "ctestCommandArgs": "", - "inheritEnvironments": [ "msvc_x64_x64" ], - "variables": [] + "inheritEnvironments": [ "msvc_x64_x64" ] + }, + { + "name": "x64-Release-Clang", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "clang_cl_x64_x64" ] } ] } \ No newline at end of file diff --git a/README.md b/README.md index 2c74b72..013ad15 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Template Hell Base +# YimMenuV2 -This base is honestly a joke and a learning opporunity for myself to learn some more stuff about C++20. I went through the basics of what makes a mod menu base and tried to template them to hell and back. +Experimental menu for GTA 5: Enhanced ## Structure diff --git a/cmake/async-logger.cmake b/cmake/async-logger.cmake index b04224d..87aff1e 100644 --- a/cmake/async-logger.cmake +++ b/cmake/async-logger.cmake @@ -1,10 +1,10 @@ include(FetchContent) - +add_compile_definitions(CXX_FORMAT_SUPPORT) message(STATUS "Setting up AsyncLogger") FetchContent_Declare( AsyncLogger GIT_REPOSITORY https://github.com/Yimura/AsyncLogger.git - GIT_TAG v0.0.6 + GIT_TAG 6fcfd90b3f4ca4dae09c4a96e9a506e6aea06472 GIT_PROGRESS TRUE ) FetchContent_MakeAvailable(AsyncLogger) diff --git a/cmake/gtav-classes.cmake b/cmake/gtav-classes.cmake deleted file mode 100644 index c6dd5d4..0000000 --- a/cmake/gtav-classes.cmake +++ /dev/null @@ -1,14 +0,0 @@ -include(FetchContent) - -FetchContent_Declare( - gtav_classes - GIT_REPOSITORY https://github.com/maybegreat48/GTAV-Classes.git - GIT_TAG fb7ec7fe0a8ac08823ab7a0a2e68c08b027fce2f - GIT_PROGRESS TRUE - CONFIGURE_COMMAND "" - BUILD_COMMAND "" -) -message("GTAV-Classes") -if(NOT gtav_classes_POPULATED) - FetchContent_Populate(gtav_classes) -endif() \ No newline at end of file diff --git a/cmake/imgui.cmake b/cmake/imgui.cmake index 0f86a30..524f906 100644 --- a/cmake/imgui.cmake +++ b/cmake/imgui.cmake @@ -5,8 +5,8 @@ message(STATUS "Setting up ${LIB_NAME}") FetchContent_Declare( ${LIB_NAME} - GIT_REPOSITORY https://github.com/Spyral-Org/imgui.git - GIT_TAG 44d98bfd6d12caee43bea49fda71c8313c3e57e7 + GIT_REPOSITORY https://github.com/ocornut/imgui + GIT_TAG 6e30c4210181aebb6137f6c10fdfc572ea1202f2 GIT_PROGRESS TRUE ) @@ -19,7 +19,7 @@ if(NOT imgui_POPULATED) "${imgui_SOURCE_DIR}/*.cpp" "${imgui_SOURCE_DIR}/*.h" "${imgui_SOURCE_DIR}/backends/imgui_impl_win32.*" - "${imgui_SOURCE_DIR}/backends/imgui_impl_dx11.*" + "${imgui_SOURCE_DIR}/backends/imgui_impl_dx12.*" "${imgui_SOURCE_DIR}/misc/cpp/imgui_stdlib.*" ) diff --git a/src/common.hpp b/src/common.hpp index 0b87873..2e6751c 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -18,15 +18,20 @@ #include #include #include +#include +#include #include using namespace al; #include "core/logger/LogHelper.hpp" +#undef Yield + namespace YimMenu { using namespace std::chrono_literals; + using namespace std::string_view_literals; extern std::atomic g_Running; extern HINSTANCE g_DllInstance; diff --git a/src/core/backend/FiberPool.cpp b/src/core/backend/FiberPool.cpp new file mode 100644 index 0000000..ad0b630 --- /dev/null +++ b/src/core/backend/FiberPool.cpp @@ -0,0 +1,51 @@ +#include "FiberPool.hpp" + +#include "ScriptMgr.hpp" + +namespace YimMenu +{ + void FiberPool::InitImpl(int num_fibers) + { + for (std::size_t i = 0; i < num_fibers; ++i) + { + ScriptMgr::AddScript(std::make_unique