feat(TabWeapons): Added dropdown for different guns
This commit is contained in:
parent
44a060c943
commit
62bfe65dae
@ -8,13 +8,47 @@ namespace big
|
|||||||
{
|
{
|
||||||
if (ImGui::BeginTabItem("Weapons"))
|
if (ImGui::BeginTabItem("Weapons"))
|
||||||
{
|
{
|
||||||
if (ImGui::TreeNode("Gravity Gun"))
|
if (ImGui::TreeNode("Custom Weapons"))
|
||||||
{
|
{
|
||||||
if (ImGui::Checkbox("Gravity Gun", g_settings.options["gravity_gun"]["enabled"].get<bool*>()))
|
uint8_t selected = g_settings.options["custom_gun"]["type"];
|
||||||
g_settings.save();
|
|
||||||
|
|
||||||
if (ImGui::SliderScalar("Multiplier", ImGuiDataType_Double, g_settings.options["gravity_gun"]["multiplier"].get<double*>(), &min, &max))
|
if (ImGui::BeginCombo("Weapon", custom_guns[selected].name))
|
||||||
g_settings.save();
|
{
|
||||||
|
for (custom_gun gun : custom_guns)
|
||||||
|
{
|
||||||
|
if (ImGui::Selectable(gun.name, gun.id == selected))
|
||||||
|
{
|
||||||
|
g_settings.options["custom_gun"]["type"] = gun.id;
|
||||||
|
|
||||||
|
g_settings.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gun.id == selected)
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::EndCombo();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (selected)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
ImGui::Text("No custom weapon selected.");
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
if (ImGui::SliderScalar("Multiplier", ImGuiDataType_Double, g_settings.options["custom_gun"]["gravity_velocity_multiplier"].get<double*>(), &min, &max))
|
||||||
|
g_settings.save();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ImGui::Text("Set the vehicle model to spawn.");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user