feat(Tunables): Added disable phone

This commit is contained in:
Yimura 2021-07-24 00:16:04 +02:00
parent 560e5068b0
commit a1739bcca4
7 changed files with 46 additions and 0 deletions

View File

@ -14,6 +14,11 @@ namespace big
looped::system_update_players(); looped::system_update_players();
}QUEUE_JOB_END_CLAUSE }QUEUE_JOB_END_CLAUSE
QUEUE_JOB_BEGIN_CLAUSE()
{
looped::tunables_disable_phone();
}QUEUE_JOB_END_CLAUSE
QUEUE_JOB_BEGIN_CLAUSE() QUEUE_JOB_BEGIN_CLAUSE()
{ {
looped::self_godmode(); looped::self_godmode();

View File

@ -5,6 +5,8 @@ namespace big
{ {
class looped { class looped {
public: public:
static void tunables_disable_phone();
static void player_specate(); static void player_specate();
static void self_godmode(); static void self_godmode();

View File

@ -0,0 +1,11 @@
#include "backend/looped/looped.hpp"
#include "script_global.hpp"
namespace big
{
void looped::tunables_disable_phone()
{
if (g.tunables.disable_phone)
*script_global(19984).as<bool*>() = true;
}
}

View File

@ -10,6 +10,10 @@ struct globals {
nlohmann::json default_options; nlohmann::json default_options;
nlohmann::json options; nlohmann::json options;
struct tunables {
bool disable_phone = false;
};
struct player { struct player {
int character_slot = 1; int character_slot = 1;
int set_level = 130; int set_level = 130;
@ -48,6 +52,7 @@ struct globals {
CPlayer players[32]; CPlayer players[32];
CPlayer selected_player; CPlayer selected_player;
tunables tunables{};
player player{}; player player{};
self self{}; self self{};
vehicle vehicle{}; vehicle vehicle{};
@ -56,6 +61,8 @@ struct globals {
void from_json(const nlohmann::json& j) void from_json(const nlohmann::json& j)
{ {
this->tunables.disable_phone = j["tunables"]["disable_phone"];
this->self.godmode = j["self"]["godmode"]; this->self.godmode = j["self"]["godmode"];
this->self.off_radar = j["self"]["off_radar"]; this->self.off_radar = j["self"]["off_radar"];
this->self.no_ragdoll = j["self"]["no_ragdoll"]; this->self.no_ragdoll = j["self"]["no_ragdoll"];
@ -73,6 +80,11 @@ struct globals {
nlohmann::json to_json() nlohmann::json to_json()
{ {
return nlohmann::json{ return nlohmann::json{
{
"tunables", {
{ "disable_phone", this->tunables.disable_phone }
}
},
{ {
"self", { "self", {
{ "godmode", this->self.godmode }, { "godmode", this->self.godmode },

View File

@ -6,6 +6,7 @@ namespace big
{ {
class tab_main { class tab_main {
public: public:
static void tab_tunables();
static void tab_self(); static void tab_self();
static void tab_recovery(); static void tab_recovery();
static void tab_spawn(); static void tab_spawn();

View File

@ -0,0 +1,14 @@
#include "main_tabs.hpp"
namespace big
{
void tab_main::tab_tunables()
{
if (ImGui::BeginTabItem("Tunables"))
{
ImGui::Checkbox("Disable Phone", &g.tunables.disable_phone);
ImGui::EndTabItem();
}
}
}

View File

@ -12,6 +12,7 @@ namespace big
ImGui::BeginTabBar("tabbar"); ImGui::BeginTabBar("tabbar");
tab_main::tab_self(); tab_main::tab_self();
tab_main::tab_spawn(); tab_main::tab_spawn();
tab_main::tab_tunables();
tab_main::tab_teleport(); tab_main::tab_teleport();
tab_main::tab_vehicle(); tab_main::tab_vehicle();
tab_main::tab_weapons(); tab_main::tab_weapons();