From a8458163dcc27bce8c95db9bea7a8af082e8845a Mon Sep 17 00:00:00 2001 From: Yimura Date: Tue, 29 Dec 2020 23:32:58 +0100 Subject: [PATCH] refactor(UX): Moved menu options around for better UX --- BigBaseV2/src/features.cpp | 1 + BigBaseV2/src/features.hpp | 2 + BigBaseV2/src/gui/main_window.cpp | 2 +- BigBaseV2/src/gui/tab_bar/tab_bar.hpp | 2 +- BigBaseV2/src/gui/tab_bar/tab_misc.cpp | 13 +++- BigBaseV2/src/gui/tab_bar/tab_network.cpp | 41 ---------- BigBaseV2/src/gui/tab_bar/tab_online.cpp | 88 ++++++++++++++++++++++ BigBaseV2/src/gui/tab_bar/tab_self.cpp | 6 +- BigBaseV2/src/gui/tab_bar/tab_tunables.cpp | 10 --- BigBaseV2/src/gui/tab_bar/tab_world.cpp | 3 +- BigBaseV2/src/structs/temp.hpp | 2 + 11 files changed, 108 insertions(+), 62 deletions(-) delete mode 100644 BigBaseV2/src/gui/tab_bar/tab_network.cpp create mode 100644 BigBaseV2/src/gui/tab_bar/tab_online.cpp diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index 076db446..5b835b04 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -20,6 +20,7 @@ namespace big off_radar(); population_modifiers(); reveal_players(); + speedo_meter(); spoof_rank(); sticky_tyres(); super_sprint(); diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index 2e5ef7f6..3b7feebb 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -4,6 +4,7 @@ #include "structs/lists.hpp" #include "structs/player.hpp" #include "structs/temp.hpp" +#include "features/functions.hpp" #include "features/notify.hpp" #include "features/stats.hpp" #include "features/teleport.hpp" @@ -34,6 +35,7 @@ namespace big void off_radar(); void population_modifiers(); void reveal_players(); + void speedo_meter(); void spoof_rank(); void sticky_tyres(); void super_sprint(); diff --git a/BigBaseV2/src/gui/main_window.cpp b/BigBaseV2/src/gui/main_window.cpp index 33766937..89f29748 100644 --- a/BigBaseV2/src/gui/main_window.cpp +++ b/BigBaseV2/src/gui/main_window.cpp @@ -15,7 +15,7 @@ namespace big tabbar::render_teleport(); tabbar::render_vehicle(); tabbar::render_world(); - tabbar::render_network(); + tabbar::render_online(); tabbar::render_misc(); tabbar::render_spawn(); ImGui::EndTabBar(); diff --git a/BigBaseV2/src/gui/tab_bar/tab_bar.hpp b/BigBaseV2/src/gui/tab_bar/tab_bar.hpp index 3d65bd46..a017b758 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_bar.hpp +++ b/BigBaseV2/src/gui/tab_bar/tab_bar.hpp @@ -18,7 +18,7 @@ namespace big static void render_teleport(); static void render_vehicle(); static void render_world(); - static void render_network(); + static void render_online(); static void render_misc(); static void render_spawn(); }; diff --git a/BigBaseV2/src/gui/tab_bar/tab_misc.cpp b/BigBaseV2/src/gui/tab_bar/tab_misc.cpp index 0f9589e2..d7e35a3f 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_misc.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_misc.cpp @@ -6,10 +6,15 @@ namespace big { if (ImGui::BeginTabItem("Misc")) { - if (ImGui::Checkbox("Player Join Message", g_settings.options["join_message"].get())) - g_settings.save(); - - ImGui::Separator(); + ImGui::Text("Set Current Character Level:"); + ImGui::SliderInt("##input_levels_self", &g_temp.set_level, 0, 8000); + if (ImGui::Button("Set Level")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + features::functions::set_player_level(g_temp.set_level); + }QUEUE_JOB_END_CLAUSE + } if (ImGui::Button("Unlock Achievements")) { diff --git a/BigBaseV2/src/gui/tab_bar/tab_network.cpp b/BigBaseV2/src/gui/tab_bar/tab_network.cpp deleted file mode 100644 index b1835945..00000000 --- a/BigBaseV2/src/gui/tab_bar/tab_network.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once -#include "tab_bar.hpp" -#include "pointers.hpp" -#include "script_global.hpp" - -namespace big -{ - void tabbar::render_network() - { - if (ImGui::BeginTabItem("Network")) - { - if (ImGui::Checkbox("Reveal Players", g_settings.options["reveal_players"].get())) - g_settings.save(); - - ImGui::Separator(); - - ImGui::Text("Time: "); - ImGui::SliderInt("Hour:", &g_temp.time.hour, 0, 23); - ImGui::SliderInt("Minutes:", &g_temp.time.minutes, 0, 59); - if (ImGui::Button("Apply")) - { - QUEUE_JOB_BEGIN_CLAUSE(= ) - { - NETWORK::NETWORK_OVERRIDE_CLOCK_TIME(g_temp.time.hour, g_temp.time.minutes, 0); - - g_pointers->m_sync_local_time(1, 0); - }QUEUE_JOB_END_CLAUSE - } - - ImGui::Separator(); - - if (ImGui::Checkbox("Spoof Online Rank", g_settings.options["spoof_rank"].get())) - g_settings.save(); - - if (ImGui::InputInt(": Rank", (PINT)g_settings.options["rank"].get(), 1, 50)) - g_settings.save(); - - ImGui::EndTabItem(); - } - } -} \ No newline at end of file diff --git a/BigBaseV2/src/gui/tab_bar/tab_online.cpp b/BigBaseV2/src/gui/tab_bar/tab_online.cpp new file mode 100644 index 00000000..fbc1b089 --- /dev/null +++ b/BigBaseV2/src/gui/tab_bar/tab_online.cpp @@ -0,0 +1,88 @@ +#include "tab_bar.hpp" +#include "pointers.hpp" +#include "script_global.hpp" + +namespace big +{ + void tabbar::render_online() + { + if (ImGui::BeginTabItem("Online")) + { + if (ImGui::TreeNode("Self")) + { + if (ImGui::Checkbox("Off-Radar", g_settings.options["off_radar"].get())) + g_settings.save(); + + ImGui::SameLine(); + + if (ImGui::Checkbox("Reveal Players", g_settings.options["reveal_players"].get())) + g_settings.save(); + + if (ImGui::Checkbox("Player Join Message", g_settings.options["join_message"].get())) + g_settings.save(); + + ImGui::TreePop(); + } + ImGui::Separator(); + + if (ImGui::TreeNode("Money")) + { + ImGui::Text("Instructions:\n\nTake a vehicle from the street.\nGo in LSC and put a tracker on it.\nOpen the sell submenu but don't confirm it.\nOpen this menu and click one of the below buttons."); + + if (ImGui::Button("Set Car Sell Value at 25 million")) + { + features::functions::set_car_sell_value((int)25e6); + } + + if (ImGui::Button("Set Car Sell Value at INT_MAX (2.1 billion)")) + { + features::functions::set_car_sell_value(INT_MAX); + } + + if (ImGui::Button("Reset Vehicle Sell Stats")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + features::functions::reset_vehicle_sell_stats(); + }QUEUE_JOB_END_CLAUSE + } + + ImGui::TreePop(); + } + ImGui::Separator(); + + if (ImGui::TreeNode("Spoofing")) + { + if (ImGui::Checkbox("Spoof Online Rank", g_settings.options["spoof_rank"].get())) + g_settings.save(); + + ImGui::Text("Rank:"); + if (ImGui::InputInt("##rank", (PINT)g_settings.options["rank"].get(), 1, 50)) + g_settings.save(); + + ImGui::TreePop(); + } + ImGui::Separator(); + + if (ImGui::TreeNode("World")) + { + ImGui::Text("Time: "); + ImGui::SliderInt("Hour:", &g_temp.time.hour, 0, 23); + ImGui::SliderInt("Minutes:", &g_temp.time.minutes, 0, 59); + if (ImGui::Button("Apply")) + { + QUEUE_JOB_BEGIN_CLAUSE(= ) + { + NETWORK::NETWORK_OVERRIDE_CLOCK_TIME(g_temp.time.hour, g_temp.time.minutes, 0); + + g_pointers->m_sync_local_time(1, 0); + }QUEUE_JOB_END_CLAUSE + } + + ImGui::TreePop(); + } + + ImGui::EndTabItem(); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/gui/tab_bar/tab_self.cpp b/BigBaseV2/src/gui/tab_bar/tab_self.cpp index 990bf5bb..1f539328 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_self.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_self.cpp @@ -27,10 +27,8 @@ namespace big ImGui::Separator(); - if (ImGui::Checkbox("God Mode", g_settings.options["god_mode"].get()) - || ImGui::Checkbox("No Ragdoll", g_settings.options["ragdoll"].get()) - || ImGui::Checkbox("Off-Radar", g_settings.options["off_radar"].get()) - ) g_settings.save(); + if (ImGui::Checkbox("God Mode", g_settings.options["god_mode"].get()) || ImGui::Checkbox("No Ragdoll", g_settings.options["ragdoll"].get())) + g_settings.save(); ImGui::Separator(); diff --git a/BigBaseV2/src/gui/tab_bar/tab_tunables.cpp b/BigBaseV2/src/gui/tab_bar/tab_tunables.cpp index 4150efc1..b4f17a1c 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_tunables.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_tunables.cpp @@ -11,16 +11,6 @@ namespace big if (ImGui::Checkbox("No Idle Kick", g_settings.options["no_idle_kick"].get())) g_settings.save(); - if (ImGui::Button("Set Car Sell Value at 25 million")) - { - *script_global(99007).at(970).as() = 25000000; - } - - if (ImGui::Button("Set Car Sell Value at INT_MAX (2.1 billion)")) - { - *script_global(99007).at(970).as() = INT_MAX; - } - ImGui::EndTabItem(); } } diff --git a/BigBaseV2/src/gui/tab_bar/tab_world.cpp b/BigBaseV2/src/gui/tab_bar/tab_world.cpp index 10a00fc9..d43da487 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_world.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_world.cpp @@ -35,7 +35,8 @@ namespace big { QUEUE_JOB_BEGIN_CLAUSE(=) { - MISC::SET_WEATHER_TYPE_NOW(weather_types[g_temp.weather_type]); + MISC::SET_OVERRIDE_WEATHER(weather_types[g_temp.weather_type]); + MISC::SET_WEATHER_TYPE_NOW_PERSIST(weather_types[g_temp.weather_type]); }QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/structs/temp.hpp b/BigBaseV2/src/structs/temp.hpp index 879e3739..0f52a08f 100644 --- a/BigBaseV2/src/structs/temp.hpp +++ b/BigBaseV2/src/structs/temp.hpp @@ -10,6 +10,8 @@ namespace big struct temp { + int character_slot = 0; + int set_level = 0; int spoofed_rank = 0; game_time time = game_time{}; int wanted_level = 0;