diff --git a/CheatMenu/Animation.cpp b/CheatMenu/Animation.cpp index 1ccebeb..511bb1b 100644 --- a/CheatMenu/Animation.cpp +++ b/CheatMenu/Animation.cpp @@ -6,6 +6,49 @@ Animation::Animation() { json.LoadData(search_categories, selected_item); + Cutscene::json.LoadData(Cutscene::categories, Cutscene::selected); + + Events::processScriptsEvent += [] + { + if (Cutscene::running) + { + if (Command()) + { + Command(); + Cutscene::running = false; + Cutscene::scene_name = ""; + CPlayerPed* player = FindPlayerPed(); + player->m_nAreaCode = Cutscene::interior; + Command(player->m_nAreaCode); + Cutscene::interior = 0; + TheCamera.Fade(0, 1); + } + } + else + { + if (Cutscene::scene_name != "" && Command()) + { + Command(); + Cutscene::running = true; + } + } + }; +} + +void Animation::PlayCutscene(std::string& rootkey, std::string& cutscene_str, std::string& interior) +{ + if (Util::IsOnCutscene()) + { + CHud::SetHelpMessage("Another cutscene is running", false, false, false); + return; + } + + Cutscene::scene_name = cutscene_str; + Command(cutscene_str.c_str()); + CPlayerPed *player =FindPlayerPed(); + Cutscene::interior = player->m_nAreaCode; + player->m_nAreaCode = std::stoi(interior); + Command(player->m_nAreaCode); } void Animation::Draw() @@ -88,6 +131,33 @@ void Animation::Draw() } ImGui::EndTabItem(); } + if (ImGui::BeginTabItem("Cutscene")) + { + ImGui::Spacing(); + if (ImGui::Button("Stop cutscene", Ui::GetSize())) + { + if (Cutscene::running) + { + Command(); + Cutscene::running = false; + Cutscene::scene_name = ""; + CPlayerPed* player = FindPlayerPed(); + player->m_nAreaCode = Cutscene::interior; + Command(player->m_nAreaCode); + Cutscene::interior = 0; + TheCamera.Fade(0, 1); + } + } + ImGui::Spacing(); + + if (ImGui::BeginChild("Cutscene Child")) + { + ImGui::Spacing(); + Ui::DrawJSON(Cutscene::json, Cutscene::categories, Cutscene::selected, Cutscene::filter, &PlayCutscene, nullptr); + ImGui::EndChild(); + } + ImGui::EndTabItem(); + } ImGui::EndTabBar(); } } diff --git a/CheatMenu/Animation.h b/CheatMenu/Animation.h index 02c9600..c23cd69 100644 --- a/CheatMenu/Animation.h +++ b/CheatMenu/Animation.h @@ -10,6 +10,18 @@ private: inline static std::vector search_categories; inline static std::string selected_item = "All"; + struct Cutscene + { + inline static CJson json = CJson("cutscene"); + inline static ImGuiTextFilter filter = ""; + inline static std::vector categories; + inline static std::string selected = "All"; + inline static std::string scene_name = ""; + inline static int interior = 0; + inline static bool running = false; + }; + + inline static char anim_buffer[INPUT_BUFFER_SIZE] = ""; inline static char ifp_buffer[INPUT_BUFFER_SIZE] = ""; @@ -26,6 +38,7 @@ protected: public: static void Draw(); static void PlayAnimation(std::string& rootkey, std::string& anim, std::string& ifp); + static void PlayCutscene(std::string& rootkey, std::string& cutscene_str, std::string& interior); static void RemoveAnimation(std::string& rootkey, std::string& anim, std::string& ifp); }; diff --git a/CheatMenu/CheatMenu/json/cutscene.json b/CheatMenu/CheatMenu/json/cutscene.json new file mode 100644 index 0000000..d3ce1f0 --- /dev/null +++ b/CheatMenu/CheatMenu/json/cutscene.json @@ -0,0 +1,149 @@ +{ + "All": + { + "bcesa4w" : "0", + "bcesa5w" : "0", + "bcesar2" : "2", + "bcesar4" : "0", + "bcesar5" : "0", + "bcras1" : "0", + "bcras2" : "0", + "bhill1" : "0", + "bhill2" : "5", + "bhill3a" : "5", + "bhill3b" : "0", + "bhill3c" : "0", + "bhill5a" : "5", + "bhill5b" : "3", + "cas6b_1" : "1", + "cas6b_2" : "1", + "cas_11a" : "2", + "cas_1a" : "11", + "cas_2" : "0", + "cas_3" : "11", + "cas_4a" : "0", + "cas_4b" : "0", + "cas_4c" : "2", + "cas_5a" : "2", + "cas_6a" : "2", + "cas_7b" : "11", + "cas_9a1" : "2", + "cas_9a2" : "0", + "cat_2" : "0", + "cat_3" : "0", + "cat_4" : "0", + "cesar1a" : "0", + "crash1a" : "17", + "crash3a" : "0", + "crashv1" : "0", + "d10_alt" : "0", + "d8_alt" : "0", + "date1a" : "10", + "date3a" : "4", + "date3b" : "4", + "date5a" : "6", + "date5b" : "6", + "date2a" : "9", + "date2b" : "9", + "date4a" : "5", + "date4b" : "5", + "date1b" : "5", + "date6a" : "5", + "date6b" : "17", + "desert1" : "0", + "desert2" : "0", + "desert3" : "0", + "desert4" : "0", + "desert6" : "0", + "desert8" : "0", + "desert9" : "0", + "des_10a" : "0", + "des_10b" : "0", + "doc_2" : "0", + "epilog" : "3", + "farl_2a" : "3", + "farl_3a" : "3", + "farl_3b" : "0", + "farl_4a" : "1", + "farl_5a" : "1", + "final1a" : "1", + "final2a" : "1", + "final2b" : "0", + "garag1b" : "1", + "garag1c" : "1", + "garag3a" : "1", + "grove1a" : "3", + "grove1b" : "3", + "grove1c" : "2", + "grove2" : "1", + "heist1a" : "10", + "heist2a" : "10", + "heist4a" : "10", + "heist5a" : "10", + "heist6a" : "10", + "heist8a" : "0", + "intro1a" : "3", + "intro1b" : "0", + "intro2a" : "2", + "prolog1" : "14", + "prolog3" : "0", + "riot4e1" : "0", + "riot4e2" : "0", + "riot_1a" : "5", + "riot_1b" : "5", + "riot_2" : "1", + "riot_4a" : "1", + "riot_4b" : "0", + "riot_4c" : "2", + "riot_4d" : "2", + "ryder1a" : "0", + "ryder2a" : "0", + "ryder3a" : "2", + "scrash1" : "1", + "scrash2" : "1", + "smoke1a" : "0", + "smoke1b" : "0", + "smoke2a" : "0", + "smoke2b" : "0", + "smoke3a" : "0", + "smoke4a" : "0", + "steal_1" : "1", + "steal_2" : "1", + "steal_4" : "1", + "steal_5" : "1", + "strap1a" : "0", + "strap2a" : "10", + "strap3a" : "10", + "strap4a" : "0", + "strp4b1" : "3", + "strp4b2" : "0", + "sweet1a" : "0", + "sweet1b" : "1", + "sweet1c" : "3", + "sweet2a" : "0", + "sweet2b" : "0", + "sweet3a" : "1", + "sweet3b" : "0", + "sweet4a" : "0", + "sweet5a" : "1", + "sweet6a" : "1", + "sweet6b" : "0", + "sweet7a" : "0", + "synd_2a" : "1", + "synd_2b" : "3", + "synd_3a" : "0", + "synd_4a" : "1", + "synd_4b" : "0", + "synd_7" : "1", + "truth_1" : "12", + "truth_2" : "0", + "w2_alt" : "1", + "woozi1a" : "1", + "woozi1b" : "1", + "woozie2" : "1", + "woozie4" : "1", + "zero_1" : "6", + "zero_2" : "6", + "zero_4" : "6" + } +} \ No newline at end of file diff --git a/CheatMenu/CheatMenu/json/teleport.json b/CheatMenu/CheatMenu/json/teleport.json index 3a4375a..a624d79 100644 --- a/CheatMenu/CheatMenu/json/teleport.json +++ b/CheatMenu/CheatMenu/json/teleport.json @@ -420,7 +420,55 @@ "Oyster 8": "0, 1249, -2687, -1", "Oyster 9": "0, 725, -1849, -5" }, - "Radar": null, + "Radar": { + "Cj sprite, Ganton, LS": "0, 2495.214355, -1687.029785, 12.514400", + "No sprite, Blueberry Acres, LS": "0, 0.000000, 0.000000, 0.000000", + "Propertyg sprite, Jefferson, LS": "0, 2103.345947, -1288.338867, 23.816799", + "Propertyg sprite, Mulholland, LS": "0, 1331.185547, -630.496216, 108.634903", + "Propertyg sprite, Santa Maria Beach, LS": "0, 316.069611, -1772.568848, 4.189300", + "Propertyg sprite, Verdant Bluffs, LS": "0, 1687.980469, -2100.643066, 13.334300", + "Propertyg sprite, Verona Beach, LS": "0, 892.666199, -1639.713867, 14.456700", + "Propertyg sprite, Willowfield, LS": "0, 2483.023682, -2001.074097, 13.054000", + "Propertyr sprite, Angel Pine, LS": "0, -2079.096924, -2309.898682, 30.117201", + "Propertyr sprite, Blueberry, LS": "0, 206.800003, -112.099998, 4.396500", + "Propertyr sprite, Calton Heights, LS": "0, -2106.639160, 900.553711, 76.203201", + "Propertyr sprite, Chinatown, LS": "0, -2213.864258, 723.558716, 48.914001", + "Propertyr sprite, Creek, LS": "0, 2819.125488, 2149.371826, 10.320300", + "Propertyr sprite, Dillimore, LS": "0, 793.562317, -514.411621, 16.397301", + "Propertyr sprite, Doherty, LS": "0, -2027.829956, -44.045399, 38.769199", + "Propertyr sprite, Downtown, LS": "0, -1969.270020, 282.470001, 34.599998", + "Propertyr sprite, El Quebrados, LS": "0, -1534.170288, 2650.300049, 55.343700", + "Propertyr sprite, Fort Carson, LS": "0, -366.184906, 1166.030518, 19.242201", + "Propertyr sprite, Garcia, LS": "0, -2243.620117, 133.199997, 34.799999", + "Propertyr sprite, Hashbury, LS": "0, -2456.925537, -131.329193, 25.537600", + "Propertyr sprite, Old Venturas Strip, LS": "0, 2370.477295, 2165.474365, 10.326900", + "Propertyr sprite, Palomino Creek, LS": "0, 2236.927979, 162.805695, 26.846201", + "Propertyr sprite, Paradiso, LS": "0, -2695.745117, 818.471802, 49.484402", + "Propertyr sprite, Pirates in Men's Pants, LS": "0, 1969.932495, 1623.242920, 12.361900", + "Propertyr sprite, Prickle Pine, LS": "0, 1283.843872, 2528.702881, 10.320300", + "Propertyr sprite, Queens, LS": "0, -2419.676758, 334.162109, 34.679600", + "Propertyr sprite, Redsands West, LS": "0, 1402.317383, 1901.978271, 10.844900", + "Propertyr sprite, Rockshore West, LS": "0, 2441.002197, 695.108887, 10.664600", + "Propertyr sprite, The Camel's Toe, LS": "0, 2234.908691, 1285.698120, 10.320300", + "Propertyr sprite, The Clown's Pocket, LS": "0, 2220.625732, 1837.347534, 10.320300", + "Propertyr sprite, Tierra Robada, LS": "0, -1045.775146, 1552.976318, 32.798000", + "Propertyr sprite, Verdant Meadows, LS": "0, 426.497192, 2530.688965, 16.100000", + "Propertyr sprite, Whetstone, LS": "0, -1439.014038, -1540.590088, 101.257896", + "Propertyr sprite, Whitewood Estates, LS": "0, 922.364685, 2011.898438, 10.766000", + "Race sprite, Blackfield, LS": "0, 1099.551270, 1601.497437, 11.554600", + "Race sprite, East Beach, LS": "0, 2695.624268, -1704.688477, 10.843700", + "Race sprite, Foster Valley, LS": "0, -2120.041748, -444.283813, 34.531200", + "Sprayshop sprite, Dillimore, LS": "0, 720.015991, -454.625000, 15.328000", + "Sprayshop sprite, Downtown, LS": "0, -1908.900024, 292.299988, 40.000000", + "Sprayshop sprite, El Quebrados, LS": "0, -1420.546997, 2583.945068, 58.030998", + "Sprayshop sprite, Fort Carson, LS": "0, -103.599998, 1112.400024, 18.700001", + "Sprayshop sprite, Idlewood, LS": "0, 2067.399902, -1831.199951, 13.500000", + "Sprayshop sprite, Juniper Hollow, LS": "0, -2425.459961, 1020.830017, 49.389999", + "Sprayshop sprite, Redsands East, LS": "0, 1966.531982, 2162.649902, 10.995000", + "Sprayshop sprite, Santa Maria Beach, LS": "0, 488.000000, -1734.000000, 34.400002", + "Sprayshop sprite, Temple, LS": "0, 1021.799988, -1018.700012, 30.900000", + "Waypoint sprite, Los Flores, LS": "0, 2623.328613, -1228.941040, 0.000000" + }, "Snapshots": { "Snapshot 1": "0, -2511.28, -672.99, 195.75", "Snapshot 10": "0, -2773.04, 783.45, 67.66", diff --git a/CheatMenu/CheatMenu/json/versioninfo.json b/CheatMenu/CheatMenu/json/versioninfo.json new file mode 100644 index 0000000..01cc526 --- /dev/null +++ b/CheatMenu/CheatMenu/json/versioninfo.json @@ -0,0 +1 @@ +[{"name":"2.6.2","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/2.6.2","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/2.6.2","commit":{"sha":"f913a6de4eaed7126b79efff5988d99d33c164d1","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/f913a6de4eaed7126b79efff5988d99d33c164d1"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8yLjYuMg=="},{"name":"2.6.1","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/2.6.1","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/2.6.1","commit":{"sha":"580e72ec43156a33b61d7b750fb2e8d7adb04f64","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/580e72ec43156a33b61d7b750fb2e8d7adb04f64"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8yLjYuMQ=="},{"name":"2.6","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/2.6","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/2.6","commit":{"sha":"96673070c64291b0590d2568705dca10b3517d68","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/96673070c64291b0590d2568705dca10b3517d68"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8yLjY="},{"name":"2.5","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/2.5","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/2.5","commit":{"sha":"91ac2f02fe15a2aa3461a61b9461e56eb7a31439","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/91ac2f02fe15a2aa3461a61b9461e56eb7a31439"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8yLjU="},{"name":"2.2","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/2.2","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/2.2","commit":{"sha":"c87590ce3e1b2d85394848279fd3ebfcc7c70b23","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/c87590ce3e1b2d85394848279fd3ebfcc7c70b23"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8yLjI="},{"name":"2.1","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/2.1","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/2.1","commit":{"sha":"a05f0095a7e70a371d93e7c37c540a5b83de4388","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/a05f0095a7e70a371d93e7c37c540a5b83de4388"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8yLjE="},{"name":"2.0","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/2.0","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/2.0","commit":{"sha":"15a8fa5780b9627b394ac6adab7a8ed3c11f441a","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/15a8fa5780b9627b394ac6adab7a8ed3c11f441a"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8yLjA="},{"name":"1.9","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/1.9","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/1.9","commit":{"sha":"9eb617ec93569a33fe96a85a277177231165092e","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/9eb617ec93569a33fe96a85a277177231165092e"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8xLjk="},{"name":"1.8","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/1.8","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/1.8","commit":{"sha":"ddb651ea2497fc1406851304da951ca338310a45","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/ddb651ea2497fc1406851304da951ca338310a45"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8xLjg="},{"name":"1.7","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/1.7","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/1.7","commit":{"sha":"23b17d1d66000b547f34bb2d4709a04f8b818e2a","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/23b17d1d66000b547f34bb2d4709a04f8b818e2a"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8xLjc="},{"name":"1.6","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/1.6","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/1.6","commit":{"sha":"23b17d1d66000b547f34bb2d4709a04f8b818e2a","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/23b17d1d66000b547f34bb2d4709a04f8b818e2a"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8xLjY="},{"name":"1.5","zipball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/zipball/refs/tags/1.5","tarball_url":"https://api.github.com/repos/user-grinch/Cheat-Menu/tarball/refs/tags/1.5","commit":{"sha":"db12c60ae8dd97c06d7037a9264d60184d248949","url":"https://api.github.com/repos/user-grinch/Cheat-Menu/commits/db12c60ae8dd97c06d7037a9264d60184d248949"},"node_id":"MDM6UmVmMTkxNzg4MjI2OnJlZnMvdGFncy8xLjU="}] \ No newline at end of file diff --git a/CheatMenu/Game.cpp b/CheatMenu/Game.cpp index 388dabc..8953355 100644 --- a/CheatMenu/Game.cpp +++ b/CheatMenu/Game.cpp @@ -289,8 +289,8 @@ void Game::ClearFreecamStuff() void Game::Draw() { ImGui::Spacing(); - static CPlayerPed* player = FindPlayerPed(); - static int hplayer = CPools::GetPedRef(player); + CPlayerPed* player = FindPlayerPed(); + int hplayer = CPools::GetPedRef(player); if (ImGui::BeginTabBar("Game", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { diff --git a/CheatMenu/Util.cpp b/CheatMenu/Util.cpp index 3257eea..7fa437e 100644 --- a/CheatMenu/Util.cpp +++ b/CheatMenu/Util.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Util.h" #include "../Depend/imgui/stb_image.h" +#include void Util::ClearCharTasksVehCheck(CPed* ped) { @@ -124,6 +125,11 @@ bool Util::IsOnMission() return FindPlayerPed()->CanPlayerStartMission() && !*(patch::Get(0x5D5380, false) + CTheScripts::OnAMissionFlag); } +bool Util::IsOnCutscene() +{ + return CCutsceneMgr::ms_running; +} + std::string Util::GetLocationName(CVector* pos) { int hplayer = CPools::GetPedRef(FindPlayerPed()); diff --git a/CheatMenu/Util.h b/CheatMenu/Util.h index a006ed9..a30b6a9 100644 --- a/CheatMenu/Util.h +++ b/CheatMenu/Util.h @@ -12,6 +12,7 @@ public: static int GetLargestGangInZone(); static void LoadTexturesInDirRecursive(const char * path, const char * file_ext, std::vector& category_vec, std::vector> &store_vec); static void ReleaseTextures(std::vector> &store_vec); + static bool IsOnCutscene(); static bool IsOnMission(); static std::string GetLocationName(CVector *pos); static void RainbowValues(int &r, int&g, int &b, float speed);