Orbital Drone Feature (#1148)

* Orbital Drone Feature

* Fixed PR review comments

* chore: cleanup code

* UI & globals saving

* Fixed typo

* Fixed noclip conflict & Applied review suggestions & Added another changeable variable

---------

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
DayibBaba
2023-03-30 00:37:10 +02:00
committed by GitHub
parent 45c6edb129
commit 8ad4cf01dd
15 changed files with 615 additions and 2 deletions

View File

@ -5,8 +5,10 @@
#include "script.hpp"
#include "script_patches.hpp"
#include "services/context_menu/context_menu_service.hpp"
#include "services/orbital_drone/orbital_drone.hpp"
#include "thread_pool.hpp"
namespace big
{
void backend::loop()
@ -186,4 +188,22 @@ namespace big
script::get_current()->yield();
}
}
void backend::orbital_drone()
{
while (true)
{
if (g.world.orbital_drone.enabled && PAD::IS_CONTROL_JUST_PRESSED(2, (int)ControllerInputs::INPUT_VEH_LOOK_BEHIND))
{
if (!g_orbital_drone_service.initialized())
g_orbital_drone_service.init();
else
g_orbital_drone_service.destroy();
}
g_orbital_drone_service.tick();
script::get_current()->yield();
}
}
}