pause menu done
This commit is contained in:
		
							parent
							
								
									7471d64491
								
							
						
					
					
						commit
						04ce565c1b
					
				
					 7 changed files with 26 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -22,7 +22,7 @@
 | 
			
		|||
[ext_resource type="PackedScene" uid="uid://c4s6y758n77lw" path="res://villager_shared.tscn" id="24_ddfvk"]
 | 
			
		||||
[ext_resource type="PackedScene" uid="uid://b3aus2kigf8xt" path="res://Models/beach_decor/cooler.tscn" id="24_sl7ne"]
 | 
			
		||||
[ext_resource type="PackedScene" uid="uid://cft26nug7kyqb" path="res://ambient_light_1.tscn" id="25_novxt"]
 | 
			
		||||
[ext_resource type="PackedScene" uid="uid://ukful430mmkn" path="res://color_cube.tscn" id="25_rm0cr"]
 | 
			
		||||
[ext_resource type="PackedScene" path="res://color_cube.tscn" id="25_rm0cr"]
 | 
			
		||||
[ext_resource type="PackedScene" uid="uid://d2pvg0f5jtpve" path="res://slime_kill_box.tscn" id="27_cjxk6"]
 | 
			
		||||
[ext_resource type="PackedScene" uid="uid://bw3k2c75qavce" path="res://Models/beach_decor/bucket.tscn" id="27_f3p1i"]
 | 
			
		||||
[ext_resource type="PackedScene" uid="uid://6ycop5t3nra5" path="res://Level/World/DayNightEnvironment.tscn" id="27_jutn4"]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +1,15 @@
 | 
			
		|||
[gd_scene load_steps=4 format=3 uid="uid://difi2tur2j4dg"]
 | 
			
		||||
[gd_scene load_steps=5 format=3 uid="uid://difi2tur2j4dg"]
 | 
			
		||||
 | 
			
		||||
[ext_resource type="PackedScene" uid="uid://dfyt6kjw8yli" path="res://Models/island.glb" id="1_5vc8b"]
 | 
			
		||||
[ext_resource type="Script" path="res://Models/island.gd" id="2_1q8nk"]
 | 
			
		||||
[ext_resource type="Material" uid="uid://yuhlhpwji3c4" path="res://Textures/sand.tres" id="2_nhexh"]
 | 
			
		||||
[ext_resource type="Material" uid="uid://b88xmds4mx7rd" path="res://Textures/grass.tres" id="4_uusb2"]
 | 
			
		||||
 | 
			
		||||
[node name="island" instance=ExtResource("1_5vc8b")]
 | 
			
		||||
script = ExtResource("2_1q8nk")
 | 
			
		||||
 | 
			
		||||
[node name="Island" parent="." index="0"]
 | 
			
		||||
material_override = ExtResource("2_nhexh")
 | 
			
		||||
 | 
			
		||||
[node name="Island_001" parent="." index="2"]
 | 
			
		||||
surface_material_override/0 = ExtResource("4_uusb2")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,9 +23,6 @@ func _ready():
 | 
			
		|||
	
 | 
			
		||||
	
 | 
			
		||||
func _process(_delta):
 | 
			
		||||
	# Brings your mouse out of the window if you press escape. Add pause screen function here?
 | 
			
		||||
	if Input.is_action_just_pressed("Pause"):
 | 
			
		||||
		$PauseMenu.pause()
 | 
			
		||||
		
 | 
			
		||||
	var obj = holding.get_ref()
 | 
			
		||||
	if obj:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
[resource]
 | 
			
		||||
diffuse_mode = 3
 | 
			
		||||
specular_mode = 1
 | 
			
		||||
albedo_color = Color(0.423529, 0.619608, 0.145098, 1)
 | 
			
		||||
albedo_color = Color(0.294118, 0.435294, 0.0980392, 1)
 | 
			
		||||
albedo_texture = ExtResource("1_40rrr")
 | 
			
		||||
normal_texture = ExtResource("1_r1qrb")
 | 
			
		||||
uv1_scale = Vector3(75, 75, 75)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
[resource]
 | 
			
		||||
diffuse_mode = 3
 | 
			
		||||
specular_mode = 1
 | 
			
		||||
albedo_color = Color(0.439216, 0.552941, 0, 1)
 | 
			
		||||
albedo_color = Color(0.192157, 0.376471, 0.156863, 1)
 | 
			
		||||
albedo_texture = ExtResource("1_5s240")
 | 
			
		||||
normal_texture = ExtResource("2_blarx")
 | 
			
		||||
uv1_scale = Vector3(2, 2, 2)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,6 +5,17 @@ var is_paused = false
 | 
			
		|||
@onready var resume_button = $CenterContainer/HBoxContainer/ResumeButton
 | 
			
		||||
@onready var quit_button = $CenterContainer/HBoxContainer/QuitButton
 | 
			
		||||
 | 
			
		||||
func _input(event):
 | 
			
		||||
	if Input.is_action_just_pressed("Pause"):
 | 
			
		||||
		toggle()
 | 
			
		||||
		
 | 
			
		||||
func toggle():
 | 
			
		||||
	if self.visible:
 | 
			
		||||
		unpause()
 | 
			
		||||
	else:
 | 
			
		||||
		pause()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
func unpause():
 | 
			
		||||
	self.hide()
 | 
			
		||||
	get_tree().paused = false
 | 
			
		||||
| 
						 | 
				
			
			@ -12,6 +23,7 @@ func unpause():
 | 
			
		|||
	
 | 
			
		||||
func pause():
 | 
			
		||||
	self.show()
 | 
			
		||||
	resume_button.grab_focus()
 | 
			
		||||
	get_tree().paused = true
 | 
			
		||||
	Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,6 +48,9 @@ alignment = 1
 | 
			
		|||
[node name="ResumeButton" type="Button" parent="CenterContainer/HBoxContainer"]
 | 
			
		||||
process_mode = 3
 | 
			
		||||
layout_mode = 2
 | 
			
		||||
focus_neighbor_left = NodePath("../QuitButton")
 | 
			
		||||
focus_neighbor_right = NodePath("../QuitButton")
 | 
			
		||||
focus_next = NodePath(".")
 | 
			
		||||
text = "          "
 | 
			
		||||
icon = ExtResource("1_c4do0")
 | 
			
		||||
flat = true
 | 
			
		||||
| 
						 | 
				
			
			@ -56,6 +59,9 @@ icon_alignment = 1
 | 
			
		|||
[node name="QuitButton" type="Button" parent="CenterContainer/HBoxContainer"]
 | 
			
		||||
process_mode = 3
 | 
			
		||||
layout_mode = 2
 | 
			
		||||
focus_neighbor_left = NodePath("../ResumeButton")
 | 
			
		||||
focus_neighbor_right = NodePath("../ResumeButton")
 | 
			
		||||
focus_next = NodePath("../ResumeButton")
 | 
			
		||||
theme_override_constants/outline_size = 1
 | 
			
		||||
theme_override_constants/h_separation = 0
 | 
			
		||||
theme_override_constants/icon_max_width = 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue