mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
Added UI
This commit is contained in:
parent
7e15294443
commit
9812b07374
@ -4,11 +4,13 @@ var player_master = null
|
||||
var ui = null
|
||||
var alive_players = []
|
||||
|
||||
|
||||
func instance_node_at_location(node: Object, parent: Object, location: Vector2) -> Object:
|
||||
var node_instance = instance_node(node, parent)
|
||||
node_instance.global_position = location
|
||||
return node_instance
|
||||
|
||||
|
||||
func instance_node(node: Object, parent: Object) -> Object:
|
||||
var node_instance = node.instance()
|
||||
parent.add_child(node_instance)
|
||||
|
||||
@ -1,29 +1,94 @@
|
||||
extends Control
|
||||
|
||||
var player = load("res://source/entities/player/player_node.tscn")
|
||||
|
||||
var current_spawn_location_instance_number = 1
|
||||
var current_player_for_spawn_location_number = null
|
||||
var player = load("res://source/entities/player/player_node.tscn")
|
||||
|
||||
export onready var username_text_edit = $multiplayer_configure/username_text_edit
|
||||
onready var multiplayer_config_ui = $multiplayer_configure
|
||||
onready var username_text_edit = $multiplayer_configure/username_text_edit
|
||||
|
||||
onready var device_ip_address = $UI/device_ip_address
|
||||
onready var start_game = $UI/start_game
|
||||
onready var background_lobby = $background_lobby
|
||||
onready var text = $UI/text
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("esc"):
|
||||
get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn")
|
||||
func _ready() -> void:
|
||||
background_lobby.hide()
|
||||
device_ip_address.hide()
|
||||
text.hide()
|
||||
|
||||
get_tree().connect("network_peer_connected", self, "_player_connected")
|
||||
get_tree().connect("network_peer_disconnected", self, "_player_disconnected")
|
||||
get_tree().connect("connected_to_server", self, "_connected_to_server")
|
||||
|
||||
device_ip_address.text = Network.ip_address
|
||||
|
||||
if get_tree().network_peer != null:
|
||||
multiplayer_config_ui.hide()
|
||||
background_lobby.show()
|
||||
device_ip_address.show()
|
||||
text.show()
|
||||
current_spawn_location_instance_number = 1
|
||||
for player in PersistentNodes.get_children():
|
||||
if player.is_in_group("Player"):
|
||||
for spawn_location in $spawn_locations.get_children():
|
||||
if int(spawn_location.name) == current_spawn_location_instance_number and current_player_for_spawn_location_number != player:
|
||||
player.rpc("update_position", spawn_location.global_position)
|
||||
player.rpc("enable")
|
||||
current_spawn_location_instance_number += 1
|
||||
current_player_for_spawn_location_number = player
|
||||
else:
|
||||
start_game.hide()
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if get_tree().network_peer != null:
|
||||
if get_tree().get_network_connected_peers().size() >= 0 and get_tree().is_network_server():
|
||||
start_game.show()
|
||||
else:
|
||||
start_game.hide()
|
||||
|
||||
|
||||
func _player_connected(id) -> void:
|
||||
print("Player " + str(id) + " has connected")
|
||||
instance_player(id)
|
||||
|
||||
|
||||
func _player_disconnected(id) -> void:
|
||||
print("Player " + str(id) + " has disconnected")
|
||||
|
||||
if PersistentNodes.has_node(str(id)):
|
||||
PersistentNodes.get_node(str(id)).username_text_instance.queue_free()
|
||||
PersistentNodes.get_node(str(id)).queue_free()
|
||||
|
||||
func _on_create_server_pressed():
|
||||
if username_text_edit.text != "":
|
||||
Network.current_player_username = username_text_edit.text
|
||||
multiplayer_config_ui.hide()
|
||||
device_ip_address.show()
|
||||
background_lobby.show()
|
||||
text.show()
|
||||
Network.create_server()
|
||||
get_tree().change_scene("res://source/scenes/GUI/lobby.tscn")
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
|
||||
|
||||
func _on_join_server_pressed():
|
||||
if username_text_edit.text != "":
|
||||
multiplayer_config_ui.hide()
|
||||
username_text_edit.hide()
|
||||
Global.instance_node(load("res://source/scenes/GUI/server_handlers/server_browser.tscn"), self)
|
||||
|
||||
|
||||
func _connected_to_server() -> void:
|
||||
yield(get_tree().create_timer(0.1), "timeout")
|
||||
device_ip_address.show()
|
||||
background_lobby.show()
|
||||
text.show()
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
|
||||
|
||||
func instance_player(id) -> void:
|
||||
var player_instance = Global.instance_node_at_location(player, PersistentNodes, get_node("spawn_locations/" + str(current_spawn_location_instance_number)).global_position)
|
||||
player_instance.name = str(id)
|
||||
@ -32,9 +97,17 @@ func instance_player(id) -> void:
|
||||
current_spawn_location_instance_number += 1
|
||||
|
||||
|
||||
func _on_start_game_pressed():
|
||||
rpc("switch_to_game")
|
||||
|
||||
|
||||
sync func switch_to_game() -> void:
|
||||
for child in PersistentNodes.get_children():
|
||||
if child.is_in_group("Player"):
|
||||
child.update_shoot_mode(true)
|
||||
|
||||
get_tree().change_scene("res://source/levels/trinity_site/trinity_site_level.tscn")
|
||||
|
||||
|
||||
func _on_return_pressed():
|
||||
get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn")
|
||||
|
||||
|
||||
func enter_username():
|
||||
pass
|
||||
|
||||
@ -2,7 +2,7 @@ extends Control
|
||||
|
||||
onready var server_listener = $server_listener
|
||||
onready var server_ip_text_edit = $background_panel/server_ip_text_edit
|
||||
onready var server_container = $controls/VBoxContainer
|
||||
onready var server_container = $controls/background_panel/VBoxContainer
|
||||
onready var manual_setup_button = $controls/manual_setup/Label
|
||||
onready var background_panel = $background_panel
|
||||
|
||||
@ -14,8 +14,6 @@ func _ready() -> void:
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("esc") and background_panel.is_visible_in_tree():
|
||||
background_panel.hide()
|
||||
elif Input.is_action_just_pressed("esc") and not background_panel.is_visible_in_tree():
|
||||
get_tree().change_scene("res://source/scenes/GUI/network_setup.tscn")
|
||||
|
||||
|
||||
func _on_server_listener_new_server(serverInfo):
|
||||
@ -45,4 +43,4 @@ func _on_join_server_pressed():
|
||||
|
||||
|
||||
func _on_return_pressed():
|
||||
get_tree().change_scene("res://source/scenes/GUI/network_setup.tscn")
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
@ -6,4 +6,4 @@ var ip_address = ""
|
||||
func _on_join_button_pressed():
|
||||
Network.ip_address = ip_address
|
||||
Network.join_server()
|
||||
get_parent().get_parent().queue_free()
|
||||
get_parent().get_parent().get_parent().get_parent().queue_free()
|
||||
|
||||
@ -1,77 +0,0 @@
|
||||
extends Node2D
|
||||
|
||||
var player = load("res://source/entities/player/player_node.tscn")
|
||||
|
||||
|
||||
var min_players = 2
|
||||
var current_spawn_location_instance_number = 1
|
||||
var current_player_for_spawn_location_number = null
|
||||
|
||||
onready var multiplayer_config_ui = $multiplayer_configure
|
||||
onready var device_ip_address = $background/background_lobby/Control/device_ip_address
|
||||
onready var start_game = $UI/start_game
|
||||
|
||||
|
||||
func _ready():
|
||||
get_tree().connect("network_peer_connected", self, "_player_connected")
|
||||
get_tree().connect("network_peer_disconnected", self, "_player_disconnected")
|
||||
get_tree().connect("connected_to_server", self, "_connected_to_server")
|
||||
|
||||
device_ip_address.text = Network.ip_address
|
||||
|
||||
if get_tree().network_peer != null:
|
||||
|
||||
current_spawn_location_instance_number = 1
|
||||
for player in PersistentNodes.get_children():
|
||||
if player.is_in_group("Player"):
|
||||
for spawn_location in $spawn_locations.get_children():
|
||||
if int(spawn_location.name) == current_spawn_location_instance_number and current_player_for_spawn_location_number != player:
|
||||
player.rpc("update_position", spawn_location.global_position)
|
||||
player.rpc("enable")
|
||||
current_spawn_location_instance_number += 1
|
||||
current_player_for_spawn_location_number = player
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if get_tree().network_peer != null:
|
||||
if get_tree().get_network_connected_peers().size() >= (min_players - 1) and get_tree().is_network_server():
|
||||
start_game.show()
|
||||
else:
|
||||
start_game.hide()
|
||||
|
||||
|
||||
func _player_connected(id) -> void:
|
||||
print("Player " + str(id) + " has connected")
|
||||
instance_player(id)
|
||||
|
||||
|
||||
func _player_disconnected(id) -> void:
|
||||
print("Player " + str(id) + " has disconnected")
|
||||
if PersistentNodes.has_node(str(id)):
|
||||
PersistentNodes.get_node(str(id)).username_text_instance.queue_free()
|
||||
PersistentNodes.get_node(str(id)).queue_free()
|
||||
|
||||
|
||||
func _connected_to_server() -> void:
|
||||
yield(get_tree().create_timer(0.1), "timeout")
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
|
||||
|
||||
func instance_player(id) -> void:
|
||||
var player_instance = Global.instance_node_at_location(player, PersistentNodes, get_node("spawn_locations/" + str(current_spawn_location_instance_number)).global_position)
|
||||
player_instance.name = str(id)
|
||||
player_instance.set_network_master(id)
|
||||
#player_instance.username = username_text_edit.text
|
||||
current_spawn_location_instance_number += 1
|
||||
|
||||
|
||||
func _on_start_game_pressed():
|
||||
rpc("switch_to_game")
|
||||
|
||||
|
||||
sync func switch_to_game() -> void:
|
||||
for child in PersistentNodes.get_children():
|
||||
if child.is_in_group("Player"):
|
||||
child.update_shoot_mode(true)
|
||||
|
||||
get_tree().change_scene("res://source/levels/trinity_site/trinity_site_level.tscn")
|
||||
@ -1,7 +1,7 @@
|
||||
extends Label
|
||||
|
||||
sync func return_to_lobby():
|
||||
get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn")
|
||||
get_tree().change_scene("res://source/scenes/GUI/network_setup.tscn")
|
||||
|
||||
|
||||
func _on_win_timer_timeout():
|
||||
|
||||
@ -24,9 +24,9 @@
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:zoom="1.587419"
|
||||
inkscape:cx="196.23049"
|
||||
inkscape:cy="197.4904"
|
||||
inkscape:zoom="0.28061869"
|
||||
inkscape:cx="201.34083"
|
||||
inkscape:cy="685.98426"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1007"
|
||||
inkscape:window-x="1920"
|
||||
@ -62,7 +62,7 @@
|
||||
inkscape:export-ydpi="96"
|
||||
style="stroke-width:0.264583" />
|
||||
<g
|
||||
transform="matrix(0.3951543,0,0,0.4420098,-4.2333333,0)"
|
||||
transform="matrix(0.3951543,0,0,0.45446078,-4.2333333,0)"
|
||||
fill="#201831"
|
||||
stroke="#418df2"
|
||||
stroke-width="10"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
@ -1,5 +0,0 @@
|
||||
extends Position2D
|
||||
|
||||
|
||||
func _process(delta):
|
||||
look_at(get_global_mouse_position())
|
||||
@ -47,7 +47,6 @@ z_index = 1
|
||||
texture = ExtResource( 44 )
|
||||
|
||||
[node name="trinity_site_level_layout-level_design_z-index_-2-version_ct_f_hd_3840_2160 – 025" type="Sprite" parent="trinity_site_body/trinity_site_level_layout-level_design_z-index_-2-version_ct_f_hd_3840_2160 – 01"]
|
||||
visible = false
|
||||
position = Vector2( -275.886, 3244.16 )
|
||||
rotation = -1.01229
|
||||
texture = ExtResource( 45 )
|
||||
@ -107,11 +106,11 @@ z_index = -3
|
||||
[node name="spawn_locations" type="Node" parent="."]
|
||||
|
||||
[node name="1" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 460, 540 )
|
||||
position = Vector2( 260, 540 )
|
||||
z_index = 1
|
||||
|
||||
[node name="2" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 260, 540 )
|
||||
position = Vector2( 460, 540 )
|
||||
z_index = 1
|
||||
|
||||
[node name="3" type="Position2D" parent="spawn_locations"]
|
||||
@ -156,6 +155,6 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="win_timer" type="Timer" parent="game_UI/Control/winner"]
|
||||
wait_time = 60.0
|
||||
wait_time = 4.0
|
||||
|
||||
[connection signal="timeout" from="game_UI/Control/winner/win_timer" to="game_UI/Control/winner" method="_on_win_timer_timeout"]
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://source/scenes/OVERLAY/elements/floor.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://source/assets/sprites/GUI/background_main_menu.svg" type="Texture" id=6]
|
||||
[ext_resource path="res://source/entities/menu_player/player_node.tscn" type="PackedScene" id=11]
|
||||
|
||||
[node name="background" type="Node2D"]
|
||||
|
||||
@ -17,6 +16,3 @@ __meta__ = {
|
||||
|
||||
[node name="floor" parent="." instance=ExtResource( 5 )]
|
||||
position = Vector2( 960, 1016 )
|
||||
|
||||
[node name="player" parent="." instance=ExtResource( 11 )]
|
||||
position = Vector2( 408, 872 )
|
||||
|
||||
@ -1,127 +0,0 @@
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://source/assets/sprites/GUI/background_lobby.svg" type="Texture" id=1]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=2]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Regular.ttf" type="DynamicFontData" id=3]
|
||||
[ext_resource path="res://source/scenes/OVERLAY/elements/floor.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://source/scenes/OVERLAY/elements/button.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://source/assets/scripts/ui_element_handlers/UI.gd" type="Script" id=6]
|
||||
[ext_resource path="res://source/fonts/oxygen/oxygen_regular.tres" type="DynamicFont" id=7]
|
||||
[ext_resource path="res://source/assets/scripts/ui_element_handlers/lobby.gd" type="Script" id=8]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 88
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 22
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 3 )
|
||||
|
||||
[node name="lobby" type="Node2D"]
|
||||
script = ExtResource( 8 )
|
||||
|
||||
[node name="background" type="Node2D" parent="."]
|
||||
|
||||
[node name="background_lobby" type="Sprite" parent="background"]
|
||||
position = Vector2( 960, 540 )
|
||||
texture = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Control" type="Control" parent="background/background_lobby"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -960.0
|
||||
margin_top = -540.0
|
||||
margin_right = -960.0
|
||||
margin_bottom = -540.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="device_ip_address" type="Label" parent="background/background_lobby/Control"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -319.0
|
||||
margin_top = -56.0
|
||||
margin_right = 319.0
|
||||
margin_bottom = 56.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 0.439216, 0.666667, 1, 0.27451 )
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="text" type="Label" parent="background/background_lobby/Control"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -116.5
|
||||
margin_top = 60.0
|
||||
margin_right = 116.5
|
||||
margin_bottom = 89.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_colors/font_color = Color( 0.439216, 0.666667, 1, 0.27451 )
|
||||
text = "WAITING FOR PLAYERS"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="floor" parent="background" instance=ExtResource( 4 )]
|
||||
position = Vector2( 960, 1016 )
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
script = ExtResource( 6 )
|
||||
|
||||
[node name="start_game" parent="UI" instance=ExtResource( 5 )]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -150.0
|
||||
margin_top = 100.0
|
||||
margin_right = 150.0
|
||||
margin_bottom = 172.0
|
||||
|
||||
[node name="Label" type="Label" parent="UI/start_game"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -74.5
|
||||
margin_top = -32.0
|
||||
margin_right = 74.5
|
||||
margin_bottom = 32.0
|
||||
custom_fonts/font = ExtResource( 7 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "START"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="spawn_locations" type="Node" parent="."]
|
||||
|
||||
[node name="1" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 384, 860 )
|
||||
|
||||
[node name="2" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 768, 860 )
|
||||
|
||||
[node name="3" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 1152, 860 )
|
||||
|
||||
[node name="4" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 1536, 860 )
|
||||
|
||||
[connection signal="pressed" from="UI/start_game" to="." method="_on_start_game_pressed"]
|
||||
@ -1,5 +1,6 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://source/entities/menu_player/player_node.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://source/scenes/GUI/background.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://source/assets/sprites/GUI/lan_logo.svg" type="Texture" id=3]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=4]
|
||||
@ -23,6 +24,9 @@ __meta__ = {
|
||||
|
||||
[node name="background" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
[node name="player" parent="background" instance=ExtResource( 1 )]
|
||||
position = Vector2( 408, 872 )
|
||||
|
||||
[node name="foreground" type="Control" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
@ -1,11 +1,29 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
[gd_scene load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://source/assets/scripts/server_handlers/network_processors/network_setup.gd" type="Script" id=1]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Regular.ttf" type="DynamicFontData" id=2]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=3]
|
||||
[ext_resource path="res://source/fonts/roboto/roboto.tres" type="DynamicFont" id=4]
|
||||
[ext_resource path="res://source/scenes/GUI/background.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://source/scenes/OVERLAY/elements/floor.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://source/assets/sprites/GUI/lan_logo.svg" type="Texture" id=7]
|
||||
[ext_resource path="res://source/fonts/oxygen/oxygen_bold.tres" type="DynamicFont" id=8]
|
||||
[ext_resource path="res://source/scenes/OVERLAY/elements/button.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://source/fonts/oxygen/oxygen_regular.tres" type="DynamicFont" id=10]
|
||||
[ext_resource path="res://source/assets/scripts/ui_element_handlers/UI.gd" type="Script" id=11]
|
||||
[ext_resource path="res://source/assets/sprites/GUI/background_lobby.svg" type="Texture" id=12]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 88
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 3 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 22
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[node name="network_setup" type="Control"]
|
||||
anchor_right = 1.0
|
||||
@ -122,6 +140,100 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="background_lobby" type="Node2D" parent="."]
|
||||
z_index = -1
|
||||
|
||||
[node name="background_lobby" type="Sprite" parent="background_lobby"]
|
||||
position = Vector2( 960, 540 )
|
||||
texture = ExtResource( 12 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="floor" parent="background_lobby" instance=ExtResource( 6 )]
|
||||
position = Vector2( 960, 1016 )
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
script = ExtResource( 11 )
|
||||
|
||||
[node name="device_ip_address" type="Label" parent="UI"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -319.0
|
||||
margin_top = -56.0
|
||||
margin_right = 319.0
|
||||
margin_bottom = 56.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 0.439216, 0.666667, 1, 0.27451 )
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="text" type="Label" parent="UI"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -116.5
|
||||
margin_top = 60.0
|
||||
margin_right = 116.5
|
||||
margin_bottom = 89.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_colors/font_color = Color( 0.439216, 0.666667, 1, 0.27451 )
|
||||
text = "WAITING FOR PLAYERS"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="start_game" parent="UI" instance=ExtResource( 9 )]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -150.0
|
||||
margin_top = 100.0
|
||||
margin_right = 150.0
|
||||
margin_bottom = 172.0
|
||||
|
||||
[node name="Label" type="Label" parent="UI/start_game"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -74.5
|
||||
margin_top = -32.0
|
||||
margin_right = 74.5
|
||||
margin_bottom = 32.0
|
||||
custom_fonts/font = ExtResource( 10 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "START"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="spawn_locations" type="Node" parent="."]
|
||||
|
||||
[node name="1" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 384, 860 )
|
||||
|
||||
[node name="2" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 768, 860 )
|
||||
|
||||
[node name="3" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 1152, 860 )
|
||||
|
||||
[node name="4" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 1536, 860 )
|
||||
|
||||
[connection signal="pressed" from="multiplayer_configure/create_server" to="." method="_on_create_server_pressed"]
|
||||
[connection signal="pressed" from="multiplayer_configure/join_server" to="." method="_on_join_server_pressed"]
|
||||
[connection signal="pressed" from="multiplayer_configure/return" to="." method="_on_return_pressed"]
|
||||
[connection signal="pressed" from="UI/start_game" to="." method="_on_start_game_pressed"]
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=13 format=2]
|
||||
[gd_scene load_steps=12 format=2]
|
||||
|
||||
[ext_resource path="res://source/fonts/roboto/roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://source/scenes/GUI/server_handlers/server_listener.tscn" type="PackedScene" id=2]
|
||||
@ -8,21 +8,20 @@
|
||||
[ext_resource path="res://source/assets/sprites/GUI/server_title.svg" type="Texture" id=6]
|
||||
[ext_resource path="res://source/assets/sprites/GUI/button_disabled.svg" type="Texture" id=7]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Regular.ttf" type="DynamicFontData" id=8]
|
||||
[ext_resource path="res://source/fonts/oxygen/oxygen_regular.tres" type="DynamicFont" id=9]
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 36
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 8 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 32
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 8 )
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "searching_for_servers"
|
||||
length = 0.8
|
||||
loop = true
|
||||
@ -79,7 +78,7 @@ margin_bottom = -44.0
|
||||
[node name="Label" type="Label" parent="controls/manual_setup"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "MANUAL SETUP"
|
||||
align = 1
|
||||
@ -107,7 +106,7 @@ __meta__ = {
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 68.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 0.329412, 0.329412, 0.329412, 1 )
|
||||
text = "ONLINE"
|
||||
align = 1
|
||||
@ -125,7 +124,7 @@ margin_bottom = 656.0
|
||||
[node name="Label" type="Label" parent="controls/return"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "RETURN"
|
||||
align = 1
|
||||
@ -174,7 +173,7 @@ margin_left = -450.0
|
||||
margin_top = -64.0
|
||||
margin_bottom = 14.0
|
||||
rect_min_size = Vector2( 0, 70 )
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Searching for servers"
|
||||
align = 1
|
||||
@ -187,19 +186,18 @@ __meta__ = {
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="controls/background_panel/server_title/searching_for_servers"]
|
||||
autoplay = "searching_for_servers"
|
||||
playback_speed = 0.5
|
||||
anims/searching_for_servers = SubResource( 1 )
|
||||
|
||||
[node name="server_listener" parent="." instance=ExtResource( 2 )]
|
||||
anims/searching_for_servers = SubResource( 3 )
|
||||
|
||||
[node name="background_panel" type="Panel" parent="."]
|
||||
visible = false
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -960.0
|
||||
margin_top = -540.0
|
||||
margin_right = 960.0
|
||||
margin_bottom = 540.0
|
||||
margin_left = -480.0
|
||||
margin_top = -270.0
|
||||
margin_right = 480.0
|
||||
margin_bottom = 270.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@ -217,18 +215,11 @@ custom_fonts/font = ExtResource( 1 )
|
||||
custom_colors/selection_color = Color( 0.607843, 0.607843, 0.607843, 1 )
|
||||
custom_colors/cursor_color = Color( 1, 1, 1, 1 )
|
||||
align = 1
|
||||
placeholder_text = "Server IP"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="type_in_server_ip" type="Label" parent="background_panel/server_ip_text_edit"]
|
||||
anchor_right = 1.0
|
||||
margin_top = -105.0
|
||||
custom_fonts/font = ExtResource( 9 )
|
||||
text = "Type in server IP"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="join_server" parent="background_panel/server_ip_text_edit" instance=ExtResource( 4 )]
|
||||
margin_left = 255.623
|
||||
margin_top = 129.885
|
||||
@ -238,7 +229,7 @@ margin_bottom = 201.885
|
||||
[node name="Label" type="Label" parent="background_panel/server_ip_text_edit/join_server"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "JOIN SERVER"
|
||||
align = 1
|
||||
@ -247,8 +238,10 @@ __meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="server_listener" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
[connection signal="pressed" from="controls/manual_setup" to="." method="_on_manual_setup_pressed"]
|
||||
[connection signal="pressed" from="controls/return" to="." method="_on_return_pressed"]
|
||||
[connection signal="pressed" from="background_panel/server_ip_text_edit/join_server" to="." method="_on_join_server_pressed"]
|
||||
[connection signal="new_server" from="server_listener" to="." method="_on_server_listener_new_server"]
|
||||
[connection signal="remove_server" from="server_listener" to="." method="_on_server_listener_remove_server"]
|
||||
[connection signal="pressed" from="background_panel/server_ip_text_edit/join_server" to="." method="_on_join_server_pressed"]
|
||||
|
||||
@ -1,18 +1,30 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://source/fonts/roboto/roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Regular.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://source/assets/scripts/server_handlers/server_processors/server_display.gd" type="Script" id=2]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=3]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 24
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 36
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 3 )
|
||||
|
||||
[node name="server_display" type="Label" groups=[
|
||||
"Server_display",
|
||||
]]
|
||||
anchor_right = 1.0
|
||||
margin_right = -220.0
|
||||
margin_right = -1520.0
|
||||
margin_bottom = 130.0
|
||||
rect_min_size = Vector2( 0, 130 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "N/A: 000.000.000"
|
||||
align = 1
|
||||
valign = 1
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
@ -22,11 +34,9 @@ __meta__ = {
|
||||
[node name="join_button" type="Button" parent="."]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -302.0
|
||||
margin_top = 13.0
|
||||
margin_bottom = -13.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
margin_left = -100.0
|
||||
margin_bottom = 52.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
text = "Join"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
|
||||
@ -11,4 +11,5 @@ extents = Vector2( 960, 64 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
visible = false
|
||||
shape = SubResource( 1 )
|
||||
|
||||
@ -1,8 +1,14 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://source/fonts/roboto/roboto.tres" type="DynamicFont" id=1]
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://source/assets/scripts/ui_element_handlers/username_text.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 36
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="username_text" type="Node2D" groups=[
|
||||
"Net",
|
||||
]]
|
||||
@ -14,7 +20,7 @@ margin_left = -197.0
|
||||
margin_top = -125.0
|
||||
margin_right = 197.0
|
||||
margin_bottom = -49.0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "null"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user