feat(Tunables): Added disable phone

This commit is contained in:
Yimura 2021-07-24 00:16:04 +02:00
parent 2afef4153d
commit 9f8e3597fb
7 changed files with 46 additions and 0 deletions

View File

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

View File

@ -5,6 +5,8 @@ namespace big
{
class looped {
public:
static void tunables_disable_phone();
static void player_specate();
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 options;
struct tunables {
bool disable_phone = false;
};
struct player {
int character_slot = 1;
int set_level = 130;
@ -48,6 +52,7 @@ struct globals {
CPlayer players[32];
CPlayer selected_player;
tunables tunables{};
player player{};
self self{};
vehicle vehicle{};
@ -56,6 +61,8 @@ struct globals {
void from_json(const nlohmann::json& j)
{
this->tunables.disable_phone = j["tunables"]["disable_phone"];
this->self.godmode = j["self"]["godmode"];
this->self.off_radar = j["self"]["off_radar"];
this->self.no_ragdoll = j["self"]["no_ragdoll"];
@ -73,6 +80,11 @@ struct globals {
nlohmann::json to_json()
{
return nlohmann::json{
{
"tunables", {
{ "disable_phone", this->tunables.disable_phone }
}
},
{
"self", {
{ "godmode", this->self.godmode },

View File

@ -6,6 +6,7 @@ namespace big
{
class tab_main {
public:
static void tab_tunables();
static void tab_self();
static void tab_recovery();
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");
tab_main::tab_self();
tab_main::tab_spawn();
tab_main::tab_tunables();
tab_main::tab_teleport();
tab_main::tab_vehicle();
tab_main::tab_weapons();