1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 14:02:59 +01:00

Add checks to ensure an animation object is selected for each peep type

This commit is contained in:
Aaron van Geffen
2024-12-07 13:40:30 +01:00
parent 42adf84723
commit 7efe73f6ac
10 changed files with 65 additions and 2 deletions

View File

@@ -687,6 +687,23 @@ bool EditorCheckObjectGroupAtLeastOneSelected(ObjectType checkObjectType)
return false;
}
bool EditorCheckObjectGroupAtLeastOneOfPeepTypeSelected(uint8_t peepType)
{
auto numObjects = std::min(ObjectRepositoryGetItemsCount(), _objectSelectionFlags.size());
const ObjectRepositoryItem* items = ObjectRepositoryGetItems();
for (size_t i = 0; i < numObjects; i++)
{
const auto isAnimObjectType = items[i].Type == ObjectType::PeepAnimations;
const bool isSelected = _objectSelectionFlags[i] & ObjectSelectionFlags::Selected;
if (isAnimObjectType && isSelected && items[i].PeepAnimationsInfo.PeepType == peepType)
{
return true;
}
}
return false;
}
bool EditorCheckObjectGroupAtLeastOneSurfaceSelected(bool queue)
{
auto numObjects = std::min(ObjectRepositoryGetItemsCount(), _objectSelectionFlags.size());