Skip to content

Commit

Permalink
Adjust GetStaffIconDataForClearingSlots to replicate behaviour from F…
Browse files Browse the repository at this point in the history
…acility UI Indicator Fix (i.e. Display correctly which facility slots are empty)
  • Loading branch information
BlackDog86 committed Aug 12, 2023
1 parent 1e8558f commit 8235f0e
Showing 1 changed file with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1341,25 +1341,37 @@ function array<EUIStaffIconType> GetStaffIconData(XComGameState_FacilityXCom Fac

function array<EUIStaffIconType> GetStaffIconDataForClearingSlots()
{
local int i, numSlotsFilled, numSlotsEmpty;
local int i;
local array<EUIStaffIconType> NewIcons;
local XComGameState_HeadquartersRoom Room;

// Variable for Issue #1181
local XComGameState_StaffSlot BuildSlot;

Room = GetRoom();

//------------------------------------------------
numSlotsFilled = Room.GetNumFilledBuildSlots();
for( i = 0; i < numSlotsFilled; i++ )
// Start Issue #1181
/// HL-Docs: ref:Bugfixes; issue:1181
/// Make facility staff icons correctly display which staff slots are filled.
if (Room != none)
{
NewIcons.AddItem(eUIFG_Engineer);
}
//------------------------------------------------
numSlotsEmpty = Room.GetNumEmptyBuildSlots();
for( i = 0; i < numSlotsEmpty; i++ )
{
NewIcons.AddItem(eUIFG_EngineerEmpty);
for (i = 0; i < Room.BuildSlots.Length; ++i)
{
BuildSlot = Room.GetBuildSlot(i);
if (BuildSlot == none)
continue;

if (BuildSlot.IsSlotFilled())
{
NewIcons.AddItem(eUIFG_Engineer);
}
else
{
NewIcons.AddItem(eUIFG_EngineerEmpty);
}
}
}
//------------------------------------------------
// End Issue #1181
return NewIcons;
}

Expand Down

0 comments on commit 8235f0e

Please sign in to comment.