nice nice nice
This commit is contained in:
@@ -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>()];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user