diff --git a/.gitignore b/.gitignore index ae31d738..d8fc8d8a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,428 +1,16 @@ -### C++ ### -# Prerequisites -*.d +# IDE +.vs/ -# Compiled Object files -*.slo -*.lo -*.o -*.obj +# output directory +bin/ +# premake in project dir people +*.exe -# Precompiled Headers +# precompiled headers +*.ipch *.gch *.pch -*.ipch -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app -*.bat - -### CMake ### -CMakeLists.txt.user -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps - -### CMake Patch ### -# External projects -*-prefix/ - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -### VisualStudio ### -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.iobj -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- Backup*.rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -### Project specific ### -bin/ +# project files *.sln -*.vcxproj -*.vcxproj.filters -*.vcxproj.user \ No newline at end of file +*.vcxproj* \ No newline at end of file diff --git a/BigBaseV2/src/gui/handling/handling_tabs.hpp b/BigBaseV2/src/gui/handling/handling_tabs.hpp deleted file mode 100644 index 0dede516..00000000 --- a/BigBaseV2/src/gui/handling/handling_tabs.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -#include "current_profile/current_profile_tabs.hpp" -#include "services/vehicle/vehicle_service.hpp" - -namespace big::tab_handling -{ - void tab_current_profile(); - void tab_my_profiles(); - void tab_saved_profiles(); - void tab_search(); -} \ No newline at end of file diff --git a/BigBaseV2/src/services/gui/gui_service.hpp b/BigBaseV2/src/services/gui/gui_service.hpp index 60b7daa4..b99b0966 100644 --- a/BigBaseV2/src/services/gui/gui_service.hpp +++ b/BigBaseV2/src/services/gui/gui_service.hpp @@ -85,7 +85,7 @@ namespace big { tabs::GUI_SETTINGS, { "GUI", view::gui_settings}}, { tabs::NOTIFICATION_SETTINGS, { "Notifications", view::notification_settings}}, { tabs::PROTECTION_SETTINGS, { "Protection", view::protection_settings}}, - { tabs::DEBUG, { "Debug", view::debug }}, + { tabs::DEBUG, { "Debug", nullptr }}, }}}, {tabs::PLAYER, {"", view::view_player}} }; diff --git a/BigBaseV2/src/views/core/view_navigation.cpp b/BigBaseV2/src/views/core/view_navigation.cpp index d9765090..0bfe4e57 100644 --- a/BigBaseV2/src/views/core/view_navigation.cpp +++ b/BigBaseV2/src/views/core/view_navigation.cpp @@ -10,9 +10,16 @@ namespace big if (ImGui::Begin("navigation", 0, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav)) { g_gui_service->reset_nav_size(); - for (std::pair navItem : g_gui_service->get_navigation()) { - if (navItem.first == tabs::PLAYER) continue; - components::nav_item(navItem, 0); + for (std::pair navItem : g_gui_service->get_navigation()) + { + switch (navItem.first) + { + case tabs::PLAYER: + case tabs::DEBUG: + continue; + default: + components::nav_item(navItem, 0); + } } ImGui::End(); diff --git a/BigBaseV2/src/views/core/view_root.cpp b/BigBaseV2/src/views/core/view_root.cpp index c731395f..7d9a1af1 100644 --- a/BigBaseV2/src/views/core/view_root.cpp +++ b/BigBaseV2/src/views/core/view_root.cpp @@ -8,5 +8,7 @@ namespace big view::navigation(); view::players(); view::active_view(); + + debug::main(); } } diff --git a/BigBaseV2/src/views/debug/view_debug.cpp b/BigBaseV2/src/views/debug/view_debug.cpp new file mode 100644 index 00000000..63fd09b8 --- /dev/null +++ b/BigBaseV2/src/views/debug/view_debug.cpp @@ -0,0 +1,22 @@ +#include "services/gui/gui_service.hpp" +#include "view_debug.hpp" + +namespace big +{ + void debug::main() + { + if (strcmp(g_gui_service->get_selected()->name, "Debug")) + return; + + if (ImGui::Begin("Debug")) + { + ImGui::BeginTabBar("debug_tabbar"); + misc(); + globals(); + locals(); + script_events(); + ImGui::EndTabBar(); + } + ImGui::End(); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/views/debug/view_debug.hpp b/BigBaseV2/src/views/debug/view_debug.hpp new file mode 100644 index 00000000..b40783b2 --- /dev/null +++ b/BigBaseV2/src/views/debug/view_debug.hpp @@ -0,0 +1,11 @@ +#pragma once + +namespace big::debug +{ + extern void globals(); + extern void misc(); + extern void script_events(); + extern void locals(); + + extern void main(); +} \ No newline at end of file diff --git a/BigBaseV2/src/views/debug/view_debug_globals.cpp b/BigBaseV2/src/views/debug/view_debug_globals.cpp new file mode 100644 index 00000000..0d5e9c25 --- /dev/null +++ b/BigBaseV2/src/views/debug/view_debug_globals.cpp @@ -0,0 +1,161 @@ +#include "gui/components/components.hpp" +#include "services/globals/globals_service.hpp" +#include "thread_pool.hpp" +#include "view_debug.hpp" + +namespace big +{ + void debug::globals() + { + if (ImGui::BeginTabItem("Globals")) + { + if (ImGui::Checkbox("Enable Freezing", &g_globals_service->m_running) && g_globals_service->m_running) + g_thread_pool->push([&]() { g_globals_service->loop(); }); + + if (components::button("Load")) + g_globals_service->load(); + ImGui::SameLine(); + if (components::button("Save")) + g_globals_service->save(); + + + ImGui::SameLine(); + if (components::button("Add Global")) + { + ImGui::OpenPopup("New Global"); + } + + if (ImGui::BeginPopupModal("New Global")) + { + static int base_address = 0; + static bool freeze = false; + static char name[32] = ""; + static int(*offsets)[2] = nullptr; + static int offset_count = 0; + static int previous_offset_count = 0; + + ImGui::Text("Name:"); + components::input_text_with_hint("##global_name", "Name", name, sizeof(name)); + ImGui::Text("Base Address:"); + ImGui::InputInt("##modal_global_base_addr", &base_address); + ImGui::Text("Freeze:"); + ImGui::Checkbox("##modal_global_freeze", &freeze); + ImGui::Text("Number of Offsets:"); + ImGui::InputInt("##modal_offset_count", &offset_count); + + if (offset_count < 0) offset_count = 0; + else if (offset_count > 10) offset_count = 10; + + if (offset_count != previous_offset_count) + { + int(*new_offsets)[2] = new int[offset_count][2]{ 0 }; + memcpy(new_offsets, offsets, sizeof(int) * std::min(offset_count, previous_offset_count) * 2); + + delete[] offsets; + offsets = new_offsets; + + previous_offset_count = offset_count; + } + + ImGui::PushItemWidth(320.f); + for (int i = 0; i < offset_count; i++) + { + ImGui::PushID(i); + + ImGui::Separator(); + + ImGui::Text("Offset: %d", i + 1); + ImGui::InputInt("##offset", &offsets[i][0]); + + ImGui::Text("Size:"); + ImGui::SameLine(); + ImGui::InputInt("##size", &offsets[i][1]); + + ImGui::PopID(); + } + ImGui::PopItemWidth(); + + if (components::button("Cancel")) + { + strcpy(name, ""); + freeze = false; + delete[] offsets; + offsets = nullptr; + offset_count = 0; + previous_offset_count = 0; + + ImGui::CloseCurrentPopup(); + } + ImGui::SameLine(); + if (components::button("Save")) + { + auto new_global = global(name, base_address, freeze, offsets, offset_count); + new_global.build_cache(); + + g_globals_service->m_globals.push_back(new_global); + + strcpy(name, ""); + freeze = false; + delete[] offsets; + offsets = nullptr; + offset_count = 0; + previous_offset_count = 0; + + ImGui::CloseCurrentPopup(); + } + + ImGui::EndPopup(); + } + + for (auto& global : g_globals_service->m_globals) + { + char label[64]; + + ImGui::Separator(); + + ImGui::PushID(global.get_id()); + ImGui::Checkbox("Freeze", &global.m_freeze); + + ImGui::BeginGroup(); + + ImGui::Text("Name:"); + ImGui::Text("Value:"); + + ImGui::EndGroup(); + + ImGui::SameLine(); + + ImGui::BeginGroup(); + + ImGui::Text(global.m_name.c_str()); + + sprintf(label, "###input_%d", global.get_id()); + ImGui::SetNextItemWidth(200.f); + ImGui::InputInt(label, global.get()); + + ImGui::EndGroup(); + + ImGui::SameLine(); + + ImGui::BeginGroup(); + + if (components::button("Delete")) + { + for (int i = 0; i < g_globals_service->m_globals.size(); i++) + if (auto& it = g_globals_service->m_globals.at(i); it.get_id() == global.get_id()) + g_globals_service->m_globals.erase(g_globals_service->m_globals.begin() + i); + + break; + } + + if (components::button("Write")) + global.write(); + + ImGui::PopID(); + ImGui::EndGroup(); + } + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/views/debug/view_debug_locals.cpp b/BigBaseV2/src/views/debug/view_debug_locals.cpp new file mode 100644 index 00000000..a0ce130c --- /dev/null +++ b/BigBaseV2/src/views/debug/view_debug_locals.cpp @@ -0,0 +1,13 @@ +#include "view_debug.hpp" + +namespace big +{ + void debug::locals() + { + if (ImGui::BeginTabItem("Locals")) + { + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/views/debug/view_debug_misc.cpp b/BigBaseV2/src/views/debug/view_debug_misc.cpp new file mode 100644 index 00000000..1186c9ee --- /dev/null +++ b/BigBaseV2/src/views/debug/view_debug_misc.cpp @@ -0,0 +1,25 @@ +#include "gui/components/components.hpp" +#include "natives.hpp" +#include "util/system.hpp" +#include "view_debug.hpp" + +namespace big +{ + void debug::misc() + { + if (ImGui::BeginTabItem("Misc")) + { + if (components::button("Dump entrypoints")) + { + system::dump_entry_points(); + } + + components::button("Network Bail", [] + { + NETWORK::NETWORK_BAIL(16, 0, 0); + }); + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/views/debug/view_debug_script_events.cpp b/BigBaseV2/src/views/debug/view_debug_script_events.cpp new file mode 100644 index 00000000..ccfb4e49 --- /dev/null +++ b/BigBaseV2/src/views/debug/view_debug_script_events.cpp @@ -0,0 +1,66 @@ +#include "gui/components/components.hpp" +#include "pointers.hpp" +#include "view_debug.hpp" + +namespace big +{ + void debug::script_events() + { + if (ImGui::BeginTabItem("Script Events")) + { + static int64_t* args; + static int event_arg_count = 3; + static int previous_arg_count; + static int event_player_bits; + static bool event_everyone = false; + + ImGui::Text("Script Argument Count:"); + ImGui::InputInt("###script_event_arg_count", &event_arg_count); + if (event_arg_count > 32) + event_arg_count = 32; + else if (event_arg_count < 3) + event_arg_count = 3; + + if (event_arg_count != previous_arg_count) + { + int64_t* temp_args = new int64_t[event_arg_count]{ 0 }; + memcpy(temp_args, args, sizeof(int64_t) * std::min(event_arg_count, previous_arg_count)); + + delete[] args; + args = temp_args; + + previous_arg_count = event_arg_count; + } + + ImGui::Separator(); + + for (int i = 0; i < event_arg_count; i++) + { + ImGui::PushID(i); + ImGui::Text("Arg[%d]", i); + ImGui::SameLine(); + + ImGui::InputScalar("###input_dynamic_arg", ImGuiDataType_S64, &args[i]); + + ImGui::PopID(); + } + + ImGui::Separator(); + + ImGui::Checkbox("Send to everyone", &event_everyone); + if (!event_everyone) + { + ImGui::Text("Player ID:"); + ImGui::InputInt("###player_bits", &event_player_bits); + } + + components::button("Send Event", [] + { + args[1] = self::id; // prevent detection from AC + g_pointers->m_trigger_script_event(1, args, event_arg_count, event_everyone ? -1 : 1 << event_player_bits); + }); + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/views/players/view_player.cpp b/BigBaseV2/src/views/players/view_player.cpp index 49a9ad31..1da40b93 100644 --- a/BigBaseV2/src/views/players/view_player.cpp +++ b/BigBaseV2/src/views/players/view_player.cpp @@ -18,7 +18,8 @@ namespace big if (g_player_service->get_selected()->is_valid()) { - if (ImGui::TreeNode("Misc")) { + if (ImGui::TreeNode("Misc")) + { components::button("Steal Outfit", [] { ped::steal_outfit( PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->get_selected()->id()) @@ -166,8 +167,8 @@ namespace big ImGui::TreePop(); } - if (ImGui::TreeNode("Teleport")) { - + if (ImGui::TreeNode("Teleport")) + { components::button("Teleport", [] { teleport::to_player(g_player_service->get_selected()->id()); }); diff --git a/BigBaseV2/src/views/settings/view_debug.cpp b/BigBaseV2/src/views/settings/view_debug.cpp deleted file mode 100644 index 4890c9d8..00000000 --- a/BigBaseV2/src/views/settings/view_debug.cpp +++ /dev/null @@ -1,231 +0,0 @@ -#include "fiber_pool.hpp" -#include "natives.hpp" -#include "pointers.hpp" -#include "services/globals/globals_service.hpp" -#include "thread_pool.hpp" -#include "util/system.hpp" -#include "views/view.hpp" - -namespace big -{ - void view::debug() { - components::sub_title("Globals"); - - if (ImGui::Checkbox("Enable Freezing", &g_globals_service->m_running) && g_globals_service->m_running) - g_thread_pool->push([&]() { g_globals_service->loop(); }); - - if (components::button("Load")) - g_globals_service->load(); - ImGui::SameLine(); - if (components::button("Save")) - g_globals_service->save(); - - components::button("Network Bail", [] - { - NETWORK::NETWORK_BAIL(16, 0, 0); - }); - - ImGui::SameLine(); - if (components::button("Add Global")) - { - ImGui::OpenPopup("New Global"); - } - - if (ImGui::BeginPopupModal("New Global")) - { - static int base_address = 0; - static bool freeze = false; - static char name[32] = ""; - static int(*offsets)[2] = nullptr; - static int offset_count = 0; - static int previous_offset_count = 0; - - g_fiber_pool->queue_job([] { - PAD::DISABLE_ALL_CONTROL_ACTIONS(0); - }); - - ImGui::Text("Name:"); - ImGui::InputText("##modal_global_name", name, sizeof(name)); - ImGui::Text("Base Address:"); - ImGui::InputInt("##modal_global_base_addr", &base_address); - ImGui::Text("Freeze:"); - ImGui::Checkbox("##modal_global_freeze", &freeze); - ImGui::Text("Number of Offsets:"); - ImGui::InputInt("##modal_offset_count", &offset_count); - - if (offset_count < 0) offset_count; - else if (offset_count > 10) offset_count = 10; - - if (offset_count != previous_offset_count) - { - int(*new_offsets)[2] = new int[offset_count][2]{ 0 }; - memcpy(new_offsets, offsets, sizeof(int) * std::min(offset_count, previous_offset_count) * 2); - - delete[] offsets; - offsets = new_offsets; - - previous_offset_count = offset_count; - } - - ImGui::PushItemWidth(320.f); - for (int i = 0; i < offset_count; i++) - { - char id[32]; - - ImGui::Separator(); - - ImGui::Text("Offset: %d", i + 1); - - sprintf(id, "##offset_%d", i); - ImGui::InputInt(id, &offsets[i][0]); - - ImGui::Text("Size:"); - ImGui::SameLine(); - sprintf(id, "##size_%d", i); - ImGui::InputInt(id, &offsets[i][1]); - } - ImGui::PopItemWidth(); - - if (components::button("Cancel")) - { - strcpy(name, ""); - freeze = false; - delete[] offsets; - offsets = nullptr; - offset_count = 0; - previous_offset_count = 0; - - ImGui::CloseCurrentPopup(); - } - ImGui::SameLine(); - if (components::button("Save")) - { - auto new_global = global(name, base_address, freeze, offsets, offset_count); - new_global.build_cache(); - - g_globals_service->m_globals.push_back(new_global); - - strcpy(name, ""); - freeze = false; - delete[] offsets; - offsets = nullptr; - offset_count = 0; - previous_offset_count = 0; - - ImGui::CloseCurrentPopup(); - } - - ImGui::EndPopup(); - } - - for (auto& global : g_globals_service->m_globals) - { - char label[64]; - - ImGui::Separator(); - - sprintf(label, "Freeze##%d", global.get_id()); - ImGui::Checkbox(label, &global.m_freeze); - - ImGui::BeginGroup(); - - ImGui::Text("Name:"); - ImGui::Text("Value:"); - - ImGui::EndGroup(); - - ImGui::SameLine(); - - ImGui::BeginGroup(); - - ImGui::Text(global.m_name.c_str()); - - sprintf(label, "###input_%d", global.get_id()); - ImGui::SetNextItemWidth(200.f); - ImGui::InputInt(label, global.get()); - - ImGui::EndGroup(); - - ImGui::SameLine(); - - ImGui::BeginGroup(); - - sprintf(label, "Delete##%d", global.get_id()); - if (components::button(label)) - { - for (int i = 0; i < g_globals_service->m_globals.size(); i++) - if (auto& it = g_globals_service->m_globals.at(i); it.get_id() == global.get_id()) - g_globals_service->m_globals.erase(g_globals_service->m_globals.begin() + i); - - break; - } - - sprintf(label, "Write###%d", global.get_id()); - if (components::button(label)) - global.write(); - - ImGui::EndGroup(); - } - - components::sub_title("Scripting Events"); - - static int64_t* args; - static int event_arg_count = 1; - static int previous_arg_count; - static int event_player_bits; - static bool event_everyone = false; - - ImGui::Text("Script Argument Count:"); - ImGui::InputInt("###script_event_arg_count", &event_arg_count); - if (event_arg_count > 32) - event_arg_count = 32; - else if (event_arg_count < 1) - event_arg_count = 1; - - if (event_arg_count != previous_arg_count) - { - int64_t* temp_args = new int64_t[event_arg_count]{ 0 }; - memcpy(temp_args, args, sizeof(int64_t) * std::min(event_arg_count, previous_arg_count)); - - delete[] args; - args = temp_args; - - previous_arg_count = event_arg_count; - } - - ImGui::Separator(); - - for (int i = 0; i < event_arg_count; i++) - { - ImGui::Text("Arg[%d]", i); - ImGui::SameLine(); - - char input_arg_name[20]; - sprintf(input_arg_name, "###input_dynamic_arg_%d", i); - ImGui::InputScalar(input_arg_name, ImGuiDataType_S64, &args[i]); - } - - ImGui::Separator(); - - ImGui::Checkbox("Send to everyone", &event_everyone); - if (!event_everyone) - { - ImGui::Text("Player ID:"); - ImGui::InputInt("###player_bits", &event_player_bits); - } - - components::button("Send Event", [] { - args[1] = self::id; // prevent detection from AC - g_pointers->m_trigger_script_event(1, args, event_arg_count, event_everyone ? -1 : 1 << event_player_bits); - }); - - components::sub_title("Debug"); - - ImGui::Checkbox("Script Event Logging", &g->debug.script_event_logging); - - if (components::button("Dump entrypoints")) - { - system::dump_entry_points(); - } - } -} \ No newline at end of file diff --git a/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp index 91126cb5..b7bff653 100644 --- a/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_fun_vehicle.cpp @@ -5,7 +5,6 @@ #include "util/vehicle.hpp" #include "util/mobile.hpp" #include "core/data/speed_units.hpp" -#include "gui/handling/handling_tabs.hpp" #include "services/gta_data/gta_data_service.hpp" #include "services/model_preview/model_preview_service.hpp" diff --git a/BigBaseV2/src/views/vehicle/view_persist_car.cpp b/BigBaseV2/src/views/vehicle/view_persist_car.cpp index c5c11e7c..a2b7ea89 100644 --- a/BigBaseV2/src/views/vehicle/view_persist_car.cpp +++ b/BigBaseV2/src/views/vehicle/view_persist_car.cpp @@ -1,5 +1,4 @@ #include "fiber_pool.hpp" -#include "gui/handling/handling_tabs.hpp" #include "script.hpp" #include "util/vehicle.hpp" #include "views/view.hpp" diff --git a/BigBaseV2/src/views/vehicle/view_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_vehicle.cpp index 7069c759..9593ff2d 100644 --- a/BigBaseV2/src/views/vehicle/view_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_vehicle.cpp @@ -1,5 +1,4 @@ #include "fiber_pool.hpp" -#include "gui/handling/handling_tabs.hpp" #include "util/vehicle.hpp" #include "views/view.hpp" #include "util/mobile.hpp" diff --git a/BigBaseV2/src/views/view.hpp b/BigBaseV2/src/views/view.hpp index ad17abdf..27f3a636 100644 --- a/BigBaseV2/src/views/view.hpp +++ b/BigBaseV2/src/views/view.hpp @@ -1,7 +1,8 @@ #pragma once #include "gui/components/components.hpp" #include "util/animator.hpp" -#include "views/esp/view_esp.hpp" +#include "esp/view_esp.hpp" +#include "debug/view_debug.hpp" namespace big @@ -13,7 +14,6 @@ namespace big public: static void active_view(); - static void debug(); static void esp_settings(); static void context_menu_settings(); static void gui_settings();