diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 19:37:29 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 19:37:29 -0400 |
commit | 5756a8f8ed23f0af88b9a351fbbde7417ac82c2f (patch) | |
tree | 483d564f7868a74276a930784f18b3271d6abbcc | |
parent | c96db866eaa188ea73548a58716f3c0a46bc011c (diff) | |
download | Planner-5756a8f8ed23f0af88b9a351fbbde7417ac82c2f.tar.gz Planner-5756a8f8ed23f0af88b9a351fbbde7417ac82c2f.zip |
Add Prototype Task Manager Screen
-rw-r--r-- | Main.gd | 2 | ||||
-rw-r--r-- | icons/arrow-left-hi.png | bin | 0 -> 2343 bytes | |||
-rw-r--r-- | icons/arrow-left-hi.png.import | 35 | ||||
-rw-r--r-- | icons/arrow-left.png | bin | 0 -> 2296 bytes | |||
-rw-r--r-- | icons/arrow-left.png.import | 35 | ||||
-rw-r--r-- | icons/arrow-right-hi.png | bin | 0 -> 2345 bytes | |||
-rw-r--r-- | icons/arrow-right-hi.png.import | 35 | ||||
-rw-r--r-- | icons/arrow-right.png | bin | 0 -> 2295 bytes | |||
-rw-r--r-- | icons/arrow-right.png.import | 35 | ||||
-rw-r--r-- | screens/TaskManager/Body.gd | 10 | ||||
-rw-r--r-- | screens/TaskManager/Body.tscn | 48 | ||||
-rw-r--r-- | screens/TaskManager/Header.gd | 7 | ||||
-rw-r--r-- | screens/TaskManager/Header.tscn | 33 | ||||
-rw-r--r-- | screens/TaskManager/TaskCategory.gd | 10 | ||||
-rw-r--r-- | screens/TaskManager/TaskCategory.tscn | 18 | ||||
-rw-r--r-- | screens/TaskManager/TaskItem.gd | 11 | ||||
-rw-r--r-- | screens/TaskManager/TaskItem.tscn | 48 | ||||
-rw-r--r-- | screens/TimeSlot/TaskItem.tscn | 6 |
18 files changed, 329 insertions, 4 deletions
@@ -43,4 +43,4 @@ func swap_screen(screen): body_container.add_child(body) func _ready(): - nav_screen("TimeSlot", TimeSlot, "get_by_id", [2]) + nav_screen("TaskManager", DataHelpers, "dummy_data", [[]]) diff --git a/icons/arrow-left-hi.png b/icons/arrow-left-hi.png Binary files differnew file mode 100644 index 0000000..56ddf05 --- /dev/null +++ b/icons/arrow-left-hi.png diff --git a/icons/arrow-left-hi.png.import b/icons/arrow-left-hi.png.import new file mode 100644 index 0000000..98a3875 --- /dev/null +++ b/icons/arrow-left-hi.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow-left-hi.png-4237ad7fdcdc7d0e68cacd2b8e5d01f6.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icons/arrow-left-hi.png" +dest_files=[ "res://.import/arrow-left-hi.png-4237ad7fdcdc7d0e68cacd2b8e5d01f6.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/icons/arrow-left.png b/icons/arrow-left.png Binary files differnew file mode 100644 index 0000000..5f46865 --- /dev/null +++ b/icons/arrow-left.png diff --git a/icons/arrow-left.png.import b/icons/arrow-left.png.import new file mode 100644 index 0000000..97eefaa --- /dev/null +++ b/icons/arrow-left.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow-left.png-1bd6dfe049987f6c365061997819ed65.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icons/arrow-left.png" +dest_files=[ "res://.import/arrow-left.png-1bd6dfe049987f6c365061997819ed65.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/icons/arrow-right-hi.png b/icons/arrow-right-hi.png Binary files differnew file mode 100644 index 0000000..5b4a89c --- /dev/null +++ b/icons/arrow-right-hi.png diff --git a/icons/arrow-right-hi.png.import b/icons/arrow-right-hi.png.import new file mode 100644 index 0000000..6c7a3e9 --- /dev/null +++ b/icons/arrow-right-hi.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow-right-hi.png-2e16d8707740b1cd0cb279427328555d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icons/arrow-right-hi.png" +dest_files=[ "res://.import/arrow-right-hi.png-2e16d8707740b1cd0cb279427328555d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/icons/arrow-right.png b/icons/arrow-right.png Binary files differnew file mode 100644 index 0000000..60ba87c --- /dev/null +++ b/icons/arrow-right.png diff --git a/icons/arrow-right.png.import b/icons/arrow-right.png.import new file mode 100644 index 0000000..f70dede --- /dev/null +++ b/icons/arrow-right.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/arrow-right.png-da13f02244eb72ad0b62ff40689e4810.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icons/arrow-right.png" +dest_files=[ "res://.import/arrow-right.png-da13f02244eb72ad0b62ff40689e4810.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/screens/TaskManager/Body.gd b/screens/TaskManager/Body.gd new file mode 100644 index 0000000..9f783fc --- /dev/null +++ b/screens/TaskManager/Body.gd @@ -0,0 +1,10 @@ +extends VBoxContainer + +func populate(_data): + var TaskCategory = load("res://screens/TaskManager/TaskCategory.tscn") + var tabs = $"%Tabs" + for i in range(DataHelpers.Frequency.SIZE): + var cat = TaskCategory.instance() + cat.name = DataHelpers.frequency(i).replace("\n", " ") + cat.populate(i) + tabs.add_child(cat) diff --git a/screens/TaskManager/Body.tscn b/screens/TaskManager/Body.tscn new file mode 100644 index 0000000..7d7e4f2 --- /dev/null +++ b/screens/TaskManager/Body.tscn @@ -0,0 +1,48 @@ +[gd_scene load_steps=10 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TaskManager/Body.gd" type="Script" id=2] +[ext_resource path="res://icons/arrow-right.png" type="Texture" id=4] +[ext_resource path="res://icons/arrow-left-hi.png" type="Texture" id=5] +[ext_resource path="res://icons/arrow-left.png" type="Texture" id=6] +[ext_resource path="res://icons/arrow-right-hi.png" type="Texture" id=7] + +[sub_resource type="DynamicFont" id=1] +size = 60 +font_data = ExtResource( 1 ) + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.239216, 0.231373, 0.27451, 1 ) +border_width_right = 40 +border_color = Color( 0, 0, 0, 0 ) +expand_margin_left = 10.0 +expand_margin_right = 10.0 + +[sub_resource type="StyleBoxFlat" id=3] +bg_color = Color( 0.176471, 0.168627, 0.2, 1 ) +border_width_right = 40 +border_color = Color( 0, 0, 0, 0 ) +expand_margin_left = 10.0 +expand_margin_right = 10.0 + +[node name="TaskManagerBody" type="VBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1060.0 +margin_bottom = 1676.0 +script = ExtResource( 2 ) + +[node name="Tabs" type="TabContainer" parent="."] +unique_name_in_owner = true +margin_right = 1040.0 +margin_bottom = 1656.0 +size_flags_vertical = 3 +custom_constants/side_margin = 20 +custom_fonts/font = SubResource( 1 ) +custom_icons/increment_highlight = ExtResource( 7 ) +custom_icons/increment = ExtResource( 4 ) +custom_icons/decrement_highlight = ExtResource( 5 ) +custom_icons/decrement = ExtResource( 6 ) +custom_styles/tab_fg = SubResource( 2 ) +custom_styles/tab_bg = SubResource( 3 ) +tab_align = 0 diff --git a/screens/TaskManager/Header.gd b/screens/TaskManager/Header.gd new file mode 100644 index 0000000..f47048b --- /dev/null +++ b/screens/TaskManager/Header.gd @@ -0,0 +1,7 @@ +extends HBoxContainer + +func populate(_data): + pass + +func _on_Back_button_up(): + $"/root/Main".nav_back() diff --git a/screens/TaskManager/Header.tscn b/screens/TaskManager/Header.tscn new file mode 100644 index 0000000..747d3b5 --- /dev/null +++ b/screens/TaskManager/Header.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TaskManager/Header.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=2] +size = 100 +font_data = ExtResource( 1 ) + +[node name="TaskManagerHeader" type="HBoxContainer"] +margin_left = 20.0 +margin_top = 20.0 +margin_right = 1060.0 +margin_bottom = 200.0 +script = ExtResource( 2 ) + +[node name="Title" type="Label" parent="."] +margin_top = 31.0 +margin_right = 813.0 +margin_bottom = 148.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 2 ) +text = "Task Manager" +clip_text = true + +[node name="Back" type="Button" parent="."] +margin_left = 817.0 +margin_right = 1040.0 +margin_bottom = 180.0 +custom_fonts/font = SubResource( 2 ) +text = "Back" + +[connection signal="button_up" from="Back" to="." method="_on_Back_button_up"] diff --git a/screens/TaskManager/TaskCategory.gd b/screens/TaskManager/TaskCategory.gd new file mode 100644 index 0000000..ef97c3b --- /dev/null +++ b/screens/TaskManager/TaskCategory.gd @@ -0,0 +1,10 @@ +extends ScrollContainer + +func populate(data): + var tasks = Task.get_by_frequency(data) + var TaskItem = load("res://screens/TaskManager/TaskItem.tscn") + var task_list = $"%TaskList" + for task in tasks: + var item = TaskItem.instance() + item.populate(task) + task_list.add_child(item)
\ No newline at end of file diff --git a/screens/TaskManager/TaskCategory.tscn b/screens/TaskManager/TaskCategory.tscn new file mode 100644 index 0000000..34c4752 --- /dev/null +++ b/screens/TaskManager/TaskCategory.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://screens/TaskManager/TaskCategory.gd" type="Script" id=1] + +[node name="TaskCategory" type="ScrollContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 67.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_vertical = 3 +script = ExtResource( 1 ) + +[node name="TaskList" type="VBoxContainer" parent="."] +unique_name_in_owner = true +margin_right = 1072.0 +size_flags_horizontal = 3 diff --git a/screens/TaskManager/TaskItem.gd b/screens/TaskManager/TaskItem.gd new file mode 100644 index 0000000..ce9dd75 --- /dev/null +++ b/screens/TaskManager/TaskItem.gd @@ -0,0 +1,11 @@ +extends MarginContainer + +var task_id + +func populate(data): + task_id = data.id + $"%Name".text = data.name + $"%Length".text = "%d min" % data.estimated_length + +func _on_Button_button_up(): + $"/root/Main".nav_screen("Task", Task, "get_by_id", [task_id]) diff --git a/screens/TaskManager/TaskItem.tscn b/screens/TaskManager/TaskItem.tscn new file mode 100644 index 0000000..ef223ee --- /dev/null +++ b/screens/TaskManager/TaskItem.tscn @@ -0,0 +1,48 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://screens/TaskManager/TaskItem.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=3] +size = 72 +font_data = ExtResource( 1 ) + +[node name="TaskItem" 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 +margin_right = 1026.0 +margin_bottom = 105.0 +rect_min_size = Vector2( 0, 100 ) + +[node name="HBoxContainer" type="HBoxContainer" parent="Button"] +margin_right = 1026.0 +margin_bottom = 100.0 +alignment = 2 + +[node name="Name" type="Label" parent="Button/HBoxContainer"] +unique_name_in_owner = true +margin_top = 8.0 +margin_right = 797.0 +margin_bottom = 92.0 +size_flags_horizontal = 3 +custom_fonts/font = SubResource( 3 ) +text = "Stretching" +clip_text = true + +[node name="Length" type="Label" parent="Button/HBoxContainer"] +unique_name_in_owner = true +margin_left = 801.0 +margin_top = 8.0 +margin_right = 1026.0 +margin_bottom = 92.0 +custom_fonts/font = SubResource( 3 ) +text = "10 min" +align = 2 + +[connection signal="button_up" from="Button" to="." method="_on_Button_button_up"] diff --git a/screens/TimeSlot/TaskItem.tscn b/screens/TimeSlot/TaskItem.tscn index 1a9948d..5c33386 100644 --- a/screens/TimeSlot/TaskItem.tscn +++ b/screens/TimeSlot/TaskItem.tscn @@ -3,7 +3,7 @@ [ext_resource path="res://fonts/DroidSans.ttf" type="DynamicFontData" id=1] [ext_resource path="res://screens/TimeSlot/TaskItem.gd" type="Script" id=2] -[sub_resource type="DynamicFont" id=1] +[sub_resource type="DynamicFont" id=3] size = 72 font_data = ExtResource( 1 ) @@ -35,7 +35,7 @@ margin_top = 8.0 margin_right = 493.0 margin_bottom = 92.0 size_flags_horizontal = 3 -custom_fonts/font = SubResource( 1 ) +custom_fonts/font = SubResource( 3 ) text = "Stretching" clip_text = true @@ -45,7 +45,7 @@ margin_left = 497.0 margin_top = 8.0 margin_right = 722.0 margin_bottom = 92.0 -custom_fonts/font = SubResource( 1 ) +custom_fonts/font = SubResource( 3 ) text = "10 min" align = 2 |