Skip to content

Commit

Permalink
made it so in phase 2, hyc cseed/fertilizer icons don't appear over t…
Browse files Browse the repository at this point in the history
…he wheat
  • Loading branch information
andyw1589 committed Mar 30, 2024
1 parent 129911d commit d59fc18
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions Assets/Scripts/Components/FarmPlotCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ void Start()
_highImage = gameObject.transform.Find("High").gameObject;
_irrigatedOverlay = gameObject.transform.Find("Irrigated").gameObject;
_image = GetComponent<Image>();

_hycImage.SetActive(false);
_lowImage.SetActive(false);
_highImage.SetActive(false);
_irrigatedOverlay.SetActive(false);
}

// Update this cell visually based on the attributes of the assigned farm plot
Expand Down Expand Up @@ -80,22 +85,26 @@ public void RefreshVisuals()
/// </summary>
public void RefreshStatus()
{
_hycImage.SetActive(Plot.SeedType == SeedType.HYC);

if (Plot.FertilizerType == FertilizerType.Low)
{
_lowImage.SetActive(true);
_highImage.SetActive(false);
}
else if (Plot.FertilizerType == FertilizerType.High)
// in phase two, only show wheat icon + irrigation overlay
if (GameState.s_Phase != 2)
{
_lowImage.SetActive(false);
_highImage.SetActive(true);
}
else
{
_lowImage.SetActive(false);
_highImage.SetActive(false);
_hycImage.SetActive(Plot.SeedType == SeedType.HYC);

if (Plot.FertilizerType == FertilizerType.Low)
{
_lowImage.SetActive(true);
_highImage.SetActive(false);
}
else if (Plot.FertilizerType == FertilizerType.High)
{
_lowImage.SetActive(false);
_highImage.SetActive(true);
}
else
{
_lowImage.SetActive(false);
_highImage.SetActive(false);
}
}

_irrigatedOverlay.SetActive(Plot.Irrigated);
Expand Down

0 comments on commit d59fc18

Please sign in to comment.