mess of changes

This commit is contained in:
Axsajim 2022-04-19 08:24:57 -04:00
parent 8d0931f19d
commit b7b49c81e9
63 changed files with 1179 additions and 311 deletions

@ -0,0 +1,3 @@
source_md5="8d73edfee105bd3ad210fa2c862a3972"
dest_md5="6c170633e4146bf363cbac64997a01f5"

Binary file not shown.

@ -0,0 +1,3 @@
source_md5="0be71e4a3f3003fa0a57ab68d5a11d9e"
dest_md5="b30b9ea337e43a4056ba6381c9715218"

Binary file not shown.

@ -0,0 +1,3 @@
source_md5="8d73edfee105bd3ad210fa2c862a3972"
dest_md5="da277aa6b9ea71c2a760eeb2af6cefa2"

Binary file not shown.

@ -0,0 +1,3 @@
source_md5="1e39735d90edd4ada48e200ae89237a8"
dest_md5="fefc7220661c77b03c385234b93d5dc1"

@ -0,0 +1,3 @@
source_md5="1e39735d90edd4ada48e200ae89237a8"
dest_md5="fefc7220661c77b03c385234b93d5dc1"

Binary file not shown.

@ -0,0 +1,3 @@
source_md5="f22f3d8ef152307565cbf4014e01ff6e"
dest_md5="ff5ab25eb8150b54056caf04c497554a"

@ -0,0 +1,3 @@
source_md5="1e39735d90edd4ada48e200ae89237a8"
dest_md5="fefc7220661c77b03c385234b93d5dc1"

@ -1,3 +1,3 @@
source_md5="47313fa4c47a9963fddd764e1ec6e4a8" source_md5="e5d3288a900b6d4421e9d3937d08ab5e"
dest_md5="26ea799ea0a3da9e753b3ebe822e0570" dest_md5="cc45eda6d302c77d5e7d876bb1d30a13"

@ -0,0 +1,3 @@
source_md5="7ac917032afeec8a7824e5472cf13638"
dest_md5="6930cf1e3a1ddce048f1fc4dc82e656d"

Binary file not shown.

@ -0,0 +1,3 @@
source_md5="6a0879affdd3ff3272b40d2b876c493a"
dest_md5="786aedb5f9921c46dec8adf5d5d80443"

Binary file not shown.

@ -0,0 +1,3 @@
source_md5="3e46c68a686c87959e97519c25a35e46"
dest_md5="c25d3e0fc261f6ed19218d9c837850f4"

@ -0,0 +1,3 @@
source_md5="ceec25b08b0d0ebb65b34989f2ac10b2"
dest_md5="34ea352b537e79967ccf8d818710414f"

@ -0,0 +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]
[resource]
size = 12
use_mipmaps = true
use_filter = true
font_data = ExtResource( 1 )

@ -0,0 +1,8 @@
[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 )

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 463 B

@ -2,15 +2,15 @@
importer="texture" importer="texture"
type="StreamTexture" type="StreamTexture"
path="res://.import/sendedmessage.png-1993f79a450b61f8cc85cf448c69010c.stex" path="res://.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.stex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/textures/sendedmessage.png" source_file="res://assets/textures/bg1.png"
dest_files=[ "res://.import/sendedmessage.png-1993f79a450b61f8cc85cf448c69010c.stex" ] dest_files=[ "res://.import/bg1.png-2d9bbad5f625762ac0af49d7ca55a8a6.stex" ]
[params] [params]

Before

Width:  |  Height:  |  Size: 427 B

After

Width:  |  Height:  |  Size: 427 B

@ -2,15 +2,15 @@
importer="texture" importer="texture"
type="StreamTexture" type="StreamTexture"
path="res://.import/receivedmessage.png-d95d8fd9495e2ef27a08219e22416dff.stex" path="res://.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.stex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/textures/receivedmessage.png" source_file="res://assets/textures/bg2.png"
dest_files=[ "res://.import/receivedmessage.png-d95d8fd9495e2ef27a08219e22416dff.stex" ] dest_files=[ "res://.import/bg2.png-037ea2aab7e76c11ac02a64d0acebd69.stex" ]
[params] [params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/profilepicture/1.jpg"
dest_files=[ "res://.import/1.jpg-7276ac5cb19c72f2df421cd60bf4c086.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 KiB

@ -0,0 +1,37 @@
[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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/profilepicture/shape.png"
dest_files=[ "res://.import/shape.png-8ea81c746be02ee8ccedc5a6d73f5cb5.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=false
svg/scale=1.0

@ -0,0 +1,8 @@
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);
}

BIN
assets/ui/icons/off.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/icons/off.png"
dest_files=[ "res://.import/off.png-f8f2df2e86728445b5ee9dc41ada0725.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

BIN
assets/ui/icons/on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/on.png-4bc6a2158c537328d87921ed56daf94b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/icons/on.png"
dest_files=[ "res://.import/on.png-4bc6a2158c537328d87921ed56daf94b.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

BIN
assets/ui/icons/plus0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/icons/plus0.png"
dest_files=[ "res://.import/plus0.png-f742ef172b1b3261c3f4f94612adc002.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

@ -16,12 +16,7 @@ corner_radius_top_right = 15
corner_radius_bottom_right = 15 corner_radius_bottom_right = 15
corner_radius_bottom_left = 15 corner_radius_bottom_left = 15
[sub_resource type="StyleBoxFlat" id=8] [sub_resource type="StyleBoxEmpty" id=10]
bg_color = Color( 0.121569, 0.137255, 0.160784, 1 )
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
[sub_resource type="StyleBoxFlat" id=7] [sub_resource type="StyleBoxFlat" id=7]
bg_color = Color( 0.184314, 0.203922, 0.239216, 1 ) bg_color = Color( 0.184314, 0.203922, 0.239216, 1 )
@ -35,6 +30,7 @@ corner_radius_bottom_right = 10
corner_radius_bottom_left = 5 corner_radius_bottom_left = 5
[sub_resource type="DynamicFont" id=3] [sub_resource type="DynamicFont" id=3]
size = 17
use_mipmaps = true use_mipmaps = true
use_filter = true use_filter = true
font_data = ExtResource( 1 ) font_data = ExtResource( 1 )
@ -43,7 +39,7 @@ font_data = ExtResource( 1 )
default_font = SubResource( 3 ) default_font = SubResource( 3 )
Panel/styles/panel = SubResource( 5 ) Panel/styles/panel = SubResource( 5 )
PanelContainer/styles/panel = SubResource( 6 ) PanelContainer/styles/panel = SubResource( 6 )
TextEdit/styles/normal = SubResource( 8 ) TextEdit/styles/normal = SubResource( 10 )
Tree/styles/bg = SubResource( 7 ) Tree/styles/bg = SubResource( 7 )
VScrollBar/styles/grabber = SubResource( 9 ) VScrollBar/styles/grabber = SubResource( 9 )
VScrollBar/styles/grabber_highlight = SubResource( 9 ) VScrollBar/styles/grabber_highlight = SubResource( 9 )

@ -28,38 +28,21 @@ texture = ExtResource( 2 )
expand = true expand = true
stretch_mode = 5 stretch_mode = 5
[node name="VBoxContainer" type="MarginContainer" parent="."] [node name="VBoxContainer2" type="VBoxContainer" parent="."]
margin_left = 69.0 margin_left = 69.0
margin_right = 246.0 margin_right = 246.0
margin_bottom = 65.0 margin_bottom = 94.0
size_flags_horizontal = 0
size_flags_vertical = 3
custom_constants/margin_top = 10
custom_constants/margin_left = 10
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer"]
margin_left = 10.0
margin_top = 10.0
margin_right = 177.0
margin_bottom = 58.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 2 size_flags_vertical = 2
custom_constants/separation = 5 custom_constants/separation = 5
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/VBoxContainer"] [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer2"]
margin_right = 167.0 margin_right = 177.0
margin_bottom = 19.0
size_flags_vertical = 3
custom_constants/margin_left = 5
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/MarginContainer"]
margin_left = 5.0
margin_right = 167.0
margin_bottom = 19.0 margin_bottom = 19.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/MarginContainer/HBoxContainer"] [node name="Label" type="Label" parent="VBoxContainer2/HBoxContainer"]
margin_right = 65.0 margin_right = 65.0
margin_bottom = 19.0 margin_bottom = 19.0
size_flags_vertical = 3 size_flags_vertical = 3
@ -67,9 +50,9 @@ custom_fonts/font = SubResource( 1 )
text = "Bluejim" text = "Bluejim"
valign = 1 valign = 1
[node name="Label2" type="Label" parent="VBoxContainer/VBoxContainer/MarginContainer/HBoxContainer"] [node name="Label2" type="Label" parent="VBoxContainer2/HBoxContainer"]
margin_left = 69.0 margin_left = 69.0
margin_right = 162.0 margin_right = 177.0
margin_bottom = 19.0 margin_bottom = 19.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
@ -77,10 +60,16 @@ text = "Today at 05:59"
align = 2 align = 2
valign = 1 valign = 1
[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer/VBoxContainer"] [node name="MarginContainer" type="MarginContainer" parent="VBoxContainer2"]
margin_top = 24.0 margin_top = 24.0
margin_right = 167.0 margin_right = 177.0
margin_bottom = 48.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_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
texture = ExtResource( 1 ) texture = ExtResource( 1 )
@ -92,17 +81,28 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="RichTextLabel" type="Label" parent="VBoxContainer/VBoxContainer/NinePatchRect"] [node name="MarginContainer (Force Fill_Expand)" type="MarginContainer" parent="VBoxContainer2/MarginContainer"]
anchor_left = 0.5 margin_right = 177.0
anchor_top = 0.5 margin_bottom = 70.0
anchor_right = 0.5 custom_constants/margin_right = 5
anchor_bottom = 0.5 custom_constants/margin_top = 5
margin_left = -60.5 custom_constants/margin_left = 16
margin_top = -7.0 custom_constants/margin_bottom = 5
margin_right = 61.5
margin_bottom = 7.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Received Message."
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_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

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

364
main.tscn

@ -1,14 +1,17 @@
[gd_scene load_steps=14 format=2] [gd_scene load_steps=21 format=2]
[ext_resource path="res://assets/ui/mainTheme.tres" type="Theme" id=1] [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://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/textures/jimsito.png" type="Texture" id=3]
[ext_resource path="res://assets/ui/sendedMessage.tscn" type="PackedScene" id=4] [ext_resource path="res://assets/fonts/Helvetica/Helvetica-Oblique.ttf" type="DynamicFontData" id=4]
[ext_resource path="res://assets/ui/receivedMessage.tscn" type="PackedScene" id=5] [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://assets/ui/icons/call0.png" type="Texture" id=6]
[ext_resource path="res://treecontrolling.gd" type="Script" id=7] [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/call01.png" type="Texture" id=8]
[ext_resource path="res://assets/ui/icons/call1.png" type="Texture" id=9] [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]
[sub_resource type="StyleBoxFlat" id=15] [sub_resource type="StyleBoxFlat" id=15]
bg_color = Color( 0.0823529, 0.101961, 0.133333, 1 ) bg_color = Color( 0.0823529, 0.101961, 0.133333, 1 )
@ -23,18 +26,39 @@ corner_radius_top_left = 10
corner_radius_top_right = 10 corner_radius_top_right = 10
[sub_resource type="DynamicFont" id=14] [sub_resource type="DynamicFont" id=14]
size = 24
use_mipmaps = true use_mipmaps = true
use_filter = true use_filter = true
font_data = ExtResource( 2 ) font_data = ExtResource( 2 )
[node name="Control" type="Control"] [sub_resource type="DynamicFont" id=17]
size = 24
use_mipmaps = true
use_filter = true
font_data = ExtResource( 4 )
[sub_resource type="StyleBoxFlat" id=18]
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 = 10
[sub_resource type="StyleBoxEmpty" id=19]
[sub_resource type="StyleBoxEmpty" id=20]
[node name="core" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
theme = ExtResource( 1 ) theme = ExtResource( 1 )
script = ExtResource( 10 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
main_input_path = NodePath("Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer/VBoxContainer/HBoxContainer/MarginContainer/TextEdit")
message_scroller_path = NodePath("Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer")
message_container_path = NodePath("Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/messageContainer")
username_label_path = NodePath("Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile/UserTexts/Label")
[node name="Panel" type="Panel" parent="."] [node name="Panel" type="Panel" parent="."]
anchor_right = 1.0 anchor_right = 1.0
@ -60,88 +84,98 @@ __meta__ = {
[node name="Structure" type="VBoxContainer" parent="Panel/Margin"] [node name="Structure" type="VBoxContainer" parent="Panel/Margin"]
margin_left = 20.0 margin_left = 20.0
margin_top = 20.0 margin_top = 20.0
margin_right = 1157.0 margin_right = 1346.0
margin_bottom = 789.0 margin_bottom = 738.0
custom_constants/separation = 20 custom_constants/separation = 20
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Header" type="PanelContainer" parent="Panel/Margin/Structure"] [node name="Header" type="PanelContainer" parent="Panel/Margin/Structure"]
margin_right = 1137.0 margin_right = 1326.0
margin_bottom = 83.0 margin_bottom = 77.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/Margin/Structure/Header"]
margin_right = 1326.0
margin_bottom = 77.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 2
[node name="Body" type="HBoxContainer" parent="Panel/Margin/Structure"] [node name="Body" type="HBoxContainer" parent="Panel/Margin/Structure"]
margin_top = 103.0 margin_top = 97.0
margin_right = 1137.0 margin_right = 1326.0
margin_bottom = 769.0 margin_bottom = 718.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 8.0 size_flags_stretch_ratio = 8.0
custom_constants/separation = 20 custom_constants/separation = 20
[node name="SidePanel" type="PanelContainer" parent="Panel/Margin/Structure/Body"] [node name="SidePanel" type="PanelContainer" parent="Panel/Margin/Structure/Body"]
margin_right = 279.0 margin_right = 288.0
margin_bottom = 666.0 margin_bottom = 621.0
rect_min_size = Vector2( 279, 0 ) rect_min_size = Vector2( 279, 0 )
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 2.0 size_flags_stretch_ratio = 1.7
custom_styles/panel = SubResource( 16 ) custom_styles/panel = SubResource( 16 )
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel"] [node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel"]
margin_right = 279.0 margin_right = 288.0
margin_bottom = 666.0 margin_bottom = 621.0
[node name="Margin" type="MarginContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer"] [node name="Margin" type="MarginContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer"]
margin_right = 279.0 margin_right = 288.0
margin_bottom = 588.0 margin_bottom = 548.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 8.0 size_flags_stretch_ratio = 8.0
[node name="Structure" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin"] [node name="Structure" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin"]
margin_right = 279.0 margin_right = 288.0
margin_bottom = 588.0 margin_bottom = 548.0
[node name="Panel" type="Panel" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure"] [node name="Panel" type="Panel" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure"]
margin_right = 279.0 margin_right = 288.0
margin_bottom = 83.0 margin_bottom = 77.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_styles/panel = SubResource( 9 ) custom_styles/panel = SubResource( 9 )
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure"] [node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure"]
margin_top = 87.0 margin_top = 81.0
margin_right = 279.0 margin_right = 288.0
margin_bottom = 588.0 margin_bottom = 548.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 6.0 size_flags_stretch_ratio = 6.0
script = ExtResource( 7 ) script = ExtResource( 7 )
[node name="Tree" type="Tree" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure/VBoxContainer"] [node name="Tree" type="Tree" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure/VBoxContainer"]
margin_right = 279.0 margin_right = 288.0
margin_bottom = 248.0 margin_bottom = 231.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Tree2" type="Tree" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure/VBoxContainer"] [node name="Tree2" type="Tree" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/Margin/Structure/VBoxContainer"]
margin_top = 252.0 margin_top = 235.0
margin_right = 279.0 margin_right = 288.0
margin_bottom = 501.0 margin_bottom = 467.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="UserToolbox" type="PanelContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer"] [node name="UserToolbox" type="PanelContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer"]
margin_top = 592.0 margin_top = 552.0
margin_right = 279.0 margin_right = 288.0
margin_bottom = 666.0 margin_bottom = 621.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Margin" type="MarginContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox"] [node name="Margin" type="MarginContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox"]
margin_right = 279.0 margin_right = 288.0
margin_bottom = 74.0 margin_bottom = 69.0
custom_constants/margin_right = 10 custom_constants/margin_right = 10
custom_constants/margin_top = 10 custom_constants/margin_top = 10
custom_constants/margin_left = 10 custom_constants/margin_left = 10
@ -150,57 +184,51 @@ custom_constants/margin_bottom = 10
[node name="Structure" type="HBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin"] [node name="Structure" type="HBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin"]
margin_left = 10.0 margin_left = 10.0
margin_top = 10.0 margin_top = 10.0
margin_right = 269.0 margin_right = 278.0
margin_bottom = 64.0 margin_bottom = 59.0
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure"] [node name="Profile" type="HBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure"]
margin_right = 170.0 margin_right = 147.0
margin_bottom = 54.0 margin_bottom = 49.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 2.0 size_flags_stretch_ratio = 4.0
custom_constants/separation = 10 custom_constants/separation = 10
[node name="TextureRect" type="TextureRect" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/HBoxContainer"] [node name="UserProfile" type="TextureRect" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile"]
margin_right = 53.0 margin_right = 58.0
margin_bottom = 54.0 margin_bottom = 49.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 1.5
texture = ExtResource( 3 ) texture = ExtResource( 3 )
expand = true expand = true
stretch_mode = 6 stretch_mode = 6
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/HBoxContainer"] [node name="UserTexts" type="VBoxContainer" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile"]
margin_left = 63.0 margin_left = 68.0
margin_right = 170.0 margin_right = 147.0
margin_bottom = 54.0 margin_bottom = 49.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 2.0 size_flags_stretch_ratio = 2.0
alignment = 1 alignment = 1
[node name="Label" type="Label" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"] [node name="Label" type="Label" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/Profile/UserTexts"]
margin_right = 107.0 margin_right = 79.0
margin_bottom = 25.0 margin_bottom = 49.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_fonts/font = SubResource( 14 ) custom_fonts/font = SubResource( 14 )
text = "Axsajim" text = "asdasd"
valign = 1 valign = 1
autowrap = true
clip_text = true
[node name="Label2" type="Label" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"] [node name="CallButton" type="TextureButton" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure"]
margin_top = 29.0 margin_left = 151.0
margin_right = 107.0 margin_right = 187.0
margin_bottom = 54.0 margin_bottom = 49.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "WORKMODE"
valign = 1
[node name="Panel" type="TextureButton" parent="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure"]
margin_left = 174.0
margin_right = 259.0
margin_bottom = 54.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
texture_normal = ExtResource( 6 ) texture_normal = ExtResource( 6 )
@ -209,160 +237,148 @@ texture_hover = ExtResource( 8 )
expand = true expand = true
stretch_mode = 5 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
size_flags_stretch_ratio = 0.5
custom_fonts/font = SubResource( 17 )
custom_icons/off = ExtResource( 5 )
custom_icons/on = ExtResource( 11 )
align = 1
expand_icon = true
[node name="ChatPanel" type="PanelContainer" parent="Panel/Margin/Structure/Body"] [node name="ChatPanel" type="PanelContainer" parent="Panel/Margin/Structure/Body"]
margin_left = 299.0 margin_left = 308.0
margin_right = 1137.0 margin_right = 1326.0
margin_bottom = 666.0 margin_bottom = 621.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 6.0 size_flags_stretch_ratio = 6.0
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel"] [node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel"]
margin_right = 838.0 margin_right = 1018.0
margin_bottom = 666.0 margin_bottom = 621.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="MarginContainer" type="MarginContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer"] [node name="MarginContainer" type="MarginContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer"]
margin_right = 838.0 margin_right = 1018.0
margin_bottom = 588.0 margin_bottom = 548.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 8.0 size_flags_stretch_ratio = 8.0
custom_constants/margin_right = 70 custom_constants/margin_right = 20
custom_constants/margin_top = 20 custom_constants/margin_top = 10
custom_constants/margin_left = 35 custom_constants/margin_left = 10
custom_constants/margin_bottom = 35 custom_constants/margin_bottom = 10
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer"] [node name="ScrollContainer" type="ScrollContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer"]
margin_left = 35.0 margin_left = 10.0
margin_top = 20.0 margin_top = 10.0
margin_right = 768.0 margin_right = 998.0
margin_bottom = 553.0 margin_bottom = 538.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
scroll_horizontal_enabled = false scroll_horizontal_enabled = false
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer"] [node name="messageContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer"]
margin_right = 721.0 margin_right = 988.0
margin_bottom = 617.0 margin_bottom = 528.0
focus_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_constants/separation = 20
[node name="receivedMessage" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 5 )] [node name="PanelContainer" type="Panel" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer"]
margin_right = 721.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="sendedMessage" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 4 )]
anchor_left = 0.0
anchor_right = 0.0
margin_left = 0.0
margin_top = 69.0
margin_right = 721.0
margin_bottom = 134.0
rect_scale = Vector2( 1, 1 )
size_flags_horizontal = 3
[node name="sendedMessage2" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 4 )]
anchor_left = 0.0
anchor_right = 0.0
margin_left = 0.0
margin_top = 138.0
margin_right = 721.0
margin_bottom = 203.0
rect_scale = Vector2( 1, 1 )
size_flags_horizontal = 3
[node name="sendedMessage4" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 4 )]
anchor_left = 0.0
anchor_right = 0.0
margin_left = 0.0
margin_top = 207.0
margin_right = 721.0
margin_bottom = 272.0
rect_scale = Vector2( 1, 1 )
size_flags_horizontal = 3
[node name="receivedMessage2" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 5 )]
margin_top = 276.0
margin_right = 721.0
margin_bottom = 341.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="receivedMessage3" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 5 )]
margin_top = 345.0
margin_right = 721.0
margin_bottom = 410.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="receivedMessage5" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 5 )]
margin_top = 414.0
margin_right = 721.0
margin_bottom = 479.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="sendedMessage3" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 4 )]
anchor_left = 0.0
anchor_right = 0.0
margin_left = 0.0
margin_top = 483.0
margin_right = 721.0
margin_bottom = 548.0
rect_scale = Vector2( 1, 1 )
size_flags_horizontal = 3
[node name="receivedMessage4" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/MarginContainer/ScrollContainer/VBoxContainer" instance=ExtResource( 5 )]
margin_top = 552.0 margin_top = 552.0
margin_right = 721.0 margin_right = 1018.0
margin_bottom = 617.0 margin_bottom = 621.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_styles/panel = SubResource( 18 )
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer"] [node name="HBoxContainer" type="HBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer"]
margin_top = 592.0 margin_right = 1018.0
margin_right = 838.0 margin_bottom = 69.0
margin_bottom = 666.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="InputContainer" type="PanelContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/HBoxContainer"] [node name="InputContainer" type="PanelContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer"]
margin_right = 741.0 margin_right = 921.0
margin_bottom = 74.0 margin_bottom = 69.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 8.0 size_flags_stretch_ratio = 10.0
custom_styles/panel = SubResource( 19 )
[node name="MarginContainer" type="MarginContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/HBoxContainer/InputContainer"] [node name="MarginContainer" type="MarginContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer"]
margin_right = 741.0 margin_right = 921.0
margin_bottom = 74.0 margin_bottom = 69.0
custom_constants/margin_right = 10 custom_constants/margin_right = 10
custom_constants/margin_top = 10 custom_constants/margin_top = 10
custom_constants/margin_left = 10 custom_constants/margin_left = 10
custom_constants/margin_bottom = 10 custom_constants/margin_bottom = 10
[node name="TextEdit" type="TextEdit" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/HBoxContainer/InputContainer/MarginContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer"]
margin_left = 10.0 margin_left = 10.0
margin_top = 10.0 margin_top = 10.0
margin_right = 731.0 margin_right = 911.0
margin_bottom = 64.0 margin_bottom = 59.0
text = "Message"
[node name="TimerConainer" type="PanelContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/HBoxContainer"] [node name="HBoxContainer" type="HBoxContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer/VBoxContainer"]
margin_left = 745.0 margin_right = 901.0
margin_right = 838.0 margin_bottom = 49.0
margin_bottom = 74.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Label" type="Label" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/HBoxContainer/TimerConainer"] [node name="UploadButton" type="TextureButton" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer/VBoxContainer/HBoxContainer"]
margin_right = 50.0
margin_bottom = 49.0
rect_min_size = Vector2( 50, 0 )
texture_normal = ExtResource( 12 )
expand = true
stretch_mode = 5
[node name="MarginContainer" type="MarginContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer/VBoxContainer/HBoxContainer"]
margin_left = 54.0
margin_right = 901.0
margin_bottom = 49.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_top = 13
custom_constants/margin_left = 10
custom_constants/margin_bottom = 10
[node name="TextEdit" type="TextEdit" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer/VBoxContainer/HBoxContainer/MarginContainer"]
margin_left = 10.0
margin_top = 13.0
margin_right = 847.0
margin_bottom = 39.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_colors/font_color = Color( 0.72549, 0.733333, 0.745098, 1 )
text = "Message"
[node name="TimerConainer" type="PanelContainer" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer"]
margin_left = 925.0
margin_right = 1018.0
margin_bottom = 69.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_styles/panel = SubResource( 20 )
[node name="Label" type="Label" parent="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/TimerConainer"]
margin_right = 93.0 margin_right = 93.0
margin_bottom = 74.0 margin_bottom = 69.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
text = "00:00:00" text = "00:00:00"
align = 1 align = 1
valign = 1 valign = 1
[connection signal="toggled" from="Panel/Margin/Structure/Body/SidePanel/VBoxContainer/UserToolbox/Margin/Structure/CheckButton" to="." method="_on_CheckButton_toggled"]
[connection signal="pressed" from="Panel/Margin/Structure/Body/ChatPanel/VBoxContainer/PanelContainer/HBoxContainer/InputContainer/MarginContainer/VBoxContainer/HBoxContainer/UploadButton" to="." method="_on_UploadButton_pressed"]

@ -8,16 +8,32 @@
config_version=4 config_version=4
_global_script_classes=[ {
"base": "Resource",
"class": "Message",
"language": "GDScript",
"path": "res://system/message/message.gd"
}, {
"base": "Resource",
"class": "User",
"language": "GDScript",
"path": "res://system/users/user.gd"
} ]
_global_script_class_icons={
"Message": "",
"User": ""
}
[application] [application]
config/name="Diary" config/name="SelfMessenger"
run/main_scene="res://main.tscn" run/main_scene="res://main.tscn"
config/icon="res://icon.png" config/icon="res://icon.png"
[display] [display]
window/size/width=1177 window/size/width=1366
window/size/height=819 window/size/height=768
[physics] [physics]

120
system/Message.gd Normal file

@ -0,0 +1,120 @@
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()

11
system/Message.tscn Normal file

@ -0,0 +1,11 @@
[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
}

206
system/core.gd Normal file

@ -0,0 +1,206 @@
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)

@ -1 +0,0 @@
extends Control

10
system/message/message.gd Normal file

@ -0,0 +1,10 @@
extends Resource
class_name Message
export(String, "user1", "user2") var user
export var date = ""
export(String) var content
export(Texture) var profile_picture

@ -0,0 +1,11 @@
[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 )

@ -81,80 +81,80 @@ __meta__ = {
[node name="Structure" type="VBoxContainer" parent="Margin"] [node name="Structure" type="VBoxContainer" parent="Margin"]
margin_left = 20.0 margin_left = 20.0
margin_top = 20.0 margin_top = 20.0
margin_right = 1346.0 margin_right = 1157.0
margin_bottom = 738.0 margin_bottom = 789.0
custom_constants/separation = 20 custom_constants/separation = 20
[node name="Header" type="PanelContainer" parent="Margin/Structure"] [node name="Header" type="PanelContainer" parent="Margin/Structure"]
margin_right = 1326.0 margin_right = 1137.0
margin_bottom = 67.0 margin_bottom = 72.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Body" type="HBoxContainer" parent="Margin/Structure"] [node name="Body" type="HBoxContainer" parent="Margin/Structure"]
margin_top = 87.0 margin_top = 92.0
margin_right = 1326.0 margin_right = 1137.0
margin_bottom = 630.0 margin_bottom = 676.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 8.0 size_flags_stretch_ratio = 8.0
custom_constants/separation = 20 custom_constants/separation = 20
[node name="SidePanel" type="PanelContainer" parent="Margin/Structure/Body"] [node name="SidePanel" type="PanelContainer" parent="Margin/Structure/Body"]
margin_right = 326.0 margin_right = 279.0
margin_bottom = 543.0 margin_bottom = 584.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 2.0 size_flags_stretch_ratio = 2.0
[node name="Margin" type="MarginContainer" parent="Margin/Structure/Body/SidePanel"] [node name="Margin" type="MarginContainer" parent="Margin/Structure/Body/SidePanel"]
margin_right = 326.0 margin_right = 279.0
margin_bottom = 543.0 margin_bottom = 584.0
[node name="Structure" type="VBoxContainer" parent="Margin/Structure/Body/SidePanel/Margin"] [node name="Structure" type="VBoxContainer" parent="Margin/Structure/Body/SidePanel/Margin"]
margin_right = 326.0 margin_right = 279.0
margin_bottom = 543.0 margin_bottom = 584.0
[node name="Panel" type="Panel" parent="Margin/Structure/Body/SidePanel/Margin/Structure"] [node name="Panel" type="Panel" parent="Margin/Structure/Body/SidePanel/Margin/Structure"]
margin_right = 326.0 margin_right = 279.0
margin_bottom = 77.0 margin_bottom = 82.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_styles/panel = SubResource( 9 ) custom_styles/panel = SubResource( 9 )
[node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Body/SidePanel/Margin/Structure"] [node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Body/SidePanel/Margin/Structure"]
margin_top = 81.0 margin_top = 86.0
margin_right = 326.0 margin_right = 279.0
margin_bottom = 543.0 margin_bottom = 584.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 6.0 size_flags_stretch_ratio = 6.0
custom_constants/separation = 20 custom_constants/separation = 20
[node name="Tree" type="Tree" parent="Margin/Structure/Body/SidePanel/Margin/Structure/VBoxContainer"] [node name="Tree" type="Tree" parent="Margin/Structure/Body/SidePanel/Margin/Structure/VBoxContainer"]
margin_right = 326.0 margin_right = 279.0
margin_bottom = 221.0 margin_bottom = 239.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Tree2" type="Tree" parent="Margin/Structure/Body/SidePanel/Margin/Structure/VBoxContainer"] [node name="Tree2" type="Tree" parent="Margin/Structure/Body/SidePanel/Margin/Structure/VBoxContainer"]
margin_top = 241.0 margin_top = 259.0
margin_right = 326.0 margin_right = 279.0
margin_bottom = 462.0 margin_bottom = 498.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="ChatPanel" type="PanelContainer" parent="Margin/Structure/Body"] [node name="ChatPanel" type="PanelContainer" parent="Margin/Structure/Body"]
margin_left = 346.0 margin_left = 299.0
margin_right = 1326.0 margin_right = 1137.0
margin_bottom = 543.0 margin_bottom = 584.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 6.0 size_flags_stretch_ratio = 6.0
[node name="MarginContainer" type="MarginContainer" parent="Margin/Structure/Body/ChatPanel"] [node name="MarginContainer" type="MarginContainer" parent="Margin/Structure/Body/ChatPanel"]
margin_right = 980.0 margin_right = 838.0
margin_bottom = 543.0 margin_bottom = 584.0
custom_constants/margin_right = 70 custom_constants/margin_right = 70
custom_constants/margin_top = 20 custom_constants/margin_top = 20
custom_constants/margin_left = 35 custom_constants/margin_left = 35
@ -163,49 +163,44 @@ custom_constants/margin_bottom = 35
[node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Body/ChatPanel/MarginContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Body/ChatPanel/MarginContainer"]
margin_left = 35.0 margin_left = 35.0
margin_top = 20.0 margin_top = 20.0
margin_right = 910.0 margin_right = 768.0
margin_bottom = 508.0 margin_bottom = 549.0
[node name="receivedMessage" type="HBoxContainer" parent="Margin/Structure/Body/ChatPanel/MarginContainer/VBoxContainer" instance=ExtResource( 5 )] [node name="receivedMessage" parent="Margin/Structure/Body/ChatPanel/MarginContainer/VBoxContainer" instance=ExtResource( 5 )]
modulate = Color( 0.478431, 0.752941, 1, 1 ) margin_right = 733.0
margin_right = 875.0 margin_bottom = 262.0
margin_bottom = 242.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="sendedMessage" type="HBoxContainer" parent="Margin/Structure/Body/ChatPanel/MarginContainer/VBoxContainer" instance=ExtResource( 4 )] [node name="sendedMessage" parent="Margin/Structure/Body/ChatPanel/MarginContainer/VBoxContainer" instance=ExtResource( 4 )]
margin_top = 246.0 anchor_left = 0.0
margin_right = 875.0 anchor_right = 0.0
margin_bottom = 488.0 margin_left = 0.0
rect_pivot_offset = Vector2( -375, -163 ) margin_top = 266.0
margin_right = 733.0
margin_bottom = 529.0
rect_scale = Vector2( 1, 1 )
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Footer" type="HBoxContainer" parent="Margin/Structure"] [node name="Footer" type="HBoxContainer" parent="Margin/Structure"]
margin_top = 650.0 margin_top = 696.0
margin_right = 1326.0 margin_right = 1137.0
margin_bottom = 718.0 margin_bottom = 769.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_constants/separation = 20 custom_constants/separation = 20
[node name="UserToolbox" type="PanelContainer" parent="Margin/Structure/Footer"] [node name="UserToolbox" type="PanelContainer" parent="Margin/Structure/Footer"]
margin_right = 329.0 margin_right = 281.0
margin_bottom = 68.0 margin_bottom = 73.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 3.1 size_flags_stretch_ratio = 3.1
[node name="Margin" type="MarginContainer" parent="Margin/Structure/Footer/UserToolbox"] [node name="Margin" type="MarginContainer" parent="Margin/Structure/Footer/UserToolbox"]
margin_right = 329.0 margin_right = 281.0
margin_bottom = 68.0 margin_bottom = 73.0
custom_constants/margin_right = 10 custom_constants/margin_right = 10
custom_constants/margin_top = 10 custom_constants/margin_top = 10
custom_constants/margin_left = 10 custom_constants/margin_left = 10
@ -214,20 +209,20 @@ custom_constants/margin_bottom = 10
[node name="Structure" type="HBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin"] [node name="Structure" type="HBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin"]
margin_left = 10.0 margin_left = 10.0
margin_top = 10.0 margin_top = 10.0
margin_right = 319.0 margin_right = 271.0
margin_bottom = 58.0 margin_bottom = 63.0
[node name="HBoxContainer" type="HBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure"] [node name="HBoxContainer" type="HBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure"]
margin_right = 203.0 margin_right = 171.0
margin_bottom = 48.0 margin_bottom = 53.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 2.0 size_flags_stretch_ratio = 2.0
custom_constants/separation = 10 custom_constants/separation = 10
[node name="TextureRect" type="TextureRect" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer"] [node name="TextureRect" type="TextureRect" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer"]
margin_right = 64.0 margin_right = 51.0
margin_bottom = 48.0 margin_bottom = 53.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
texture = ExtResource( 3 ) texture = ExtResource( 3 )
@ -235,16 +230,16 @@ expand = true
stretch_mode = 6 stretch_mode = 6
[node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer"]
margin_left = 74.0 margin_left = 61.0
margin_right = 203.0 margin_right = 171.0
margin_bottom = 48.0 margin_bottom = 53.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 2.0 size_flags_stretch_ratio = 2.0
alignment = 1 alignment = 1
[node name="Label" type="Label" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"] [node name="Label" type="Label" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"]
margin_right = 129.0 margin_right = 110.0
margin_bottom = 25.0 margin_bottom = 25.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
@ -254,32 +249,32 @@ valign = 1
[node name="Label2" type="Label" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"] [node name="Label2" type="Label" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure/HBoxContainer/VBoxContainer"]
margin_top = 29.0 margin_top = 29.0
margin_right = 129.0 margin_right = 110.0
margin_bottom = 48.0 margin_bottom = 53.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
text = "WORKMODE" text = "WORKMODE"
valign = 1 valign = 1
[node name="Panel" type="Button" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure"] [node name="Panel" type="Button" parent="Margin/Structure/Footer/UserToolbox/Margin/Structure"]
margin_left = 207.0 margin_left = 175.0
margin_right = 309.0 margin_right = 261.0
margin_bottom = 48.0 margin_bottom = 53.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
text = "Call" text = "Call"
[node name="InputContainer" type="PanelContainer" parent="Margin/Structure/Footer"] [node name="InputContainer" type="PanelContainer" parent="Margin/Structure/Footer"]
margin_left = 349.0 margin_left = 301.0
margin_right = 1199.0 margin_right = 1026.0
margin_bottom = 68.0 margin_bottom = 73.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
size_flags_stretch_ratio = 8.0 size_flags_stretch_ratio = 8.0
[node name="MarginContainer" type="MarginContainer" parent="Margin/Structure/Footer/InputContainer"] [node name="MarginContainer" type="MarginContainer" parent="Margin/Structure/Footer/InputContainer"]
margin_right = 850.0 margin_right = 725.0
margin_bottom = 68.0 margin_bottom = 73.0
custom_constants/margin_right = 30 custom_constants/margin_right = 30
custom_constants/margin_top = 20 custom_constants/margin_top = 20
custom_constants/margin_left = 30 custom_constants/margin_left = 30
@ -288,20 +283,20 @@ custom_constants/margin_bottom = 20
[node name="TextEdit" type="TextEdit" parent="Margin/Structure/Footer/InputContainer/MarginContainer"] [node name="TextEdit" type="TextEdit" parent="Margin/Structure/Footer/InputContainer/MarginContainer"]
margin_left = 30.0 margin_left = 30.0
margin_top = 20.0 margin_top = 20.0
margin_right = 820.0 margin_right = 695.0
margin_bottom = 48.0 margin_bottom = 53.0
text = "Message" text = "Message"
[node name="TimerConainer" type="PanelContainer" parent="Margin/Structure/Footer"] [node name="TimerConainer" type="PanelContainer" parent="Margin/Structure/Footer"]
margin_left = 1219.0 margin_left = 1046.0
margin_right = 1326.0 margin_right = 1137.0
margin_bottom = 68.0 margin_bottom = 73.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
[node name="Label" type="Label" parent="Margin/Structure/Footer/TimerConainer"] [node name="Label" type="Label" parent="Margin/Structure/Footer/TimerConainer"]
margin_right = 107.0 margin_right = 91.0
margin_bottom = 68.0 margin_bottom = 73.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
text = "00:00:00" text = "00:00:00"

195
system/ping/ping.gd Normal file

@ -0,0 +1,195 @@
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)

@ -0,0 +1,9 @@
[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 )

@ -0,0 +1,9 @@
[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 )

5
system/users/user.gd Normal file

@ -0,0 +1,5 @@
extends Resource
class_name User
export(String) var username
export(Texture) var picture