From 4dfc84711307685d0217273c26258ba9134f837a Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Thu, 12 Dec 2024 15:39:52 +0100 Subject: [PATCH] Application: allow wild weapon type switching. --- .../Application_MassViewer_Weapons.cpp | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/Application/Application_MassViewer_Weapons.cpp b/src/Application/Application_MassViewer_Weapons.cpp index 219300c..170f600 100644 --- a/src/Application/Application_MassViewer_Weapons.cpp +++ b/src/Application/Application_MassViewer_Weapons.cpp @@ -270,6 +270,11 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) { ImGui::BeginGroup(); drawAlignedText("Equipped:"); + if(conf().advancedMode()) { + drawAlignedText("Weapon type:"); + drawAlignedText(""); + } + if(weapon.type != GameObjects::Weapon::Type::Shield) { drawAlignedText("Damage type:"); } @@ -288,6 +293,47 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) { ImGui::BeginGroup(); ImGui::Checkbox("##EquippedCheckbox", &weapon.attached); + if(conf().advancedMode()) { + if(ImGui::RadioButton("Melee##MeleeType", weapon.type == GameObjects::Weapon::Type::Melee)) { + weapon.type = GameObjects::Weapon::Type::Melee; + if(weapon.damageType == GameObjects::Weapon::DamageType::Piercing || weapon.damageType == GameObjects::Weapon::DamageType::Plasma) { + weapon.damageType = GameObjects::Weapon::DamageType::Physical; + } + } + ImGui::SameLine(); + if(ImGui::RadioButton("Shield##ShieldType", weapon.type == GameObjects::Weapon::Type::Shield)) { + weapon.type = GameObjects::Weapon::Type::Shield; + } + ImGui::SameLine(); + if(ImGui::RadioButton("Bullet shooter##BShooterType", weapon.type == GameObjects::Weapon::Type::BulletShooter)) { + weapon.type = GameObjects::Weapon::Type::BulletShooter; + if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Plasma) { + weapon.damageType = GameObjects::Weapon::DamageType::Piercing; + } + } + + if(ImGui::RadioButton("Energy shooter##EShooterType", weapon.type == GameObjects::Weapon::Type::EnergyShooter)) { + weapon.type = GameObjects::Weapon::Type::EnergyShooter; + if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Piercing) { + weapon.damageType = GameObjects::Weapon::DamageType::Plasma; + } + } + ImGui::SameLine(); + if(ImGui::RadioButton("Bullet launcher##BLauncherType", weapon.type == GameObjects::Weapon::Type::BulletLauncher)) { + weapon.type = GameObjects::Weapon::Type::BulletLauncher; + if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Plasma) { + weapon.damageType = GameObjects::Weapon::DamageType::Piercing; + } + } + ImGui::SameLine(); + if(ImGui::RadioButton("Energy launcher##ELauncherType", weapon.type == GameObjects::Weapon::Type::EnergyLauncher)) { + weapon.type = GameObjects::Weapon::Type::EnergyLauncher; + if(weapon.damageType == GameObjects::Weapon::DamageType::Physical || weapon.damageType == GameObjects::Weapon::DamageType::Piercing) { + weapon.damageType = GameObjects::Weapon::DamageType::Plasma; + } + } + } + if(weapon.type != GameObjects::Weapon::Type::Shield) { if(weapon.type == GameObjects::Weapon::Type::Melee && ImGui::RadioButton("Physical##NoElement", weapon.damageType == GameObjects::Weapon::DamageType::Physical))