diff --git a/.import/.gdignore b/.import/.gdignore deleted file mode 100644 index 8b13789..0000000 --- a/.import/.gdignore +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.import/0.jpg-2366d911423fcb1998eb8418bd01ab24.md5 b/.import/0.jpg-2366d911423fcb1998eb8418bd01ab24.md5 deleted file mode 100644 index d329163..0000000 --- a/.import/0.jpg-2366d911423fcb1998eb8418bd01ab24.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="8d73edfee105bd3ad210fa2c862a3972" -dest_md5="6c170633e4146bf363cbac64997a01f5" - diff --git a/.import/0.jpg-2366d911423fcb1998eb8418bd01ab24.stex b/.import/0.jpg-2366d911423fcb1998eb8418bd01ab24.stex deleted file mode 100644 index c56d6d9..0000000 Binary files a/.import/0.jpg-2366d911423fcb1998eb8418bd01ab24.stex and /dev/null differ diff --git a/.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.md5 b/.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.md5 deleted file mode 100644 index 8dc14bb..0000000 --- a/.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="0be71e4a3f3003fa0a57ab68d5a11d9e" -dest_md5="b30b9ea337e43a4056ba6381c9715218" - diff --git a/.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.stex b/.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.stex deleted file mode 100644 index 158632d..0000000 Binary files a/.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.stex and /dev/null differ diff --git a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.etc.stex b/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.etc.stex deleted file mode 100644 index 087f97a..0000000 Binary files a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.etc.stex and /dev/null differ diff --git a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.md5 b/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.md5 deleted file mode 100644 index 8920c4a..0000000 --- a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="8d73edfee105bd3ad210fa2c862a3972" -dest_md5="da277aa6b9ea71c2a760eeb2af6cefa2" - diff --git a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.s3tc.stex b/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.s3tc.stex deleted file mode 100644 index 2079fe8..0000000 Binary files a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.s3tc.stex and /dev/null differ diff --git a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.stex b/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.stex deleted file mode 100644 index c56d6d9..0000000 Binary files a/.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.stex and /dev/null differ diff --git a/.import/bg.png-6eb74ab5396c64f230bdaa24e04060fa.md5 b/.import/bg.png-6eb74ab5396c64f230bdaa24e04060fa.md5 deleted file mode 100644 index 9540950..0000000 --- a/.import/bg.png-6eb74ab5396c64f230bdaa24e04060fa.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="1e39735d90edd4ada48e200ae89237a8" -dest_md5="fefc7220661c77b03c385234b93d5dc1" - diff --git a/.import/bg.png-6eb74ab5396c64f230bdaa24e04060fa.stex b/.import/bg.png-6eb74ab5396c64f230bdaa24e04060fa.stex deleted file mode 100644 index fbf7e74..0000000 Binary files a/.import/bg.png-6eb74ab5396c64f230bdaa24e04060fa.stex and /dev/null differ diff --git a/.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.md5 b/.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.md5 deleted file mode 100644 index 9540950..0000000 --- a/.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="1e39735d90edd4ada48e200ae89237a8" -dest_md5="fefc7220661c77b03c385234b93d5dc1" - diff --git a/.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.stex b/.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.stex deleted file mode 100644 index fbf7e74..0000000 Binary files a/.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.stex and /dev/null differ diff --git a/.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.md5 b/.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.md5 deleted file mode 100644 index 38372ac..0000000 --- a/.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="f22f3d8ef152307565cbf4014e01ff6e" -dest_md5="ff5ab25eb8150b54056caf04c497554a" - diff --git a/.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.stex b/.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.stex deleted file mode 100644 index c601220..0000000 Binary files a/.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.stex and /dev/null differ diff --git a/.import/bgtexture.png-febe34c63fe1da32f77269006b132410.md5 b/.import/bgtexture.png-febe34c63fe1da32f77269006b132410.md5 deleted file mode 100644 index 9540950..0000000 --- a/.import/bgtexture.png-febe34c63fe1da32f77269006b132410.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="1e39735d90edd4ada48e200ae89237a8" -dest_md5="fefc7220661c77b03c385234b93d5dc1" - diff --git a/.import/bgtexture.png-febe34c63fe1da32f77269006b132410.stex b/.import/bgtexture.png-febe34c63fe1da32f77269006b132410.stex deleted file mode 100644 index fbf7e74..0000000 Binary files a/.import/bgtexture.png-febe34c63fe1da32f77269006b132410.stex and /dev/null differ diff --git a/.import/call.png-f0ead0cab8f2742b18976fe6998a7ae3.md5 b/.import/call.png-f0ead0cab8f2742b18976fe6998a7ae3.md5 deleted file mode 100644 index 4d0aa47..0000000 --- a/.import/call.png-f0ead0cab8f2742b18976fe6998a7ae3.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="c2f8ee7e4013f01b8975066b1777efc3" -dest_md5="e6cfd3bf61f70ebbea21b68a617a8ea3" - diff --git a/.import/call.png-f0ead0cab8f2742b18976fe6998a7ae3.stex b/.import/call.png-f0ead0cab8f2742b18976fe6998a7ae3.stex deleted file mode 100644 index 73749d0..0000000 Binary files a/.import/call.png-f0ead0cab8f2742b18976fe6998a7ae3.stex and /dev/null differ diff --git a/.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.md5 b/.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.md5 deleted file mode 100644 index 4d0aa47..0000000 --- a/.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="c2f8ee7e4013f01b8975066b1777efc3" -dest_md5="e6cfd3bf61f70ebbea21b68a617a8ea3" - diff --git a/.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.stex b/.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.stex deleted file mode 100644 index 73749d0..0000000 Binary files a/.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.stex and /dev/null differ diff --git a/.import/call01.png-79c09e4be83487355c231beafdae0086.md5 b/.import/call01.png-79c09e4be83487355c231beafdae0086.md5 deleted file mode 100644 index 5cee7dc..0000000 --- a/.import/call01.png-79c09e4be83487355c231beafdae0086.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="986d1626ecf7c000ffc9a56f80b2df64" -dest_md5="62bc505c9ab152918cacabee23655e14" - diff --git a/.import/call01.png-79c09e4be83487355c231beafdae0086.stex b/.import/call01.png-79c09e4be83487355c231beafdae0086.stex deleted file mode 100644 index 14892d4..0000000 Binary files a/.import/call01.png-79c09e4be83487355c231beafdae0086.stex and /dev/null differ diff --git a/.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.md5 b/.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.md5 deleted file mode 100644 index 5f21338..0000000 --- a/.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="11112eaa7cf69b157d1f7c8f2ce01bab" -dest_md5="8870411b528c6ffb49de9f8db6854cb5" - diff --git a/.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.stex b/.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.stex deleted file mode 100644 index eeee60c..0000000 Binary files a/.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.stex and /dev/null differ diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 deleted file mode 100644 index 7b55c14..0000000 --- a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="e5d3288a900b6d4421e9d3937d08ab5e" -dest_md5="cc45eda6d302c77d5e7d876bb1d30a13" - diff --git a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex b/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex deleted file mode 100644 index 0632608..0000000 Binary files a/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex and /dev/null differ diff --git a/.import/image.png-9179a1b8b8208e9ac827f973fccd72e0.md5 b/.import/image.png-9179a1b8b8208e9ac827f973fccd72e0.md5 deleted file mode 100644 index bbab118..0000000 --- a/.import/image.png-9179a1b8b8208e9ac827f973fccd72e0.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="6218a7e4769821b59a77bed6d074a4e7" -dest_md5="77d9abc9b9c8784a62c114d61cf096b2" - diff --git a/.import/image.png-9179a1b8b8208e9ac827f973fccd72e0.stex b/.import/image.png-9179a1b8b8208e9ac827f973fccd72e0.stex deleted file mode 100644 index 2e3f744..0000000 Binary files a/.import/image.png-9179a1b8b8208e9ac827f973fccd72e0.stex and /dev/null differ diff --git a/.import/jimsito.png-0282e9988476bbabb7014326f21007ce.md5 b/.import/jimsito.png-0282e9988476bbabb7014326f21007ce.md5 deleted file mode 100644 index 6c6c6be..0000000 --- a/.import/jimsito.png-0282e9988476bbabb7014326f21007ce.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="938ae33adfedfb81957ea0d3fd1bdb2c" -dest_md5="a0ddd5f392a99291648938b6874e70b1" - diff --git a/.import/jimsito.png-0282e9988476bbabb7014326f21007ce.stex b/.import/jimsito.png-0282e9988476bbabb7014326f21007ce.stex deleted file mode 100644 index 81625b3..0000000 Binary files a/.import/jimsito.png-0282e9988476bbabb7014326f21007ce.stex and /dev/null differ diff --git a/.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.md5 b/.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.md5 deleted file mode 100644 index 738f333..0000000 --- a/.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="7ac917032afeec8a7824e5472cf13638" -dest_md5="6930cf1e3a1ddce048f1fc4dc82e656d" - diff --git a/.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.stex b/.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.stex deleted file mode 100644 index aeabc80..0000000 Binary files a/.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.stex and /dev/null differ diff --git a/.import/on.png-4bc6a2158c537328d87921ed56daf94b.md5 b/.import/on.png-4bc6a2158c537328d87921ed56daf94b.md5 deleted file mode 100644 index 0b676e7..0000000 --- a/.import/on.png-4bc6a2158c537328d87921ed56daf94b.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="6a0879affdd3ff3272b40d2b876c493a" -dest_md5="786aedb5f9921c46dec8adf5d5d80443" - diff --git a/.import/on.png-4bc6a2158c537328d87921ed56daf94b.stex b/.import/on.png-4bc6a2158c537328d87921ed56daf94b.stex deleted file mode 100644 index 18a8c2b..0000000 Binary files a/.import/on.png-4bc6a2158c537328d87921ed56daf94b.stex and /dev/null differ diff --git a/.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.md5 b/.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.md5 deleted file mode 100644 index 6de66c9..0000000 --- a/.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="3e46c68a686c87959e97519c25a35e46" -dest_md5="c25d3e0fc261f6ed19218d9c837850f4" - diff --git a/.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.stex b/.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.stex deleted file mode 100644 index af8a9d2..0000000 Binary files a/.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.stex and /dev/null differ diff --git a/.import/receivedmessage.png-d95d8fd9495e2ef27a08219e22416dff.md5 b/.import/receivedmessage.png-d95d8fd9495e2ef27a08219e22416dff.md5 deleted file mode 100644 index 9540950..0000000 --- a/.import/receivedmessage.png-d95d8fd9495e2ef27a08219e22416dff.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="1e39735d90edd4ada48e200ae89237a8" -dest_md5="fefc7220661c77b03c385234b93d5dc1" - diff --git a/.import/sendedmessage.png-1993f79a450b61f8cc85cf448c69010c.md5 b/.import/sendedmessage.png-1993f79a450b61f8cc85cf448c69010c.md5 deleted file mode 100644 index 38372ac..0000000 --- a/.import/sendedmessage.png-1993f79a450b61f8cc85cf448c69010c.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="f22f3d8ef152307565cbf4014e01ff6e" -dest_md5="ff5ab25eb8150b54056caf04c497554a" - diff --git a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.etc.stex b/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.etc.stex deleted file mode 100644 index cf3cd61..0000000 Binary files a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.etc.stex and /dev/null differ diff --git a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.md5 b/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.md5 deleted file mode 100644 index 1328594..0000000 --- a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.md5 +++ /dev/null @@ -1,3 +0,0 @@ -source_md5="ceec25b08b0d0ebb65b34989f2ac10b2" -dest_md5="34ea352b537e79967ccf8d818710414f" - diff --git a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.s3tc.stex b/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.s3tc.stex deleted file mode 100644 index cffe32e..0000000 Binary files a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.s3tc.stex and /dev/null differ diff --git a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.stex b/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.stex deleted file mode 100644 index 9250a8e..0000000 Binary files a/.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.stex and /dev/null differ diff --git a/assets/fonts/username_label.tres b/assets/fonts/username_label.tres deleted file mode 100644 index 81e482f..0000000 --- a/assets/fonts/username_label.tres +++ /dev/null @@ -1,8 +0,0 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] - -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-Bold.ttf" type="DynamicFontData" id=1] - -[resource] -use_mipmaps = true -use_filter = true -font_data = ExtResource( 1 ) diff --git a/assets/textures/bg1.png b/assets/textures/bg1.png deleted file mode 100644 index 1da7bf7..0000000 Binary files a/assets/textures/bg1.png and /dev/null differ diff --git a/assets/textures/bg2.png b/assets/textures/bg2.png deleted file mode 100644 index 4ff155a..0000000 Binary files a/assets/textures/bg2.png and /dev/null differ diff --git a/assets/textures/jimsito.png b/assets/textures/jimsito.png deleted file mode 100644 index a3c1bf2..0000000 Binary files a/assets/textures/jimsito.png and /dev/null differ diff --git a/assets/textures/profilepicture/1.jpg b/assets/textures/profilepicture/1.jpg deleted file mode 100644 index e5042f1..0000000 Binary files a/assets/textures/profilepicture/1.jpg and /dev/null differ diff --git a/assets/textures/profilepicture/2.jpg b/assets/textures/profilepicture/2.jpg deleted file mode 100644 index 515a813..0000000 Binary files a/assets/textures/profilepicture/2.jpg and /dev/null differ diff --git a/assets/textures/profilepicture/2.jpg.import b/assets/textures/profilepicture/2.jpg.import deleted file mode 100644 index 97fb225..0000000 --- a/assets/textures/profilepicture/2.jpg.import +++ /dev/null @@ -1,37 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path.s3tc="res://.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.s3tc.stex" -path.etc="res://.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.etc.stex" -metadata={ -"imported_formats": [ "s3tc", "etc" ], -"vram_texture": true -} - -[deps] - -source_file="res://assets/textures/profilepicture/2.jpg" -dest_files=[ "res://.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.s3tc.stex", "res://.import/2.jpg-a6860f3420aa314326ad7a28f94823fa.etc.stex" ] - -[params] - -compress/mode=2 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=true -flags/filter=true -flags/mipmaps=true -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=false -svg/scale=1.0 diff --git a/assets/textures/profilepicture/shape.shader b/assets/textures/profilepicture/shape.shader deleted file mode 100644 index 4aca8df..0000000 --- a/assets/textures/profilepicture/shape.shader +++ /dev/null @@ -1,8 +0,0 @@ -shader_type canvas_item; -render_mode blend_mix; - -uniform sampler2D mask; - -void fragment() { - COLOR = texture(TEXTURE, UV) * vec4(vec3(1.0), texture(mask, UV).r); -} \ No newline at end of file diff --git a/assets/ui/mainTheme.tres b/assets/ui/mainTheme.tres deleted file mode 100644 index dbff474..0000000 --- a/assets/ui/mainTheme.tres +++ /dev/null @@ -1,46 +0,0 @@ -[gd_resource type="Theme" load_steps=8 format=2] - -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-standard.ttf" type="DynamicFontData" id=1] - -[sub_resource type="StyleBoxFlat" id=5] -bg_color = Color( 0.184314, 0.203922, 0.239216, 1 ) -corner_radius_top_left = 15 -corner_radius_top_right = 15 -corner_radius_bottom_right = 15 -corner_radius_bottom_left = 15 - -[sub_resource type="StyleBoxFlat" id=6] -bg_color = Color( 0.121569, 0.137255, 0.160784, 1 ) -corner_radius_top_left = 15 -corner_radius_top_right = 15 -corner_radius_bottom_right = 15 -corner_radius_bottom_left = 15 - -[sub_resource type="StyleBoxEmpty" id=10] - -[sub_resource type="StyleBoxFlat" id=7] -bg_color = Color( 0.184314, 0.203922, 0.239216, 1 ) -border_width_top = 5 - -[sub_resource type="StyleBoxFlat" id=9] -bg_color = Color( 0.25098, 0.266667, 0.294118, 1 ) -corner_radius_top_left = 10 -corner_radius_top_right = 10 -corner_radius_bottom_right = 10 -corner_radius_bottom_left = 5 - -[sub_resource type="DynamicFont" id=3] -size = 17 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 1 ) - -[resource] -default_font = SubResource( 3 ) -Panel/styles/panel = SubResource( 5 ) -PanelContainer/styles/panel = SubResource( 6 ) -TextEdit/styles/normal = SubResource( 10 ) -Tree/styles/bg = SubResource( 7 ) -VScrollBar/styles/grabber = SubResource( 9 ) -VScrollBar/styles/grabber_highlight = SubResource( 9 ) -VScrollBar/styles/grabber_pressed = SubResource( 9 ) diff --git a/assets/ui/receivedMessage.tscn b/assets/ui/receivedMessage.tscn deleted file mode 100644 index df4e282..0000000 --- a/assets/ui/receivedMessage.tscn +++ /dev/null @@ -1,108 +0,0 @@ -[gd_scene load_steps=5 format=2] - -[ext_resource path="res://assets/textures/receivedmessage.png" type="Texture" id=1] -[ext_resource path="res://assets/textures/jimsito.png" type="Texture" id=2] -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-Bold.ttf" type="DynamicFontData" id=3] - -[sub_resource type="DynamicFont" id=1] -size = 18 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 3 ) - -[node name="receivedMessage" type="HBoxContainer"] -modulate = Color( 0.478431, 0.752941, 1, 1 ) -margin_right = 246.0 -margin_bottom = 65.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="TextureRect" type="TextureRect" parent="."] -margin_right = 65.0 -margin_bottom = 65.0 -rect_min_size = Vector2( 65, 65 ) -size_flags_horizontal = 0 -size_flags_vertical = 0 -texture = ExtResource( 2 ) -expand = true -stretch_mode = 5 - -[node name="VBoxContainer2" type="VBoxContainer" parent="."] -margin_left = 69.0 -margin_right = 246.0 -margin_bottom = 94.0 -size_flags_horizontal = 3 -size_flags_vertical = 2 -custom_constants/separation = 5 - -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer2"] -margin_right = 177.0 -margin_bottom = 19.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Label" type="Label" parent="VBoxContainer2/HBoxContainer"] -margin_right = 65.0 -margin_bottom = 19.0 -size_flags_vertical = 3 -custom_fonts/font = SubResource( 1 ) -text = "Bluejim" -valign = 1 - -[node name="Label2" type="Label" parent="VBoxContainer2/HBoxContainer"] -margin_left = 69.0 -margin_right = 177.0 -margin_bottom = 19.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Today at 05:59" -align = 2 -valign = 1 - -[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer2"] -margin_top = 24.0 -margin_right = 177.0 -margin_bottom = 94.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer2/MarginContainer"] -margin_right = 177.0 -margin_bottom = 70.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -texture = ExtResource( 1 ) -patch_margin_left = 21 -patch_margin_top = 12 -patch_margin_right = 12 -patch_margin_bottom = 12 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="MarginContainer (Force Fill_Expand)" type="MarginContainer" parent="VBoxContainer2/MarginContainer"] -margin_right = 177.0 -margin_bottom = 70.0 -custom_constants/margin_right = 5 -custom_constants/margin_top = 5 -custom_constants/margin_left = 16 -custom_constants/margin_bottom = 5 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Label" type="RichTextLabel" parent="VBoxContainer2/MarginContainer/MarginContainer (Force Fill_Expand)"] -margin_left = 16.0 -margin_top = 5.0 -margin_right = 172.0 -margin_bottom = 65.0 -size_flags_vertical = 0 -custom_colors/default_color = Color( 0, 0, 0, 1 ) -bbcode_enabled = true -bbcode_text = "This is supposed to expand once the label grows up. -Now it did." -text = "This is supposed to expand once the label grows up. -Now it did." -fit_content_height = true -scroll_active = false diff --git a/assets/ui/sendedMessage.tscn b/assets/ui/sendedMessage.tscn deleted file mode 100644 index 3f72691..0000000 --- a/assets/ui/sendedMessage.tscn +++ /dev/null @@ -1,110 +0,0 @@ -[gd_scene load_steps=5 format=2] - -[ext_resource path="res://assets/textures/sendedmessage.png" type="Texture" id=1] -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-Bold.ttf" type="DynamicFontData" id=2] -[ext_resource path="res://assets/textures/jimsito.png" type="Texture" id=3] - -[sub_resource type="DynamicFont" id=1] -size = 18 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 2 ) - -[node name="sendedMessage" type="HBoxContainer"] -anchor_left = 1.0 -anchor_right = 1.0 -margin_left = -294.0 -margin_right = -46.0 -margin_bottom = 65.0 -rect_scale = Vector2( 1.00197, 1 ) -rect_pivot_offset = Vector2( -375, -163 ) -alignment = 2 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="MarginContainer" type="MarginContainer" parent="."] -margin_right = 179.0 -margin_bottom = 65.0 -custom_constants/margin_right = 10 -custom_constants/margin_top = 10 - -[node name="sendedMessage" type="VBoxContainer" parent="MarginContainer"] -margin_top = 10.0 -margin_right = 169.0 -margin_bottom = 65.0 -rect_pivot_offset = Vector2( 39, -180 ) -custom_constants/separation = 5 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/sendedMessage"] -margin_right = 169.0 -margin_bottom = 19.0 -size_flags_vertical = 3 -custom_constants/margin_right = 5 -custom_constants/margin_left = 0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/sendedMessage/MarginContainer2"] -margin_right = 164.0 -margin_bottom = 19.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Label" type="Label" parent="MarginContainer/sendedMessage/MarginContainer2/HBoxContainer"] -margin_right = 67.0 -margin_bottom = 19.0 -size_flags_vertical = 3 -custom_fonts/font = SubResource( 1 ) -text = "Grayjim" -valign = 1 - -[node name="Label2" type="Label" parent="MarginContainer/sendedMessage/MarginContainer2/HBoxContainer"] -margin_left = 71.0 -margin_right = 164.0 -margin_bottom = 19.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Today at 06:34" -align = 2 -valign = 1 - -[node name="NinePatchRect" type="NinePatchRect" parent="MarginContainer/sendedMessage"] -margin_top = 24.0 -margin_right = 169.0 -margin_bottom = 55.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 9.0 -texture = ExtResource( 1 ) -region_rect = Rect2( 0, 0, 33.9571, 25.155 ) -patch_margin_left = 12 -patch_margin_top = 12 -patch_margin_right = 21 -patch_margin_bottom = 12 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="RichTextLabel" type="Label" parent="MarginContainer/sendedMessage/NinePatchRect"] -margin_left = 16.0 -margin_top = 8.0 -margin_right = 150.0 -margin_bottom = 24.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) -text = "Sended Message." - -[node name="TextureRect" type="TextureRect" parent="."] -margin_left = 183.0 -margin_right = 248.0 -margin_bottom = 65.0 -rect_min_size = Vector2( 65, 65 ) -size_flags_horizontal = 0 -size_flags_vertical = 0 -texture = ExtResource( 3 ) -expand = true -stretch_mode = 5 diff --git a/configuration/emotes/emb.png b/configuration/emotes/emb.png new file mode 100644 index 0000000..35f3878 Binary files /dev/null and b/configuration/emotes/emb.png differ diff --git a/assets/ui/icons/call1.png.import b/configuration/emotes/emb.png.import similarity index 71% rename from assets/ui/icons/call1.png.import rename to configuration/emotes/emb.png.import index 9c55e73..ea6c0db 100644 --- a/assets/ui/icons/call1.png.import +++ b/configuration/emotes/emb.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.stex" +path="res://.import/emb.png-15b5f2ba8092793d40606e10ddccb660.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/ui/icons/call1.png" -dest_files=[ "res://.import/call1.png-4482b573d199206eeb31f35a4ca8b47d.stex" ] +source_file="res://configuration/emotes/emb.png" +dest_files=[ "res://.import/emb.png-15b5f2ba8092793d40606e10ddccb660.stex" ] [params] diff --git a/configuration/emotes/emote_list.gd b/configuration/emotes/emote_list.gd new file mode 100644 index 0000000..e120dfc --- /dev/null +++ b/configuration/emotes/emote_list.gd @@ -0,0 +1,4 @@ +extends Resource +class_name EmoteList + +export(Array, String) var list # Each emote shortcut needs to be set here. diff --git a/configuration/emotes/emote_list.tres b/configuration/emotes/emote_list.tres new file mode 100644 index 0000000..7b73a90 --- /dev/null +++ b/configuration/emotes/emote_list.tres @@ -0,0 +1,7 @@ +[gd_resource type="Resource" load_steps=2 format=2] + +[ext_resource path="res://configuration/emotes/emote_list.gd" type="Script" id=1] + +[resource] +script = ExtResource( 1 ) +list = [ "note", "emb", "hime", "stronk", "sweat", "iee" ] diff --git a/configuration/emotes/hime.png b/configuration/emotes/hime.png new file mode 100644 index 0000000..b7f3f1f Binary files /dev/null and b/configuration/emotes/hime.png differ diff --git a/configuration/emotes/hime.png.import b/configuration/emotes/hime.png.import new file mode 100644 index 0000000..a7bdc4d --- /dev/null +++ b/configuration/emotes/hime.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/hime.png-3859ec6e8920d1924f20ea8c659a69d3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://configuration/emotes/hime.png" +dest_files=[ "res://.import/hime.png-3859ec6e8920d1924f20ea8c659a69d3.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=true +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/configuration/emotes/iee.png b/configuration/emotes/iee.png new file mode 100644 index 0000000..d734e81 Binary files /dev/null and b/configuration/emotes/iee.png differ diff --git a/assets/ui/icons/plus0.png.import b/configuration/emotes/iee.png.import similarity index 71% rename from assets/ui/icons/plus0.png.import rename to configuration/emotes/iee.png.import index df157c2..92a710b 100644 --- a/assets/ui/icons/plus0.png.import +++ b/configuration/emotes/iee.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.stex" +path="res://.import/iee.png-2ace60c60bc9444db96f8335a0a42fd8.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/ui/icons/plus0.png" -dest_files=[ "res://.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.stex" ] +source_file="res://configuration/emotes/iee.png" +dest_files=[ "res://.import/iee.png-2ace60c60bc9444db96f8335a0a42fd8.stex" ] [params] diff --git a/configuration/emotes/note.png b/configuration/emotes/note.png new file mode 100644 index 0000000..26ff6d1 Binary files /dev/null and b/configuration/emotes/note.png differ diff --git a/configuration/emotes/note.png.import b/configuration/emotes/note.png.import new file mode 100644 index 0000000..9ebdce9 --- /dev/null +++ b/configuration/emotes/note.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/note.png-efb60329feae1162eb5809ba1529a3d3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://configuration/emotes/note.png" +dest_files=[ "res://.import/note.png-efb60329feae1162eb5809ba1529a3d3.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=true +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/configuration/emotes/stronk.png b/configuration/emotes/stronk.png new file mode 100644 index 0000000..051bcb4 Binary files /dev/null and b/configuration/emotes/stronk.png differ diff --git a/assets/ui/icons/call01.png.import b/configuration/emotes/stronk.png.import similarity index 72% rename from assets/ui/icons/call01.png.import rename to configuration/emotes/stronk.png.import index 33fd288..61a134d 100644 --- a/assets/ui/icons/call01.png.import +++ b/configuration/emotes/stronk.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/call01.png-79c09e4be83487355c231beafdae0086.stex" +path="res://.import/stronk.png-84390bd08630eef7a8687f8b906bc8cb.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/ui/icons/call01.png" -dest_files=[ "res://.import/call01.png-79c09e4be83487355c231beafdae0086.stex" ] +source_file="res://configuration/emotes/stronk.png" +dest_files=[ "res://.import/stronk.png-84390bd08630eef7a8687f8b906bc8cb.stex" ] [params] diff --git a/configuration/emotes/sweat.png b/configuration/emotes/sweat.png new file mode 100644 index 0000000..114dacb Binary files /dev/null and b/configuration/emotes/sweat.png differ diff --git a/assets/ui/icons/call0.png.import b/configuration/emotes/sweat.png.import similarity index 72% rename from assets/ui/icons/call0.png.import rename to configuration/emotes/sweat.png.import index 17d5657..b7e36e6 100644 --- a/assets/ui/icons/call0.png.import +++ b/configuration/emotes/sweat.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.stex" +path="res://.import/sweat.png-2bb73a0e3fc2dab640bb3f479d92a16a.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/ui/icons/call0.png" -dest_files=[ "res://.import/call0.png-6bbfd817211a380306e1bdee9a3ccaed.stex" ] +source_file="res://configuration/emotes/sweat.png" +dest_files=[ "res://.import/sweat.png-2bb73a0e3fc2dab640bb3f479d92a16a.stex" ] [params] diff --git a/configuration/helper_user.tres b/configuration/helper_user.tres new file mode 100644 index 0000000..d92e5e9 --- /dev/null +++ b/configuration/helper_user.tres @@ -0,0 +1,20 @@ +[gd_resource type="Resource" load_steps=3 format=2] + +[ext_resource path="res://system/users/user.gd" type="Script" id=1] +[ext_resource path="res://configuration/helper_user_profile_image.jpg" type="Texture" id=2] + +[resource] +script = ExtResource( 1 ) +username = "Amber" +profile_image = ExtResource( 2 ) +background_color = Color( 0.278431, 0.121569, 0.254902, 1 ) +panel_color = Color( 0.443137, 0.184314, 0.309804, 1 ) +popup_menu_color = Color( 0.321569, 0.133333, 0.258824, 1 ) +own_message_color = Color( 0.380392, 0.152941, 0.27451, 1 ) +others_message_color = Color( 0.294118, 0.168627, 0.34902, 1 ) +scroll_bar_color = Color( 0.372549, 0.137255, 0.286275, 1 ) +scroll_bar_highlight_color = Color( 0.760784, 0.34902, 0.964706, 1 ) +scroll_bar_pressed_color = Color( 1, 0.631373, 0.701961, 1 ) +casual_topic_color = Color( 0.380392, 0.152941, 0.27451, 1 ) +daily_topic_color = Color( 0.294118, 0.168627, 0.34902, 1 ) +urgent_topic_color = Color( 0.352941, 0.129412, 0.243137, 1 ) diff --git a/configuration/helper_user_profile_image.jpg b/configuration/helper_user_profile_image.jpg new file mode 100644 index 0000000..3de9684 Binary files /dev/null and b/configuration/helper_user_profile_image.jpg differ diff --git a/configuration/helper_user_profile_image.jpg.import b/configuration/helper_user_profile_image.jpg.import new file mode 100644 index 0000000..0cba2f7 --- /dev/null +++ b/configuration/helper_user_profile_image.jpg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/helper_user_profile_image.jpg-05ffe1aae0930c8319f064319d90f030.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://configuration/helper_user_profile_image.jpg" +dest_files=[ "res://.import/helper_user_profile_image.jpg-05ffe1aae0930c8319f064319d90f030.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=true +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/configuration/primary_user.tres b/configuration/primary_user.tres new file mode 100644 index 0000000..03c2ee5 --- /dev/null +++ b/configuration/primary_user.tres @@ -0,0 +1,20 @@ +[gd_resource type="Resource" load_steps=3 format=2] + +[ext_resource path="res://system/users/user.gd" type="Script" id=1] +[ext_resource path="res://configuration/primary_user_profile_image.png" type="Texture" id=2] + +[resource] +script = ExtResource( 1 ) +username = "Mono" +profile_image = ExtResource( 2 ) +background_color = Color( 0.184314, 0.203922, 0.239216, 1 ) +panel_color = Color( 0.121569, 0.137255, 0.160784, 1 ) +popup_menu_color = Color( 0.105882, 0.121569, 0.141176, 1 ) +own_message_color = Color( 0.14902, 0.172549, 0.203922, 1 ) +others_message_color = Color( 0.0980392, 0.180392, 0.305882, 1 ) +scroll_bar_color = Color( 0.227451, 0.243137, 0.270588, 1 ) +scroll_bar_highlight_color = Color( 0.211765, 0.533333, 0.690196, 1 ) +scroll_bar_pressed_color = Color( 0.396078, 0.435294, 0.447059, 1 ) +casual_topic_color = Color( 0.14902, 0.172549, 0.203922, 1 ) +daily_topic_color = Color( 0.0980392, 0.180392, 0.305882, 1 ) +urgent_topic_color = Color( 0.290196, 0.152941, 0.203922, 1 ) diff --git a/configuration/primary_user_profile_image.png b/configuration/primary_user_profile_image.png new file mode 100644 index 0000000..b8542d2 Binary files /dev/null and b/configuration/primary_user_profile_image.png differ diff --git a/configuration/primary_user_profile_image.png.import b/configuration/primary_user_profile_image.png.import new file mode 100644 index 0000000..2cf0d15 --- /dev/null +++ b/configuration/primary_user_profile_image.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/primary_user_profile_image.png-65acd669e54a91c7a80c286798601426.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://configuration/primary_user_profile_image.png" +dest_files=[ "res://.import/primary_user_profile_image.png-65acd669e54a91c7a80c286798601426.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=true +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/default_bus_layout.tres b/default_bus_layout.tres new file mode 100644 index 0000000..eb4accc --- /dev/null +++ b/default_bus_layout.tres @@ -0,0 +1,3 @@ +[gd_resource type="AudioBusLayout" format=2] + +[resource] diff --git a/main.tscn b/main.tscn index 290e2c0..be48384 100644 --- a/main.tscn +++ b/main.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=21 format=2] [ext_resource path="res://assets/ui/mainTheme.tres" type="Theme" id=1] -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-Bold.ttf" type="DynamicFontData" id=2] +[ext_resource path="res://user_interface/fonts/Helvetica/Helvetica-Bold.ttf" type="DynamicFontData" id=2] [ext_resource path="res://assets/textures/jimsito.png" type="Texture" id=3] -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-Oblique.ttf" type="DynamicFontData" id=4] -[ext_resource path="res://assets/ui/icons/off.png" type="Texture" id=5] -[ext_resource path="res://assets/ui/icons/call0.png" type="Texture" id=6] +[ext_resource path="res://user_interface/fonts/Helvetica/Helvetica-Oblique.ttf" type="DynamicFontData" id=4] +[ext_resource path="res://user_interface/tool_bar/icons/off.png" type="Texture" id=5] +[ext_resource path="res://user_interface/tool_bar/icons/call0.png" type="Texture" id=6] [ext_resource path="res://treecontrolling.gd" type="Script" id=7] -[ext_resource path="res://assets/ui/icons/call01.png" type="Texture" id=8] -[ext_resource path="res://assets/ui/icons/call1.png" type="Texture" id=9] -[ext_resource path="res://system/core.gd" type="Script" id=10] -[ext_resource path="res://assets/ui/icons/on.png" type="Texture" id=11] -[ext_resource path="res://assets/ui/icons/plus0.png" type="Texture" id=12] +[ext_resource path="res://user_interface/tool_bar/icons/call01.png" type="Texture" id=8] +[ext_resource path="res://user_interface/tool_bar/icons/call1.png" type="Texture" id=9] +[ext_resource path="res://system_old/core.gd" type="Script" id=10] +[ext_resource path="res://user_interface/tool_bar/icons/on.png" type="Texture" id=11] +[ext_resource path="res://user_interface/tool_bar/icons/plus0.png" type="Texture" id=12] [sub_resource type="StyleBoxFlat" id=15] bg_color = Color( 0.0823529, 0.101961, 0.133333, 1 ) @@ -84,38 +84,38 @@ __meta__ = { [node name="Structure" type="VBoxContainer" parent="Panel/Margin"] margin_left = 20.0 margin_top = 20.0 -margin_right = 1346.0 -margin_bottom = 738.0 +margin_right = 1004.0 +margin_bottom = 546.0 custom_constants/separation = 20 __meta__ = { "_edit_use_anchors_": false } [node name="Header" type="PanelContainer" parent="Panel/Margin/Structure"] -margin_right = 1326.0 -margin_bottom = 77.0 +margin_right = 984.0 +margin_bottom = 56.0 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="HBoxContainer" type="HBoxContainer" parent="Panel/Margin/Structure/Header"] -margin_right = 1326.0 -margin_bottom = 77.0 +margin_right = 984.0 +margin_bottom = 56.0 size_flags_horizontal = 3 size_flags_vertical = 3 alignment = 2 [node name="Body" type="HBoxContainer" parent="Panel/Margin/Structure"] -margin_top = 97.0 -margin_right = 1326.0 -margin_bottom = 718.0 +margin_top = 76.0 +margin_right = 984.0 +margin_bottom = 526.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 8.0 custom_constants/separation = 20 [node name="SidePanel" type="PanelContainer" parent="Panel/Margin/Structure/Body"] -margin_right = 288.0 -margin_bottom = 621.0 +margin_right = 279.0 +margin_bottom = 450.0 rect_min_size = Vector2( 279, 0 ) size_flags_horizontal = 3 size_flags_vertical = 3 @@ -123,59 +123,59 @@ size_flags_stretch_ratio = 1.7 custom_styles/panel = SubResource( 16 ) [node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel"] -margin_right = 288.0 -margin_bottom = 621.0 +margin_right = 279.0 +margin_bottom = 450.0 [node name="Margin" type="MarginContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer"] -margin_right = 288.0 -margin_bottom = 548.0 +margin_right = 279.0 +margin_bottom = 386.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 8.0 [node name="Structure" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin"] -margin_right = 288.0 -margin_bottom = 548.0 +margin_right = 279.0 +margin_bottom = 386.0 [node name="Panel" type="Panel" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure"] -margin_right = 288.0 -margin_bottom = 77.0 +margin_right = 279.0 +margin_bottom = 54.0 size_flags_horizontal = 3 size_flags_vertical = 3 custom_styles/panel = SubResource( 9 ) [node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure"] -margin_top = 81.0 -margin_right = 288.0 -margin_bottom = 548.0 +margin_top = 58.0 +margin_right = 279.0 +margin_bottom = 386.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 6.0 script = ExtResource( 7 ) [node name="Tree" type="Tree" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure/VBoxContainer"] -margin_right = 288.0 -margin_bottom = 231.0 +margin_right = 279.0 +margin_bottom = 162.0 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="Tree2" type="Tree" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure/VBoxContainer"] -margin_top = 235.0 -margin_right = 288.0 -margin_bottom = 467.0 +margin_top = 166.0 +margin_right = 279.0 +margin_bottom = 328.0 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="UserToolbox" type="PanelContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer"] -margin_top = 552.0 -margin_right = 288.0 -margin_bottom = 621.0 +margin_top = 390.0 +margin_right = 279.0 +margin_bottom = 450.0 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="Margin" type="MarginContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox"] -margin_right = 288.0 -margin_bottom = 69.0 +margin_right = 279.0 +margin_bottom = 60.0 custom_constants/margin_right = 10 custom_constants/margin_top = 10 custom_constants/margin_left = 10 @@ -184,20 +184,20 @@ custom_constants/margin_bottom = 10 [node name="Structure" type="HBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin"] margin_left = 10.0 margin_top = 10.0 -margin_right = 278.0 -margin_bottom = 59.0 +margin_right = 269.0 +margin_bottom = 50.0 [node name="Profile" type="HBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure"] -margin_right = 147.0 -margin_bottom = 49.0 +margin_right = 140.0 +margin_bottom = 40.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 4.0 custom_constants/separation = 10 [node name="UserProfile" type="TextureRect" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile"] -margin_right = 58.0 -margin_bottom = 49.0 +margin_right = 55.0 +margin_bottom = 40.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 1.5 @@ -206,17 +206,17 @@ expand = true stretch_mode = 6 [node name="UserTexts" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile"] -margin_left = 68.0 -margin_right = 147.0 -margin_bottom = 49.0 +margin_left = 65.0 +margin_right = 140.0 +margin_bottom = 40.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 2.0 alignment = 1 [node name="Label" type="Label" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile/UserTexts"] -margin_right = 79.0 -margin_bottom = 49.0 +margin_right = 75.0 +margin_bottom = 40.0 size_flags_horizontal = 3 size_flags_vertical = 3 custom_fonts/font = SubResource( 14 ) @@ -226,9 +226,9 @@ autowrap = true clip_text = true [node name="CallButton" type="TextureButton" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure"] -margin_left = 151.0 -margin_right = 187.0 -margin_bottom = 49.0 +margin_left = 144.0 +margin_right = 179.0 +margin_bottom = 40.0 size_flags_horizontal = 3 size_flags_vertical = 3 texture_normal = ExtResource( 6 ) @@ -238,9 +238,9 @@ expand = true stretch_mode = 5 [node name="CheckButton" type="CheckButton" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure"] -margin_left = 191.0 -margin_right = 267.0 -margin_bottom = 49.0 +margin_left = 183.0 +margin_right = 259.0 +margin_bottom = 40.0 size_flags_stretch_ratio = 0.5 custom_fonts/font = SubResource( 17 ) custom_icons/off = ExtResource( 5 ) @@ -249,22 +249,22 @@ align = 1 expand_icon = true [node name="ChatPanel" type="PanelContainer" parent="Panel/Margin/Structure/Body"] -margin_left = 308.0 -margin_right = 1326.0 -margin_bottom = 621.0 +margin_left = 299.0 +margin_right = 984.0 +margin_bottom = 450.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 6.0 [node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel"] -margin_right = 1018.0 -margin_bottom = 621.0 +margin_right = 685.0 +margin_bottom = 450.0 size_flags_horizontal = 3 size_flags_vertical = 3 [node name="MarginContainer" type="MarginContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer"] -margin_right = 1018.0 -margin_bottom = 548.0 +margin_right = 685.0 +margin_bottom = 396.0 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 8.0 @@ -276,24 +276,24 @@ custom_constants/margin_bottom = 10 [node name="ScrollContainer" type="ScrollContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer"] margin_left = 10.0 margin_top = 10.0 -margin_right = 998.0 -margin_bottom = 538.0 +margin_right = 665.0 +margin_bottom = 386.0 size_flags_horizontal = 3 size_flags_vertical = 3 scroll_horizontal_enabled = false [node name="messageContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer"] -margin_right = 988.0 -margin_bottom = 528.0 +margin_right = 655.0 +margin_bottom = 376.0 focus_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 custom_constants/separation = 20 [node name="PanelContainer" type="Panel" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer"] -margin_top = 552.0 -margin_right = 1018.0 -margin_bottom = 621.0 +margin_top = 400.0 +margin_right = 685.0 +margin_bottom = 450.0 size_flags_horizontal = 3 size_flags_vertical = 3 custom_styles/panel = SubResource( 18 ) diff --git a/project.godot b/project.godot index c239032..6bd7059 100644 --- a/project.godot +++ b/project.godot @@ -9,10 +9,65 @@ config_version=4 _global_script_classes=[ { +"base": "TextEdit", +"class": "ContentFitTextEdit", +"language": "GDScript", +"path": "res://user_interface/utility_controls/content_fit_text_edit.gd" +}, { +"base": "MarginContainer", +"class": "EditableTextBlock", +"language": "GDScript", +"path": "res://user_interface/utility_controls/editable_text_block.gd" +}, { "base": "Resource", +"class": "EmoteList", +"language": "GDScript", +"path": "res://configuration/emotes/emote_list.gd" +}, { +"base": "Reference", "class": "Message", "language": "GDScript", -"path": "res://system/message/message.gd" +"path": "res://system/data/message_data/message.gd" +}, { +"base": "Node", +"class": "MessageData", +"language": "GDScript", +"path": "res://system/data/message_data/message_data_singleton.gd" +}, { +"base": "EditableTextBlock", +"class": "MessageEditable", +"language": "GDScript", +"path": "res://user_interface/chat_panel/message_editable.gd" +}, { +"base": "Reference", +"class": "MessageGroup", +"language": "GDScript", +"path": "res://system/data/message_data/message_group.gd" +}, { +"base": "HBoxContainer", +"class": "MessageGroupContainer", +"language": "GDScript", +"path": "res://user_interface/chat_panel/message_group_container.gd" +}, { +"base": "Reference", +"class": "Topic", +"language": "GDScript", +"path": "res://system/data/topic_data/topic.gd" +}, { +"base": "Node", +"class": "TopicData", +"language": "GDScript", +"path": "res://system/data/topic_data/topic_data_singleton.gd" +}, { +"base": "Container", +"class": "TopicDraggable", +"language": "GDScript", +"path": "res://user_interface/topic_panel/topic_draggable.gd" +}, { +"base": "EditableTextBlock", +"class": "TopicEditable", +"language": "GDScript", +"path": "res://user_interface/topic_panel/topic_editable.gd" }, { "base": "Resource", "class": "User", @@ -20,20 +75,48 @@ _global_script_classes=[ { "path": "res://system/users/user.gd" } ] _global_script_class_icons={ +"ContentFitTextEdit": "", +"EditableTextBlock": "", +"EmoteList": "", "Message": "", +"MessageData": "", +"MessageEditable": "", +"MessageGroup": "", +"MessageGroupContainer": "", +"Topic": "", +"TopicData": "", +"TopicDraggable": "", +"TopicEditable": "", "User": "" } [application] config/name="SelfMessenger" -run/main_scene="res://main.tscn" +run/main_scene="res://user_interface/main.tscn" config/icon="res://icon.png" +[autoload] + +Data="*res://system/data/data_singleton.gd" +Users="*res://system/users/users_singleton.gd" +Time="*res://system/time/time_singleton.gd" +PingSystem="*res://system/ping_system/ping_system.tscn" + [display] -window/size/width=1366 -window/size/height=768 +window/size/height=576 + +[input] + +ui_accept={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} [physics] diff --git a/sounds/message_denied.wav b/sounds/message_denied.wav new file mode 100644 index 0000000..86d1541 Binary files /dev/null and b/sounds/message_denied.wav differ diff --git a/sounds/message_denied.wav.import b/sounds/message_denied.wav.import new file mode 100644 index 0000000..4c2b17c --- /dev/null +++ b/sounds/message_denied.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/message_denied.wav-b540b71974fee01218dbebcfe6b244a6.sample" + +[deps] + +source_file="res://sounds/message_denied.wav" +dest_files=[ "res://.import/message_denied.wav-b540b71974fee01218dbebcfe6b244a6.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/sounds/message_inserted.wav b/sounds/message_inserted.wav new file mode 100644 index 0000000..ba2d6a2 Binary files /dev/null and b/sounds/message_inserted.wav differ diff --git a/sounds/message_inserted.wav.import b/sounds/message_inserted.wav.import new file mode 100644 index 0000000..0527543 --- /dev/null +++ b/sounds/message_inserted.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/message_inserted.wav-5747e70b3abde0fbe2826eea6bf09096.sample" + +[deps] + +source_file="res://sounds/message_inserted.wav" +dest_files=[ "res://.import/message_inserted.wav-5747e70b3abde0fbe2826eea6bf09096.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/sounds/ping.wav b/sounds/ping.wav new file mode 100644 index 0000000..13231ab Binary files /dev/null and b/sounds/ping.wav differ diff --git a/sounds/ping.wav.import b/sounds/ping.wav.import new file mode 100644 index 0000000..ea798a7 --- /dev/null +++ b/sounds/ping.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/ping.wav-f50f49c78cdede9aeaa6d25c0d968e0c.sample" + +[deps] + +source_file="res://sounds/ping.wav" +dest_files=[ "res://.import/ping.wav-f50f49c78cdede9aeaa6d25c0d968e0c.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/system/Message.gd b/system/Message.gd deleted file mode 100644 index 84a2e67..0000000 --- a/system/Message.gd +++ /dev/null @@ -1,120 +0,0 @@ -tool -extends HBoxContainer - -onready var bg_texture = preload("res://assets/textures/bg.png") - -func create_message(): - # Creates Data - var resource = Message.new() - resource.user = 1 - resource.date = "today" - resource.content = "hello" - resource.profile_picture = null - - var user = resource.user - var date = resource.date - var content = resource.content - var pfp = resource.profile_picture - - - print("Resource: ", resource, "\nUser: ", user, "\nDate: ", date, "\nContent: ", content, "\nProfile Picture: ", pfp) - - # root is a HBoxContainer. - var root = HBoxContainer.new() - - # Icon is a texture_rect connected to the root. - # HBoxContainer/TextureRect - # Settings are... - # Texture: Should load texture from 'Resource.new()' once sent a message. - # Expand: On - # Stretch Mode: Keep Aspect - # Size Flags: Null - var profile_picture = TextureRect.new() - profile_picture.set_texture(pfp) - profile_picture.set_custom_minimum_size(Vector2(65, 65)) - profile_picture.expand = true - profile_picture.size_flags_horizontal = 0 - profile_picture.size_flags_vertical = 0 - profile_picture.set_name("profile_picture") - - self.add_child(profile_picture) - - # Main node for message's Header and Body - # Separates sections of Header and Body - var GridStructure = VBoxContainer.new() - GridStructure.set_name("GridStructure") - self.add_child(GridStructure) - # Header (Contains Name Label and Date Label) - var Header = HBoxContainer.new() - Header.set_name("Header") - GridStructure.add_child(Header) - - var NameLabel = Label.new() - NameLabel.set_name("NameLabel") - NameLabel.set_text(name) - Header.add_child(NameLabel) - - var DateLabel = Label.new() - DateLabel.set_name("DateLabel") - DateLabel.set_text(date) - Header.add_child(DateLabel) - - - - # Body (Contains NinePatchRect for Background and Margins that contain the RichTextLabel - var Body = MarginContainer.new() - Body.set_name("Body") - GridStructure.add_child(Body) - # BGTexture uses NinePatchRect for Message Bubble - var BGTexture = NinePatchRect.new() - BGTexture.set_name("BGTexture") - BGTexture.set_texture(bg_texture) - BGTexture.patch_margin_left = 21 - BGTexture.patch_margin_top = 12 - BGTexture.patch_margin_right = 12 - BGTexture.patch_margin_bottom = 12 - BGTexture.size_flags_horizontal = 3 - BGTexture.size_flags_vertical = 3 - Body.add_child(BGTexture) - # Margin forces FILL_EXPAND into it's children. - var Margin = MarginContainer.new() - Margin.set_name("Margin") - Margin.add_constant_override("margin_top", 5) - Margin.add_constant_override("margin_left", 16) - Margin.add_constant_override("margin_right", 5) - Margin.add_constant_override("margin_bottom", 5) - Body.add_child(Margin) - # Stretch is what keeps the Message expanding as if it has an anchor for Full_Rect - - # Body Content: - var TextLabel = RichTextLabel.new() - TextLabel.set_name("TextLabel") - TextLabel.bbcode_enabled = true - TextLabel.set_bbcode(content) - TextLabel.fit_content_height = true - TextLabel.scroll_active = false - TextLabel.size_flags_horizontal = 1 - TextLabel.add_color_override("default_color", Color(0,0,0,1)) - Margin.add_child(TextLabel) - -func build_time(): - var time - var all_time = false - var os_time = OS.get_datetime() - var storaged_today = OS.get_datetime().day - var storaged_yesterday = OS.get_datetime().day +1 - - if storaged_today == os_time.day: - time = "today" - if storaged_yesterday == os_time.day +1: - storaged_yesterday = "yesterday" - if os_time.day > 1: - print("Before Yesterday: ",os_time.day, "/", os_time.month, "/", os_time.year) - - - - print("if Today: ", time, "\nif Yesterday: ", storaged_yesterday) - -func _ready(): - - build_time() diff --git a/system/Message.tscn b/system/Message.tscn deleted file mode 100644 index be99d8c..0000000 --- a/system/Message.tscn +++ /dev/null @@ -1,11 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://system/Message.gd" type="Script" id=1] - -[node name="Message" type="HBoxContainer"] -margin_right = 295.0 -margin_bottom = 150.0 -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/system/NinePatchRect.tscn b/system/NinePatchRect.tscn deleted file mode 100644 index 9facc0b..0000000 --- a/system/NinePatchRect.tscn +++ /dev/null @@ -1,38 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://assets/textures/receivedmessage.png" type="Texture" id=1] - -[node name="NinePatchRect" type="NinePatchRect"] -margin_top = 24.0 -margin_right = 213.0 -margin_bottom = 217.0 -size_flags_horizontal = 0 -size_flags_vertical = 0 -texture = ExtResource( 1 ) -region_rect = Rect2( 1.66171, 0.894091, 598.791, 499.394 ) -patch_margin_left = 123 -patch_margin_top = 99 -patch_margin_right = 234 -patch_margin_bottom = 94 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="MarginContainer" type="MarginContainer" parent="."] -anchor_right = 1.0 -anchor_bottom = 1.0 -custom_constants/margin_right = 35 -custom_constants/margin_top = 35 -custom_constants/margin_left = 50 -custom_constants/margin_bottom = 35 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer"] -margin_left = 50.0 -margin_top = 35.0 -margin_right = 322.0 -margin_bottom = 158.0 -custom_colors/default_color = Color( 0, 0, 0, 1 ) -text = "Received Message." diff --git a/system/core.gd b/system/core.gd deleted file mode 100644 index 38d37a4..0000000 --- a/system/core.gd +++ /dev/null @@ -1,206 +0,0 @@ -extends Control - -export(NodePath) var main_input_path -onready var main_input = get_node(main_input_path) - -export(NodePath) var message_scroller_path -onready var msg_scroll = get_node(message_scroller_path) - -export(NodePath) var message_container_path -onready var msg_cont = get_node(message_container_path) - -export(NodePath) var username_label_path -onready var username_label = get_node(username_label_path) - -#export(NodePath) var upload_button_path -#onready var upload_button = get_node(username_label_path) - -#--------- -onready var bg_texture1 = preload("res://assets/textures/bg1.png") -onready var bg_texture2 = preload("res://assets/textures/bg2.png") - -onready var round_shader = preload("res://assets/textures/profilepicture/shape.shader") -onready var round_shape = preload("res://assets/textures/profilepicture/shape.png") -onready var username_font = preload("res://assets/fonts/username_label.tres") -onready var date_font = preload("res://assets/fonts/date_label.tres") - -onready var first_user_data = preload("res://system/users/first_user.tres") -onready var second_user_data = preload("res://system/users/second_user.tres") - -func _ready(): - username_label.set_text(first_user_data.username) - -func _on_CheckButton_toggled(button_pressed): - if button_pressed == true: - username_label.set_text(second_user_data.username) - elif button_pressed == false: - username_label.set_text(first_user_data.username) - -func _input(event): - if event is InputEventKey: - if Input.is_action_just_pressed("ui_accept"): - create_message() - elif Input.is_action_just_released("ui_accept"): - var test = msg_cont.get_size().y - var scroller = msg_scroll.get_child(2) - scroller.set("value", test) - main_input.set_text("") - -func create_message(): - - var text_content = main_input.get_text() - var username = username_label.get_text() - var resource = Message.new() - resource.user = username - - # Define date - var os_time = OS.get_datetime() - var storaged_today = OS.get_datetime().day - - if storaged_today == os_time.day: - resource.date = "Today, at " + str(OS.get_datetime().hour) + ":" + str(OS.get_datetime().minute) - elif storaged_today == os_time.day +1: - resource.date = "yesterday" - - - resource.content = text_content - - if username_label.get_text() == first_user_data.username: - resource.profile_picture = first_user_data.picture - elif username_label.get_text() == second_user_data.username: - resource.profile_picture = second_user_data.picture - - var msg_min_h_size = 0 - var msg_header_h_size = 0 - if text_content.length() < 25: - msg_min_h_size = 50 - msg_header_h_size = 25 - else: - msg_min_h_size = 350 - msg_header_h_size = 300 - - var datetime = OS.get_datetime() - - var user = resource.user - var date = resource.date - var content = resource.content - var pfp = resource.profile_picture - - - # root is a HBoxContainer. - var root = HBoxContainer.new() - root.set_name("message0") - msg_cont.add_child(root) - - # Icon is a texture_rect connected to the root. - # HBoxContainer/TextureRect - # Settings are... - # Texture: Should load texture from 'Resource.new()' once sent a message. - # Expand: On - # Stretch Mode: Keep Aspect - # Size Flags: Null - var profile_picture = TextureRect.new() - var core_shader = ShaderMaterial.new() - var real_shader = Shader.new() - core_shader.set_shader(real_shader) - var round_shader_txt = round_shader.get_code() - core_shader.set_shader_param("mask", round_shape) - real_shader.set_code(round_shader_txt) - profile_picture.set_texture(pfp) - profile_picture.set_custom_minimum_size(Vector2(65, 65)) - profile_picture.expand = true - profile_picture.size_flags_horizontal = 0 - profile_picture.size_flags_vertical = 0 - profile_picture.set_name("profile_picture") - profile_picture.set_material(core_shader) - - - - # Main node for message's Header and Body - # Separates sections of Header and Body - var GridStructure = VBoxContainer.new() - GridStructure.set_name("GridStructure") - - if username_label.get_text() == first_user_data.username: - root.add_child(profile_picture) - root.add_child(GridStructure) - elif username_label.get_text() == second_user_data.username: - root.size_flags_horizontal = 8 - root.add_child(GridStructure) - root.add_child(profile_picture) - # Header (Contains Name Label and Date Label) - var Header = HBoxContainer.new() - Header.set_name("Header") - Header.set_custom_minimum_size(Vector2(msg_header_h_size,0)) - Header.size_flags_horizontal = 3 - GridStructure.add_child(Header) - - var NameLabel = Label.new() - NameLabel.set_name("NameLabel") - NameLabel.set_text(user) - NameLabel.add_font_override("font", username_font) - NameLabel.size_flags_horizontal = 3 - Header.add_child(NameLabel) - - var DateLabel = Label.new() - DateLabel.set_name("DateLabel") - DateLabel.set_text(str(date)) - DateLabel.add_font_override("font", date_font) - DateLabel.size_flags_horizontal = 3 - Header.add_child(DateLabel) - - - - # Body (Contains NinePatchRect for Background and Margins that contain the RichTextLabel - var Body = MarginContainer.new() - Body.set_name("Body") - GridStructure.set_custom_minimum_size(Vector2(msg_min_h_size, 25)) - GridStructure.add_child(Body) - # BGTexture uses NinePatchRect for Message Bubble - var BGTexture = NinePatchRect.new() - BGTexture.set_name("BGTexture") - if username_label.get_text() == first_user_data.username: - BGTexture.patch_margin_left = 21 - BGTexture.patch_margin_top = 12 - BGTexture.patch_margin_right = 12 - BGTexture.patch_margin_bottom = 12 - BGTexture.size_flags_horizontal = 3 - BGTexture.size_flags_vertical = 3 - BGTexture.set_texture(bg_texture1) - elif username_label.get_text() == second_user_data.username: - BGTexture.patch_margin_left = 12 - BGTexture.patch_margin_top = 12 - BGTexture.patch_margin_right = 21 - BGTexture.patch_margin_bottom = 12 - BGTexture.size_flags_horizontal = 3 - BGTexture.size_flags_vertical = 3 - BGTexture.set_texture(bg_texture2) - Body.add_child(BGTexture) - # Margin forces FILL_EXPAND into it's children. - var Margin = MarginContainer.new() - Margin.set_name("Margin") - if username_label.get_text() == first_user_data.username: - Margin.add_constant_override("margin_top", 5) - Margin.add_constant_override("margin_left", 16) - Margin.add_constant_override("margin_right", 5) - Margin.add_constant_override("margin_bottom", 5) - - if username_label.get_text() == second_user_data.username: - Margin.add_constant_override("margin_top", 5) - Margin.add_constant_override("margin_left", 5) - Margin.add_constant_override("margin_right", 16) - Margin.add_constant_override("margin_bottom", 5) - - Body.add_child(Margin) - # Stretch is what keeps the Message expanding as if it has an anchor for Full_Rect - - # Body Content: - var TextLabel = RichTextLabel.new() - TextLabel.set_name("TextLabel") - TextLabel.bbcode_enabled = true - TextLabel.set_bbcode(content) - TextLabel.fit_content_height = true - TextLabel.scroll_active = false - TextLabel.size_flags_horizontal = 1 - TextLabel.add_color_override("default_color", Color(0,0,0,1)) - Margin.add_child(TextLabel) diff --git a/system/data/data_singleton.gd b/system/data/data_singleton.gd new file mode 100644 index 0000000..500694f --- /dev/null +++ b/system/data/data_singleton.gd @@ -0,0 +1,38 @@ +extends Node + +var messages: MessageData +var topics: TopicData + + +func _ready(): + messages = MessageData.new() + topics = TopicData.new() + + var autosave_timer = Timer.new() + autosave_timer.wait_time = 600.0 # Every ten minutes. + autosave_timer.autostart = true + autosave_timer.connect("timeout", self, "_save_data") + add_child(autosave_timer) + + yield(get_tree(), "idle_frame") + _load_data() + + +func _notification(what): + if what == NOTIFICATION_WM_QUIT_REQUEST: + _save_data() + + +func _exit_tree(): + messages.free() + topics.free() + + +func _load_data(): + messages.load_data() + topics.load_data() + + +func _save_data(): + messages.save_data() + topics.save_data() diff --git a/system/data/message_data/message.gd b/system/data/message_data/message.gd new file mode 100644 index 0000000..1eb36bf --- /dev/null +++ b/system/data/message_data/message.gd @@ -0,0 +1,28 @@ +extends Reference +class_name Message + +const MESSAGE_NODE = preload("res://user_interface/chat_panel/message_node.tscn") + +var associated_node: Control +var associated_message_group: MessageGroup + +var content: String +var time_stamp: int + + +func get_user() -> User: + return associated_message_group.associated_user + + +func delete(): + associated_message_group.delete(self) + + +# Used by the MessageFeed, to spawn message nodes. +func create_node() -> Control: + var message_node = MESSAGE_NODE.instance() + associated_node = message_node + message_node.associated_message = self + if associated_message_group.messages.size() > 1: + message_node.follow_up = true + return message_node diff --git a/system/data/message_data/message_data_singleton.gd b/system/data/message_data/message_data_singleton.gd new file mode 100644 index 0000000..a468327 --- /dev/null +++ b/system/data/message_data/message_data_singleton.gd @@ -0,0 +1,63 @@ +extends Node +class_name MessageData + + +signal message_added(message) +signal message_group_added(message_group) + + +var dirty_flag = false +var loaded_message_groups = [] + + +func add_message(content, time_stamp, user): + var message_group: MessageGroup + + if loaded_message_groups.empty(): + message_group = _add_message_group(time_stamp, user) + else: + var latest_message_group = loaded_message_groups[-1] + if latest_message_group.associated_user != user: + message_group = _add_message_group(time_stamp, user) + else: + var latest_message = latest_message_group.messages[-1] + if time_stamp - latest_message.time_stamp >= 120: + message_group = _add_message_group(time_stamp, user) + else: + message_group = loaded_message_groups[-1] + + var message = Message.new() + message.content = content + message.time_stamp = time_stamp + message_group.add(message) + emit_signal("message_added", message) + +# var node = message.create_node() +# message_group.associated_container.add(node) + + +func load_data(): + # TODO: load data. + pass + + +func save_data(): + if dirty_flag: + # TODO: Save data. + pass + + # dirty_flag needs to be set to false after successful save! + dirty_flag = false + + +func _add_message_group(time_stamp, user) -> MessageGroup: + var message_group = MessageGroup.new() + message_group.associated_user = user + message_group.time_stamp = time_stamp + loaded_message_groups.append(message_group) + emit_signal("message_group_added", message_group) + +# var container = message_group.create_container() +# UI.message_feed_container.add_child(container) + + return message_group diff --git a/system/data/message_data/message_group.gd b/system/data/message_data/message_group.gd new file mode 100644 index 0000000..b34dcb5 --- /dev/null +++ b/system/data/message_data/message_group.gd @@ -0,0 +1,36 @@ +extends Reference +class_name MessageGroup + + +const MESSAGE_GROUP_CONTAINER = preload("res://user_interface/chat_panel/message_group_container.tscn") + +var associated_container: Control + +var associated_user: User +var time_stamp: int +var messages := [] + + +func add(message): + messages.append(message) + message.associated_message_group = self + + +func delete(message): + if messages.size() == 1: + Data.messages.loaded_message_groups.erase(self) + associated_container.queue_free() + return + if message == messages[0]: + messages[1].associated_node.follow_up = false + messages[1].associated_node._adjust_appearance_to_user() + messages.erase(message) + message.associated_node.queue_free() + + +# Used by the MessageFeed, to spawn message group container nodes. +func create_container() -> Control: + var container = MESSAGE_GROUP_CONTAINER.instance() + associated_container = container + container.associated_message_group = self + return container diff --git a/system/data/topic_data/topic.gd b/system/data/topic_data/topic.gd new file mode 100644 index 0000000..37d7aa0 --- /dev/null +++ b/system/data/topic_data/topic.gd @@ -0,0 +1,29 @@ +extends Reference +class_name Topic + +const TYPE_CASUAL = 0 +const TYPE_DAILY = 1 +const TYPE_URGENT = 2 + +const TOPIC_NODE = preload("res://user_interface/topic_panel/topic_node.tscn") + +var associated_node: Control + +var content: String +var type: int + + +func delete(): + Data.topics.loaded_topics.erase(self) + associated_node.parent.queue_free() + + +# Used by the TopicFeed, to spawn topic nodes. +func create_node() -> Control: + var topic_node = TOPIC_NODE.instance() + var editable = topic_node.get_node("TopicEditable") + associated_node = editable + editable.associated_topic = self + editable.type = type + + return topic_node diff --git a/system/data/topic_data/topic_data_singleton.gd b/system/data/topic_data/topic_data_singleton.gd new file mode 100644 index 0000000..cc0788a --- /dev/null +++ b/system/data/topic_data/topic_data_singleton.gd @@ -0,0 +1,31 @@ +extends Node +class_name TopicData + + +signal topic_added(topic) + +var dirty_flag = false +var loaded_topics = [] + + +func add_topic(position: int): + var topic = Topic.new() + topic.type = position # Delete this line later. + loaded_topics.append(topic) + + # TODO: Make it possible to vary in position in the array!! + emit_signal("topic_added", topic) + + +func load_data(): + # TODO: Load data. + pass + + +func save_data(): + if dirty_flag: + # TODO: Save data. + pass + + # dirty_flag needs to be set to false after successful save! + dirty_flag = false diff --git a/system/message/message.gd b/system/message/message.gd deleted file mode 100644 index 77f7db0..0000000 --- a/system/message/message.gd +++ /dev/null @@ -1,10 +0,0 @@ -extends Resource -class_name Message - -export(String, "user1", "user2") var user - -export var date = "" - -export(String) var content - -export(Texture) var profile_picture diff --git a/system/message/test_message.tres b/system/message/test_message.tres deleted file mode 100644 index 9704f0d..0000000 --- a/system/message/test_message.tres +++ /dev/null @@ -1,11 +0,0 @@ -[gd_resource type="Resource" load_steps=3 format=2] - -[ext_resource path="res://system/message/message.gd" type="Script" id=1] -[ext_resource path="res://assets/textures/jimsito.png" type="Texture" id=2] - -[resource] -script = ExtResource( 1 ) -user = "user1" -date = "Today, at 15:07" -content = "This is a test message." -profile_picture = ExtResource( 2 ) diff --git a/system/oldDesign.tscn b/system/oldDesign.tscn deleted file mode 100644 index 6268482..0000000 --- a/system/oldDesign.tscn +++ /dev/null @@ -1,304 +0,0 @@ -[gd_scene load_steps=17 format=2] - -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-standard.ttf" type="DynamicFontData" id=1] -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-Bold.ttf" type="DynamicFontData" id=2] -[ext_resource path="res://assets/textures/jimsito.png" type="Texture" id=3] -[ext_resource path="res://assets/ui/sendedMessage.tscn" type="PackedScene" id=4] -[ext_resource path="res://assets/ui/receivedMessage.tscn" type="PackedScene" id=5] - -[sub_resource type="StyleBoxFlat" id=5] -bg_color = Color( 0.12549, 0.133333, 0.145098, 1 ) - -[sub_resource type="StyleBoxFlat" id=6] -bg_color = Color( 0.211765, 0.223529, 0.247059, 1 ) -corner_radius_top_left = 10 -corner_radius_top_right = 10 -corner_radius_bottom_right = 10 -corner_radius_bottom_left = 10 - -[sub_resource type="StyleBoxEmpty" id=10] - -[sub_resource type="StyleBoxEmpty" id=11] - -[sub_resource type="StyleBoxEmpty" id=12] - -[sub_resource type="StyleBoxEmpty" id=13] - -[sub_resource type="StyleBoxEmpty" id=8] - -[sub_resource type="DynamicFont" id=3] -size = 18 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 1 ) - -[sub_resource type="Theme" id=4] -default_font = SubResource( 3 ) -Panel/styles/panel = SubResource( 5 ) -PanelContainer/styles/panel = SubResource( 6 ) -TextEdit/styles/completion = SubResource( 10 ) -TextEdit/styles/focus = SubResource( 11 ) -TextEdit/styles/normal = SubResource( 12 ) -TextEdit/styles/read_only = SubResource( 13 ) -Tree/colors/font_color = Color( 0.862745, 0.866667, 0.870588, 1 ) -Tree/styles/bg = SubResource( 8 ) -Tree/styles/bg_focus = SubResource( 8 ) - -[sub_resource type="StyleBoxFlat" id=9] -bg_color = Color( 0.25098, 0.266667, 0.294118, 1 ) -border_width_bottom = 2 -border_color = Color( 0.160784, 0.168627, 0.184314, 1 ) -corner_radius_top_left = 10 -corner_radius_top_right = 10 - -[sub_resource type="DynamicFont" id=14] -size = 24 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 2 ) - -[node name="Panel" type="Panel"] -anchor_right = 1.0 -anchor_bottom = 1.0 -theme = SubResource( 4 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Margin" type="MarginContainer" parent="."] -anchor_right = 1.0 -anchor_bottom = 1.0 -custom_constants/margin_right = 20 -custom_constants/margin_top = 20 -custom_constants/margin_left = 20 -custom_constants/margin_bottom = 30 -__meta__ = { -"_edit_use_anchors_": false, -"_editor_description_": " -" -} - -[node name="Structure" type="VBoxContainer" parent="Margin"] -margin_left = 20.0 -margin_top = 20.0 -margin_right = 1157.0 -margin_bottom = 789.0 -custom_constants/separation = 20 - -[node name="Header" type="PanelContainer" parent="Margin/Structure"] -margin_right = 1137.0 -margin_bottom = 72.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Body" type="HBoxContainer" parent="Margin/Structure"] -margin_top = 92.0 -margin_right = 1137.0 -margin_bottom = 676.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 8.0 -custom_constants/separation = 20 - -[node name="SidePanel" type="PanelContainer" parent="Margin/Structure/Body"] -margin_right = 279.0 -margin_bottom = 584.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 2.0 - -[node name="Margin" type="MarginContainer" parent="Margin/Structure/Body/SidePanel"] -margin_right = 279.0 -margin_bottom = 584.0 - -[node name="Structure" type="VBoxContainer" parent="Margin/Structure/Body/SidePanel/Margin"] -margin_right = 279.0 -margin_bottom = 584.0 - -[node name="Panel" type="Panel" parent="Margin/Structure/Body/SidePanel/Margin/Structure"] -margin_right = 279.0 -margin_bottom = 82.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_styles/panel = SubResource( 9 ) - -[node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Body/SidePanel/Margin/Structure"] -margin_top = 86.0 -margin_right = 279.0 -margin_bottom = 584.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 6.0 -custom_constants/separation = 20 - -[node name="Tree" type="Tree" parent="Margin/Structure/Body/SidePanel/Margin/Structure/VBoxContainer"] -margin_right = 279.0 -margin_bottom = 239.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Tree2" type="Tree" parent="Margin/Structure/Body/SidePanel/Margin/Structure/VBoxContainer"] -margin_top = 259.0 -margin_right = 279.0 -margin_bottom = 498.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="ChatPanel" type="PanelContainer" parent="Margin/Structure/Body"] -margin_left = 299.0 -margin_right = 1137.0 -margin_bottom = 584.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 6.0 - -[node name="MarginContainer" type="MarginContainer" parent="Margin/Structure/Body/ChatPanel"] -margin_right = 838.0 -margin_bottom = 584.0 -custom_constants/margin_right = 70 -custom_constants/margin_top = 20 -custom_constants/margin_left = 35 -custom_constants/margin_bottom = 35 - -[node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Body/ChatPanel/MarginContainer"] -margin_left = 35.0 -margin_top = 20.0 -margin_right = 768.0 -margin_bottom = 549.0 - -[node name="receivedMessage" parent="Margin/Structure/Body/ChatPanel/MarginContainer/VBoxContainer" instance=ExtResource( 5 )] -margin_right = 733.0 -margin_bottom = 262.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="sendedMessage" parent="Margin/Structure/Body/ChatPanel/MarginContainer/VBoxContainer" instance=ExtResource( 4 )] -anchor_left = 0.0 -anchor_right = 0.0 -margin_left = 0.0 -margin_top = 266.0 -margin_right = 733.0 -margin_bottom = 529.0 -rect_scale = Vector2( 1, 1 ) -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Footer" type="HBoxContainer" parent="Margin/Structure"] -margin_top = 696.0 -margin_right = 1137.0 -margin_bottom = 769.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_constants/separation = 20 - -[node name="UserToolbox" type="PanelContainer" parent="Margin/Structure/Footer"] -margin_right = 281.0 -margin_bottom = 73.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 3.1 - -[node name="Margin" type="MarginContainer" parent="Margin/Structure/Footer/UserToolbox"] -margin_right = 281.0 -margin_bottom = 73.0 -custom_constants/margin_right = 10 -custom_constants/margin_top = 10 -custom_constants/margin_left = 10 -custom_constants/margin_bottom = 10 - -[node name="Structure" type="HBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin"] -margin_left = 10.0 -margin_top = 10.0 -margin_right = 271.0 -margin_bottom = 63.0 - -[node name="HBoxContainer" type="HBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure"] -margin_right = 171.0 -margin_bottom = 53.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 2.0 -custom_constants/separation = 10 - -[node name="TextureRect" type="TextureRect" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer"] -margin_right = 51.0 -margin_bottom = 53.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -texture = ExtResource( 3 ) -expand = true -stretch_mode = 6 - -[node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer"] -margin_left = 61.0 -margin_right = 171.0 -margin_bottom = 53.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 2.0 -alignment = 1 - -[node name="Label" type="Label" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"] -margin_right = 110.0 -margin_bottom = 25.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_fonts/font = SubResource( 14 ) -text = "Axsajim" -valign = 1 - -[node name="Label2" type="Label" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"] -margin_top = 29.0 -margin_right = 110.0 -margin_bottom = 53.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "WORKMODE" -valign = 1 - -[node name="Panel" type="Button" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure"] -margin_left = 175.0 -margin_right = 261.0 -margin_bottom = 53.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "Call" - -[node name="InputContainer" type="PanelContainer" parent="Margin/Structure/Footer"] -margin_left = 301.0 -margin_right = 1026.0 -margin_bottom = 73.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 8.0 - -[node name="MarginContainer" type="MarginContainer" parent="Margin/Structure/Footer/InputContainer"] -margin_right = 725.0 -margin_bottom = 73.0 -custom_constants/margin_right = 30 -custom_constants/margin_top = 20 -custom_constants/margin_left = 30 -custom_constants/margin_bottom = 20 - -[node name="TextEdit" type="TextEdit" parent="Margin/Structure/Footer/InputContainer/MarginContainer"] -margin_left = 30.0 -margin_top = 20.0 -margin_right = 695.0 -margin_bottom = 53.0 -text = "Message" - -[node name="TimerConainer" type="PanelContainer" parent="Margin/Structure/Footer"] -margin_left = 1046.0 -margin_right = 1137.0 -margin_bottom = 73.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="Label" type="Label" parent="Margin/Structure/Footer/TimerConainer"] -margin_right = 91.0 -margin_bottom = 73.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -text = "00:00:00" -align = 1 -valign = 1 diff --git a/system/ping/ping.gd b/system/ping/ping.gd deleted file mode 100644 index 9a28f45..0000000 --- a/system/ping/ping.gd +++ /dev/null @@ -1,195 +0,0 @@ -extends Node - - -onready var main_input = get_node("../core/Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer/VBoxContainer/HBoxContainer/MarginContainer/TextEdit") - - -onready var msg_scroll = get_node("../core/Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer") - - -onready var msg_cont = get_node("../core/Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/messageContainer") - - -onready var username_label = get_node("../core/Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile/UserTexts/Label") - - -onready var bg_texture1 = preload("res://assets/textures/bg1.png") -onready var bg_texture2 = preload("res://assets/textures/bg2.png") - -onready var round_shader = preload("res://assets/textures/profilepicture/shape.shader") -onready var round_shape = preload("res://assets/textures/profilepicture/shape.png") -onready var username_font = preload("res://assets/fonts/username_label.tres") -onready var date_font = preload("res://assets/fonts/date_label.tres") - -onready var first_user_data = preload("res://system/users/first_user.tres") -onready var second_user_data = preload("res://system/users/second_user.tres") - -func _input(event): - if event is InputEventKey: - if Input.is_action_just_pressed("ui_accept"): - create_message() - elif Input.is_action_just_released("ui_accept"): - var test = msg_cont.get_size().y - var scroller = msg_scroll.get_child(2) - scroller.set("value", test) - main_input.set_text("") - - -func create_message(): - - var text_content = main_input.get_text() - var username = username_label.get_text() - var resource = Message.new() - resource.user = username - - # Define date - var os_time = OS.get_datetime() - var storaged_today = OS.get_datetime().day - - if storaged_today == os_time.day: - resource.date = "Today, at " + str(OS.get_datetime().hour) + ":" + str(OS.get_datetime().minute) - elif storaged_today == os_time.day +1: - resource.date = "yesterday" - - - resource.content = text_content - - if username_label.get_text() == first_user_data.username: - resource.profile_picture = first_user_data.picture - elif username_label.get_text() == second_user_data.username: - resource.profile_picture = second_user_data.picture - - var msg_min_h_size = 0 - var msg_header_h_size = 0 - if text_content.length() < 25: - msg_min_h_size = 50 - msg_header_h_size = 25 - else: - msg_min_h_size = 350 - msg_header_h_size = 300 - - var datetime = OS.get_datetime() - - var user = resource.user - var date = resource.date - var content = resource.content - var pfp = resource.profile_picture - - - # root is a HBoxContainer. - var root = HBoxContainer.new() - root.set_name("message0") - msg_cont.add_child(root) - - # Icon is a texture_rect connected to the root. - # HBoxContainer/TextureRect - # Settings are... - # Texture: Should load texture from 'Resource.new()' once sent a message. - # Expand: On - # Stretch Mode: Keep Aspect - # Size Flags: Null - var profile_picture = TextureRect.new() - var core_shader = ShaderMaterial.new() - var real_shader = Shader.new() - core_shader.set_shader(real_shader) - var round_shader_txt = round_shader.get_code() - core_shader.set_shader_param("mask", round_shape) - real_shader.set_code(round_shader_txt) - profile_picture.set_texture(pfp) - profile_picture.set_custom_minimum_size(Vector2(65, 65)) - profile_picture.expand = true - profile_picture.size_flags_horizontal = 0 - profile_picture.size_flags_vertical = 0 - profile_picture.set_name("profile_picture") - profile_picture.set_material(core_shader) - - - - # Main node for message's Header and Body - # Separates sections of Header and Body - var GridStructure = VBoxContainer.new() - GridStructure.set_name("GridStructure") - - if username_label.get_text() == first_user_data.username: - root.add_child(profile_picture) - root.add_child(GridStructure) - elif username_label.get_text() == second_user_data.username: - root.size_flags_horizontal = 8 - root.add_child(GridStructure) - root.add_child(profile_picture) - # Header (Contains Name Label and Date Label) - var Header = HBoxContainer.new() - Header.set_name("Header") - Header.set_custom_minimum_size(Vector2(msg_header_h_size,0)) - Header.size_flags_horizontal = 3 - GridStructure.add_child(Header) - - var NameLabel = Label.new() - NameLabel.set_name("NameLabel") - NameLabel.set_text(user) - NameLabel.add_font_override("font", username_font) - NameLabel.size_flags_horizontal = 3 - Header.add_child(NameLabel) - - var DateLabel = Label.new() - DateLabel.set_name("DateLabel") - DateLabel.set_text(str(date)) - DateLabel.add_font_override("font", date_font) - DateLabel.size_flags_horizontal = 3 - Header.add_child(DateLabel) - - - - # Body (Contains NinePatchRect for Background and Margins that contain the RichTextLabel - var Body = MarginContainer.new() - Body.set_name("Body") - GridStructure.set_custom_minimum_size(Vector2(msg_min_h_size, 25)) - GridStructure.add_child(Body) - # BGTexture uses NinePatchRect for Message Bubble - var BGTexture = NinePatchRect.new() - BGTexture.set_name("BGTexture") - if username_label.get_text() == first_user_data.username: - BGTexture.patch_margin_left = 21 - BGTexture.patch_margin_top = 12 - BGTexture.patch_margin_right = 12 - BGTexture.patch_margin_bottom = 12 - BGTexture.size_flags_horizontal = 3 - BGTexture.size_flags_vertical = 3 - BGTexture.set_texture(bg_texture1) - elif username_label.get_text() == second_user_data.username: - BGTexture.patch_margin_left = 12 - BGTexture.patch_margin_top = 12 - BGTexture.patch_margin_right = 21 - BGTexture.patch_margin_bottom = 12 - BGTexture.size_flags_horizontal = 3 - BGTexture.size_flags_vertical = 3 - BGTexture.set_texture(bg_texture2) - Body.add_child(BGTexture) - # Margin forces FILL_EXPAND into it's children. - var Margin = MarginContainer.new() - Margin.set_name("Margin") - if username_label.get_text() == first_user_data.username: - Margin.add_constant_override("margin_top", 5) - Margin.add_constant_override("margin_left", 16) - Margin.add_constant_override("margin_right", 5) - Margin.add_constant_override("margin_bottom", 5) - - if username_label.get_text() == second_user_data.username: - Margin.add_constant_override("margin_top", 5) - Margin.add_constant_override("margin_left", 5) - Margin.add_constant_override("margin_right", 16) - Margin.add_constant_override("margin_bottom", 5) - - Body.add_child(Margin) - # Stretch is what keeps the Message expanding as if it has an anchor for Full_Rect - - # Body Content: - var TextLabel = RichTextLabel.new() - TextLabel.set_name("TextLabel") - TextLabel.bbcode_enabled = true - TextLabel.set_bbcode(content) - TextLabel.fit_content_height = true - TextLabel.scroll_active = false - TextLabel.size_flags_horizontal = 1 - TextLabel.add_color_override("default_color", Color(0,0,0,1)) - Margin.add_child(TextLabel) diff --git a/system/ping_system/ping_system.gd b/system/ping_system/ping_system.gd new file mode 100644 index 0000000..eab0bbf --- /dev/null +++ b/system/ping_system/ping_system.gd @@ -0,0 +1,32 @@ +extends Node + +# warning-ignore:unused_signal +signal ping_handled + + +onready var ping_sound = get_node("PingSound") + +var unhandled_ping_count = 0 +var total_ping_count = 0 +var current_ping_id = 0 + + +func _input(event): + if event is InputEventKey: + if event.scancode == KEY_P and event.control and event.alt: + if event.pressed and !event.is_echo(): + send_ping() + + +func send_ping(): + if unhandled_ping_count < 15: + Data.messages.add_message("", Time.get_current_time(), Users.get_helper()) + unhandled_ping_count += 1 + total_ping_count += 1 + ping_sound.play() + OS.request_attention() + + +func _on_ping_handled(): + unhandled_ping_count -= 1 + current_ping_id += 1 diff --git a/system/ping_system/ping_system.tscn b/system/ping_system/ping_system.tscn new file mode 100644 index 0000000..5848685 --- /dev/null +++ b/system/ping_system/ping_system.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://system/ping_system/ping_system.gd" type="Script" id=1] +[ext_resource path="res://sounds/ping.wav" type="AudioStream" id=2] + +[node name="PingSystem" type="Node"] +script = ExtResource( 1 ) + +[node name="PingSound" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 2 ) + +[connection signal="ping_handled" from="." to="." method="_on_ping_handled"] diff --git a/system/time/time_singleton.gd b/system/time/time_singleton.gd new file mode 100644 index 0000000..53dedba --- /dev/null +++ b/system/time/time_singleton.gd @@ -0,0 +1,8 @@ +extends Node + + +var offset = 0 # This is for debug purposes. (Doing sudden time jumps) + + +func get_current_time() -> int: + return OS.get_unix_time() + offset diff --git a/system/users/first_user.tres b/system/users/first_user.tres deleted file mode 100644 index 1208d4e..0000000 --- a/system/users/first_user.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="Resource" load_steps=3 format=2] - -[ext_resource path="res://system/users/user.gd" type="Script" id=1] -[ext_resource path="res://assets/textures/profilepicture/1.jpg" type="Texture" id=2] - -[resource] -script = ExtResource( 1 ) -username = "User1" -picture = ExtResource( 2 ) diff --git a/system/users/second_user.tres b/system/users/second_user.tres deleted file mode 100644 index 5b479cd..0000000 --- a/system/users/second_user.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="Resource" load_steps=3 format=2] - -[ext_resource path="res://system/users/user.gd" type="Script" id=1] -[ext_resource path="res://assets/textures/profilepicture/2.jpg" type="Texture" id=2] - -[resource] -script = ExtResource( 1 ) -username = "User2" -picture = ExtResource( 2 ) diff --git a/system/users/user.gd b/system/users/user.gd index bf55cbf..751017a 100644 --- a/system/users/user.gd +++ b/system/users/user.gd @@ -2,4 +2,30 @@ extends Resource class_name User export(String) var username -export(Texture) var picture +export(Texture) var profile_image + +export(Color) var background_color +export(Color) var panel_color # Color of PanelContainers +export(Color) var popup_menu_color +export(Color) var own_message_color +export(Color) var others_message_color +export(Color) var scroll_bar_color +export(Color) var scroll_bar_highlight_color +export(Color) var scroll_bar_pressed_color +export(Color) var casual_topic_color +export(Color) var daily_topic_color +export(Color) var urgent_topic_color + +var message_box_content: String = "" + + +func is_primary() -> bool: + return self == Users._primary_user + + +func is_helper() -> bool: + return self == Users._helper_user + + +func is_current() -> bool: + return self == Users._current_user diff --git a/system/users/users_singleton.gd b/system/users/users_singleton.gd new file mode 100644 index 0000000..127af5b --- /dev/null +++ b/system/users/users_singleton.gd @@ -0,0 +1,56 @@ +extends Node + +signal switched + + +var _primary_user: User +var _helper_user: User # Since helper has more rights, this is required. + +var _current_user: User + + +func _ready(): + _set_up_users() + + +func switch(): + if _current_user == _primary_user: + _current_user = _helper_user + elif _current_user == _helper_user: + _current_user = _primary_user + else: + _current_user = null + emit_signal("switched") + + +func switch_to(user: User): + if user != _current_user: + _current_user = user + emit_signal("switched") + + +func get_primary(): + return _primary_user + + +func get_helper(): + return _helper_user + + +func get_current(): + return _current_user + + +func get_inactive(): + if _primary_user.is_current(): + return _helper_user + elif _helper_user.is_current(): + return _primary_user + else: + return null + + +func _set_up_users(): + _primary_user = preload("res://configuration/primary_user.tres") + _helper_user = preload("res://configuration/helper_user.tres") + _current_user = _primary_user diff --git a/treecontrolling.gd b/treecontrolling.gd deleted file mode 100644 index a6d0c01..0000000 --- a/treecontrolling.gd +++ /dev/null @@ -1,22 +0,0 @@ -extends VBoxContainer - - -onready var tree1 = get_node("Tree") -onready var tree2 = get_node("Tree2") - -func _ready(): - var root = tree1.create_item() - root.set_text(0, "Priority Topics") - - var item1 = tree1.create_item(root) - item1.set_text(0, "item1") - var item2 = tree1.create_item(root) - item2.set_text(0, "item2") - - var root2 = tree2.create_item() - root2.set_text(0, "Daily Topics") - - var item3 = tree2.create_item(root2) - item3.set_text(0, "item1") - var item4 = tree2.create_item(root2) - item4.set_text(0, "item2") diff --git a/user_interface/call_panel/call_panel.tscn b/user_interface/call_panel/call_panel.tscn new file mode 100644 index 0000000..e168add --- /dev/null +++ b/user_interface/call_panel/call_panel.tscn @@ -0,0 +1,6 @@ +[gd_scene format=2] + +[node name="CallPanel" type="PanelContainer"] +margin_top = 88.0 +margin_right = 1008.0 +margin_bottom = 88.0 diff --git a/user_interface/chat_panel/bubble_by_current.png b/user_interface/chat_panel/bubble_by_current.png new file mode 100644 index 0000000..dd30cef Binary files /dev/null and b/user_interface/chat_panel/bubble_by_current.png differ diff --git a/assets/textures/bg2.png.import b/user_interface/chat_panel/bubble_by_current.png.import similarity index 67% rename from assets/textures/bg2.png.import rename to user_interface/chat_panel/bubble_by_current.png.import index ea2e59f..22fa98d 100644 --- a/assets/textures/bg2.png.import +++ b/user_interface/chat_panel/bubble_by_current.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.stex" +path="res://.import/bubble_by_current.png-a4a635a6733fc7d17bda16cb5b20b983.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/bg2.png" -dest_files=[ "res://.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.stex" ] +source_file="res://user_interface/chat_panel/bubble_by_current.png" +dest_files=[ "res://.import/bubble_by_current.png-a4a635a6733fc7d17bda16cb5b20b983.stex" ] [params] diff --git a/user_interface/chat_panel/bubble_by_inactive.png b/user_interface/chat_panel/bubble_by_inactive.png new file mode 100644 index 0000000..2b52b99 Binary files /dev/null and b/user_interface/chat_panel/bubble_by_inactive.png differ diff --git a/assets/textures/profilepicture/1.jpg.import b/user_interface/chat_panel/bubble_by_inactive.png.import similarity index 67% rename from assets/textures/profilepicture/1.jpg.import rename to user_interface/chat_panel/bubble_by_inactive.png.import index c10b85a..6778cf6 100644 --- a/assets/textures/profilepicture/1.jpg.import +++ b/user_interface/chat_panel/bubble_by_inactive.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.stex" +path="res://.import/bubble_by_inactive.png-b64f748e2d000aeb31ceb2a393f981b0.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/profilepicture/1.jpg" -dest_files=[ "res://.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.stex" ] +source_file="res://user_interface/chat_panel/bubble_by_inactive.png" +dest_files=[ "res://.import/bubble_by_inactive.png-b64f748e2d000aeb31ceb2a393f981b0.stex" ] [params] diff --git a/user_interface/chat_panel/chat_panel.tscn b/user_interface/chat_panel/chat_panel.tscn new file mode 100644 index 0000000..f5f9437 --- /dev/null +++ b/user_interface/chat_panel/chat_panel.tscn @@ -0,0 +1,83 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://user_interface/main.theme" type="Theme" id=1] +[ext_resource path="res://user_interface/utility_controls/content_fit_text_edit.gd" type="Script" id=2] +[ext_resource path="res://user_interface/chat_panel/message_box.gd" type="Script" id=3] +[ext_resource path="res://user_interface/chat_panel/message_feed.gd" type="Script" id=4] +[ext_resource path="res://sounds/message_denied.wav" type="AudioStream" id=5] + +[node name="ChatPanel" type="VBoxContainer"] +margin_left = 336.0 +margin_right = 1008.0 +margin_bottom = 472.0 +size_flags_horizontal = 3 +theme = ExtResource( 1 ) + +[node name="MessageFeed" type="PanelContainer" parent="."] +margin_right = 672.0 +margin_bottom = 422.0 +size_flags_vertical = 3 +script = ExtResource( 4 ) + +[node name="MarginContainer" type="MarginContainer" parent="MessageFeed"] +margin_right = 672.0 +margin_bottom = 422.0 + +[node name="ScrollContainer" type="ScrollContainer" parent="MessageFeed/MarginContainer"] +margin_left = 8.0 +margin_top = 8.0 +margin_right = 664.0 +margin_bottom = 414.0 +scroll_horizontal_enabled = false + +[node name="MarginContainer" type="MarginContainer" parent="MessageFeed/MarginContainer/ScrollContainer"] +margin_right = 656.0 +size_flags_horizontal = 3 +custom_constants/margin_right = 32 +custom_constants/margin_top = 0 +custom_constants/margin_left = 32 +custom_constants/margin_bottom = 0 + +[node name="MessageFeedContainer" type="VBoxContainer" parent="MessageFeed/MarginContainer/ScrollContainer/MarginContainer"] +margin_left = 32.0 +margin_right = 624.0 +size_flags_horizontal = 3 +custom_constants/separation = 12 + +[node name="MessageBox" type="PanelContainer" parent="."] +margin_top = 430.0 +margin_right = 672.0 +margin_bottom = 472.0 +rect_min_size = Vector2( 0, 29 ) +script = ExtResource( 3 ) + +[node name="MarginContainer" type="MarginContainer" parent="MessageBox"] +margin_right = 672.0 +margin_bottom = 42.0 +custom_constants/margin_right = 12 +custom_constants/margin_top = 13 +custom_constants/margin_left = 12 +custom_constants/margin_bottom = 11 + +[node name="ContentFitTextEdit" type="TextEdit" parent="MessageBox/MarginContainer"] +margin_left = 12.0 +margin_top = 13.0 +margin_right = 660.0 +margin_bottom = 31.0 +rect_min_size = Vector2( 0, 18 ) +context_menu_enabled = false +virtual_keyboard_enabled = false +wrap_enabled = true +caret_blink = true +script = ExtResource( 2 ) +expansion_target = NodePath("../..") +height_addition = 27 +max_height = 200 +placeholder = "Type Message" + +[node name="MessageDeniedSound" type="AudioStreamPlayer" parent="MessageBox"] +stream = ExtResource( 5 ) +volume_db = -6.0 + +[connection signal="confirmed" from="MessageBox/MarginContainer/ContentFitTextEdit" to="MessageFeed" method="_on_message_box_confirmed"] +[connection signal="confirmed" from="MessageBox/MarginContainer/ContentFitTextEdit" to="MessageBox" method="_on_message_box_confirmed"] diff --git a/user_interface/chat_panel/follow_up_bubble_by_current.png b/user_interface/chat_panel/follow_up_bubble_by_current.png new file mode 100644 index 0000000..e5122b2 Binary files /dev/null and b/user_interface/chat_panel/follow_up_bubble_by_current.png differ diff --git a/user_interface/chat_panel/follow_up_bubble_by_current.png.import b/user_interface/chat_panel/follow_up_bubble_by_current.png.import new file mode 100644 index 0000000..3d6b317 --- /dev/null +++ b/user_interface/chat_panel/follow_up_bubble_by_current.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/follow_up_bubble_by_current.png-4c62d77585d2f1312120c7086ff35935.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/chat_panel/follow_up_bubble_by_current.png" +dest_files=[ "res://.import/follow_up_bubble_by_current.png-4c62d77585d2f1312120c7086ff35935.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/user_interface/chat_panel/follow_up_bubble_by_inactive.png b/user_interface/chat_panel/follow_up_bubble_by_inactive.png new file mode 100644 index 0000000..2e4493e Binary files /dev/null and b/user_interface/chat_panel/follow_up_bubble_by_inactive.png differ diff --git a/user_interface/chat_panel/follow_up_bubble_by_inactive.png.import b/user_interface/chat_panel/follow_up_bubble_by_inactive.png.import new file mode 100644 index 0000000..7277b6f --- /dev/null +++ b/user_interface/chat_panel/follow_up_bubble_by_inactive.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/follow_up_bubble_by_inactive.png-304f23af3fc1b34e299f422e1ccd6647.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/chat_panel/follow_up_bubble_by_inactive.png" +dest_files=[ "res://.import/follow_up_bubble_by_inactive.png-304f23af3fc1b34e299f422e1ccd6647.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/user_interface/chat_panel/message_box.gd b/user_interface/chat_panel/message_box.gd new file mode 100644 index 0000000..5eee2a0 --- /dev/null +++ b/user_interface/chat_panel/message_box.gd @@ -0,0 +1,25 @@ +extends PanelContainer + + +onready var text_edit = get_node("MarginContainer/ContentFitTextEdit") +onready var message_denied_sound = get_node("MessageDeniedSound") + + +func _ready(): +# warning-ignore:return_value_discarded + Users.connect("switched", self, "_on_user_switched") + + +func _on_message_box_confirmed(content): + if PingSystem.unhandled_ping_count == 0 and not content.empty(): + text_edit.text = "" + text_edit._on_text_changed() # To go back to minimum height. + else: + message_denied_sound.play() + + +func _on_user_switched(): + Users.get_inactive().message_box_content = text_edit.text + text_edit.text = Users.get_current().message_box_content + text_edit._on_text_changed() # To adjust height. + text_edit.select_all() diff --git a/user_interface/chat_panel/message_editable.gd b/user_interface/chat_panel/message_editable.gd new file mode 100644 index 0000000..33f3b03 --- /dev/null +++ b/user_interface/chat_panel/message_editable.gd @@ -0,0 +1,158 @@ +extends EditableTextBlock +class_name MessageEditable + + +const BUBBLE_BY_CURRENT = preload("res://user_interface/chat_panel/bubble_by_current.png") +const BUBBLE_BY_INACTIVE = preload("res://user_interface/chat_panel/bubble_by_inactive.png") +const FOLLOW_UP_BUBBLE_BY_CURRENT = preload("res://user_interface/chat_panel/follow_up_bubble_by_current.png") +const FOLLOW_UP_BUBBLE_BY_INACTIVE = preload("res://user_interface/chat_panel/follow_up_bubble_by_inactive.png") + + +onready var message_inserted_sound = get_node("MessageInsertedSound") + + +var associated_message +var follow_up: bool = false + + # If the node was spawned by PingSystem. +var insert_mode: bool = false +var ping_id: int = -1 + + +func get_user() -> User: + return associated_message.get_user() + + +func _get_content_string() -> String: # Override. + return associated_message.content + + +func _setup(): # Override. + if _get_content_string().empty(): + _setup_insert_mode() + else: + _setup_content() + + _setup_appearance() + + +func _setup_insert_mode(): +# warning-ignore:return_value_discarded + PingSystem.connect("ping_handled", self, "_on_ping_handled") + ping_id = PingSystem.total_ping_count + +# warning-ignore:return_value_discarded + _check_if_next_ping() + + insert_mode = true + + var is_multiline = (randi() % 100) < 20 + + if is_multiline: + text_edit.min_width = 488 + text_edit.min_height = 18 * (randi() % 2 + 2) + 19 + else: + text_edit.min_width = randi() % 440 + 48 + text_edit.min_height = 0 + _enable_edit_mode() + + +func _setup_popup_menu_items(): # Override. + if associated_message.get_user() == Users.get_current(): + popup_menu.add_item("Edit", 0) + popup_menu.add_item("Copy", 1) + popup_menu.add_item("Delete", 2) + else: + popup_menu.add_item("Copy", 1) + + +func _adjust_appearance_to_user(): # Override. + if get_user().is_current(): + _set_appearance_to_style_current() + else: + _set_appearance_to_style_inactive() + + +func _set_appearance_to_style_current(): + if follow_up: + nine_patch.texture = FOLLOW_UP_BUBBLE_BY_CURRENT + else: + nine_patch.texture = BUBBLE_BY_CURRENT + nine_patch.patch_margin_left = 12 + nine_patch.patch_margin_right = 21 + margin_container.add_constant_override("margin_left", 8) + margin_container.add_constant_override("margin_right", 17) + size_flags_horizontal = SIZE_SHRINK_END + nine_patch.self_modulate = get_user().own_message_color + + +func _set_appearance_to_style_inactive(): + if follow_up: + nine_patch.texture = FOLLOW_UP_BUBBLE_BY_INACTIVE + else: + nine_patch.texture = BUBBLE_BY_INACTIVE + nine_patch.patch_margin_left = 21 + nine_patch.patch_margin_right = 12 + margin_container.add_constant_override("margin_left", 17) + margin_container.add_constant_override("margin_right", 8) + size_flags_horizontal = 0 + nine_patch.self_modulate = Users.get_current().others_message_color + + +func _check_if_next_ping() -> bool: + if ping_id == PingSystem.current_ping_id: + text_edit.readonly = false + text_edit.placeholder = "Insert Message" + return true + else: + text_edit.readonly = true + return false + + +func _post_enable_edit_mode(): # Override. + if !insert_mode: + text_edit.grab_focus() + text_edit.confirm_on_focus_exit = true + + +func _post_disable_edit_mode(): # Override. + if insert_mode: + _disable_insert_mode() + + +func _disable_insert_mode(): + insert_mode = false + text_edit.min_width = 0 + text_edit.min_height = 0 + PingSystem.disconnect("ping_handled", self, "_on_ping_handled") + PingSystem.emit_signal("ping_handled") + message_inserted_sound.play() + + +func _delete(): + associated_message.delete() + + +func _on_popup_menu_id_pressed(id): + match id: + 0: # Edit. + _enable_edit_mode() + 1: # Copy. + OS.clipboard = associated_message.content + 2: # Delete. + _delete() + + +func _on_text_edit_confirmed(confirmed_content): # Override + var test_string = confirmed_content.strip_edges() + if test_string.empty(): + if not insert_mode: + _delete() + else: + associated_message.content = confirmed_content + _disable_edit_mode() + + +func _on_ping_handled(): + if _check_if_next_ping(): + text_edit.grab_focus() diff --git a/user_interface/chat_panel/message_feed.gd b/user_interface/chat_panel/message_feed.gd new file mode 100644 index 0000000..a22748e --- /dev/null +++ b/user_interface/chat_panel/message_feed.gd @@ -0,0 +1,40 @@ +extends PanelContainer + + +onready var v_scroll = get_node("MarginContainer/ScrollContainer/_v_scroll") +onready var margin_container = get_node("MarginContainer/ScrollContainer/MarginContainer") +onready var message_feed_container = get_node("MarginContainer/ScrollContainer/MarginContainer/MessageFeedContainer") + + +func _ready(): +# warning-ignore:return_value_discarded + Data.messages.connect( + "message_added", self, "_on_data_message_added" + ) +# warning-ignore:return_value_discarded + Data.messages.connect( + "message_group_added", self, "_on_data_message_group_added" + ) + + +func scroll_to_newest(): + yield(get_tree(), "idle_frame") + v_scroll.value = margin_container.rect_size.y + + +func _on_message_box_confirmed(content): + if PingSystem.unhandled_ping_count == 0 and not content.empty(): + Data.messages.add_message( + content, Time.get_current_time(), Users.get_current() + ) + + +func _on_data_message_added(message): + var node = message.create_node() + message.associated_message_group.associated_container.add(node) + scroll_to_newest() + + +func _on_data_message_group_added(message_group): + var container = message_group.create_container() + message_feed_container.add_child(container) diff --git a/user_interface/chat_panel/message_group_container.gd b/user_interface/chat_panel/message_group_container.gd new file mode 100644 index 0000000..9985f52 --- /dev/null +++ b/user_interface/chat_panel/message_group_container.gd @@ -0,0 +1,57 @@ +extends HBoxContainer +class_name MessageGroupContainer + + +onready var profile_image_rect = get_node("ProfileImageRect") +onready var header = get_node("VBoxContainer/Header") +onready var username = get_node("VBoxContainer/Header/Username") +onready var date = get_node("VBoxContainer/Header/Date") +onready var message_container = get_node("VBoxContainer/MessageContainer") + +var associated_message_group + + +func _ready(): +# warning-ignore:return_value_discarded + Users.connect("switched", self, "_on_user_switched") + _setup() + + +func get_user() -> User: + return associated_message_group.associated_user + + +func add(message): + message_container.add_child(message) + + +func _on_user_switched(): + _adjust_layout_to_user() + + +func _setup(): + profile_image_rect.texture = get_user().profile_image + username.text = get_user().username + + # Define date. + var time_stamp = associated_message_group.time_stamp + var storaged_date = OS.get_datetime_from_unix_time(time_stamp) + var os_time = OS.get_datetime() + + if storaged_date.day == os_time.day: + date.text = "today, at " + str(os_time.hour) + ":" + "%02d" % os_time.minute + elif storaged_date.day == os_time.day + 1: + date.text = "yesterday" + + _adjust_layout_to_user() + + +func _adjust_layout_to_user(): + if get_user().is_current(): + move_child(profile_image_rect, 1) + header.alignment = BoxContainer.ALIGN_END + size_flags_horizontal = SIZE_SHRINK_END + else: + move_child(profile_image_rect, 0) + header.alignment = BoxContainer.ALIGN_BEGIN + size_flags_horizontal = 0 diff --git a/user_interface/chat_panel/message_group_container.tscn b/user_interface/chat_panel/message_group_container.tscn new file mode 100644 index 0000000..3f492a1 --- /dev/null +++ b/user_interface/chat_panel/message_group_container.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://user_interface/utility_controls/profile_image_rect.tscn" type="PackedScene" id=1] +[ext_resource path="res://user_interface/chat_panel/message_group_container.gd" type="Script" id=2] +[ext_resource path="res://user_interface/fonts/date_font.tres" type="DynamicFont" id=3] +[ext_resource path="res://user_interface/fonts/username_font.tres" type="DynamicFont" id=4] + +[node name="MessageGroupContainer" type="HBoxContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_right = 488.0 +margin_bottom = 576.0 + +[node name="Header" type="HBoxContainer" parent="VBoxContainer"] +margin_right = 488.0 +margin_bottom = 12.0 +alignment = 2 + +[node name="Username" type="Label" parent="VBoxContainer/Header"] +margin_left = 396.0 +margin_right = 457.0 +margin_bottom = 12.0 +custom_fonts/font = ExtResource( 4 ) +text = "[Username]" + +[node name="Date" type="Label" parent="VBoxContainer/Header"] +margin_left = 461.0 +margin_right = 488.0 +margin_bottom = 12.0 +custom_fonts/font = ExtResource( 3 ) +text = "[date]" + +[node name="MessageContainer" type="VBoxContainer" parent="VBoxContainer"] +margin_top = 16.0 +margin_right = 488.0 +margin_bottom = 16.0 +rect_min_size = Vector2( 488, 0 ) + +[node name="ProfileImageRect" parent="." instance=ExtResource( 1 )] +margin_left = 492.0 +margin_right = 540.0 +margin_bottom = 48.0 +size_flags_vertical = 0 diff --git a/user_interface/chat_panel/message_node.tscn b/user_interface/chat_panel/message_node.tscn new file mode 100644 index 0000000..30ba7b3 --- /dev/null +++ b/user_interface/chat_panel/message_node.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://user_interface/utility_controls/editable_text_block.tscn" type="PackedScene" id=1] +[ext_resource path="res://user_interface/chat_panel/message_editable.gd" type="Script" id=2] +[ext_resource path="res://sounds/message_inserted.wav" type="AudioStream" id=4] + +[node name="MessageNode" instance=ExtResource( 1 )] +script = ExtResource( 2 ) + +[node name="NinePatch" parent="." index="0"] +patch_margin_top = 12 +patch_margin_bottom = 12 + +[node name="VBoxContainer" parent="." index="1"] +custom_constants/separation = -16 + +[node name="MessageInsertedSound" type="AudioStreamPlayer" parent="." index="3"] +stream = ExtResource( 4 ) +volume_db = -6.0 diff --git a/user_interface/debug_panel/debug_panel.tscn b/user_interface/debug_panel/debug_panel.tscn new file mode 100644 index 0000000..03d86ed --- /dev/null +++ b/user_interface/debug_panel/debug_panel.tscn @@ -0,0 +1,6 @@ +[gd_scene format=2] + +[node name="DebugPanel" type="PanelContainer"] +margin_right = 1008.0 +margin_bottom = 80.0 +rect_min_size = Vector2( 0, 80 ) diff --git a/assets/fonts/Helvetica/Helvetica-Bold.ttf b/user_interface/fonts/Helvetica/Helvetica-Bold.ttf similarity index 100% rename from assets/fonts/Helvetica/Helvetica-Bold.ttf rename to user_interface/fonts/Helvetica/Helvetica-Bold.ttf diff --git a/assets/fonts/Helvetica/Helvetica-BoldOblique.ttf b/user_interface/fonts/Helvetica/Helvetica-BoldOblique.ttf similarity index 100% rename from assets/fonts/Helvetica/Helvetica-BoldOblique.ttf rename to user_interface/fonts/Helvetica/Helvetica-BoldOblique.ttf diff --git a/assets/fonts/Helvetica/Helvetica-Oblique.ttf b/user_interface/fonts/Helvetica/Helvetica-Oblique.ttf similarity index 100% rename from assets/fonts/Helvetica/Helvetica-Oblique.ttf rename to user_interface/fonts/Helvetica/Helvetica-Oblique.ttf diff --git a/assets/fonts/Helvetica/Helvetica-standard.ttf b/user_interface/fonts/Helvetica/Helvetica-standard.ttf similarity index 100% rename from assets/fonts/Helvetica/Helvetica-standard.ttf rename to user_interface/fonts/Helvetica/Helvetica-standard.ttf diff --git a/assets/fonts/Helvetica/helvetica-compressed-bold.otf b/user_interface/fonts/Helvetica/helvetica-compressed-bold.otf similarity index 100% rename from assets/fonts/Helvetica/helvetica-compressed-bold.otf rename to user_interface/fonts/Helvetica/helvetica-compressed-bold.otf diff --git a/assets/fonts/Helvetica/helvetica-light.ttf b/user_interface/fonts/Helvetica/helvetica-light.ttf similarity index 100% rename from assets/fonts/Helvetica/helvetica-light.ttf rename to user_interface/fonts/Helvetica/helvetica-light.ttf diff --git a/assets/fonts/Helvetica/helvetica-rounded-bold.otf b/user_interface/fonts/Helvetica/helvetica-rounded-bold.otf similarity index 100% rename from assets/fonts/Helvetica/helvetica-rounded-bold.otf rename to user_interface/fonts/Helvetica/helvetica-rounded-bold.otf diff --git a/assets/fonts/Uni Sans/FFF_EULA_license.pdf b/user_interface/fonts/Uni Sans/FFF_EULA_license.pdf similarity index 100% rename from assets/fonts/Uni Sans/FFF_EULA_license.pdf rename to user_interface/fonts/Uni Sans/FFF_EULA_license.pdf diff --git a/assets/fonts/Uni Sans/Uni Sans Heavy Italic.otf b/user_interface/fonts/Uni Sans/Uni Sans Heavy Italic.otf similarity index 100% rename from assets/fonts/Uni Sans/Uni Sans Heavy Italic.otf rename to user_interface/fonts/Uni Sans/Uni Sans Heavy Italic.otf diff --git a/assets/fonts/Uni Sans/Uni Sans Heavy.otf b/user_interface/fonts/Uni Sans/Uni Sans Heavy.otf similarity index 100% rename from assets/fonts/Uni Sans/Uni Sans Heavy.otf rename to user_interface/fonts/Uni Sans/Uni Sans Heavy.otf diff --git a/assets/fonts/Uni Sans/Uni Sans Thin Italic.otf b/user_interface/fonts/Uni Sans/Uni Sans Thin Italic.otf similarity index 100% rename from assets/fonts/Uni Sans/Uni Sans Thin Italic.otf rename to user_interface/fonts/Uni Sans/Uni Sans Thin Italic.otf diff --git a/assets/fonts/Uni Sans/Uni Sans Thin.otf b/user_interface/fonts/Uni Sans/Uni Sans Thin.otf similarity index 100% rename from assets/fonts/Uni Sans/Uni Sans Thin.otf rename to user_interface/fonts/Uni Sans/Uni Sans Thin.otf diff --git a/assets/fonts/date_label.tres b/user_interface/fonts/date_font.tres similarity index 52% rename from assets/fonts/date_label.tres rename to user_interface/fonts/date_font.tres index 26c1923..de1db14 100644 --- a/assets/fonts/date_label.tres +++ b/user_interface/fonts/date_font.tres @@ -1,9 +1,9 @@ [gd_resource type="DynamicFont" load_steps=2 format=2] -[ext_resource path="res://assets/fonts/Helvetica/Helvetica-standard.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://user_interface/fonts/Helvetica/Helvetica-standard.ttf" type="DynamicFontData" id=1] [resource] -size = 12 +size = 11 use_mipmaps = true use_filter = true font_data = ExtResource( 1 ) diff --git a/user_interface/fonts/type_font.tres b/user_interface/fonts/type_font.tres new file mode 100644 index 0000000..4b6bb1c --- /dev/null +++ b/user_interface/fonts/type_font.tres @@ -0,0 +1,10 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[sub_resource type="DynamicFontData" id=1] +font_path = "res://user_interface/fonts/Helvetica/Helvetica-Bold.ttf" + +[resource] +size = 8 +use_mipmaps = true +use_filter = true +font_data = SubResource( 1 ) diff --git a/user_interface/fonts/username_font.tres b/user_interface/fonts/username_font.tres new file mode 100644 index 0000000..201cf6f --- /dev/null +++ b/user_interface/fonts/username_font.tres @@ -0,0 +1,10 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[sub_resource type="DynamicFontData" id=1] +font_path = "res://user_interface/fonts/Helvetica/Helvetica-Bold.ttf" + +[resource] +size = 11 +use_mipmaps = true +use_filter = true +font_data = SubResource( 1 ) diff --git a/user_interface/main.gd b/user_interface/main.gd new file mode 100644 index 0000000..18a5413 --- /dev/null +++ b/user_interface/main.gd @@ -0,0 +1,46 @@ +extends Control + + +const MAX_WIDTH = 1280 + +onready var margin_container = get_node("Panel/MarginContainer") + + +func _ready(): +# warning-ignore:return_value_discarded + Users.connect("switched", self, "_on_user_switched") + Users.emit_signal("switched") + + +func _on_user_switched(): + theme.get_stylebox("panel", "Panel").bg_color = Users.get_current().background_color + theme.get_stylebox("panel", "PanelContainer").bg_color = Users.get_current().panel_color + theme.get_stylebox("panel", "PopupMenu").bg_color = Users.get_current().popup_menu_color + theme.get_stylebox("grabber", "VScrollBar").bg_color = Users.get_current().scroll_bar_color + theme.get_stylebox("grabber_highlight", "VScrollBar").bg_color = Users.get_current().scroll_bar_highlight_color + theme.get_stylebox("grabber_pressed", "VScrollBar").bg_color = Users.get_current().scroll_bar_pressed_color + + +func _on_resized(): + if !margin_container: + return + + var left_margin = theme.get_constant("margin_left", "MarginContainer") + var right_margin = theme.get_constant("margin_right", "MarginContainer") + + var content_width = rect_size.x - left_margin - right_margin + + if content_width >= MAX_WIDTH: + var difference = content_width - MAX_WIDTH + var additional_margin = 0.5 * difference + + margin_container.add_constant_override( + "margin_left", left_margin + additional_margin + ) + margin_container.add_constant_override( + "margin_right", right_margin + additional_margin + ) + else: + margin_container.add_constant_override("margin_left", left_margin) + margin_container.add_constant_override("margin_right", right_margin) + diff --git a/user_interface/main.theme b/user_interface/main.theme new file mode 100644 index 0000000..2d2a675 Binary files /dev/null and b/user_interface/main.theme differ diff --git a/user_interface/main.tscn b/user_interface/main.tscn new file mode 100644 index 0000000..a8a58cc --- /dev/null +++ b/user_interface/main.tscn @@ -0,0 +1,70 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://user_interface/chat_panel/chat_panel.tscn" type="PackedScene" id=1] +[ext_resource path="res://user_interface/tool_bar/tool_bar.tscn" type="PackedScene" id=2] +[ext_resource path="res://user_interface/topic_panel/topic_panel.tscn" type="PackedScene" id=3] +[ext_resource path="res://user_interface/debug_panel/debug_panel.tscn" type="PackedScene" id=4] +[ext_resource path="res://user_interface/call_panel/call_panel.tscn" type="PackedScene" id=5] +[ext_resource path="res://user_interface/main.theme" type="Theme" id=9] +[ext_resource path="res://user_interface/main.gd" type="Script" id=13] + +[node name="Main" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_min_size = Vector2( 984, 360 ) +theme = ExtResource( 9 ) +script = ExtResource( 13 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Panel" type="Panel" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="MarginContainer" type="MarginContainer" parent="Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer"] +margin_left = 8.0 +margin_top = 8.0 +margin_right = 1016.0 +margin_bottom = 568.0 + +[node name="DebugPanel" parent="Panel/MarginContainer/VBoxContainer" instance=ExtResource( 4 )] +visible = false + +[node name="CallPanel" parent="Panel/MarginContainer/VBoxContainer" instance=ExtResource( 5 )] +visible = false + +[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/VBoxContainer"] +margin_right = 1008.0 +margin_bottom = 560.0 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SidePanel" type="VBoxContainer" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer"] +margin_right = 328.0 +margin_bottom = 560.0 +rect_min_size = Vector2( 328, 0 ) + +[node name="TopicPanel" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/SidePanel" instance=ExtResource( 3 )] +margin_bottom = 484.0 + +[node name="ToolBar" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/SidePanel" instance=ExtResource( 2 )] +margin_top = 492.0 +margin_bottom = 560.0 + +[node name="ChatPanel" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer" instance=ExtResource( 1 )] +margin_bottom = 560.0 + +[connection signal="resized" from="." to="." method="_on_resized"] diff --git a/assets/ui/icons/call0.png b/user_interface/tool_bar/icons/call0.png similarity index 100% rename from assets/ui/icons/call0.png rename to user_interface/tool_bar/icons/call0.png diff --git a/assets/textures/jimsito.png.import b/user_interface/tool_bar/icons/call0.png.import similarity index 70% rename from assets/textures/jimsito.png.import rename to user_interface/tool_bar/icons/call0.png.import index a121bcb..155557c 100644 --- a/assets/textures/jimsito.png.import +++ b/user_interface/tool_bar/icons/call0.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/jimsito.png-0282e9988476bbabb7014326f21007ce.stex" +path="res://.import/call0.png-bd301461443cfb2159f3203b22d64513.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/jimsito.png" -dest_files=[ "res://.import/jimsito.png-0282e9988476bbabb7014326f21007ce.stex" ] +source_file="res://user_interface/tool_bar/icons/call0.png" +dest_files=[ "res://.import/call0.png-bd301461443cfb2159f3203b22d64513.stex" ] [params] diff --git a/assets/ui/icons/call01.png b/user_interface/tool_bar/icons/call01.png similarity index 100% rename from assets/ui/icons/call01.png rename to user_interface/tool_bar/icons/call01.png diff --git a/user_interface/tool_bar/icons/call01.png.import b/user_interface/tool_bar/icons/call01.png.import new file mode 100644 index 0000000..49cd2e2 --- /dev/null +++ b/user_interface/tool_bar/icons/call01.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/call01.png-6a8d3bd7cabe8fc7da1d3078de113ba3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/tool_bar/icons/call01.png" +dest_files=[ "res://.import/call01.png-6a8d3bd7cabe8fc7da1d3078de113ba3.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=true +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/assets/ui/icons/call1.png b/user_interface/tool_bar/icons/call1.png similarity index 100% rename from assets/ui/icons/call1.png rename to user_interface/tool_bar/icons/call1.png diff --git a/user_interface/tool_bar/icons/call1.png.import b/user_interface/tool_bar/icons/call1.png.import new file mode 100644 index 0000000..18b5d15 --- /dev/null +++ b/user_interface/tool_bar/icons/call1.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/call1.png-6cb5273ff894162c8dc068ddac753817.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/tool_bar/icons/call1.png" +dest_files=[ "res://.import/call1.png-6cb5273ff894162c8dc068ddac753817.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=true +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/assets/ui/icons/off.png b/user_interface/tool_bar/icons/off.png similarity index 100% rename from assets/ui/icons/off.png rename to user_interface/tool_bar/icons/off.png diff --git a/assets/ui/icons/off.png.import b/user_interface/tool_bar/icons/off.png.import similarity index 71% rename from assets/ui/icons/off.png.import rename to user_interface/tool_bar/icons/off.png.import index 7191a0b..85d8c36 100644 --- a/assets/ui/icons/off.png.import +++ b/user_interface/tool_bar/icons/off.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.stex" +path="res://.import/off.png-9e318488e74f0027d75f0bc130ff17e4.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/ui/icons/off.png" -dest_files=[ "res://.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.stex" ] +source_file="res://user_interface/tool_bar/icons/off.png" +dest_files=[ "res://.import/off.png-9e318488e74f0027d75f0bc130ff17e4.stex" ] [params] diff --git a/assets/ui/icons/on.png b/user_interface/tool_bar/icons/on.png similarity index 100% rename from assets/ui/icons/on.png rename to user_interface/tool_bar/icons/on.png diff --git a/assets/ui/icons/on.png.import b/user_interface/tool_bar/icons/on.png.import similarity index 71% rename from assets/ui/icons/on.png.import rename to user_interface/tool_bar/icons/on.png.import index 96da16d..2b01363 100644 --- a/assets/ui/icons/on.png.import +++ b/user_interface/tool_bar/icons/on.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/on.png-4bc6a2158c537328d87921ed56daf94b.stex" +path="res://.import/on.png-30e09c905166ec12e325b6897eba5eab.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/ui/icons/on.png" -dest_files=[ "res://.import/on.png-4bc6a2158c537328d87921ed56daf94b.stex" ] +source_file="res://user_interface/tool_bar/icons/on.png" +dest_files=[ "res://.import/on.png-30e09c905166ec12e325b6897eba5eab.stex" ] [params] diff --git a/assets/ui/icons/plus0.png b/user_interface/tool_bar/icons/plus0.png similarity index 100% rename from assets/ui/icons/plus0.png rename to user_interface/tool_bar/icons/plus0.png diff --git a/user_interface/tool_bar/icons/plus0.png.import b/user_interface/tool_bar/icons/plus0.png.import new file mode 100644 index 0000000..733e6d5 --- /dev/null +++ b/user_interface/tool_bar/icons/plus0.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/plus0.png-5b08f8ec4468b765a90486e3bd698ea3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://user_interface/tool_bar/icons/plus0.png" +dest_files=[ "res://.import/plus0.png-5b08f8ec4468b765a90486e3bd698ea3.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=true +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/user_interface/tool_bar/tool_bar.gd b/user_interface/tool_bar/tool_bar.gd new file mode 100644 index 0000000..0897694 --- /dev/null +++ b/user_interface/tool_bar/tool_bar.gd @@ -0,0 +1,26 @@ +extends PanelContainer + + +onready var profile_image_rect = get_node("Margin/Structure/Profile/ProfileImageRect") +onready var username = get_node("Margin/Structure/Profile/UserTexts/Username") + + +func _ready(): +# warning-ignore:return_value_discarded + Users.connect("switched", self, "_on_user_switched") + + +func _input(event): + if event is InputEventKey: + if event.scancode == KEY_T and event.control and event.alt: + if event.pressed and !event.is_echo(): + Users.switch() + + +func _on_user_switched(): + profile_image_rect.texture = Users.get_current().profile_image + username.text = Users.get_current().username + + +func _on_CheckButton_toggled(_button_pressed): + Users.switch() diff --git a/user_interface/tool_bar/tool_bar.tscn b/user_interface/tool_bar/tool_bar.tscn new file mode 100644 index 0000000..178fca0 --- /dev/null +++ b/user_interface/tool_bar/tool_bar.tscn @@ -0,0 +1,124 @@ +[gd_scene load_steps=16 format=2] + +[ext_resource path="res://user_interface/main.theme" type="Theme" id=1] +[ext_resource path="res://user_interface/utility_controls/profile_image_rect_mask.png" type="Texture" id=2] +[ext_resource path="res://user_interface/utility_controls/profile_image_rect.tscn" type="PackedScene" id=3] +[ext_resource path="res://user_interface/fonts/Helvetica/Helvetica-Oblique.ttf" type="DynamicFontData" id=4] +[ext_resource path="res://user_interface/fonts/Helvetica/Helvetica-Bold.ttf" type="DynamicFontData" id=5] +[ext_resource path="res://user_interface/tool_bar/tool_bar.gd" type="Script" id=6] +[ext_resource path="res://user_interface/tool_bar/icons/call0.png" type="Texture" id=7] +[ext_resource path="res://user_interface/tool_bar/icons/off.png" type="Texture" id=8] +[ext_resource path="res://user_interface/tool_bar/icons/call1.png" type="Texture" id=9] +[ext_resource path="res://user_interface/tool_bar/icons/call01.png" type="Texture" id=10] +[ext_resource path="res://user_interface/tool_bar/icons/on.png" type="Texture" id=11] + +[sub_resource type="Shader" id=1] +code = "shader_type canvas_item; +render_mode blend_mix; + +uniform sampler2D mask; + +void fragment() { + COLOR = texture(TEXTURE, UV) * vec4(vec3(1.0), texture(mask, UV).r); +}" + +[sub_resource type="ShaderMaterial" id=2] +shader = SubResource( 1 ) +shader_param/mask = ExtResource( 2 ) + +[sub_resource type="DynamicFont" id=3] +use_mipmaps = true +use_filter = true +font_data = ExtResource( 5 ) + +[sub_resource type="DynamicFont" id=4] +size = 24 +use_mipmaps = true +use_filter = true +font_data = ExtResource( 4 ) + +[node name="ToolBar" type="PanelContainer"] +margin_top = 404.0 +margin_right = 328.0 +margin_bottom = 472.0 +rect_min_size = Vector2( 0, 60 ) +theme = ExtResource( 1 ) +script = ExtResource( 6 ) + +[node name="Margin" type="MarginContainer" parent="."] +margin_right = 328.0 +margin_bottom = 68.0 +custom_constants/margin_right = 10 +custom_constants/margin_top = 10 +custom_constants/margin_left = 10 +custom_constants/margin_bottom = 10 + +[node name="Structure" type="HBoxContainer" parent="Margin"] +margin_left = 10.0 +margin_top = 10.0 +margin_right = 318.0 +margin_bottom = 58.0 + +[node name="Profile" type="HBoxContainer" parent="Margin/Structure"] +margin_right = 172.0 +margin_bottom = 48.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 4.0 +custom_constants/separation = 10 + +[node name="ProfileImageRect" type="TextureRect" parent="Margin/Structure/Profile" instance=ExtResource( 3 )] +material = SubResource( 2 ) +margin_right = 48.0 +margin_bottom = 48.0 +rect_min_size = Vector2( 48, 48 ) +texture = ExtResource( 2 ) +expand = true +stretch_mode = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="UserTexts" type="VBoxContainer" parent="Margin/Structure/Profile"] +margin_left = 58.0 +margin_right = 172.0 +margin_bottom = 48.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 2.0 + +[node name="Username" type="Label" parent="Margin/Structure/Profile/UserTexts"] +margin_right = 114.0 +margin_bottom = 48.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_fonts/font = SubResource( 3 ) +text = "[User]" +valign = 1 +autowrap = true +clip_text = true + +[node name="CallButton" type="TextureButton" parent="Margin/Structure"] +margin_left = 180.0 +margin_right = 224.0 +margin_bottom = 48.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture_normal = ExtResource( 7 ) +texture_pressed = ExtResource( 9 ) +texture_hover = ExtResource( 10 ) +expand = true +stretch_mode = 5 + +[node name="CheckButton" type="CheckButton" parent="Margin/Structure"] +margin_left = 232.0 +margin_right = 308.0 +margin_bottom = 48.0 +size_flags_stretch_ratio = 0.5 +custom_fonts/font = SubResource( 4 ) +custom_icons/off = ExtResource( 8 ) +custom_icons/on = ExtResource( 11 ) +align = 1 +expand_icon = true + +[connection signal="toggled" from="Margin/Structure/CheckButton" to="." method="_on_CheckButton_toggled"] diff --git a/user_interface/topic_panel/bubble.png b/user_interface/topic_panel/bubble.png new file mode 100644 index 0000000..82b182d Binary files /dev/null and b/user_interface/topic_panel/bubble.png differ diff --git a/assets/textures/bg1.png.import b/user_interface/topic_panel/bubble.png.import similarity index 70% rename from assets/textures/bg1.png.import rename to user_interface/topic_panel/bubble.png.import index d07d859..7e3e17d 100644 --- a/assets/textures/bg1.png.import +++ b/user_interface/topic_panel/bubble.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.stex" +path="res://.import/bubble.png-4f609f28c2c064c69f714259f156e4b9.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/bg1.png" -dest_files=[ "res://.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.stex" ] +source_file="res://user_interface/topic_panel/bubble.png" +dest_files=[ "res://.import/bubble.png-4f609f28c2c064c69f714259f156e4b9.stex" ] [params] diff --git a/user_interface/topic_panel/topic_draggable.gd b/user_interface/topic_panel/topic_draggable.gd new file mode 100644 index 0000000..fd736e3 --- /dev/null +++ b/user_interface/topic_panel/topic_draggable.gd @@ -0,0 +1,152 @@ +extends Container +class_name TopicDraggable + + +onready var topic_feed: VBoxContainer = get_node("..") +onready var scroll_container: ScrollContainer = get_node("../..") +onready var v_scroll: VScrollBar = get_node("../../_v_scroll") +onready var editable = get_node("TopicEditable") +onready var tween = get_node("Tween") + +var global_position setget _set_global_position +var _in_fit_in_animation = false +var _previous_position +var _offset + + +func _ready(): + pass + + +func _input(event): + if event is InputEventMouseButton and event.button_index == BUTTON_LEFT: + if event.is_pressed(): + if _is_mouse_on_control(): + if event.shift: + topic_feed._toggle_selection_result = _set_selection(null) + topic_feed._shift_hold = true + else: + _deselect_all() + if not editable.edit_mode: + if event.doubleclick: + editable._enable_edit_mode() + editable.text_edit.grab_focus() + editable.text_edit.select_all() + elif !_in_fit_in_animation: + _set_as_grabbed() + elif editable.edit_mode: + editable.text_edit._confirm() + else: + _fit_in_animation() + topic_feed._shift_hold = false + + if event is InputEventMouseMotion: + if topic_feed.currently_grabbed_topic == self: + _move_block(event) + topic_feed.check_all_passings() + if topic_feed._shift_hold and _is_mouse_on_control(): +# warning-ignore:return_value_discarded + _set_selection(topic_feed._toggle_selection_result) + + +func _set_selection(to) -> bool: + # If 'to' is null, selection is toggled. + if topic_feed.selected_topics.has(self) and to != true: + topic_feed.selected_topics.erase(self) + editable._update_color() + return false + elif !topic_feed.selected_topics.has(self) and to != false: + topic_feed.selected_topics.append(self) + editable._update_color() + return true + else: + return topic_feed.selected_topics.has(self) + + +func _deselect_all(): + topic_feed.selected_topics.clear() + topic_feed.update_all_colors() + + +func _set_as_grabbed(): + var rect = editable.get_global_rect() + rect_min_size.y = editable.rect_size.y + editable.set_as_toplevel(true) + editable.rect_position = rect.position + topic_feed.currently_grabbed_topic = self + _previous_position = editable.rect_global_position + _offset = 0 + + +func _fit_in_animation(): + _in_fit_in_animation = true + topic_feed.currently_grabbed_topic = null + tween.stop_all() + tween.interpolate_property(self, "global_position", + editable.rect_global_position, rect_global_position, + 0.12, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT + ) + tween.start() + yield(tween, "tween_completed") + editable.set_as_toplevel(false) + rect_min_size.y = 0 + editable.rect_position = Vector2.ZERO + _in_fit_in_animation = false + + +func _move_block(event): + _offset += event.relative.y + editable.set_global_position(_previous_position + Vector2(0.0, _offset)) + + +func _is_mouse_on_control() -> bool: + return get_global_rect().has_point(get_viewport().get_mouse_position()) + + +func set_previous_position(): + _previous_position = editable.rect_global_position + + +func check_for_passing() -> bool: + var dragged: TopicDraggable = topic_feed.currently_grabbed_topic + if dragged == self or dragged == null: + return false + + var dir = sign(dragged.get_index() - get_index()) + + var self_rect = get_global_rect() + var self_half_size = self_rect.size.y * 0.5 + # Center line. + var self_coll_line = self_rect.position.y + self_half_size + + var dragged_rect = dragged.editable.get_global_rect() + var dragged_half_size = dragged_rect.size.y * 0.5 + var dragged_half_pos = dragged_rect.position.y + dragged_half_size + # Top or bottom line, depending on if moved up or down. + var dragged_coll_line = dragged_half_pos + dragged_half_size * -dir + + # +1 if dragged_coll_line is below; -1 if above. + var coll_dir = sign(self_coll_line - dragged_coll_line) + + if coll_dir == dir: + topic_feed.set_all_previous_positions() + topic_feed.move_child( + topic_feed.currently_grabbed_topic, + get_index() + ) + return true + return false + + +func setup_tween(): + if _previous_position != editable.rect_global_position: + tween.stop_all() + tween.interpolate_property(self, "global_position", + _previous_position, rect_global_position, 0.15, + Tween.TRANS_LINEAR, Tween.EASE_IN_OUT + ) + tween.start() + + +func _set_global_position(value): + editable.set_global_position(value) diff --git a/user_interface/topic_panel/topic_editable.gd b/user_interface/topic_panel/topic_editable.gd new file mode 100644 index 0000000..b4a96f8 --- /dev/null +++ b/user_interface/topic_panel/topic_editable.gd @@ -0,0 +1,60 @@ +extends EditableTextBlock +class_name TopicEditable + +const TYPE_CASUAL = 0 +const TYPE_DAILY = 1 +const TYPE_URGENT = 2 + +onready var parent = get_parent() +onready var type_label = get_node("VBoxContainer/HBoxContainer/TypeLabel") + +var associated_topic +var type: int = TYPE_CASUAL +var color: Color + + +func _get_content_string() -> String: # Override. + return associated_topic.content + + +func _setup(): # Override. + _setup_content() + _setup_appearance() + + +func _adjust_appearance_to_user(): # Override. + match type: + TYPE_CASUAL: + if type_label: + type_label.text = "CASUAL" + color = Users.get_current().casual_topic_color + TYPE_DAILY: + if type_label: + type_label.text = "DAILY" + color = Users.get_current().daily_topic_color + TYPE_URGENT: + if type_label: + type_label.text = "URGENT" + color = Users.get_current().urgent_topic_color + _update_color() + + +func _update_color(): + var addition = Color(0.1, 0.12, 0.15) if _is_selected() else Color.black + nine_patch.self_modulate = color + addition + + +func _is_selected() -> bool: + if get_parent().topic_feed: + return parent.topic_feed.selected_topics.has(parent) + else: + return false + + +func _delete(): + associated_topic.delete() + + +func _on_text_edit_confirmed(confirmed_content): # Override + associated_topic.content = confirmed_content + _disable_edit_mode() diff --git a/user_interface/topic_panel/topic_feed.gd b/user_interface/topic_panel/topic_feed.gd new file mode 100644 index 0000000..a0b0750 --- /dev/null +++ b/user_interface/topic_panel/topic_feed.gd @@ -0,0 +1,67 @@ +extends VBoxContainer + +# warning-ignore:unused_signal +signal topic_node_added(topic_node) + + +var currently_grabbed_topic = null +var selected_topics = [] + +# For multi-selection. +var _shift_hold = false +var _toggle_selection_result + + +func _ready(): +# warning-ignore:return_value_discarded + Data.topics.connect("topic_added", self, "_on_data_topic_added") + + +func _input(event): + if event is InputEventKey: + if event.scancode == KEY_DELETE and !event.is_pressed(): + _delete_selected_topics() + + +func set_all_previous_positions(): + for topic in get_children(): + if topic != currently_grabbed_topic: + topic.set_previous_position() + + +func check_all_passings(): + if currently_grabbed_topic == null: + return + + var did_passing_occur = false + + for topic in get_children(): + if topic != currently_grabbed_topic: + if topic.check_for_passing(): + did_passing_occur = true + + if did_passing_occur: + yield(get_tree(), "idle_frame") + setup_all_tweens() + + +func setup_all_tweens(): + for topic in get_children(): + if topic != currently_grabbed_topic: + topic.setup_tween() + + +func update_all_colors(): + for topic in get_children(): + topic.editable._update_color() + + +func _delete_selected_topics(): + for topic in selected_topics: + topic.editable._delete() + selected_topics.clear() + + +func _on_data_topic_added(topic): + var topic_node = topic.create_node() + add_child(topic_node) diff --git a/user_interface/topic_panel/topic_node.tscn b/user_interface/topic_panel/topic_node.tscn new file mode 100644 index 0000000..b8fdea6 --- /dev/null +++ b/user_interface/topic_panel/topic_node.tscn @@ -0,0 +1,84 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://user_interface/utility_controls/editable_text_block.tscn" type="PackedScene" id=1] +[ext_resource path="res://user_interface/topic_panel/bubble.png" type="Texture" id=2] +[ext_resource path="res://user_interface/topic_panel/topic_editable.gd" type="Script" id=3] +[ext_resource path="res://user_interface/topic_panel/topic_draggable.gd" type="Script" id=4] +[ext_resource path="res://user_interface/fonts/type_font.tres" type="DynamicFont" id=5] + +[node name="TopicNode" type="MarginContainer"] +size_flags_horizontal = 3 +custom_constants/margin_right = 0 +custom_constants/margin_top = 0 +custom_constants/margin_left = 0 +custom_constants/margin_bottom = 0 +script = ExtResource( 4 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TopicEditable" parent="." instance=ExtResource( 1 )] +margin_right = 32.0 +margin_bottom = 171.0 +size_flags_horizontal = 3 +script = ExtResource( 3 ) + +[node name="NinePatch" parent="TopicEditable" index="0"] +self_modulate = Color( 0.811765, 0.180392, 0.180392, 1 ) +margin_right = 32.0 +margin_bottom = 171.0 +texture = ExtResource( 2 ) +patch_margin_left = 12 +patch_margin_top = 12 +patch_margin_right = 12 +patch_margin_bottom = 12 + +[node name="VBoxContainer" parent="TopicEditable" index="1"] +margin_right = 32.0 +margin_bottom = 171.0 + +[node name="MarginContainer" parent="TopicEditable/VBoxContainer" index="0"] +margin_right = 32.0 +margin_bottom = 166.0 + +[node name="Content" parent="TopicEditable/VBoxContainer/MarginContainer" index="0"] +margin_right = 15.0 +margin_bottom = 161.0 + +[node name="ReferenceLabel" parent="TopicEditable/VBoxContainer/MarginContainer" index="1"] +margin_right = 15.0 +margin_bottom = 161.0 +autowrap = true + +[node name="ContentFitTextEdit" parent="TopicEditable/VBoxContainer/MarginContainer" index="2"] +margin_right = 15.0 +margin_bottom = 161.0 +expand_width = false + +[node name="HBoxContainer" type="HBoxContainer" parent="TopicEditable/VBoxContainer" index="1"] +margin_top = 162.0 +margin_right = 32.0 +margin_bottom = 171.0 +custom_constants/separation = 0 +alignment = 2 + +[node name="TypeLabel" type="Label" parent="TopicEditable/VBoxContainer/HBoxContainer"] +self_modulate = Color( 1, 1, 1, 0.376471 ) +margin_right = 24.0 +margin_bottom = 9.0 +custom_fonts/font = ExtResource( 5 ) +text = "[Type]" + +[node name="Control" type="Control" parent="TopicEditable/VBoxContainer/HBoxContainer"] +margin_left = 24.0 +margin_right = 32.0 +margin_bottom = 9.0 +rect_min_size = Vector2( 8, 0 ) + +[node name="PopupMenu" parent="TopicEditable" index="2"] +margin_right = 32.0 +margin_bottom = 171.0 + +[node name="Tween" type="Tween" parent="."] + +[editable path="TopicEditable"] diff --git a/user_interface/topic_panel/topic_panel.gd b/user_interface/topic_panel/topic_panel.gd new file mode 100644 index 0000000..679fe04 --- /dev/null +++ b/user_interface/topic_panel/topic_panel.gd @@ -0,0 +1,6 @@ +extends PanelContainer + + +func _ready(): + for _i in range(30): + Data.topics.add_topic(randi() % 3) diff --git a/user_interface/topic_panel/topic_panel.tscn b/user_interface/topic_panel/topic_panel.tscn new file mode 100644 index 0000000..6558329 --- /dev/null +++ b/user_interface/topic_panel/topic_panel.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://user_interface/main.theme" type="Theme" id=1] +[ext_resource path="res://user_interface/topic_panel/topic_panel.gd" type="Script" id=2] +[ext_resource path="res://user_interface/topic_panel/topic_feed.gd" type="Script" id=3] + +[node name="TopicPanel" type="PanelContainer"] +margin_right = 328.0 +margin_bottom = 396.0 +size_flags_vertical = 3 +theme = ExtResource( 1 ) +script = ExtResource( 2 ) + +[node name="MarginContainer" type="MarginContainer" parent="."] +margin_right = 328.0 +margin_bottom = 396.0 + +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"] +margin_left = 8.0 +margin_top = 8.0 +margin_right = 320.0 +margin_bottom = 388.0 +scroll_horizontal_enabled = false + +[node name="TopicFeed" type="VBoxContainer" parent="MarginContainer/ScrollContainer"] +margin_right = 312.0 +size_flags_horizontal = 3 +script = ExtResource( 3 ) diff --git a/user_interface/utility_controls/content_fit_text_edit.gd b/user_interface/utility_controls/content_fit_text_edit.gd new file mode 100644 index 0000000..d895e93 --- /dev/null +++ b/user_interface/utility_controls/content_fit_text_edit.gd @@ -0,0 +1,154 @@ +extends TextEdit +class_name ContentFitTextEdit + +signal confirmed(content) + + +const PLACEHOLDER_VISIBILITY = 0.35 +const MAIN_THEME = preload("res://user_interface/main.theme") + +export(NodePath) var expansion_target = @"." +export(int) var height_addition = 0 +export(int) var min_height = 0 +export(int) var max_height = 0 +export(bool) var expand_width = false +export(int) var width_addition = 0 +export(int) var min_width = 0 +export(int) var max_width = 488 +export(String) var placeholder = "" +export(bool) var confirm_on_focus_exit = false + + +var reference_label: Label +var width_reference_label: Label + + +func _ready(): + reference_label = Label.new() + reference_label.name = "@@9" + + width_reference_label = Label.new() + width_reference_label.name = "@@10" + width_reference_label.theme = MAIN_THEME + width_reference_label.self_modulate.a = 0.0 + width_reference_label.set_as_toplevel(true) + + reference_label.margin_top = 2.0 + reference_label.anchor_right = 1.0 + reference_label.margin_right = -9.0 + reference_label.autowrap = true + + add_child(reference_label) + add_child(width_reference_label) + + _check_for_placeholder(false) + +# warning-ignore:return_value_discarded + connect("text_changed", self, "_on_text_changed") +# warning-ignore:return_value_discarded + connect("resized", self, "_on_resized") +# warning-ignore:return_value_discarded + connect("focus_entered", self, "_on_focus_entered") +# warning-ignore:return_value_discarded + connect("focus_exited", self, "_on_focus_exited") + + +func _input(event): + if has_focus(): + if event is InputEventKey and event.is_pressed(): + if event.scancode == KEY_ENTER and not event.shift: + get_tree().set_input_as_handled() + _confirm() + + +func _on_text_changed(): + adjust_size() + if expand_width: + # I honestly don't know why, but the second call helps with refreshing. + adjust_size() + + +func _on_resized(): + _adjust_height() + + +func _on_focus_entered(): + if has_focus(): + _check_for_placeholder(true) + + +func _on_focus_exited(): + _check_for_placeholder(false) + if confirm_on_focus_exit: + _confirm() + + +func _confirm(): + emit_signal("confirmed", text) + + +func adjust_size(): + if expand_width: + width_reference_label.rect_size.x = 1 + width_reference_label.text = text + _adjust_width() + reference_label.text = text + _refresh() + _adjust_height() + + +func _adjust_width(): + if is_connected("resized", self, "_on_resized"): + disconnect("resized", self, "_on_resized") + + var target = get_node(expansion_target) + + # I swear I'm not doing this for fun. + width_reference_label.visible = false + width_reference_label.visible = true + + var width = width_reference_label.rect_size.x + target.rect_min_size.x = clamp(width, min_width, max_width) + width_addition + + if not is_connected("resized", self, "_on_resized"): +# warning-ignore:return_value_discarded + connect("resized", self, "_on_resized") + + +func _adjust_height(): + if is_connected("resized", self, "_on_resized"): + disconnect("resized", self, "_on_resized") + + var target = get_node(expansion_target) + + var height = reference_label.rect_size.y + height_addition + if max_height > 0: + height = min(height, max_height) + height = max(height, min_height) + target.rect_min_size.y = height + + if not is_connected("resized", self, "_on_resized"): +# warning-ignore:return_value_discarded + connect("resized", self, "_on_resized") + + +func _check_for_placeholder(focus: bool): + if !focus and text.empty(): + reference_label.text = placeholder + reference_label.self_modulate.a = PLACEHOLDER_VISIBILITY + else: + reference_label.self_modulate.a = 0.0 + + +# Control sizes sometimes don't refresh properly, but this can be forces, by +# turning visibility off and on again. +func _refresh(): + var had_focus = has_focus() + disconnect("focus_exited", self, "_on_focus_exited") + visible = false + visible = true + if had_focus: + grab_focus() + _check_for_placeholder(had_focus) +# warning-ignore:return_value_discarded + connect("focus_exited", self, "_on_focus_exited") diff --git a/user_interface/utility_controls/editable_text_block.gd b/user_interface/utility_controls/editable_text_block.gd new file mode 100644 index 0000000..96f24a7 --- /dev/null +++ b/user_interface/utility_controls/editable_text_block.gd @@ -0,0 +1,164 @@ +extends MarginContainer +class_name EditableTextBlock + + +const EMOTE_LIST = preload("res://configuration/emotes/emote_list.tres") + + +onready var nine_patch = get_node("NinePatch") +onready var margin_container = get_node("VBoxContainer/MarginContainer") +onready var content = get_node("VBoxContainer/MarginContainer/Content") +onready var reference_label = get_node("VBoxContainer/MarginContainer/ReferenceLabel") +onready var text_edit = get_node("VBoxContainer/MarginContainer/ContentFitTextEdit") +onready var popup_menu = get_node("PopupMenu") + + +var edit_mode: bool = false + + +func _ready(): + margin_container.remove_child(text_edit) + popup_menu.rect_size.x = 64 +# warning-ignore:return_value_discarded + Users.connect("switched", self, "_on_user_switched") + _setup() + + +func _gui_input(event): + if event is InputEventMouseButton: + if event.is_pressed() and event.button_index == BUTTON_RIGHT and !edit_mode: + popup_menu.clear() + popup_menu.rect_size.y = 1 + + _setup_popup_menu_items() + + popup_menu.popup(Rect2( + event.global_position, + popup_menu.rect_size + )) + + +func _get_content_string() -> String: # Virtual. + return "" + + +func _setup(): # Virtual. + _setup_content() + _setup_appearance() + + + +func _setup_content(): + var emote_placeholder = "miii" + var emote_size = 21 + if _check_if_string_only_contains_emote_tags(_get_content_string()): + emote_placeholder = "mMiii" + emote_size = 32 + + reference_label.text = _resolve_emotes_to_placeholder( + _get_content_string(), + emote_placeholder + ) + content.bbcode_text = _resolve_emotes_in_string( + _get_content_string(), + emote_size + ) + + +func _setup_appearance(): + _adjust_appearance_to_user() + if text_edit.max_width > 0: + yield(get_tree(), "idle_frame") + if rect_size.x >= 488.0: + margin_container.remove_child(reference_label) + content.rect_min_size.x = 488.0 + + +func _setup_popup_menu_items(): # Virtual. + pass + + +func _adjust_appearance_to_user(): # Virtual. + pass + + +func _check_if_string_only_contains_emote_tags(string: String): + var test_string = string + for entry in EMOTE_LIST.list: + test_string = test_string.replace(":" + entry + ":", "") + test_string = test_string.strip_edges() + return test_string.empty() + + +func _resolve_emotes_in_string(string: String, size: int) -> String: + var result := string + + var str_size = str(size) + var img_tag = "[img=<" + str_size + ">x<" + str_size + ">]" + + for entry in EMOTE_LIST.list: + result = result.replace( + ":" + entry + ":", + img_tag + "res://configuration/emotes/" + entry + ".png[/img]" + ) + return result + + +# We replace the emote_tag in ReferenceLabel with some placeholder string, +# that has about the same width, as an emote, to fit container sizing. +func _resolve_emotes_to_placeholder( + string: String, placeholder: String) -> String: + var result := string + for entry in EMOTE_LIST.list: + result = result.replace(":" + entry + ":", placeholder) + return result + + +func _enable_edit_mode(): + edit_mode = true + if margin_container.is_a_parent_of(content): + content.rect_min_size.x = 0.0 + margin_container.remove_child(content) + if margin_container.is_a_parent_of(reference_label): + margin_container.remove_child(reference_label) + margin_container.add_child(text_edit) + + yield(get_tree(), "idle_frame") + text_edit.text = _get_content_string() + text_edit.confirm_on_focus_exit = false + + _post_enable_edit_mode() + + text_edit.adjust_size() + + +func _post_enable_edit_mode(): # Virtual. + pass + + +func _disable_edit_mode(): + edit_mode = false + if margin_container.is_a_parent_of(text_edit): + margin_container.remove_child(text_edit) + margin_container.add_child(content) + margin_container.add_child(reference_label) + + _post_disable_edit_mode() + + _setup() + + +func _post_disable_edit_mode(): # Virtual. + pass + + +func _on_user_switched(): + _adjust_appearance_to_user() + + +func _on_popup_menu_id_pressed(_id): # Virtual. + pass + + +func _on_text_edit_confirmed(_confirmed_content): # Virtual. + pass diff --git a/user_interface/utility_controls/editable_text_block.tscn b/user_interface/utility_controls/editable_text_block.tscn new file mode 100644 index 0000000..fa536eb --- /dev/null +++ b/user_interface/utility_controls/editable_text_block.tscn @@ -0,0 +1,77 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://user_interface/utility_controls/editable_text_block.gd" type="Script" id=2] +[ext_resource path="res://user_interface/utility_controls/content_fit_text_edit.gd" type="Script" id=3] + +[node name="EditableTextBlock" type="MarginContainer"] +margin_right = 193.0 +margin_bottom = 40.0 +size_flags_horizontal = 0 +custom_constants/margin_right = 0 +custom_constants/margin_top = 0 +custom_constants/margin_left = 0 +custom_constants/margin_bottom = 0 +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="NinePatch" type="NinePatchRect" parent="."] +margin_right = 193.0 +margin_bottom = 40.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_right = 193.0 +margin_bottom = 40.0 +custom_constants/separation = -4 + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"] +margin_right = 193.0 +margin_bottom = 31.0 +mouse_filter = 2 +custom_constants/margin_right = 17 +custom_constants/margin_top = 11 +custom_constants/margin_left = 8 +custom_constants/margin_bottom = 5 + +[node name="Content" type="RichTextLabel" parent="VBoxContainer/MarginContainer"] +margin_left = 8.0 +margin_top = 11.0 +margin_right = 176.0 +margin_bottom = 26.0 +mouse_filter = 1 +bbcode_enabled = true +fit_content_height = true + +[node name="ReferenceLabel" type="Label" parent="VBoxContainer/MarginContainer"] +self_modulate = Color( 1, 1, 1, 0 ) +margin_left = 8.0 +margin_top = 11.0 +margin_right = 176.0 +margin_bottom = 25.0 +text = "[Content]" + +[node name="ContentFitTextEdit" type="TextEdit" parent="VBoxContainer/MarginContainer"] +margin_left = 8.0 +margin_top = 11.0 +margin_right = 176.0 +margin_bottom = 26.0 +context_menu_enabled = false +virtual_keyboard_enabled = false +wrap_enabled = true +caret_blink = true +script = ExtResource( 3 ) +height_addition = 4 +expand_width = true +width_addition = 10 +confirm_on_focus_exit = true + +[node name="PopupMenu" type="PopupMenu" parent="."] +margin_right = 193.0 +margin_bottom = 40.0 + +[connection signal="confirmed" from="VBoxContainer/MarginContainer/ContentFitTextEdit" to="." method="_on_text_edit_confirmed"] +[connection signal="id_pressed" from="PopupMenu" to="." method="_on_popup_menu_id_pressed"] diff --git a/user_interface/utility_controls/profile_image_rect.tscn b/user_interface/utility_controls/profile_image_rect.tscn new file mode 100644 index 0000000..1d90d6e --- /dev/null +++ b/user_interface/utility_controls/profile_image_rect.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://user_interface/utility_controls/profile_image_rect_mask.png" type="Texture" id=1] + +[sub_resource type="Shader" id=1] +code = "shader_type canvas_item; +render_mode blend_mix; + +uniform sampler2D mask; + +void fragment() { + COLOR = texture(TEXTURE, UV) * vec4(vec3(1.0), texture(mask, UV).r); +}" + +[sub_resource type="ShaderMaterial" id=2] +shader = SubResource( 1 ) +shader_param/mask = ExtResource( 1 ) + +[node name="ProfileImageRect" type="TextureRect"] +material = SubResource( 2 ) +margin_right = 40.0 +margin_bottom = 40.0 +rect_min_size = Vector2( 48, 48 ) +texture = ExtResource( 1 ) +expand = true +stretch_mode = 1 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/assets/textures/profilepicture/shape.png b/user_interface/utility_controls/profile_image_rect_mask.png similarity index 100% rename from assets/textures/profilepicture/shape.png rename to user_interface/utility_controls/profile_image_rect_mask.png diff --git a/assets/textures/profilepicture/shape.png.import b/user_interface/utility_controls/profile_image_rect_mask.png.import similarity index 65% rename from assets/textures/profilepicture/shape.png.import rename to user_interface/utility_controls/profile_image_rect_mask.png.import index 7200163..c4ff487 100644 --- a/assets/textures/profilepicture/shape.png.import +++ b/user_interface/utility_controls/profile_image_rect_mask.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.stex" +path="res://.import/profile_image_rect_mask.png-db03cd01e096622e62acb2146ceb8303.stex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/profilepicture/shape.png" -dest_files=[ "res://.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.stex" ] +source_file="res://user_interface/utility_controls/profile_image_rect_mask.png" +dest_files=[ "res://.import/profile_image_rect_mask.png-db03cd01e096622e62acb2146ceb8303.stex" ] [params]