Port the menu's exit button from the 3d version.

This commit is contained in:
Relintai 2021-07-12 01:02:26 +02:00
parent e0b1549475
commit c622f20e18
2 changed files with 29 additions and 8 deletions

8
game/menu/ExitButton.gd Normal file
View File

@ -0,0 +1,8 @@
extends Button
func _ready():
if OS.has_feature("mobile") || OS.has_feature("web"):
hide()
func _pressed():
get_tree().quit()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=2]
[gd_scene load_steps=18 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/menu/CharacterEntry.tscn" type="PackedScene" id=2]
@ -15,6 +15,7 @@
[ext_resource path="res://scenes/DisconnectButton.gd" type="Script" id=13]
[ext_resource path="res://scenes/ConnectServerButton.gd" type="Script" id=14]
[ext_resource path="res://scenes/HostGameButton.gd" type="Script" id=15]
[ext_resource path="res://menu/ExitButton.gd" type="Script" id=16]
[ext_resource path="res://ui/about/About.tscn" type="PackedScene" id=20]
[node name="Menu" type="Control"]
@ -435,9 +436,9 @@ __meta__ = {
}
[node name="Connect" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 47.0
margin_top = 13.0
margin_right = 120.0
margin_bottom = 73.5702
margin_bottom = 39.5702
rect_min_size = Vector2( 120, 0 )
text = "Connect"
script = ExtResource( 11 )
@ -446,9 +447,9 @@ __meta__ = {
}
[node name="Host" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 81.0
margin_top = 47.0
margin_right = 120.0
margin_bottom = 107.57
margin_bottom = 73.5702
rect_min_size = Vector2( 120, 0 )
text = "Host"
script = ExtResource( 12 )
@ -479,9 +480,9 @@ __meta__ = {
}
[node name="About" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 115.0
margin_top = 81.0
margin_right = 120.0
margin_bottom = 141.57
margin_bottom = 107.57
rect_min_size = Vector2( 120, 0 )
text = "About"
__meta__ = {
@ -489,11 +490,22 @@ __meta__ = {
}
[node name="Button" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 115.0
margin_right = 120.0
margin_bottom = 141.57
rect_min_size = Vector2( 120, 0 )
text = "Options"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Exit" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 149.0
margin_right = 120.0
margin_bottom = 175.57
rect_min_size = Vector2( 120, 0 )
text = "Options"
text = "Exit"
script = ExtResource( 16 )
__meta__ = {
"_edit_use_anchors_": false
}
@ -523,6 +535,7 @@ transform = Transform( 1, 1.49012e-08, 0, 0, 0.990268, -0.139173, -2.98023e-08,
[node name="Camera" type="Camera" parent="Char"]
transform = Transform( 0.907555, -0.0761572, 0.41297, 0.0262364, 0.99178, 0.12524, -0.419113, -0.102827, 0.902093, 0.752064, 1.69463, 3.15021 )
current = true
[connection signal="pressed" from="CharacterSelectorMenu/CharacterSelector/VBoxContainer/CharacterSelector/VBoxContainer/Load" to="CharacterSelectorMenu" method="load_character"]
[connection signal="pressed" from="CharacterSelectorMenu/CharacterSelector/VBoxContainer/CharacterSelector/VBoxContainer/New" to="." method="switch_to_menu" binds= [ 1 ]]
[connection signal="pressed" from="CharacterSelectorMenu/CharacterSelector/VBoxContainer/CharacterSelector/VBoxContainer/Delete" to="CharacterSelectorMenu" method="renounce_character"]