diff --git a/CurrentTimeLine.cs b/CurrentTimeLine.cs index 6463a4a..a78a6a2 100644 --- a/CurrentTimeLine.cs +++ b/CurrentTimeLine.cs @@ -6,11 +6,11 @@ public partial class CurrentTimeLine : Panel [Export] public float Speed = 15f; - public bool Running { get; private set; } + private bool _running; public override void _Process(double delta) { - if (!Running) + if (!_running) return; var pos = OffsetTransformPosition; @@ -21,6 +21,12 @@ public partial class CurrentTimeLine : Panel public void Start() { - Running = true; + _running = true; + } + + public void Stop() + { + _running = false; + OffsetTransformPosition = Vector2.Zero; } } diff --git a/DaySchedule.cs b/DaySchedule.cs index a84ff82..45220c3 100644 --- a/DaySchedule.cs +++ b/DaySchedule.cs @@ -34,7 +34,14 @@ public partial class DaySchedule : PanelContainer private void OnNewMeetingStarts() { + if (_currentSlot >= GetTimeSlots().Count) + { + EndDay(); + return; + } + GetTimeSlots()[_currentSlot].StartMeeting(); + _currentSlot += 1; } @@ -47,6 +54,13 @@ public partial class DaySchedule : PanelContainer _currentSlot += 1; } + public void EndDay() + { + GD.Print("The DAY was EXECUTED!"); + ProgressTimer.Stop(); + CurrentTimeLine.Stop(); + } + private List GetTimeSlots() { return [.. TimeSlotContainer.GetChildren().OfType()]; diff --git a/DaySchedule.tscn b/DaySchedule.tscn index 1d5fc05..9b7bcc7 100644 --- a/DaySchedule.tscn +++ b/DaySchedule.tscn @@ -1,7 +1,6 @@ [gd_scene format=3 uid="uid://covomnw8s7k1n"] [ext_resource type="Script" uid="uid://xv51uvc4koyc" path="res://DaySchedule.cs" id="1_b6clr"] -[ext_resource type="PackedScene" uid="uid://nnr6u0igggve" path="res://TimeSlot.tscn" id="2_ascl5"] [ext_resource type="Script" uid="uid://cbbrups0mkp17" path="res://CurrentTimeLine.cs" id="3_dtij7"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cm0pq"] @@ -21,17 +20,8 @@ color = Color(1, 0, 0, 1) thickness = 5 [node name="DaySchedule" type="PanelContainer" unique_id=457829015] -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -107.0 -offset_top = -227.0 -offset_right = 107.0 -offset_bottom = 227.0 -grow_horizontal = 2 -grow_vertical = 2 +offset_right = 214.0 +offset_bottom = 13.0 mouse_filter = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_cm0pq") script = ExtResource("1_b6clr") @@ -48,38 +38,6 @@ mouse_filter = 2 theme_override_constants/separation = 2 alignment = 1 -[node name="TimeSlot" parent="TimeSlotContainer" unique_id=979842204 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot2" parent="TimeSlotContainer" unique_id=2109237451 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot3" parent="TimeSlotContainer" unique_id=819921714 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot4" parent="TimeSlotContainer" unique_id=1554222465 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot5" parent="TimeSlotContainer" unique_id=1612666058 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot6" parent="TimeSlotContainer" unique_id=1912431362 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot7" parent="TimeSlotContainer" unique_id=1182001581 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot8" parent="TimeSlotContainer" unique_id=193012813 instance=ExtResource("2_ascl5")] -layout_mode = 2 - -[node name="TimeSlot9" parent="TimeSlotContainer" unique_id=886153912 instance=ExtResource("2_ascl5")] -visible = false -layout_mode = 2 - -[node name="TimeSlot10" parent="TimeSlotContainer" unique_id=1760034209 instance=ExtResource("2_ascl5")] -visible = false -layout_mode = 2 - [node name="CurrentTimeLine" type="Panel" parent="." unique_id=961292687] unique_name_in_owner = true z_index = 2 diff --git a/Game.tscn b/Game.tscn index ea400ee..cb6bfb0 100644 --- a/Game.tscn +++ b/Game.tscn @@ -71,10 +71,11 @@ offset_right = 0.0 [node name="DaySchedule" parent="." unique_id=457829015 instance=ExtResource("3_yx171")] unique_name_in_owner = true -offset_left = -493.0 -offset_top = -277.00006 -offset_right = -279.0 -offset_bottom = 176.99994 +offset_left = -498.0 +offset_top = -269.0 +offset_right = -284.0 +offset_bottom = -256.0 +_hoursInDay = 2 [node name="ExecuteButton" type="Button" parent="." unique_id=312490567] unique_name_in_owner = true diff --git a/resources/meetings/lockin.tres b/resources/meetings/lockin.tres index 6beacbb..7ead983 100644 --- a/resources/meetings/lockin.tres +++ b/resources/meetings/lockin.tres @@ -1,6 +1,7 @@ [gd_resource type="Resource" script_class="MeetingResource" format=3 uid="uid://du72uxjqr0h4a"] [ext_resource type="Script" uid="uid://cuq38lbfa2v74" path="res://resources/MeetingResource.cs" id="1_4yd4m"] +[ext_resource type="Script" uid="uid://chl0yv2tsg2va" path="res://resources/MeetingActionResource.cs" id="1_edffo"] [ext_resource type="Script" uid="uid://cduoflv3vjfmg" path="res://resources/GainHypeAction.cs" id="1_qpv0b"] [sub_resource type="Resource" id="Resource_7t1gw"] @@ -10,8 +11,7 @@ metadata/_custom_type_script = "uid://cduoflv3vjfmg" [resource] script = ExtResource("1_4yd4m") -OnMeetingStartActions = Array[Object]([SubResource("Resource_7t1gw")]) -OnMeetingEndActions = null +OnMeetingStartActions = Array[ExtResource("1_edffo")]([SubResource("Resource_7t1gw")]) Title = "LOCK IN" Color = Color(0.73206806, 0.22440341, 0.33911285, 1) metadata/_custom_type_script = "uid://cuq38lbfa2v74" diff --git a/resources/meetings/work_product_1.tres b/resources/meetings/work_product_1.tres index c3f2bb6..42a056c 100644 --- a/resources/meetings/work_product_1.tres +++ b/resources/meetings/work_product_1.tres @@ -1,6 +1,7 @@ [gd_resource type="Resource" script_class="MeetingResource" format=3 uid="uid://bcd4qf4i84pwf"] [ext_resource type="Script" uid="uid://cduoflv3vjfmg" path="res://resources/GainHypeAction.cs" id="1_7t1gw"] +[ext_resource type="Script" uid="uid://chl0yv2tsg2va" path="res://resources/MeetingActionResource.cs" id="1_8teln"] [ext_resource type="Script" uid="uid://cuq38lbfa2v74" path="res://resources/MeetingResource.cs" id="1_qndny"] [sub_resource type="Resource" id="Resource_b6clr"] @@ -10,8 +11,7 @@ metadata/_custom_type_script = "uid://cduoflv3vjfmg" [resource] script = ExtResource("1_qndny") -OnMeetingStartActions = Array[Object]([SubResource("Resource_b6clr")]) -OnMeetingEndActions = null +OnMeetingStartActions = Array[ExtResource("1_8teln")]([SubResource("Resource_b6clr")]) Title = "Work on your Product" Color = Color(0.4354798, 0.3262509, 0.83488727, 1) metadata/_custom_type_script = "uid://cuq38lbfa2v74"