From 2a19a891d523735327064dca525b6e7b2c9c0ac1 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 20 May 2021 22:39:56 +0200 Subject: [PATCH] feat(VehicleGun): Select custom model --- .../backend/looped/weapons/vehicle_gun.cpp | 2 +- BigBaseV2/src/core/globals.hpp | 1 + BigBaseV2/src/gui/window/main/tab_weapons.cpp | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp b/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp index 42545890..9601a54c 100644 --- a/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/vehicle_gun.cpp @@ -35,7 +35,7 @@ namespace big location.y += dist * sin(yaw) * cos(pitch); location.z += dist * sin(pitch); Vehicle veh = vehicle::spawn( - "bus", + (const char*)g.weapons.vehicle_gun_model, location, ENTITY::GET_ENTITY_HEADING(player) ); diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 8842e793..5f3ac7ff 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -20,6 +20,7 @@ struct globals { struct weapons { CustomWeapon custom_weapon = CustomWeapon::NONE; + char vehicle_gun_model[12] = "bus"; }; self self{}; diff --git a/BigBaseV2/src/gui/window/main/tab_weapons.cpp b/BigBaseV2/src/gui/window/main/tab_weapons.cpp index 49f99fee..4f59702e 100644 --- a/BigBaseV2/src/gui/window/main/tab_weapons.cpp +++ b/BigBaseV2/src/gui/window/main/tab_weapons.cpp @@ -27,6 +27,25 @@ namespace big ImGui::EndCombo(); } + switch (selected) + { + case CustomWeapon::NONE: + break; + case CustomWeapon::CAGE_GUN: + break; + case CustomWeapon::DELETE_GUN: + break; + case CustomWeapon::GRAVITY_GUN: + break; + case CustomWeapon::REPAIR_GUN: + break; + case CustomWeapon::VEHICLE_GUN: + ImGui::Text("Shooting Model:"); + ImGui::InputText("##vehicle_gun_model", g.weapons.vehicle_gun_model, 12); + + break; + } + ImGui::TreePop(); }