Updated Hub World to have portals to levels and disabled the level select menu
This commit is contained in:
@@ -1,11 +1,28 @@
|
||||
extends CanvasLayer
|
||||
|
||||
export var hub_world_path: String = 'res://Levels/Hub World.tscn'
|
||||
export var disable_back_to_hub: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if disable_back_to_hub:
|
||||
$'Menu/Menu Options/Back To Hub'.visible = false
|
||||
return
|
||||
|
||||
|
||||
func _on_resume_button_pressed() -> void:
|
||||
resume()
|
||||
return
|
||||
|
||||
|
||||
func _on_back_to_hub_button_pressed():
|
||||
if get_tree().change_scene(hub_world_path) != OK:
|
||||
print('ERROR: Pause Screen failed to change scene to Hub World.')
|
||||
resume()
|
||||
queue_free()
|
||||
return
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
return
|
||||
@@ -16,6 +33,11 @@ func _on_resume_button_mouse_entered() -> void:
|
||||
return
|
||||
|
||||
|
||||
func _on_back_to_hub_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
||||
func _on_quit_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Normal.png" type="Texture" id=2]
|
||||
@@ -7,6 +7,8 @@
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Hover.png" type="Texture" id=5]
|
||||
[ext_resource path="res://GUI/Pause Screen.gd" type="Script" id=6]
|
||||
[ext_resource path="res://Sounds/Menu_Button_Hover.wav" type="AudioStream" id=7]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png" type="Texture" id=9]
|
||||
|
||||
[node name="Pause Screen" type="CanvasLayer"]
|
||||
pause_mode = 2
|
||||
@@ -34,10 +36,10 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="Menu Options" type="VBoxContainer" parent="Menu"]
|
||||
margin_left = 49.0
|
||||
margin_top = 63.0
|
||||
margin_right = 111.0
|
||||
margin_bottom = 97.0
|
||||
margin_left = 33.0
|
||||
margin_top = 53.0
|
||||
margin_right = 126.0
|
||||
margin_bottom = 106.0
|
||||
|
||||
[node name="Resume" type="CenterContainer" parent="Menu/Menu Options"]
|
||||
margin_right = 62.0
|
||||
@@ -49,6 +51,17 @@ margin_bottom = 15.0
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 4 )
|
||||
|
||||
[node name="Back To Hub" type="CenterContainer" parent="Menu/Menu Options"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="Back To Hub Button" type="TextureButton" parent="Menu/Menu Options/Back To Hub"]
|
||||
margin_top = 12.0
|
||||
margin_right = 93.0
|
||||
margin_bottom = 27.0
|
||||
texture_normal = ExtResource( 8 )
|
||||
texture_hover = ExtResource( 9 )
|
||||
|
||||
[node name="Quit" type="CenterContainer" parent="Menu/Menu Options"]
|
||||
margin_top = 19.0
|
||||
margin_right = 62.0
|
||||
@@ -67,5 +80,7 @@ volume_db = -16.0
|
||||
|
||||
[connection signal="mouse_entered" from="Menu/Menu Options/Resume/Resume Button" to="." method="_on_resume_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu/Menu Options/Resume/Resume Button" to="." method="_on_resume_button_pressed"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Options/Back To Hub/Back To Hub Button" to="." method="_on_back_to_hub_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu/Menu Options/Back To Hub/Back To Hub Button" to="." method="_on_back_to_hub_button_pressed"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_pressed"]
|
||||
|
Reference in New Issue
Block a user