refactor(TabWeapons): CustomWeapon enum renamed

This commit is contained in:
Yimura 2021-05-19 18:10:42 +02:00
parent 4d942c998e
commit a39276f248
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682

View File

@ -10,18 +10,18 @@ namespace big
{ {
if (ImGui::TreeNode("Custom Weapons")) if (ImGui::TreeNode("Custom Weapons"))
{ {
int selected = (int)g.weapons.custom_weapon; CustomWeapon selected = g.weapons.custom_weapon;
if (ImGui::BeginCombo("Weapon", custom_weapons[selected].name)) if (ImGui::BeginCombo("Weapon", custom_weapons[(int)selected].name))
{ {
for (custom_weapon weapon : custom_weapons) for (custom_weapon weapon : custom_weapons)
{ {
if (ImGui::Selectable(weapon.name, weapon.id == (CustomWeapons)selected)) if (ImGui::Selectable(weapon.name, weapon.id == selected))
{ {
g.weapons.custom_weapon = weapon.id; g.weapons.custom_weapon = weapon.id;
} }
if (weapon.id == (CustomWeapons)selected) if (weapon.id == selected)
ImGui::SetItemDefaultFocus(); ImGui::SetItemDefaultFocus();
} }