Settings Menu basic layout
This commit is contained in:
@ -5,19 +5,35 @@ extends Control
|
||||
@onready var start_button: Button = $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Button
|
||||
@onready var settings_button: Button = $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Button2
|
||||
@onready var exit_button: Button = $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Button3
|
||||
@onready var settings_menu: Control = $Settings_Menu
|
||||
@onready var margin_container: MarginContainer = $MarginContainer
|
||||
|
||||
|
||||
@onready var start_level = preload("res://Main_menu/main_menu.tscn") as PackedScene
|
||||
|
||||
func _ready():
|
||||
start_button.button_down.connect(on_start_pressed)
|
||||
settings_button.button_down.connect(on_settings_pressed)
|
||||
exit_button.button_down.connect(on_exit_pressed)
|
||||
hanlde_signal_connections()
|
||||
|
||||
func on_start_pressed()-> void:
|
||||
print("scene changed!")
|
||||
get_tree().change_scene_to_packed(start_level)
|
||||
|
||||
func on_settings_pressed()->void:
|
||||
pass
|
||||
margin_container.visible = false
|
||||
settings_menu.set_process(true)
|
||||
settings_menu.visible = true
|
||||
|
||||
func on_exit_pressed() ->void:
|
||||
func exited_game() ->void:
|
||||
get_tree().quit()
|
||||
|
||||
func exited_settings() -> void:
|
||||
margin_container.visible = true
|
||||
settings_menu.visible = false
|
||||
|
||||
|
||||
|
||||
func hanlde_signal_connections() ->void:
|
||||
start_button.button_down.connect(on_start_pressed)
|
||||
settings_button.button_down.connect(on_settings_pressed)
|
||||
exit_button.button_down.connect(exited_game)
|
||||
settings_menu.exit_options_menu.connect(exited_settings)
|
||||
|
@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://s4dt2nklh1ef"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://s4dt2nklh1ef"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cpykl56e4h7q1" path="res://Main_menu/background.jpg" id="1_3skw3"]
|
||||
[ext_resource type="Script" path="res://Main_menu/main_menu.gd" id="1_mhyy3"]
|
||||
[ext_resource type="FontFile" uid="uid://c3jp6yk6l8gei" path="res://Main_menu/KnightWarrior-w16n8.otf" id="2_7dnc6"]
|
||||
[ext_resource type="PackedScene" uid="uid://bd2tk3epl8hbw" path="res://Settings_menu/options_menu.tscn" id="4_xieoo"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ii5ra"]
|
||||
bg_color = Color(0.6, 0.6, 0.6, 0)
|
||||
@ -94,3 +95,7 @@ layout_mode = 2
|
||||
theme_override_fonts/font = SubResource("SystemFont_e8c4f")
|
||||
theme_override_font_sizes/font_size = 24
|
||||
text = "Exit"
|
||||
|
||||
[node name="Settings_Menu" parent="." instance=ExtResource("4_xieoo")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
Reference in New Issue
Block a user