fix: vehicle control tabs and not working in offline (#1219)
This commit is contained in:
parent
6df7be6f06
commit
83ad7d65ae
@ -367,9 +367,6 @@ namespace big
|
|||||||
|
|
||||||
void vehicle_control::tick()
|
void vehicle_control::tick()
|
||||||
{
|
{
|
||||||
if (!*g_pointers->m_is_session_started)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_controlled_vehicle_exists = m_controlled_vehicle.ptr && ENTITY::DOES_ENTITY_EXIST(m_controlled_vehicle.handle)
|
m_controlled_vehicle_exists = m_controlled_vehicle.ptr && ENTITY::DOES_ENTITY_EXIST(m_controlled_vehicle.handle)
|
||||||
&& VEHICLE::IS_THIS_MODEL_A_CAR(ENTITY::GET_ENTITY_MODEL(m_controlled_vehicle.handle));
|
&& VEHICLE::IS_THIS_MODEL_A_CAR(ENTITY::GET_ENTITY_MODEL(m_controlled_vehicle.handle));
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
{
|
{
|
||||||
|
|
||||||
void render_doors_tab()
|
void render_doors_tab()
|
||||||
{
|
{
|
||||||
const char* const doornames[MAX_VEHICLE_DOORS]{
|
const char* const doornames[MAX_VEHICLE_DOORS]{
|
||||||
@ -75,10 +74,10 @@ namespace big
|
|||||||
|
|
||||||
for (int i = 0; i < MAX_VEHICLE_DOORS; i++)
|
for (int i = 0; i < MAX_VEHICLE_DOORS; i++)
|
||||||
{
|
{
|
||||||
ImGui::PushID(i);
|
|
||||||
if (!g_vehicle_control_service.m_controlled_vehicle.doors[i].valid)
|
if (!g_vehicle_control_service.m_controlled_vehicle.doors[i].valid)
|
||||||
continue;
|
continue;
|
||||||
ImGui::SetNextItemWidth(200);
|
ImGui::SetNextItemWidth(200);
|
||||||
|
ImGui::PushID(i);
|
||||||
if (ImGui::BeginCombo(doornames[i], locknames[(int)g_vehicle_control_service.m_controlled_vehicle.doors[i].lockstate]))
|
if (ImGui::BeginCombo(doornames[i], locknames[(int)g_vehicle_control_service.m_controlled_vehicle.doors[i].lockstate]))
|
||||||
{
|
{
|
||||||
for (int lockindex = 0; lockindex < MAX_VEHICLE_LOCK_STATES; lockindex++)
|
for (int lockindex = 0; lockindex < MAX_VEHICLE_LOCK_STATES; lockindex++)
|
||||||
@ -94,7 +93,7 @@ namespace big
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine(300);
|
ImGui::SameLine(300);
|
||||||
|
|
||||||
const auto button_label = g_vehicle_control_service.m_controlled_vehicle.doors[i].open ? "CLOSE"_T : "OPEN"_T;
|
const auto button_label = g_vehicle_control_service.m_controlled_vehicle.doors[i].open ? "CLOSE"_T : "OPEN"_T;
|
||||||
if (components::button(button_label))
|
if (components::button(button_label))
|
||||||
{
|
{
|
||||||
@ -301,7 +300,7 @@ namespace big
|
|||||||
|
|
||||||
void view::vehicle_control()
|
void view::vehicle_control()
|
||||||
{
|
{
|
||||||
if (!g.window.vehicle_control.opened || !*g_pointers->m_is_session_started)
|
if (!g.window.vehicle_control.opened)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGui::SetNextWindowPos(ImVec2(500.0f, 10.0f), ImGuiCond_FirstUseEver, ImVec2(0.0f, 0.0f));
|
ImGui::SetNextWindowPos(ImVec2(500.0f, 10.0f), ImGuiCond_FirstUseEver, ImVec2(0.0f, 0.0f));
|
||||||
|
Reference in New Issue
Block a user