nice nice nice

This commit is contained in:
2026-08-03 13:15:39 +02:00
parent 0bb8ce47c0
commit 737919f66f
25 changed files with 206 additions and 61 deletions

View File

@@ -1,9 +1,12 @@
using System.Collections.Generic;
using System.Linq;
using Godot;
[SceneTree]
public partial class DaySchedule : PanelContainer
{
private int _currentSlot;
[Export]
private int _hoursInDay = 6;
@@ -17,10 +20,35 @@ public partial class DaySchedule : PanelContainer
TimeSlotContainer.AddChild(timeSlot);
}
ProgressTimer.Timeout += OnNewMeetingStarts;
SetupCurrentTimeLine();
}
private void SetupCurrentTimeLine()
{
var timeSlot = Instantiator.Instantiate<TimeSlot>();
CurrentTimeLine.Speed = (float)(timeSlot.Size.Y / ProgressTimer.WaitTime);
}
private void OnNewMeetingStarts()
{
GetTimeSlots()[_currentSlot].StartMeeting();
_currentSlot += 1;
}
public void StartDay()
{
CurrentTimeLine.Running = true;
ProgressTimer.Start();
CurrentTimeLine.Start();
GetTimeSlots().First().StartMeeting();
_currentSlot += 1;
}
private List<TimeSlot> GetTimeSlots()
{
return [.. TimeSlotContainer.GetChildren().OfType<TimeSlot>()];
}
}