mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-24 01:22:23 +08:00
feat(Vehicle): Added rainbow options (#141)
This commit is contained in:
@ -28,6 +28,12 @@ namespace big
|
|||||||
looped::hud_transition_state();
|
looped::hud_transition_state();
|
||||||
}QUEUE_JOB_END_CLAUSE
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
|
{
|
||||||
|
looped::rgb_synced_fade();
|
||||||
|
looped::rgb_synced_spasm();
|
||||||
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
{
|
{
|
||||||
looped::tunables_disable_phone();
|
looped::tunables_disable_phone();
|
||||||
@ -86,6 +92,7 @@ namespace big
|
|||||||
looped::vehicle_god_mode();
|
looped::vehicle_god_mode();
|
||||||
looped::vehicle_horn_boost();
|
looped::vehicle_horn_boost();
|
||||||
looped::vehicle_is_targetable();
|
looped::vehicle_is_targetable();
|
||||||
|
looped::vehicle_rainbow_paint();
|
||||||
looped::vehicle_speedo_meter();
|
looped::vehicle_speedo_meter();
|
||||||
}QUEUE_JOB_END_CLAUSE
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@ namespace big
|
|||||||
|
|
||||||
static void hud_transition_state();
|
static void hud_transition_state();
|
||||||
|
|
||||||
|
static void rgb_synced_fade();
|
||||||
|
static void rgb_synced_spasm();
|
||||||
|
|
||||||
static void tunables_disable_phone();
|
static void tunables_disable_phone();
|
||||||
static void tunables_no_idle_kick();
|
static void tunables_no_idle_kick();
|
||||||
|
|
||||||
@ -37,6 +40,7 @@ namespace big
|
|||||||
static void vehicle_horn_boost();
|
static void vehicle_horn_boost();
|
||||||
static void vehicle_is_targetable();
|
static void vehicle_is_targetable();
|
||||||
static void vehicle_ls_customs();
|
static void vehicle_ls_customs();
|
||||||
|
static void vehicle_rainbow_paint();
|
||||||
static void vehicle_speedo_meter();
|
static void vehicle_speedo_meter();
|
||||||
|
|
||||||
static void weapons_ammo_special_type();
|
static void weapons_ammo_special_type();
|
||||||
|
83
BigBaseV2/src/backend/looped/rgb/synced_fade.cpp
Normal file
83
BigBaseV2/src/backend/looped/rgb/synced_fade.cpp
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
#include "backend/looped/looped.hpp"
|
||||||
|
#include "script.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
enum rgb_controller_t
|
||||||
|
{
|
||||||
|
rgb_controller_green_up,
|
||||||
|
rgb_controller_red_down,
|
||||||
|
rgb_controller_blue_up,
|
||||||
|
rgb_controller_green_down,
|
||||||
|
rgb_controller_red_up,
|
||||||
|
rgb_controller_blue_down,
|
||||||
|
};
|
||||||
|
|
||||||
|
void looped::rgb_synced_fade()
|
||||||
|
{
|
||||||
|
if (g->rgb.fade)
|
||||||
|
{
|
||||||
|
static int rgb_controller_v = rgb_controller_green_up;
|
||||||
|
|
||||||
|
switch (rgb_controller_v)
|
||||||
|
{
|
||||||
|
case rgb_controller_green_up:
|
||||||
|
g->rgb.g += g->rgb.speed;
|
||||||
|
if (g->rgb.g >= 255)
|
||||||
|
{
|
||||||
|
g->rgb.g = 255;
|
||||||
|
rgb_controller_v = rgb_controller_red_down;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rgb_controller_red_down:
|
||||||
|
g->rgb.r -= g->rgb.speed;
|
||||||
|
if (g->rgb.r < 0)
|
||||||
|
{
|
||||||
|
g->rgb.r = 0;
|
||||||
|
rgb_controller_v = rgb_controller_blue_up;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rgb_controller_blue_up:
|
||||||
|
g->rgb.b += g->rgb.speed;
|
||||||
|
if (g->rgb.b >= 255)
|
||||||
|
{
|
||||||
|
g->rgb.b = 255;
|
||||||
|
rgb_controller_v = rgb_controller_green_down;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rgb_controller_green_down:
|
||||||
|
g->rgb.g -= g->rgb.speed;
|
||||||
|
if (g->rgb.g < 0)
|
||||||
|
{
|
||||||
|
g->rgb.g = 0;
|
||||||
|
rgb_controller_v = rgb_controller_red_up;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rgb_controller_red_up:
|
||||||
|
g->rgb.r += g->rgb.speed;
|
||||||
|
if (g->rgb.r >= 255)
|
||||||
|
{
|
||||||
|
g->rgb.r = 255;
|
||||||
|
rgb_controller_v = rgb_controller_blue_down;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rgb_controller_blue_down:
|
||||||
|
g->rgb.b -= g->rgb.speed;
|
||||||
|
if (g->rgb.b < 0)
|
||||||
|
{
|
||||||
|
g->rgb.b = 0;
|
||||||
|
rgb_controller_v = rgb_controller_green_up;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw std::runtime_error("Invalid case provided to RGB controller!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
BigBaseV2/src/backend/looped/rgb/synced_spam.cpp
Normal file
18
BigBaseV2/src/backend/looped/rgb/synced_spam.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "backend/looped/looped.hpp"
|
||||||
|
#include "script.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void looped::rgb_synced_spasm()
|
||||||
|
{
|
||||||
|
auto delay = std::chrono::milliseconds(1000 - (g->rgb.speed * 100));
|
||||||
|
|
||||||
|
if (g->rgb.spasm)
|
||||||
|
{
|
||||||
|
g->rgb.r = rand()%256;
|
||||||
|
g->rgb.g = rand() % 256;
|
||||||
|
g->rgb.b = rand() % 256;
|
||||||
|
}
|
||||||
|
script::get_current()->yield(delay);
|
||||||
|
}
|
||||||
|
}
|
27
BigBaseV2/src/backend/looped/vehicle/rgb_paint.cpp
Normal file
27
BigBaseV2/src/backend/looped/vehicle/rgb_paint.cpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include "backend/looped/looped.hpp"
|
||||||
|
#include "natives.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void looped::vehicle_rainbow_paint()
|
||||||
|
{
|
||||||
|
const Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
|
||||||
|
|
||||||
|
if (veh != 0 && g->vehicle.rainbow_paint != 0)
|
||||||
|
{
|
||||||
|
if (g->vehicle.rainbow_paint == 1)
|
||||||
|
{
|
||||||
|
g->rgb.fade = true;
|
||||||
|
g->rgb.spasm = false;
|
||||||
|
}
|
||||||
|
else if (g->vehicle.rainbow_paint == 2)
|
||||||
|
{
|
||||||
|
g->rgb.spasm = true;
|
||||||
|
g->rgb.fade = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, g->rgb.r, g->rgb.g, g->rgb.b);
|
||||||
|
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, g->rgb.r, g->rgb.g, g->rgb.b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -116,6 +116,15 @@ namespace big
|
|||||||
script_events script_events{};
|
script_events script_events{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct rgb {
|
||||||
|
bool fade = false;
|
||||||
|
bool spasm = false;
|
||||||
|
int r = 255;
|
||||||
|
int g = 0;
|
||||||
|
int b = 0;
|
||||||
|
int speed = 0;
|
||||||
|
};
|
||||||
|
|
||||||
struct self {
|
struct self {
|
||||||
bool clean_player = false;
|
bool clean_player = false;
|
||||||
bool force_wanted_level = false;
|
bool force_wanted_level = false;
|
||||||
@ -188,6 +197,7 @@ namespace big
|
|||||||
bool is_targetable = true;
|
bool is_targetable = true;
|
||||||
bool ls_customs = false; // don't save this to disk
|
bool ls_customs = false; // don't save this to disk
|
||||||
bool pv_teleport_into = false;
|
bool pv_teleport_into = false;
|
||||||
|
int rainbow_paint = 0;
|
||||||
speedo_meter speedo_meter{};
|
speedo_meter speedo_meter{};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -248,6 +258,7 @@ namespace big
|
|||||||
notifications notifications{};
|
notifications notifications{};
|
||||||
player player{};
|
player player{};
|
||||||
protections protections{};
|
protections protections{};
|
||||||
|
rgb rgb{};
|
||||||
self self{};
|
self self{};
|
||||||
session session{};
|
session session{};
|
||||||
settings settings{};
|
settings settings{};
|
||||||
@ -378,6 +389,13 @@ namespace big
|
|||||||
script_handler.vehicle_kick = script_handler_j["vehicle_kick"];
|
script_handler.vehicle_kick = script_handler_j["vehicle_kick"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->rgb.fade = j["rgb"]["fade"];
|
||||||
|
this->rgb.spasm = j["rgb"]["spasm"];
|
||||||
|
this->rgb.r = j["rgb"]["r"];
|
||||||
|
this->rgb.g = j["rgb"]["g"];
|
||||||
|
this->rgb.b = j["rgb"]["b"];
|
||||||
|
this->rgb.speed = j["rgb"]["speed"];
|
||||||
|
|
||||||
this->tunables.disable_phone = j["tunables"]["disable_phone"];
|
this->tunables.disable_phone = j["tunables"]["disable_phone"];
|
||||||
this->tunables.no_idle_kick = j["tunables"]["no_idle_kick"];
|
this->tunables.no_idle_kick = j["tunables"]["no_idle_kick"];
|
||||||
|
|
||||||
@ -410,6 +428,7 @@ namespace big
|
|||||||
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
|
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
|
||||||
this->vehicle.is_targetable = j["vehicle"]["is_targetable"];
|
this->vehicle.is_targetable = j["vehicle"]["is_targetable"];
|
||||||
this->vehicle.pv_teleport_into = j["vehicle"]["pv_teleport_into"];
|
this->vehicle.pv_teleport_into = j["vehicle"]["pv_teleport_into"];
|
||||||
|
this->vehicle.rainbow_paint = j["vehicle"]["rainbow_paint"];
|
||||||
|
|
||||||
this->vehicle.speedo_meter.type = (SpeedoMeter)j["vehicle"]["speedo_meter"]["type"];
|
this->vehicle.speedo_meter.type = (SpeedoMeter)j["vehicle"]["speedo_meter"]["type"];
|
||||||
this->vehicle.speedo_meter.left_side = j["vehicle"]["speedo_meter"]["left_side"];
|
this->vehicle.speedo_meter.left_side = j["vehicle"]["speedo_meter"]["left_side"];
|
||||||
@ -546,6 +565,16 @@ namespace big
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"rgb", {
|
||||||
|
{ "fade", this->rgb.fade },
|
||||||
|
{ "spasm", this->rgb.spasm },
|
||||||
|
{ "r", this->rgb.r },
|
||||||
|
{ "g", this->rgb.g },
|
||||||
|
{ "b", this->rgb.b },
|
||||||
|
{ "speed", this->rgb.speed }
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"tunables", {
|
"tunables", {
|
||||||
{ "disable_phone", this->tunables.disable_phone },
|
{ "disable_phone", this->tunables.disable_phone },
|
||||||
@ -601,6 +630,7 @@ namespace big
|
|||||||
{ "horn_boost", this->vehicle.horn_boost },
|
{ "horn_boost", this->vehicle.horn_boost },
|
||||||
{ "is_targetable", this->vehicle.is_targetable },
|
{ "is_targetable", this->vehicle.is_targetable },
|
||||||
{ "pv_teleport_into", this->vehicle.pv_teleport_into },
|
{ "pv_teleport_into", this->vehicle.pv_teleport_into },
|
||||||
|
{ "rainbow_paint", this->vehicle.rainbow_paint },
|
||||||
{
|
{
|
||||||
"speedo_meter", {
|
"speedo_meter", {
|
||||||
{ "type", (int)this->vehicle.speedo_meter.type },
|
{ "type", (int)this->vehicle.speedo_meter.type },
|
||||||
|
@ -104,4 +104,6 @@ namespace big::vehicle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static constexpr char const* rgb_types[] = { "Off", "Fade", "Spasm" };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,17 @@ namespace big
|
|||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndGroup();
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::TreeNode("Paint"))
|
||||||
|
{
|
||||||
|
ImGui::ListBox("RGB Type", &g->vehicle.rainbow_paint, vehicle::rgb_types, 3);
|
||||||
|
|
||||||
|
if (g->vehicle.rainbow_paint != 0)
|
||||||
|
{
|
||||||
|
ImGui::SliderInt("RGB Speed", &g->rgb.speed, 1, 10);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user