hotbar resize

This commit is contained in:
Rendo 2025-07-21 03:18:01 +05:00
commit 1cd9ef3f3a
9 changed files with 55 additions and 23 deletions

View file

@ -0,0 +1,24 @@
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);
}
}
}

View file

@ -0,0 +1 @@
uid://bygqu13os20wi

View file

@ -24,11 +24,12 @@ public partial class RewardScene : Node
}
var rewardedObject = reward.GetPreview().Instantiate();
subviewport.AddChild(rewardedObject);
if (rewardedObject is Entity entity)
{
entity.DisableBrain();
}
subviewport.AddChild(rewardedObject);
}
}