- reworked Chat Panel system

- added user switching
- added Topic Panel functionality (features are missing)
- some basic refactoring
This commit is contained in:
mono 2022-05-14 20:51:48 +02:00
parent b7b49c81e9
commit 7d285bd607
168 changed files with 2536 additions and 1425 deletions

View File

@ -1 +0,0 @@

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +0,0 @@
source_md5="c2f8ee7e4013f01b8975066b1777efc3"
dest_md5="e6cfd3bf61f70ebbea21b68a617a8ea3"

View File

@ -1,3 +0,0 @@
source_md5="c2f8ee7e4013f01b8975066b1777efc3"
dest_md5="e6cfd3bf61f70ebbea21b68a617a8ea3"

View File

@ -1,3 +0,0 @@
source_md5="986d1626ecf7c000ffc9a56f80b2df64"
dest_md5="62bc505c9ab152918cacabee23655e14"

View File

@ -1,3 +0,0 @@
source_md5="11112eaa7cf69b157d1f7c8f2ce01bab"
dest_md5="8870411b528c6ffb49de9f8db6854cb5"

View File

@ -1,3 +0,0 @@
source_md5="e5d3288a900b6d4421e9d3937d08ab5e"
dest_md5="cc45eda6d302c77d5e7d876bb1d30a13"

View File

@ -1,3 +0,0 @@
source_md5="6218a7e4769821b59a77bed6d074a4e7"
dest_md5="77d9abc9b9c8784a62c114d61cf096b2"

View File

@ -1,3 +0,0 @@
source_md5="938ae33adfedfb81957ea0d3fd1bdb2c"
dest_md5="a0ddd5f392a99291648938b6874e70b1"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 KiB

View File

@ -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

View File

@ -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);
}

View File

@ -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 )

View File

@ -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

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -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]

View File

@ -0,0 +1,4 @@
extends Resource
class_name EmoteList
export(Array, String) var list # Each emote shortcut needs to be set here.

View File

@ -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" ]

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -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]

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -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]

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -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]

View File

@ -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 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -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

View File

@ -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 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -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

3
default_bus_layout.tres Normal file
View File

@ -0,0 +1,3 @@
[gd_resource type="AudioBusLayout" format=2]
[resource]

144
main.tscn
View File

@ -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 )

View File

@ -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]

BIN
sounds/message_denied.wav Normal file

Binary file not shown.

View File

@ -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

BIN
sounds/message_inserted.wav Normal file

Binary file not shown.

View File

@ -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

BIN
sounds/ping.wav Normal file

Binary file not shown.

21
sounds/ping.wav.import Normal file
View File

@ -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

View File

@ -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()

View File

@ -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
}

View File

@ -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."

View File

@ -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)

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 )

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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"]

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More