Application: allow hiding any weapon part.

This also improves hiding of shield parts and missiles at the same
time.
This commit is contained in:
Guillaume Jacquemin 2024-12-07 14:56:00 +01:00
parent 3fb294ca4a
commit f11c7828e5
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A

View file

@ -496,20 +496,17 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
} }
} }
if(weapon.type == GameObjects::Weapon::Type::Shield || ImGui::SameLine();
(weapon.type == GameObjects::Weapon::Type::BulletLauncher && _selectedWeaponPart != 0)) if(ImGui::SmallButton("Hide part " ICON_FA_QUESTION_CIRCLE)) {
{ part.id = 96 + (part.id / 100) * 100;
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.");
}
} }
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<float>(windowSize().x()) * 0.4f);
if(ImGui::BeginChild("##PartDetails", {}, ImGuiChildFlags_Border)) { if(ImGui::BeginChild("##PartDetails", {}, ImGuiChildFlags_Border)) {
ImGui::TextUnformatted("Styles:"); ImGui::TextUnformatted("Styles:");