diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 03:48:27 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 03:48:27 -0400 |
commit | febc05f628793d252066a173e8fce0826b2190fd (patch) | |
tree | 163b05a21767704b70a1add51d94abc2f64f3b97 /screens/Task | |
parent | 4dc99b2d0ac8cb741d1cd968d46026fae70d031e (diff) | |
download | Planner-febc05f628793d252066a173e8fce0826b2190fd.tar.gz Planner-febc05f628793d252066a173e8fce0826b2190fd.zip |
Flesh Out Navigation and Populate Screens with Data
Diffstat (limited to 'screens/Task')
-rw-r--r-- | screens/Task/Body.gd | 12 | ||||
-rw-r--r-- | screens/Task/Body.tscn | 10 | ||||
-rw-r--r-- | screens/Task/Header.gd | 5 | ||||
-rw-r--r-- | screens/Task/Header.tscn | 1 | ||||
-rw-r--r-- | screens/Task/SubtaskItem.gd | 4 | ||||
-rw-r--r-- | screens/Task/SubtaskItem.tscn | 6 |
6 files changed, 30 insertions, 8 deletions
diff --git a/screens/Task/Body.gd b/screens/Task/Body.gd new file mode 100644 index 0000000..05c9e9e --- /dev/null +++ b/screens/Task/Body.gd @@ -0,0 +1,12 @@ +extends VBoxContainer + +func populate(data): + $"%Length".text = "%d min" % data.estimated_length + $"%Description".text = data.description if data.description != null else "" + var tasks = SubTask.get_by_task(data.id) + var SubTaskItem = load("res://screens/Task/SubTaskItem.tscn") + var task_list = $"%SubTaskList" + for task in tasks: + var item = SubTaskItem.instance() + item.populate(task) + task_list.add_child(item)
\ No newline at end of file diff --git a/screens/Task/Body.tscn b/screens/Task/Body.tscn index 9185ad4..7f57ab2 100644 --- a/screens/Task/Body.tscn +++ b/screens/Task/Body.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] [ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] -[ext_resource path="res://screens/Task/SubtaskItem.tscn" type="PackedScene" id=2] +[ext_resource path="res://screens/Task/Body.gd" type="Script" id=3] [sub_resource type="DynamicFont" id=2] size = 100 @@ -16,12 +16,14 @@ margin_left = 20.0 margin_top = 20.0 margin_right = 1046.0 margin_bottom = 1664.0 +script = ExtResource( 3 ) [node name="HBoxContainer" type="HBoxContainer" parent="."] margin_right = 1026.0 margin_bottom = 300.0 [node name="Length" type="Label" parent="HBoxContainer"] +unique_name_in_owner = true margin_right = 511.0 margin_bottom = 300.0 rect_min_size = Vector2( 0, 300 ) @@ -32,6 +34,7 @@ valign = 1 clip_text = true [node name="Description" type="TextEdit" parent="HBoxContainer"] +unique_name_in_owner = true margin_left = 515.0 margin_right = 1026.0 margin_bottom = 300.0 @@ -48,10 +51,7 @@ margin_right = 1026.0 margin_bottom = 1644.0 size_flags_vertical = 3 -[node name="SubtaskList" type="VBoxContainer" parent="ScrollContainer"] +[node name="SubTaskList" type="VBoxContainer" parent="ScrollContainer"] unique_name_in_owner = true margin_right = 1026.0 -margin_bottom = 110.0 size_flags_horizontal = 3 - -[node name="TaskItem" parent="ScrollContainer/SubtaskList" instance=ExtResource( 2 )] diff --git a/screens/Task/Header.gd b/screens/Task/Header.gd index ed2fe98..8f6c3f7 100644 --- a/screens/Task/Header.gd +++ b/screens/Task/Header.gd @@ -1,4 +1,7 @@ extends HBoxContainer +func populate(data): + $"%Name".text = data.name + func _on_Back_button_up(): - $"/root/Main".nav_screen("TimeSlot") + $"/root/Main".nav_back() diff --git a/screens/Task/Header.tscn b/screens/Task/Header.tscn index 89e488c..66cb874 100644 --- a/screens/Task/Header.tscn +++ b/screens/Task/Header.tscn @@ -15,6 +15,7 @@ margin_bottom = 198.0 script = ExtResource( 2 ) [node name="Name" type="Label" parent="."] +unique_name_in_owner = true margin_top = 30.0 margin_right = 799.0 margin_bottom = 147.0 diff --git a/screens/Task/SubtaskItem.gd b/screens/Task/SubtaskItem.gd new file mode 100644 index 0000000..157ed5c --- /dev/null +++ b/screens/Task/SubtaskItem.gd @@ -0,0 +1,4 @@ +extends MarginContainer + +func populate(data): + $"Button".text = data.name
\ No newline at end of file diff --git a/screens/Task/SubtaskItem.tscn b/screens/Task/SubtaskItem.tscn index 48fc590..11bcd0b 100644 --- a/screens/Task/SubtaskItem.tscn +++ b/screens/Task/SubtaskItem.tscn @@ -1,16 +1,18 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/Task/SubtaskItem.gd" type="Script" id=2] [sub_resource type="DynamicFont" id=1] size = 72 font_data = ExtResource( 1 ) -[node name="TaskItem" type="MarginContainer"] +[node name="SubTaskItem" type="MarginContainer"] margin_right = 1026.0 margin_bottom = 110.0 custom_constants/margin_top = 5 custom_constants/margin_bottom = 5 +script = ExtResource( 2 ) [node name="Button" type="Button" parent="."] margin_top = 5.0 |