Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
derac committed Mar 10, 2020
1 parent ea0e7e5 commit 011f03e
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 132 deletions.
6 changes: 3 additions & 3 deletions Classes/1_Setup/By_IP_Button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ onready var Controls := [get_node("/root/Setup/Information/Address"),
get_node("/root/Setup/Controls/New")]

func _pressed() -> void:
if $By_IP_label.text == "cancel":
if text == "cancel":
Sound.play_sfx("res://Assets/SFX/on.wav", -3, .5)
$By_IP_label.text = "join\nby IP"
text = "by IP"
else:
Sound.play_sfx("res://Assets/SFX/on.wav", -3, .5)
$By_IP_label.text = "cancel"
text = "cancel"
for control in Controls:
control.set_visible(!control.is_visible())
3 changes: 1 addition & 2 deletions Classes/1_Setup/UDP_Players.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ func _on_udp_data_changed() -> void:
create_player_label(Global.udp_data[player], player)

# Test Data
# var udp_data = {"1": {"is_server": true, "name": "derek", "ip": "1", "port": "1"},
# "2": {"is_server": false, "name": "bob"},
# var udp_data = {"1": {"is_server": true, "name": "bob", "ip": "1", "port": "1"},
# "3": {"is_server": false, "name": "race"},
# "4": {"is_server": false, "name": "jeff"},
# "5": {"is_server": false, "name": "cody"},}
Expand Down
1 change: 0 additions & 1 deletion Classes/2_Lobby/Address.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ func set_address(address) -> void:
OS.set_clipboard(text)

func _pressed() -> void:
print("pressed")
text = "copied"
$Copy_Timer.start()

Expand Down
2 changes: 1 addition & 1 deletion Classes/3_Play/Color_Button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ func _ready() -> void:
func _pressed() -> void:
Sound.play_sfx("res://Assets/SFX/on.wav")
color_picker.color = color
get_parent().set_visible(false)
get_parent().get_parent().set_visible(false)
4 changes: 2 additions & 2 deletions Classes/3_Play/Play.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ onready var Title := $Controls/Title_Mask/Title

func _ready():
if OS.is_debug_build():
$my_name_test.set_visible(true)
$my_name_test.text = Global.my_name
$Name_Debug.set_visible(true)
$Name_Debug.text = Global.my_name

Sound.change_music("res://Assets/Music/play.ogg", 0, 25)
Sound.play_sfx("res://Assets/SFX/complete.wav", -6, .75)
Expand Down
136 changes: 68 additions & 68 deletions Screens/Lobby.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[ext_resource path="res://Classes/2_Lobby/UPNP_Box.gd" type="Script" id=9]
[ext_resource path="res://Classes/2_Lobby/Address.gd" type="Script" id=10]

[sub_resource type="StyleBoxFlat" id=12]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.960784, 0.945098, 0.929412, 1 )
draw_center = false
border_width_left = 20
Expand All @@ -25,7 +25,7 @@ corner_radius_bottom_right = 50
corner_radius_bottom_left = 50
shadow_color = Color( 0.952941, 0.843137, 0.329412, 1 )

[sub_resource type="StyleBoxFlat" id=13]
[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 0.960784, 0.945098, 0.929412, 1 )
draw_center = false
border_width_left = 20
Expand All @@ -39,12 +39,12 @@ corner_radius_bottom_right = 50
corner_radius_bottom_left = 50
shadow_color = Color( 0.952941, 0.843137, 0.329412, 1 )

[sub_resource type="DynamicFont" id=15]
[sub_resource type="DynamicFont" id=3]
size = 90
outline_color = Color( 0, 0, 0, 1 )
font_data = ExtResource( 1 )

[sub_resource type="StyleBoxFlat" id=3]
[sub_resource type="StyleBoxFlat" id=4]
bg_color = Color( 0.882353, 0.882353, 0.87451, 1 )
draw_center = false
border_width_left = 20
Expand All @@ -58,7 +58,7 @@ corner_radius_bottom_right = 50
corner_radius_bottom_left = 50
shadow_color = Color( 0.952941, 0.843137, 0.329412, 1 )

[sub_resource type="StyleBoxFlat" id=4]
[sub_resource type="StyleBoxFlat" id=5]
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
Expand All @@ -76,18 +76,18 @@ corner_radius_bottom_right = 50
corner_radius_bottom_left = 50
shadow_color = Color( 0.952941, 0.843137, 0.329412, 0 )

[sub_resource type="DynamicFont" id=5]
[sub_resource type="DynamicFont" id=6]
size = 50
outline_size = 5
outline_color = Color( 0, 0.529412, 0.317647, 1 )
font_data = ExtResource( 1 )

[sub_resource type="DynamicFont" id=6]
[sub_resource type="DynamicFont" id=7]
size = 60
outline_color = Color( 0.0392157, 0.0392157, 0.0392157, 1 )
font_data = ExtResource( 1 )

[sub_resource type="StyleBoxFlat" id=7]
[sub_resource type="StyleBoxFlat" id=8]
content_margin_left = 40.0
content_margin_right = 40.0
content_margin_top = 20.0
Expand All @@ -104,13 +104,19 @@ corner_radius_top_right = 50
corner_radius_bottom_right = 50
corner_radius_bottom_left = 50

[sub_resource type="DynamicFont" id=8]
[sub_resource type="DynamicFont" id=9]
size = 90
outline_size = 5
outline_color = Color( 0, 0.529412, 0.317647, 1 )
font_data = ExtResource( 1 )

[sub_resource type="StyleBoxFlat" id=9]
[sub_resource type="DynamicFont" id=13]
size = 90
outline_size = 5
outline_color = Color( 0, 0, 0, 1 )
font_data = ExtResource( 1 )

[sub_resource type="StyleBoxFlat" id=10]
bg_color = Color( 0.882353, 0.882353, 0.87451, 1 )
draw_center = false
border_width_left = 20
Expand All @@ -123,7 +129,7 @@ corner_radius_top_right = 50
corner_radius_bottom_right = 50
corner_radius_bottom_left = 50

[sub_resource type="StyleBoxFlat" id=10]
[sub_resource type="StyleBoxFlat" id=11]
bg_color = Color( 0.882353, 0.882353, 0.87451, 1 )
draw_center = false
border_width_left = 20
Expand All @@ -136,18 +142,12 @@ corner_radius_top_right = 50
corner_radius_bottom_right = 50
corner_radius_bottom_left = 50

[sub_resource type="DynamicFont" id=11]
[sub_resource type="DynamicFont" id=12]
size = 90
outline_size = 5
outline_color = Color( 1, 0, 0.301961, 1 )
font_data = ExtResource( 1 )

[sub_resource type="DynamicFont" id=14]
size = 90
outline_size = 5
outline_color = Color( 0, 0, 0, 1 )
font_data = ExtResource( 1 )

[node name="Lobby" type="HBoxContainer"]
margin_left = 10.0
margin_top = 10.0
Expand All @@ -174,11 +174,12 @@ margin_right = 1520.0
margin_bottom = 161.667
rect_min_size = Vector2( 0, 161.667 )
focus_mode = 0
custom_styles/hover = SubResource( 12 )
custom_styles/pressed = SubResource( 12 )
custom_styles/disabled = SubResource( 13 )
custom_styles/normal = SubResource( 13 )
custom_fonts/font = SubResource( 15 )
mouse_default_cursor_shape = 2
custom_styles/hover = SubResource( 1 )
custom_styles/pressed = SubResource( 1 )
custom_styles/disabled = SubResource( 2 )
custom_styles/normal = SubResource( 2 )
custom_fonts/font = SubResource( 3 )
custom_colors/font_color_disabled = Color( 0, 0, 0, 1 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
Expand Down Expand Up @@ -208,11 +209,11 @@ rect_pivot_offset = Vector2( 450, 210 )
mouse_default_cursor_shape = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 1.5
custom_styles/hover = SubResource( 3 )
custom_styles/pressed = SubResource( 3 )
custom_styles/disabled = SubResource( 4 )
custom_styles/normal = SubResource( 4 )
custom_fonts/font = SubResource( 5 )
custom_styles/hover = SubResource( 4 )
custom_styles/pressed = SubResource( 4 )
custom_styles/disabled = SubResource( 5 )
custom_styles/normal = SubResource( 5 )
custom_fonts/font = SubResource( 6 )
custom_colors/font_color_disabled = Color( 0, 0.894118, 0.211765, 1 )
custom_colors/font_color = Color( 0, 0.894118, 0.211765, 1 )
custom_colors/font_color_hover = Color( 0, 0.894118, 0.211765, 1 )
Expand All @@ -231,7 +232,7 @@ margin_bottom = 200.0
rect_min_size = Vector2( 0, 200 )
size_flags_horizontal = 3
custom_styles/normal = ExtResource( 8 )
custom_fonts/font = SubResource( 6 )
custom_fonts/font = SubResource( 7 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Forward UDP ports 30000-33000 with UPNP or manually. "
autowrap = true
Expand All @@ -243,8 +244,8 @@ __meta__ = {
margin_right = 1520.0
margin_bottom = 120.0
rect_min_size = Vector2( 0, 120 )
custom_styles/normal = SubResource( 7 )
custom_fonts/font = SubResource( 6 )
custom_styles/normal = SubResource( 8 )
custom_fonts/font = SubResource( 7 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Need 3 more players to start."
autowrap = true
Expand Down Expand Up @@ -275,20 +276,19 @@ __meta__ = {

[node name="Start" type="Button" parent="Controls"]
margin_right = 360.0
margin_bottom = 437.0
margin_bottom = 340.0
grow_horizontal = 0
grow_vertical = 0
rect_pivot_offset = Vector2( 450, 210 )
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 1.5
custom_styles/hover = ExtResource( 3 )
custom_styles/pressed = ExtResource( 3 )
custom_styles/disabled = SubResource( 4 )
custom_styles/normal = SubResource( 4 )
custom_fonts/font = SubResource( 8 )
custom_styles/disabled = SubResource( 5 )
custom_styles/normal = SubResource( 5 )
custom_fonts/font = SubResource( 9 )
custom_colors/font_color_disabled = Color( 0, 0.894118, 0.211765, 1 )
custom_colors/font_color = Color( 0, 0.894118, 0.211765, 1 )
custom_colors/font_color_hover = Color( 0, 0.894118, 0.211765, 1 )
Expand All @@ -303,45 +303,20 @@ __meta__ = {
[node name="Start_Timer" type="Timer" parent="Controls/Start"]
one_shot = true

[node name="Back" type="Button" parent="Controls"]
margin_top = 457.0
margin_right = 360.0
margin_bottom = 748.0
rect_pivot_offset = Vector2( 450, 210 )
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_styles/hover = SubResource( 9 )
custom_styles/pressed = SubResource( 9 )
custom_styles/disabled = SubResource( 10 )
custom_styles/normal = SubResource( 10 )
custom_fonts/font = SubResource( 11 )
custom_colors/font_color_disabled = Color( 1, 0.92549, 0.152941, 1 )
custom_colors/font_color = Color( 1, 0.92549, 0.152941, 1 )
custom_colors/font_color_hover = Color( 1, 0.92549, 0.152941, 1 )
custom_colors/font_color_pressed = Color( 1, 0.92549, 0.152941, 1 )
action_mode = 0
text = "back"
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="My_IP" type="Button" parent="Controls"]
margin_top = 768.0
margin_top = 360.0
margin_right = 360.0
margin_bottom = 1060.0
margin_bottom = 700.0
rect_pivot_offset = Vector2( 450, 210 )
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_styles/hover = SubResource( 12 )
custom_styles/pressed = SubResource( 12 )
custom_styles/disabled = SubResource( 13 )
custom_styles/normal = SubResource( 13 )
custom_fonts/font = SubResource( 14 )
custom_styles/hover = SubResource( 1 )
custom_styles/pressed = SubResource( 1 )
custom_styles/disabled = SubResource( 2 )
custom_styles/normal = SubResource( 2 )
custom_fonts/font = SubResource( 13 )
custom_colors/font_color_disabled = Color( 0.760784, 0.764706, 0.780392, 1 )
custom_colors/font_color = Color( 0.760784, 0.764706, 0.780392, 1 )
custom_colors/font_color_hover = Color( 0.760784, 0.764706, 0.780392, 1 )
Expand All @@ -358,6 +333,31 @@ wait_time = 0.5
one_shot = true

[node name="HTTPRequest" type="HTTPRequest" parent="Controls/My_IP"]

[node name="Back" type="Button" parent="Controls"]
margin_top = 720.0
margin_right = 360.0
margin_bottom = 1060.0
rect_pivot_offset = Vector2( 450, 210 )
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_styles/hover = SubResource( 10 )
custom_styles/pressed = SubResource( 10 )
custom_styles/disabled = SubResource( 11 )
custom_styles/normal = SubResource( 11 )
custom_fonts/font = SubResource( 12 )
custom_colors/font_color_disabled = Color( 1, 0.92549, 0.152941, 1 )
custom_colors/font_color = Color( 1, 0.92549, 0.152941, 1 )
custom_colors/font_color_hover = Color( 1, 0.92549, 0.152941, 1 )
custom_colors/font_color_pressed = Color( 1, 0.92549, 0.152941, 1 )
action_mode = 0
text = "back"
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="timeout" from="Information/Address/Copy_Timer" to="Information/Address" method="_on_Copy_Timer_timeout"]
[connection signal="timeout" from="Controls/Start/Start_Timer" to="Controls/Start" method="_on_Timer_timeout"]
[connection signal="timeout" from="Controls/My_IP/Copy_Timer" to="Controls/My_IP" method="_on_Copy_Timer_timeout"]
Expand Down
Loading

0 comments on commit 011f03e

Please sign in to comment.