pause menu done
This commit is contained in:
parent
7471d64491
commit
04ce565c1b
|
@ -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://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://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://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://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://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"]
|
[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="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="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://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")]
|
[node name="island" instance=ExtResource("1_5vc8b")]
|
||||||
script = ExtResource("2_1q8nk")
|
script = ExtResource("2_1q8nk")
|
||||||
|
|
||||||
[node name="Island" parent="." index="0"]
|
[node name="Island" parent="." index="0"]
|
||||||
material_override = ExtResource("2_nhexh")
|
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):
|
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()
|
var obj = holding.get_ref()
|
||||||
if obj:
|
if obj:
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
[resource]
|
[resource]
|
||||||
diffuse_mode = 3
|
diffuse_mode = 3
|
||||||
specular_mode = 1
|
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")
|
albedo_texture = ExtResource("1_40rrr")
|
||||||
normal_texture = ExtResource("1_r1qrb")
|
normal_texture = ExtResource("1_r1qrb")
|
||||||
uv1_scale = Vector3(75, 75, 75)
|
uv1_scale = Vector3(75, 75, 75)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
[resource]
|
[resource]
|
||||||
diffuse_mode = 3
|
diffuse_mode = 3
|
||||||
specular_mode = 1
|
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")
|
albedo_texture = ExtResource("1_5s240")
|
||||||
normal_texture = ExtResource("2_blarx")
|
normal_texture = ExtResource("2_blarx")
|
||||||
uv1_scale = Vector3(2, 2, 2)
|
uv1_scale = Vector3(2, 2, 2)
|
||||||
|
|
|
@ -5,6 +5,17 @@ var is_paused = false
|
||||||
@onready var resume_button = $CenterContainer/HBoxContainer/ResumeButton
|
@onready var resume_button = $CenterContainer/HBoxContainer/ResumeButton
|
||||||
@onready var quit_button = $CenterContainer/HBoxContainer/QuitButton
|
@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():
|
func unpause():
|
||||||
self.hide()
|
self.hide()
|
||||||
get_tree().paused = false
|
get_tree().paused = false
|
||||||
|
@ -12,6 +23,7 @@ func unpause():
|
||||||
|
|
||||||
func pause():
|
func pause():
|
||||||
self.show()
|
self.show()
|
||||||
|
resume_button.grab_focus()
|
||||||
get_tree().paused = true
|
get_tree().paused = true
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,9 @@ alignment = 1
|
||||||
[node name="ResumeButton" type="Button" parent="CenterContainer/HBoxContainer"]
|
[node name="ResumeButton" type="Button" parent="CenterContainer/HBoxContainer"]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
focus_neighbor_left = NodePath("../QuitButton")
|
||||||
|
focus_neighbor_right = NodePath("../QuitButton")
|
||||||
|
focus_next = NodePath(".")
|
||||||
text = " "
|
text = " "
|
||||||
icon = ExtResource("1_c4do0")
|
icon = ExtResource("1_c4do0")
|
||||||
flat = true
|
flat = true
|
||||||
|
@ -56,6 +59,9 @@ icon_alignment = 1
|
||||||
[node name="QuitButton" type="Button" parent="CenterContainer/HBoxContainer"]
|
[node name="QuitButton" type="Button" parent="CenterContainer/HBoxContainer"]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
layout_mode = 2
|
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/outline_size = 1
|
||||||
theme_override_constants/h_separation = 0
|
theme_override_constants/h_separation = 0
|
||||||
theme_override_constants/icon_max_width = 0
|
theme_override_constants/icon_max_width = 0
|
||||||
|
|
Loading…
Reference in New Issue