Application,GameData: add support for hidden armours.

This commit is contained in:
Guillaume Jacquemin 2024-07-30 13:43:36 +02:00
parent 30e6ee4018
commit 1aa301c316
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A
2 changed files with 22 additions and 7 deletions

View file

@ -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();

View file

@ -33,6 +33,7 @@ struct ArmourSet {
};
static const std::map<std::int32_t, ArmourSet> armour_sets {
{-2, {"<hidden>"_s, false}},
{-1, {"<unequipped>"_s, true}},
{0, {"Vanguard"_s, true}},
{1, {"Assault Mk.I"_s, true}},