You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Babushka/scripts/CSharp/Common/DayAndNight/CalendarController.cs

44 lines
897 B

using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
namespace Babushka.scripts.CSharp.Common.DayAndNight;
public partial class CalendarController : Node
{
[Export] private SaveableVariableNode _dayCounter;
public static CalendarController? Instance;
public int CurrentDay
{
get
{
if (Instance == null)
return 0;
return Instance._dayCounter.Payload.AsInt32();
}
}
public override void _Ready()
{
if (Instance == null)
{
Instance = this;
}
}
public override void _Input(InputEvent @event)
{
if (@event.IsActionPressed("NextDayCheat"))
{
GoToNextDay();
}
}
public void GoToNextDay()
{
int days = _dayCounter.Payload.AsInt32();
days++;
_dayCounter.Payload = days;
}
}