This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/BigBaseV2/src/gui/window/main/tab_weapons.cpp

36 lines
699 B
C++
Raw Normal View History

2021-05-19 16:05:21 +02:00
#include "core/data/custom_weapons.hpp"
#include "gui/window/main/tabs.hpp"
namespace big
{
void tab_main::tab_weapons()
{
if (ImGui::BeginTabItem("Weapons"))
{
if (ImGui::TreeNode("Custom Weapons"))
{
CustomWeapon selected = g.weapons.custom_weapon;
2021-05-19 16:05:21 +02:00
if (ImGui::BeginCombo("Weapon", custom_weapons[(int)selected].name))
2021-05-19 16:05:21 +02:00
{
for (custom_weapon weapon : custom_weapons)
{
if (ImGui::Selectable(weapon.name, weapon.id == selected))
2021-05-19 16:05:21 +02:00
{
g.weapons.custom_weapon = weapon.id;
}
if (weapon.id == selected)
2021-05-19 16:05:21 +02:00
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::TreePop();
}
ImGui::EndTabItem();
}
}
}