24 lines
616 B
C#
24 lines
616 B
C#
using Godot;
|
|
using Newlon.Components.Level;
|
|
using System;
|
|
|
|
public partial class PlantHotbarSize : PanelContainer
|
|
{
|
|
const int MARGIN = 4;
|
|
const int PACKET_WIDTH = 41;
|
|
const int MINIMUM_Y = 64;
|
|
public override void _Ready()
|
|
{
|
|
CustomMinimumSize = new Vector2(MARGIN * 2 + PACKET_WIDTH * PlayerProgress.Instance.MaxSeedpackets, MINIMUM_Y);
|
|
|
|
RuntimeLevelData.Instance.OnLevelStateChanged += OnLevelStateChanged;
|
|
}
|
|
|
|
public void OnLevelStateChanged(RuntimeLevelData.LevelStates state)
|
|
{
|
|
if (state != RuntimeLevelData.LevelStates.ChooseYourSeeds)
|
|
{
|
|
CustomMinimumSize = new Vector2(0, MINIMUM_Y);
|
|
}
|
|
}
|
|
}
|