From f11c7828e5f9d84a239e7ac72b86994c849b17ca Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Sat, 7 Dec 2024 14:56:00 +0100 Subject: [PATCH] Application: allow hiding any weapon part. This also improves hiding of shield parts and missiles at the same time. --- .../Application_MassViewer_Weapons.cpp | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Application/Application_MassViewer_Weapons.cpp b/src/Application/Application_MassViewer_Weapons.cpp index 6f3f646..a9e3281 100644 --- a/src/Application/Application_MassViewer_Weapons.cpp +++ b/src/Application/Application_MassViewer_Weapons.cpp @@ -496,20 +496,17 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) { } } - if(weapon.type == GameObjects::Weapon::Type::Shield || - (weapon.type == GameObjects::Weapon::Type::BulletLauncher && _selectedWeaponPart != 0)) - { - ImGui::SameLine(); - if(ImGui::SmallButton("Unequip")) { - part.id = -1; - } - if(weapon.type == GameObjects::Weapon::Type::Shield && _selectedWeaponPart == 0) { - drawTooltip("This will make the whole shield and its accessories invisible."); - } - else { - drawTooltip("This will make accessories invisible as well."); - } + ImGui::SameLine(); + if(ImGui::SmallButton("Hide part " ICON_FA_QUESTION_CIRCLE)) { + part.id = 96 + (part.id / 100) * 100; } + drawTooltip(_selectedWeaponPart == 0 ? + "This will hide the selected part, but not its accessories. " + "Parts attached to this one will also be hidden, though their accessories WON'T be visible. " + "For parts that affect weapon stance/functionality, this feature will try to preserve that." : + "This will hide the selected part, but not its accessories. " + "For parts that affect weapon stance/functionality, this feature will try to preserve that.", + static_cast(windowSize().x()) * 0.4f); if(ImGui::BeginChild("##PartDetails", {}, ImGuiChildFlags_Border)) { ImGui::TextUnformatted("Styles:");