mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
Added menu button
This commit is contained in:
parent
9a157b2284
commit
ca55ea4d5e
@ -69,6 +69,15 @@ func _server_disconnected() -> void:
|
||||
prompt.set_text("Disconnected from server")
|
||||
|
||||
|
||||
func _server_leave() -> void:
|
||||
print("Left the server")
|
||||
|
||||
for child in PersistentNodes.get_children():
|
||||
if child.is_in_group("Net"):
|
||||
child.queue_free()
|
||||
reset_network_connection()
|
||||
|
||||
|
||||
func _client_connection_timeout():
|
||||
if client_connected_to_server == false:
|
||||
print("Client has been timed out")
|
||||
|
||||
@ -15,6 +15,7 @@ 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
|
||||
onready var menu_botton = $UI/menu_button
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@ -22,6 +23,7 @@ func _ready() -> void:
|
||||
background_lobby.hide()
|
||||
device_ip_address.hide()
|
||||
text.hide()
|
||||
menu_botton.hide()
|
||||
|
||||
|
||||
get_tree().connect("network_peer_connected", self, "_player_connected")
|
||||
@ -90,9 +92,7 @@ func _on_join_server_pressed():
|
||||
|
||||
func _connected_to_server() -> void:
|
||||
yield(get_tree().create_timer(0.1), "timeout")
|
||||
device_ip_address.show()
|
||||
background_lobby.show()
|
||||
text.show()
|
||||
show_lobby()
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
|
||||
|
||||
@ -120,18 +120,22 @@ func _on_confirm_pressed():
|
||||
if mode == "create":
|
||||
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()
|
||||
show_lobby()
|
||||
Network.create_server()
|
||||
instance_player(get_tree().get_network_unique_id())
|
||||
elif mode == "join":
|
||||
if username_text_edit.text != "":
|
||||
multiplayer_config_ui.hide()
|
||||
Global.instance_node(load("res://source/scenes/GUI/server_handlers/server_browser.tscn"), self)
|
||||
|
||||
|
||||
func show_lobby():
|
||||
multiplayer_config_ui.hide()
|
||||
device_ip_address.show()
|
||||
background_lobby.show()
|
||||
text.show()
|
||||
menu_botton.show()
|
||||
|
||||
|
||||
func _on_return_pressed():
|
||||
get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn")
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ func _on_confirm_pressed():
|
||||
|
||||
|
||||
func instance_player(id) -> void:
|
||||
var player_instance = Global.instance_node_at_location(player, PersistentNodes, Vector2(960, 540))
|
||||
var player_instance = Global.instance_node_at_location(player, PersistentNodes, Vector2())
|
||||
player_instance.name = str(id)
|
||||
player_instance.set_network_master(id)
|
||||
player_instance.username = username_text_edit.text
|
||||
|
||||
@ -25,6 +25,7 @@ func setup_player_positions() -> void:
|
||||
func _player_disconnected(id) -> void:
|
||||
if PersistentNodes.has_node(str(id)):
|
||||
PersistentNodes.get_node(str(id)).username_text_instance.queue_free()
|
||||
PersistentNodes.get_node(str(id)).health_bar_instance.queue_free()
|
||||
PersistentNodes.get_node(str(id)).queue_free()
|
||||
|
||||
|
||||
|
||||
@ -27,6 +27,4 @@ func _process(delta):
|
||||
|
||||
|
||||
func _on_hitbox_body_entered(body):
|
||||
if body.is_in_group("mobs"):
|
||||
body.queue_free()
|
||||
queue_free()
|
||||
|
||||
@ -21,6 +21,4 @@ func _process(delta):
|
||||
|
||||
|
||||
func _on_hitbox_body_entered(body):
|
||||
if body.is_in_group("mobs"):
|
||||
body.queue_free()
|
||||
queue_free()
|
||||
|
||||
@ -30,6 +30,4 @@ func _process(delta):
|
||||
|
||||
|
||||
func _on_hitbox_body_entered(body):
|
||||
if body.is_in_group("mobs"):
|
||||
body.queue_free()
|
||||
queue_free()
|
||||
|
||||
@ -3,8 +3,8 @@ extends CanvasLayer
|
||||
# if 0, then singleplayer will work, if 1, then multiplayer only
|
||||
var winner_amount = 1
|
||||
|
||||
onready var win_timer = $Control/winner/win_timer
|
||||
onready var winner = $Control/winner
|
||||
onready var win_timer = $winner/win_timer
|
||||
onready var winner = $winner
|
||||
|
||||
func _ready() -> void:
|
||||
winner.hide()
|
||||
|
||||
@ -2,7 +2,7 @@ extends Control
|
||||
|
||||
|
||||
func _on_play_pressed():
|
||||
get_tree().change_scene("res://source/scenes/GUI/sinplayer_setup.tscn")
|
||||
get_tree().change_scene("res://source/scenes/GUI/singleplayer_setup.tscn")
|
||||
|
||||
|
||||
func _on_LAN_party_pressed():
|
||||
@ -11,3 +11,5 @@ func _on_LAN_party_pressed():
|
||||
|
||||
func _on_exit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
|
||||
8
source/assets/scripts/ui_element_handlers/menu_button.gd
Normal file
8
source/assets/scripts/ui_element_handlers/menu_button.gd
Normal file
@ -0,0 +1,8 @@
|
||||
extends TextureButton
|
||||
|
||||
#func _process(delta) -> void:
|
||||
# if Input.is_action_just_pressed("esc"):
|
||||
# Global.instance_node(load("res://source/scenes/OVERLAY/elements/menu_button_overlay.tscn"), Global.ui)
|
||||
|
||||
func _on_menu_button_pressed():
|
||||
Global.instance_node(load("res://source/scenes/OVERLAY/elements/menu_button_overlay.tscn"), Global.ui)
|
||||
@ -0,0 +1,27 @@
|
||||
extends Control
|
||||
|
||||
|
||||
func _process(delta) -> void:
|
||||
# print(str(self))
|
||||
if Input.is_action_just_pressed("esc"):
|
||||
hide()
|
||||
|
||||
|
||||
func _on_return_to_game_pressed():
|
||||
hide()
|
||||
|
||||
|
||||
func _on_return_to_main_menu_pressed():
|
||||
Network._server_leave()
|
||||
get_tree().change_scene("res://source/scenes/GUI/main_menu.tscn")
|
||||
|
||||
|
||||
func _on_exit_game_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _player_disconnected(id) -> void:
|
||||
if PersistentNodes.has_node(str(id)):
|
||||
PersistentNodes.get_node(str(id)).username_text_instance.queue_free()
|
||||
PersistentNodes.get_node(str(id)).health_bar_instance.queue_free()
|
||||
PersistentNodes.get_node(str(id)).queue_free()
|
||||
105
source/assets/sprites/GUI/menu_button.svg
Normal file
105
source/assets/sprites/GUI/menu_button.svg
Normal file
@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="50"
|
||||
height="50"
|
||||
viewBox="0 0 13.229166 13.229167"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
sodipodi:docname="menu_button.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:pageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
width="500px"
|
||||
inkscape:zoom="8.979798"
|
||||
inkscape:cx="17.093926"
|
||||
inkscape:cy="22.105174"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1007"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="44"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g3016" />
|
||||
<defs
|
||||
id="defs2" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g3016"
|
||||
transform="matrix(0.12499999,0,0,0.125,-1.653645,-1.653646)">
|
||||
<g
|
||||
id="g3482">
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3208"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3450"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3452"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3470"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3472"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3474"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
161
source/assets/sprites/GUI/menu_button_hover.svg
Normal file
161
source/assets/sprites/GUI/menu_button_hover.svg
Normal file
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="50"
|
||||
height="50"
|
||||
viewBox="0 0 13.229166 13.229167"
|
||||
version="1.1"
|
||||
id="svg3513"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
sodipodi:docname="menu_button_hover.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview3515"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:pageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:zoom="4.489899"
|
||||
inkscape:cx="-19.710911"
|
||||
inkscape:cy="15.47919"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1007"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="44"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs3510" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g3482"
|
||||
transform="matrix(0.12499999,0,0,0.125,-1.6536449,-1.653646)"
|
||||
style="fill:#b3b3b3;fill-opacity:1">
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3208"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3450"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3452"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3470"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3472"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3474"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
</g>
|
||||
<g
|
||||
id="g19319"
|
||||
transform="matrix(0.12499999,0,0,0.125,-1.6536449,-1.653646)"
|
||||
style="fill:#b3b3b3;fill-opacity:1">
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19307"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19309"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19311"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19313"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19315"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19317"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
161
source/assets/sprites/GUI/menu_button_pressed.svg
Normal file
161
source/assets/sprites/GUI/menu_button_pressed.svg
Normal file
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="50"
|
||||
height="50"
|
||||
viewBox="0 0 13.229166 13.229167"
|
||||
version="1.1"
|
||||
id="svg3513"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
sodipodi:docname="menu_button_pressed.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview3515"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#ffffff"
|
||||
borderopacity="1"
|
||||
inkscape:pageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="1"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:zoom="4.489899"
|
||||
inkscape:cx="-16.147357"
|
||||
inkscape:cy="13.920135"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1007"
|
||||
inkscape:window-x="1920"
|
||||
inkscape:window-y="44"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs3510" />
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g3482"
|
||||
transform="matrix(0.12499999,0,0,0.125,-1.6536449,-1.653646)"
|
||||
style="fill:#b3b3b3;fill-opacity:1">
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3208"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3450"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3452"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3470"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3472"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect3474"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
</g>
|
||||
<g
|
||||
id="g19319"
|
||||
transform="matrix(0.12499999,0,0,0.125,-1.6536449,-1.653646)"
|
||||
style="fill:#999999;fill-opacity:1">
|
||||
<rect
|
||||
style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19307"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19309"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19311"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19313"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.229161"
|
||||
y="55.5625"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19315"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="13.229168"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
<rect
|
||||
style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:9.85695;stroke-opacity:1"
|
||||
id="rect19317"
|
||||
width="105.83334"
|
||||
height="21.166666"
|
||||
x="13.22916"
|
||||
y="97.895836"
|
||||
rx="2.1166668"
|
||||
ry="2.1166668" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=15 format=2]
|
||||
[gd_scene load_steps=16 format=2]
|
||||
|
||||
[ext_resource path="res://source/assets/scripts/server_handlers/trinity_site_level.gd" type="Script" id=1]
|
||||
[ext_resource path="res://source/assets/scripts/ui_element_handlers/UI.gd" type="Script" id=2]
|
||||
@ -12,6 +12,7 @@
|
||||
[ext_resource path="res://source/levels/trinity_site/images/trinity_site_level_layout_level_design_z_index_2.svg" type="Texture" id=10]
|
||||
[ext_resource path="res://source/levels/trinity_site/images/trinity_site_level_layout_level_design_z_index_1.svg" type="Texture" id=11]
|
||||
[ext_resource path="res://source/fonts/oxygen/oxygen_bold.tres" type="DynamicFont" id=12]
|
||||
[ext_resource path="res://source/scenes/OVERLAY/elements/menu_button.tscn" type="PackedScene" id=13]
|
||||
[ext_resource path="res://source/assets/scripts/trinity_site_body_handler.gd" type="Script" id=46]
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
@ -149,16 +150,7 @@ script = ExtResource( 2 )
|
||||
[node name="game_UI" type="CanvasLayer" parent="."]
|
||||
script = ExtResource( 6 )
|
||||
|
||||
[node name="Control" type="Control" parent="game_UI"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 10 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="winner" type="Label" parent="game_UI/Control"]
|
||||
[node name="winner" type="Label" parent="game_UI"]
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
@ -179,61 +171,9 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="win_timer" type="Timer" parent="game_UI/Control/winner"]
|
||||
[node name="win_timer" type="Timer" parent="game_UI/winner"]
|
||||
wait_time = 4.0
|
||||
|
||||
[node name="Line" type="Button" parent="game_UI/Control"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 0.439999
|
||||
margin_top = -6.10352e-05
|
||||
margin_right = -0.200005
|
||||
text = "Line"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Sine" type="Button" parent="game_UI/Control"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 118.44
|
||||
margin_top = -6.10352e-05
|
||||
margin_right = 117.8
|
||||
text = "Sine"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Parab" type="Button" parent="game_UI/Control"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 233.44
|
||||
margin_top = -6.10352e-05
|
||||
margin_right = 232.8
|
||||
text = "Parabola"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Hyper" type="Button" parent="game_UI/Control"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 348.44
|
||||
margin_top = -6.10352e-05
|
||||
margin_right = 347.8
|
||||
text = "Hyperbola"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="timer" type="Label" parent="."]
|
||||
margin_right = 589.0
|
||||
margin_bottom = 175.0
|
||||
@ -245,6 +185,76 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="timeout" from="game_UI/Control/winner/win_timer" to="game_UI/Control/winner" method="_on_win_timer_timeout"]
|
||||
[connection signal="pressed" from="game_UI/Control/Line" to="game_UI/Control" method="_on_Line_pressed"]
|
||||
[connection signal="pressed" from="game_UI/Control/Sine" to="game_UI/Control" method="_on_Sine_pressed"]
|
||||
[node name="controls" type="Control" parent="."]
|
||||
margin_right = 1920.0
|
||||
margin_bottom = 1080.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="menu_button" parent="controls" instance=ExtResource( 13 )]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -70.0
|
||||
margin_top = 20.0
|
||||
margin_right = -20.0
|
||||
margin_bottom = 70.0
|
||||
focus_mode = 0
|
||||
|
||||
[node name="Line" type="Button" parent="controls"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 8.82419
|
||||
margin_top = -6.4104
|
||||
margin_right = 47.8242
|
||||
margin_bottom = 13.5896
|
||||
text = "Line"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Sine" type="Button" parent="controls"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 126.824
|
||||
margin_top = -6.4104
|
||||
margin_right = 165.824
|
||||
margin_bottom = 13.5896
|
||||
text = "Sine"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Parab" type="Button" parent="controls"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 241.824
|
||||
margin_top = -6.4104
|
||||
margin_right = 307.824
|
||||
margin_bottom = 13.5896
|
||||
text = "Parabola"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Hyper" type="Button" parent="controls"]
|
||||
anchor_left = 0.018
|
||||
anchor_top = 0.875
|
||||
anchor_right = 0.06
|
||||
anchor_bottom = 0.95
|
||||
margin_left = 356.824
|
||||
margin_top = -6.4104
|
||||
margin_right = 433.824
|
||||
margin_bottom = 13.5896
|
||||
text = "Hyperbola"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="timeout" from="game_UI/winner/win_timer" to="game_UI/winner" method="_on_win_timer_timeout"]
|
||||
|
||||
@ -50,8 +50,8 @@ margin_left = -150.0
|
||||
margin_top = -36.0
|
||||
margin_right = 150.0
|
||||
margin_bottom = 36.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
custom_fonts/font = ExtResource( 5 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "PLAY"
|
||||
align = 1
|
||||
valign = 1
|
||||
@ -75,8 +75,8 @@ margin_left = -98.8223
|
||||
margin_top = -36.0
|
||||
margin_right = 134.178
|
||||
margin_bottom = 36.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
custom_fonts/font = ExtResource( 5 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "LAN Party"
|
||||
align = 1
|
||||
valign = 1
|
||||
@ -107,8 +107,8 @@ margin_left = -150.0
|
||||
margin_top = -36.0
|
||||
margin_right = 150.0
|
||||
margin_bottom = 36.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
custom_fonts/font = ExtResource( 5 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "EXIT"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=21 format=2]
|
||||
[gd_scene load_steps=22 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/scenes/OVERLAY/elements/menu_button.tscn" type="PackedScene" 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]
|
||||
@ -333,6 +334,15 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="menu_button" parent="UI" instance=ExtResource( 4 )]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -70.0
|
||||
margin_top = 20.0
|
||||
margin_right = -20.0
|
||||
margin_bottom = 70.0
|
||||
focus_mode = 0
|
||||
|
||||
[node name="spawn_locations" type="Node" parent="."]
|
||||
|
||||
[node name="1" type="Position2D" parent="spawn_locations"]
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
[node name="TextureButton" type="TextureButton"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
focus_mode = 0
|
||||
enabled_focus_mode = 0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_pressed = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 2 )
|
||||
|
||||
20
source/scenes/OVERLAY/elements/menu_button.tscn
Normal file
20
source/scenes/OVERLAY/elements/menu_button.tscn
Normal file
@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://source/assets/sprites/GUI/menu_button.svg" type="Texture" id=1]
|
||||
[ext_resource path="res://source/assets/sprites/GUI/menu_button_pressed.svg" type="Texture" id=2]
|
||||
[ext_resource path="res://source/assets/sprites/GUI/menu_button_hover.svg" type="Texture" id=3]
|
||||
[ext_resource path="res://source/assets/scripts/ui_element_handlers/menu_button.gd" type="Script" id=4]
|
||||
|
||||
[node name="menu_button" type="TextureButton"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
enabled_focus_mode = 0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_pressed = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 3 )
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="." to="." method="_on_menu_button_pressed"]
|
||||
120
source/scenes/OVERLAY/elements/menu_button_overlay.tscn
Normal file
120
source/scenes/OVERLAY/elements/menu_button_overlay.tscn
Normal file
@ -0,0 +1,120 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://source/fonts/oxygen/Oxygen-Bold.ttf" type="DynamicFontData" id=1]
|
||||
[ext_resource path="res://source/scenes/OVERLAY/elements/button.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://source/assets/scripts/ui_element_handlers/menu_button_overlay.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 0, 0, 0, 0.380392 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 30
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
size = 30
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=4]
|
||||
size = 30
|
||||
use_mipmaps = true
|
||||
use_filter = true
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
[node name="menu_button_overlay" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 2.1189
|
||||
margin_bottom = 2.1189
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="panel" type="Panel" parent="."]
|
||||
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
|
||||
custom_styles/panel = SubResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="return_to_game" parent="panel" instance=ExtResource( 2 )]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -150.0
|
||||
margin_top = -180.0
|
||||
margin_right = 150.0
|
||||
margin_bottom = -108.0
|
||||
focus_mode = 2
|
||||
enabled_focus_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="panel/return_to_game"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Return to game"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="return_to_main_menu" parent="panel" instance=ExtResource( 2 )]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -150.0
|
||||
margin_top = -36.0
|
||||
margin_right = 150.0
|
||||
margin_bottom = 36.0
|
||||
focus_mode = 2
|
||||
enabled_focus_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="panel/return_to_main_menu"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Retrun to main menu"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="exit_game" parent="panel" instance=ExtResource( 2 )]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -150.0
|
||||
margin_top = 108.0
|
||||
margin_right = 150.0
|
||||
margin_bottom = 180.0
|
||||
focus_mode = 2
|
||||
enabled_focus_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="panel/exit_game"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_fonts/font = SubResource( 4 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Exit game"
|
||||
align = 1
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="panel/return_to_game" to="." method="_on_return_to_game_pressed"]
|
||||
[connection signal="pressed" from="panel/return_to_main_menu" to="." method="_on_return_to_main_menu_pressed"]
|
||||
[connection signal="pressed" from="panel/exit_game" to="." method="_on_exit_game_pressed"]
|
||||
Loading…
Reference in New Issue
Block a user