mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-04 00:23:27 +08:00
Added Oppressor Mk 1's gliding ability to vehicle abilities. (#2538)
This commit is contained in:
parent
e3c7235b5e
commit
0eb7ab6c50
@ -14,17 +14,18 @@ namespace big
|
|||||||
class vehicle_ability_helper
|
class vehicle_ability_helper
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static constexpr std::array<CVehicleModelInfoFlags, 4> m_abilities = {
|
static constexpr std::array<CVehicleModelInfoFlags, 5> m_abilities = {
|
||||||
CVehicleModelInfoFlags::JUMPING_CAR,
|
CVehicleModelInfoFlags::JUMPING_CAR,
|
||||||
CVehicleModelInfoFlags::HAS_ROCKET_BOOST,
|
CVehicleModelInfoFlags::HAS_ROCKET_BOOST,
|
||||||
CVehicleModelInfoFlags::HAS_PARACHUTE,
|
CVehicleModelInfoFlags::HAS_PARACHUTE,
|
||||||
CVehicleModelInfoFlags::RAMP,
|
CVehicleModelInfoFlags::RAMP,
|
||||||
|
CVehicleModelInfoFlags::HAS_GLIDER
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unordered_set<CVehicleModelInfoFlags> m_stock_abilities;
|
std::unordered_set<CVehicleModelInfoFlags> m_stock_abilities;
|
||||||
CVehicle* m_vehicle = nullptr;
|
CVehicle* m_vehicle = nullptr;
|
||||||
bool m_original_abilities[4] = {};
|
bool m_original_abilities[5] = {};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
vehicle_ability_helper() = default;
|
vehicle_ability_helper() = default;
|
||||||
@ -34,7 +35,7 @@ namespace big
|
|||||||
return;
|
return;
|
||||||
m_vehicle = vehicle;
|
m_vehicle = vehicle;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
m_original_abilities[i] = has_ability(m_abilities.at(i));
|
m_original_abilities[i] = has_ability(m_abilities.at(i));
|
||||||
|
|
||||||
for (const auto ability : m_abilities)
|
for (const auto ability : m_abilities)
|
||||||
@ -77,7 +78,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
if (m_vehicle && m_vehicle->m_model_info)
|
if (m_vehicle && m_vehicle->m_model_info)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
toggle_ability(m_abilities.at(i), m_original_abilities[i]);
|
toggle_ability(m_abilities.at(i), m_original_abilities[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,6 +129,8 @@ namespace big
|
|||||||
m_vehicle_ability_helper.toggle_ability(CVehicleModelInfoFlags::HAS_ROCKET_BOOST, g.vehicle.abilities.rocket);
|
m_vehicle_ability_helper.toggle_ability(CVehicleModelInfoFlags::HAS_ROCKET_BOOST, g.vehicle.abilities.rocket);
|
||||||
m_vehicle_ability_helper.toggle_ability(CVehicleModelInfoFlags::HAS_PARACHUTE, g.vehicle.abilities.parachute);
|
m_vehicle_ability_helper.toggle_ability(CVehicleModelInfoFlags::HAS_PARACHUTE, g.vehicle.abilities.parachute);
|
||||||
m_vehicle_ability_helper.toggle_ability(CVehicleModelInfoFlags::RAMP, g.vehicle.abilities.ramp);
|
m_vehicle_ability_helper.toggle_ability(CVehicleModelInfoFlags::RAMP, g.vehicle.abilities.ramp);
|
||||||
|
if (VEHICLE::GET_VEHICLE_CLASS(self::veh) == 8 || VEHICLE::GET_VEHICLE_CLASS(self::veh) == 13 /*Motorcycles & Bikes*/)
|
||||||
|
m_vehicle_ability_helper.toggle_ability(CVehicleModelInfoFlags::HAS_GLIDER, g.vehicle.abilities.glider);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void on_disable() override
|
virtual void on_disable() override
|
||||||
@ -155,6 +158,7 @@ namespace big
|
|||||||
g.vehicle.abilities.rocket = m_vehicle_ability_helper.get_ability_default(CVehicleModelInfoFlags::HAS_ROCKET_BOOST);
|
g.vehicle.abilities.rocket = m_vehicle_ability_helper.get_ability_default(CVehicleModelInfoFlags::HAS_ROCKET_BOOST);
|
||||||
g.vehicle.abilities.parachute = m_vehicle_ability_helper.get_ability_default(CVehicleModelInfoFlags::HAS_PARACHUTE);
|
g.vehicle.abilities.parachute = m_vehicle_ability_helper.get_ability_default(CVehicleModelInfoFlags::HAS_PARACHUTE);
|
||||||
g.vehicle.abilities.ramp = m_vehicle_ability_helper.get_ability_default(CVehicleModelInfoFlags::RAMP);
|
g.vehicle.abilities.ramp = m_vehicle_ability_helper.get_ability_default(CVehicleModelInfoFlags::RAMP);
|
||||||
|
g.vehicle.abilities.glider = m_vehicle_ability_helper.get_ability_default(CVehicleModelInfoFlags::HAS_GLIDER);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -164,4 +168,5 @@ namespace big
|
|||||||
bool_command g_rocket_ability("rocketability", "BACKEND_LOOPED_VEHICLE_ABILITY_ROCKET", "BACKEND_LOOPED_VEHICLE_ABILITY_ROCKET_DESC", g.vehicle.abilities.rocket);
|
bool_command g_rocket_ability("rocketability", "BACKEND_LOOPED_VEHICLE_ABILITY_ROCKET", "BACKEND_LOOPED_VEHICLE_ABILITY_ROCKET_DESC", g.vehicle.abilities.rocket);
|
||||||
bool_command g_parachute_ability("parachuteability", "BACKEND_LOOPED_VEHICLE_ABILITY_PARACHUTE", "BACKEND_LOOPED_VEHICLE_ABILITY_PARACHUTE_DESC", g.vehicle.abilities.parachute);
|
bool_command g_parachute_ability("parachuteability", "BACKEND_LOOPED_VEHICLE_ABILITY_PARACHUTE", "BACKEND_LOOPED_VEHICLE_ABILITY_PARACHUTE_DESC", g.vehicle.abilities.parachute);
|
||||||
bool_command g_ramp_ability("rampability", "BACKEND_LOOPED_VEHICLE_ABILITY_RAMP", "BACKEND_LOOPED_VEHICLE_ABILITY_RAMP_DESC", g.vehicle.abilities.ramp);
|
bool_command g_ramp_ability("rampability", "BACKEND_LOOPED_VEHICLE_ABILITY_RAMP", "BACKEND_LOOPED_VEHICLE_ABILITY_RAMP_DESC", g.vehicle.abilities.ramp);
|
||||||
|
bool_command g_glider_ability("gliderability", "BACKEND_LOOPED_VEHICLE_ABILITY_GLIDER", "BACKEND_LOOPED_VEHICLE_ABILITY_GLIDER_DESC", g.vehicle.abilities.glider);
|
||||||
}
|
}
|
@ -775,6 +775,7 @@ namespace big
|
|||||||
bool rocket = false;
|
bool rocket = false;
|
||||||
bool parachute = false;
|
bool parachute = false;
|
||||||
bool ramp = false;
|
bool ramp = false;
|
||||||
|
bool glider = false;
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(abilities, enabled)
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE(abilities, enabled)
|
||||||
} abilities{};
|
} abilities{};
|
||||||
|
@ -230,6 +230,7 @@ namespace big
|
|||||||
components::command_checkbox<"jumpability">();
|
components::command_checkbox<"jumpability">();
|
||||||
components::command_checkbox<"parachuteability">();
|
components::command_checkbox<"parachuteability">();
|
||||||
components::command_checkbox<"rampability">();
|
components::command_checkbox<"rampability">();
|
||||||
|
components::command_checkbox<"gliderability">();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::SeparatorText("VEHICLE_FLY"_T.data());
|
ImGui::SeparatorText("VEHICLE_FLY"_T.data());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user