From 1aa301c316235ca365527af1e03210d0ba0d04e9 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Tue, 30 Jul 2024 13:43:36 +0200 Subject: [PATCH] Application,GameData: add support for hidden armours. --- .../Application_MassViewer_Armour.cpp | 28 ++++++++++++++----- src/GameData/ArmourSets.h | 1 + 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/Application/Application_MassViewer_Armour.cpp b/src/Application/Application_MassViewer_Armour.cpp index f3cfb0c..ea9bdd1 100644 --- a/src/Application/Application_MassViewer_Armour.cpp +++ b/src/Application/Application_MassViewer_Armour.cpp @@ -96,13 +96,27 @@ Application::drawArmour() { } if(ImGui::BeginPopup("##ArmourPartPopup")) { if(ImGui::BeginListBox("##ChangePart")) { - for(auto& set : GameData::armour_sets) { - if(part.slot != GameObjects::ArmourPart::Slot::Neck || set.second.neck_compatible) { - if(ImGui::Selectable(set.second.name.data(), set.first == part.id, - ImGuiSelectableFlags_SpanAvailWidth)) - { - part.id = set.first; - } + for(const auto& [id, set] : GameData::armour_sets) { + if((part.slot == GameObjects::ArmourPart::Slot::Neck && !set.neck_compatible) || + (id == -2 && + !(part.slot == GameObjects::ArmourPart::Slot::LeftFrontSkirt || + part.slot == GameObjects::ArmourPart::Slot::RightFrontSkirt || + part.slot == GameObjects::ArmourPart::Slot::LeftSideSkirt || + part.slot == GameObjects::ArmourPart::Slot::RightSideSkirt || + part.slot == GameObjects::ArmourPart::Slot::LeftBackSkirt || + part.slot == GameObjects::ArmourPart::Slot::RightBackSkirt || + part.slot == GameObjects::ArmourPart::Slot::LeftAnkle || + part.slot == GameObjects::ArmourPart::Slot::RightAnkle) + ) + ) + { + continue; + } + + if(ImGui::Selectable(set.name.data(), id == part.id, + ImGuiSelectableFlags_SpanAvailWidth)) + { + part.id = id; } } ImGui::EndListBox(); diff --git a/src/GameData/ArmourSets.h b/src/GameData/ArmourSets.h index 97daa02..9d25f4a 100644 --- a/src/GameData/ArmourSets.h +++ b/src/GameData/ArmourSets.h @@ -33,6 +33,7 @@ struct ArmourSet { }; static const std::map armour_sets { + {-2, {""_s, false}}, {-1, {""_s, true}}, {0, {"Vanguard"_s, true}}, {1, {"Assault Mk.I"_s, true}},