minor additions
main menu updated
This commit is contained in:
parent
e9ed6cae42
commit
24e89d9383
20 changed files with 220 additions and 95 deletions
|
|
@ -165,7 +165,7 @@ func handle_joypad_movement():
|
||||||
|
|
||||||
if controller_look_vector.length() > 0:
|
if controller_look_vector.length() > 0:
|
||||||
mouse_motion += controller_look_vector
|
mouse_motion += controller_look_vector
|
||||||
mouse_motion_delta += controller_look_vector
|
mouse_motion_delta = controller_look_vector
|
||||||
|
|
||||||
func toggle_movement():
|
func toggle_movement():
|
||||||
_move_toggled = !_move_toggled
|
_move_toggled = !_move_toggled
|
||||||
|
|
@ -178,10 +178,6 @@ func _input(event: InputEvent) -> void:
|
||||||
if not UiManager.in_game_menu.visible:
|
if not UiManager.in_game_menu.visible:
|
||||||
if event is InputEventMouseMotion:
|
if event is InputEventMouseMotion:
|
||||||
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
||||||
#so it doesnt yank
|
|
||||||
if event.relative.length() > 400:
|
|
||||||
return
|
|
||||||
|
|
||||||
mouse_motion += event.relative
|
mouse_motion += event.relative
|
||||||
mouse_motion_delta = event.relative
|
mouse_motion_delta = event.relative
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ func ui_movement_handling(delta: float, cam_local_vel: Vector3):
|
||||||
if Console.toggled:
|
if Console.toggled:
|
||||||
return
|
return
|
||||||
|
|
||||||
var mouse_offset = -movement.mouse_motion_delta * PlayerConsts.UI_MOVEMENT_SENSITIVITY
|
var mouse_offset = -(movement.mouse_motion_delta * .005 / delta) * PlayerConsts.UI_MOVEMENT_SENSITIVITY
|
||||||
|
|
||||||
_smoothed_mouse_offset = _smoothed_mouse_offset.lerp(mouse_offset, 1.0 - exp(-15.0 * delta))
|
_smoothed_mouse_offset = _smoothed_mouse_offset.lerp(mouse_offset, 1.0 - exp(-15.0 * delta))
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ func ui_movement_handling(delta: float, cam_local_vel: Vector3):
|
||||||
cam_local_vel.y
|
cam_local_vel.y
|
||||||
) * PlayerConsts.CAMERA_VELOCITY_MULTIPLIER
|
) * PlayerConsts.CAMERA_VELOCITY_MULTIPLIER
|
||||||
|
|
||||||
var camera_velocity = (camera.position - _last_camera_position) / delta
|
var camera_velocity = (camera.position - _last_camera_position)
|
||||||
|
|
||||||
var bob_offset: Vector2 = Vector2(-camera_velocity.x, camera_velocity.y)
|
var bob_offset: Vector2 = Vector2(-camera_velocity.x, camera_velocity.y)
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ func ui_movement_handling(delta: float, cam_local_vel: Vector3):
|
||||||
|
|
||||||
ui.position = ui.position.lerp(ui_base_position + target_offset, weighted_lerp)
|
ui.position = ui.position.lerp(ui_base_position + target_offset, weighted_lerp)
|
||||||
|
|
||||||
var target_scale = -cam_local_vel.z * PlayerConsts.UI_MOVEMENT_SENSITIVITY * .01 + 1
|
var target_scale = -cam_local_vel.z * PlayerConsts.UI_MOVEMENT_SCALE_SENSITIVITY + 1
|
||||||
|
|
||||||
var ui_scaling_target = Vector2(target_scale, target_scale)
|
var ui_scaling_target = Vector2(target_scale, target_scale)
|
||||||
ui.offset_transform_scale = ui.offset_transform_scale.lerp(Vector2.ONE * ui_scaling_target, weighted_lerp)
|
ui.offset_transform_scale = ui.offset_transform_scale.lerp(Vector2.ONE * ui_scaling_target, weighted_lerp)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene format=3 uid="uid://cbpl3s326ok8d"]
|
[gd_scene format=3 uid="uid://cbpl3s326ok8d"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://d0n5sjpvtitix" path="res://entities/usable/button/button.gd" id="1_r4dn2"]
|
[ext_resource type="Script" uid="uid://d0n5sjpvtitix" path="res://entities/usable/button/button_3d.gd" id="1_r4dn2"]
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_f58a4"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_f58a4"]
|
||||||
albedo_color = Color(0.48374587, 0.48374587, 0.4837458, 1)
|
albedo_color = Color(0.48374587, 0.48374587, 0.4837458, 1)
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_scene format=3 uid="uid://clr8dvbm56jn8"]
|
[gd_scene format=3 uid="uid://clr8dvbm56jn8"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dw22i7cf5ekjx" path="res://entities/usable/music_player.gd" id="1_johh1"]
|
[ext_resource type="Script" uid="uid://dw22i7cf5ekjx" path="res://entities/usable/music_player.gd" id="1_johh1"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cbpl3s326ok8d" path="res://entities/usable/button/button.tscn" id="1_t1vpp"]
|
[ext_resource type="PackedScene" uid="uid://cbpl3s326ok8d" path="res://entities/usable/button/button_3d.tscn" id="1_t1vpp"]
|
||||||
[ext_resource type="Script" uid="uid://v7j6ovrub5cp" path="res://scenes/changable_sound_emitter.gd" id="3_johh1"]
|
[ext_resource type="Script" uid="uid://v7j6ovrub5cp" path="res://scenes/changable_sound_emitter.gd" id="3_johh1"]
|
||||||
[ext_resource type="AudioStream" uid="uid://b14wn4nntykxv" path="res://assets/sounds/music/Bach_ Toccata and Fugue in D Minor, BWV 565.mp3" id="3_rf3au"]
|
[ext_resource type="AudioStream" uid="uid://b14wn4nntykxv" path="res://assets/sounds/music/Bach_ Toccata and Fugue in D Minor, BWV 565.mp3" id="3_rf3au"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@ driver/output_latency=30
|
||||||
Console="*uid://bojihx1fwf426"
|
Console="*uid://bojihx1fwf426"
|
||||||
PlayerConsts="*uid://l2rc674shj03"
|
PlayerConsts="*uid://l2rc674shj03"
|
||||||
Sounds="*uid://c4vhdhbi2yu8i"
|
Sounds="*uid://c4vhdhbi2yu8i"
|
||||||
LoadingScreen="*uid://br8pa51piwxuy"
|
|
||||||
GrabbableBase="*uid://csj6ipagcwmeu"
|
GrabbableBase="*uid://csj6ipagcwmeu"
|
||||||
Report="*uid://c76y0hv0jqdr3"
|
Report="*uid://c76y0hv0jqdr3"
|
||||||
UiManager="*uid://dtrfb3xosj32r"
|
UiManager="*uid://dtrfb3xosj32r"
|
||||||
GameState="*uid://drxx0ny7uim8k"
|
GameState="*uid://drxx0ny7uim8k"
|
||||||
GlobalSignals="*uid://cky5rk5obojex"
|
GlobalSignals="*uid://cky5rk5obojex"
|
||||||
|
SceneLoader="*uid://bniwncdtbehd3"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|
@ -43,7 +43,6 @@ window/size/viewport_height=1080
|
||||||
window/size/resizable=false
|
window/size/resizable=false
|
||||||
window/stretch/mode="canvas_items"
|
window/stretch/mode="canvas_items"
|
||||||
window/stretch/aspect="expand"
|
window/stretch/aspect="expand"
|
||||||
window/vsync/vsync_mode=0
|
|
||||||
window/max_fps=60
|
window/max_fps=60
|
||||||
|
|
||||||
[editor]
|
[editor]
|
||||||
|
|
|
||||||
48
scenes/main_menu/button.gd
Normal file
48
scenes/main_menu/button.gd
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
extends Button
|
||||||
|
|
||||||
|
var tween: Tween
|
||||||
|
var _mouse_in: bool = false
|
||||||
|
var _original_position := Vector2.ZERO
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
mouse_entered.connect(_on_mouse_entered)
|
||||||
|
mouse_exited.connect(_on_mouse_exited)
|
||||||
|
pivot_offset = size / 2
|
||||||
|
offset_transform_enabled = true
|
||||||
|
_original_position = offset_transform_position
|
||||||
|
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
if _mouse_in:
|
||||||
|
track_mouse()
|
||||||
|
|
||||||
|
func track_mouse() -> void:
|
||||||
|
var _mouse_adjusted = get_viewport().get_mouse_position() - global_position - size / 2
|
||||||
|
offset_transform_position = _mouse_adjusted / 10
|
||||||
|
|
||||||
|
func reset_tween():
|
||||||
|
if tween:
|
||||||
|
tween.kill()
|
||||||
|
tween = create_tween()
|
||||||
|
|
||||||
|
func _on_mouse_entered() -> void:
|
||||||
|
reset_tween()
|
||||||
|
tween.set_ease(Tween.EASE_OUT)\
|
||||||
|
.set_trans(Tween.TRANS_ELASTIC)\
|
||||||
|
.tween_property(self, "scale", Vector2(1.1,1.1), .5)
|
||||||
|
|
||||||
|
_mouse_in = true
|
||||||
|
|
||||||
|
func _on_mouse_exited() -> void:
|
||||||
|
reset_tween()
|
||||||
|
|
||||||
|
tween.set_parallel(true)
|
||||||
|
tween.set_ease(Tween.EASE_OUT)\
|
||||||
|
.set_trans(Tween.TRANS_ELASTIC)\
|
||||||
|
.tween_property(self, "scale", Vector2.ONE, .5)
|
||||||
|
|
||||||
|
tween.set_ease(Tween.EASE_IN_OUT)\
|
||||||
|
.set_trans(Tween.TRANS_BOUNCE)\
|
||||||
|
.tween_property(self, "offset_transform_position", _original_position, .5)
|
||||||
|
|
||||||
|
_mouse_in = false
|
||||||
1
scenes/main_menu/button.gd.uid
Normal file
1
scenes/main_menu/button.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bt4l7skxjvc3i
|
||||||
|
|
@ -11,7 +11,7 @@ func _ready() -> void:
|
||||||
|
|
||||||
UiManager.hide()
|
UiManager.hide()
|
||||||
|
|
||||||
%AnimationPlayer.play("camera_init")
|
#%AnimationPlayer.play("camera_init")
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
move_camera_based_on_mouse(delta)
|
move_camera_based_on_mouse(delta)
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1375935, 0, -1.2356517)
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2707429, 1.2013705, -1.9347405)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2707429, 1.2013705, -1.9347405)
|
||||||
amount = 80
|
amount = 80
|
||||||
trail_enabled = true
|
trail_enabled = true
|
||||||
trail_lifetime = 0.09999999999999999
|
trail_lifetime = 0.1
|
||||||
process_material = SubResource("ParticleProcessMaterial_5seab")
|
process_material = SubResource("ParticleProcessMaterial_5seab")
|
||||||
draw_pass_1 = SubResource("RibbonTrailMesh_x2yjq")
|
draw_pass_1 = SubResource("RibbonTrailMesh_x2yjq")
|
||||||
|
|
||||||
|
|
@ -162,7 +162,7 @@ amount = 30
|
||||||
lifetime = 3.0
|
lifetime = 3.0
|
||||||
speed_scale = 0.8
|
speed_scale = 0.8
|
||||||
collision_base_size = 0.1
|
collision_base_size = 0.1
|
||||||
trail_lifetime = 0.09999999999999999
|
trail_lifetime = 0.1
|
||||||
process_material = SubResource("ParticleProcessMaterial_5seab")
|
process_material = SubResource("ParticleProcessMaterial_5seab")
|
||||||
draw_pass_1 = SubResource("SphereMesh_wem23")
|
draw_pass_1 = SubResource("SphereMesh_wem23")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,11 @@ func _process(delta: float) -> void:
|
||||||
|
|
||||||
func _on_button_pressed() -> void:
|
func _on_button_pressed() -> void:
|
||||||
UiManager.toggle_self()
|
UiManager.toggle_self()
|
||||||
get_tree().change_scene_to_file("uid://c5p2fbgi8co1c")
|
SceneLoader.load_scene("uid://c5p2fbgi8co1c")
|
||||||
|
|
||||||
func _on_button_2_pressed() -> void:
|
func _on_button_2_pressed() -> void:
|
||||||
UiManager.toggle_self()
|
UiManager.toggle_self()
|
||||||
get_tree().change_scene_to_file("uid://chykk2a3opu0d")
|
SceneLoader.load_scene("uid://chykk2a3opu0d")
|
||||||
|
|
||||||
func _on_button_3_pressed() -> void:
|
func _on_button_3_pressed() -> void:
|
||||||
print("options")
|
print("options")
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cpn3afv0mkf3s" path="res://scenes/main_menu/main_menu_control.gd" id="1_yt8vf"]
|
[ext_resource type="Script" uid="uid://cpn3afv0mkf3s" path="res://scenes/main_menu/main_menu_control.gd" id="1_yt8vf"]
|
||||||
[ext_resource type="Theme" uid="uid://bspxrgwuidr02" path="res://resources/styles/menu_theme.tres" id="2_bglv6"]
|
[ext_resource type="Theme" uid="uid://bspxrgwuidr02" path="res://resources/styles/menu_theme.tres" id="2_bglv6"]
|
||||||
|
[ext_resource type="Script" uid="uid://bt4l7skxjvc3i" path="res://scenes/main_menu/button.gd" id="3_ork3k"]
|
||||||
|
|
||||||
[node name="MainMenuControl" type="Control" unique_id=2137273835]
|
[node name="MainMenuControl" type="Control" unique_id=2137273835]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
|
|
@ -30,36 +31,42 @@ theme_override_font_sizes/font_size = 128
|
||||||
text = "BREADWINNER"
|
text = "BREADWINNER"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer2" unique_id=477444179]
|
[node name="ButtonContainer" type="VBoxContainer" parent="VBoxContainer2" unique_id=477444179]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 4
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
|
||||||
[node name="Button" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=1811326054]
|
[node name="Button" type="Button" parent="VBoxContainer2/ButtonContainer" unique_id=1811326054]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("2_bglv6")
|
theme = ExtResource("2_bglv6")
|
||||||
text = "Start random gen"
|
text = "Start random gen"
|
||||||
|
script = ExtResource("3_ork3k")
|
||||||
|
|
||||||
[node name="Button2" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=2118140035]
|
[node name="Button2" type="Button" parent="VBoxContainer2/ButtonContainer" unique_id=2118140035]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
offset_transform_enabled = true
|
||||||
theme = ExtResource("2_bglv6")
|
theme = ExtResource("2_bglv6")
|
||||||
text = "Start dev"
|
text = "Start dev"
|
||||||
|
script = ExtResource("3_ork3k")
|
||||||
|
|
||||||
[node name="Button3" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=331418230]
|
[node name="Button3" type="Button" parent="VBoxContainer2/ButtonContainer" unique_id=331418230]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("2_bglv6")
|
theme = ExtResource("2_bglv6")
|
||||||
text = "Options"
|
text = "Options"
|
||||||
|
script = ExtResource("3_ork3k")
|
||||||
|
|
||||||
[node name="Button4" type="Button" parent="VBoxContainer2/VBoxContainer" unique_id=1238756529]
|
[node name="Button4" type="Button" parent="VBoxContainer2/ButtonContainer" unique_id=1238756529]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("2_bglv6")
|
theme = ExtResource("2_bglv6")
|
||||||
text = "Exit"
|
text = "Exit"
|
||||||
|
script = ExtResource("3_ork3k")
|
||||||
|
|
||||||
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button" to="." method="_on_button_pressed"]
|
[connection signal="pressed" from="VBoxContainer2/ButtonContainer/Button" to="." method="_on_button_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button2" to="." method="_on_button_2_pressed"]
|
[connection signal="pressed" from="VBoxContainer2/ButtonContainer/Button2" to="." method="_on_button_2_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button3" to="." method="_on_button_3_pressed"]
|
[connection signal="pressed" from="VBoxContainer2/ButtonContainer/Button3" to="." method="_on_button_3_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer2/VBoxContainer/Button4" to="." method="_on_button_4_pressed"]
|
[connection signal="pressed" from="VBoxContainer2/ButtonContainer/Button4" to="." method="_on_button_4_pressed"]
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ func toggle_menu():
|
||||||
visible = !visible
|
visible = !visible
|
||||||
|
|
||||||
func _on_exit_pressed() -> void:
|
func _on_exit_pressed() -> void:
|
||||||
get_tree().change_scene_to_file("res://scenes/main_menu/main_menu.tscn")
|
SceneLoader.load_scene("uid://cerpwmavwn8t")
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
func _on_options_pressed() -> void:
|
func _on_options_pressed() -> void:
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,18 @@
|
||||||
extends PanelContainer
|
extends CanvasLayer
|
||||||
|
|
||||||
|
signal loading_screen_ready
|
||||||
|
|
||||||
var done: bool = false
|
@export var animation_player: AnimationPlayer
|
||||||
|
@onready var progress_bar: ProgressBar = %ProgressBar
|
||||||
|
|
||||||
func sound_loading():
|
func _ready() -> void:
|
||||||
print("loading screen shown")
|
await animation_player.animation_finished
|
||||||
show()
|
loading_screen_ready.emit()
|
||||||
|
|
||||||
func sound_loading_done():
|
func _on_progress_changed(new_value: float) -> void:
|
||||||
print("loading screen hidden")
|
progress_bar.value = new_value
|
||||||
#hide()
|
|
||||||
%Label.text = "Done!"
|
func _on_load_finished() -> void:
|
||||||
done = true
|
animation_player.play_backwards("transition")
|
||||||
|
await animation_player.animation_finished
|
||||||
# Called when the node enters the scene tree for the first time.
|
queue_free()
|
||||||
func _ready() -> void:
|
|
||||||
Sounds.loading.connect(sound_loading)
|
|
||||||
Sounds.loading_done.connect(sound_loading_done)
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
if done and %ColorRect.color != Color(0,0,0,0):
|
|
||||||
%ColorRect.color = lerp(%ColorRect.color, Color(0,0,0,0), delta)
|
|
||||||
|
|
|
||||||
|
|
@ -2,50 +2,64 @@
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://br8pa51piwxuy" path="res://scenes/ui/loading_screen/loading_screen.gd" id="1_rqdcv"]
|
[ext_resource type="Script" uid="uid://br8pa51piwxuy" path="res://scenes/ui/loading_screen/loading_screen.gd" id="1_rqdcv"]
|
||||||
|
|
||||||
[node name="LoadingScreen" type="PanelContainer" unique_id=1023721034]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g4v7s"]
|
||||||
anchors_preset = 15
|
bg_color = Color(0, 0, 0, 1)
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
[sub_resource type="Animation" id="Animation_vwscl"]
|
||||||
grow_horizontal = 2
|
length = 0.001
|
||||||
grow_vertical = 2
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Panel:theme_override_styles/panel:bg_color")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0, 0, 0, 1)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_dd6wa"]
|
||||||
|
resource_name = "transition"
|
||||||
|
length = 0.5
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Panel:theme_override_styles/panel:bg_color")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_urqlm"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_vwscl"),
|
||||||
|
&"transition": SubResource("Animation_dd6wa")
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="LoadingScreen" type="CanvasLayer" unique_id=138834705 node_paths=PackedStringArray("animation_player")]
|
||||||
script = ExtResource("1_rqdcv")
|
script = ExtResource("1_rqdcv")
|
||||||
|
animation_player = NodePath("AnimationPlayer")
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="." unique_id=2009868353]
|
[node name="Panel" type="Panel" parent="." unique_id=1829994343]
|
||||||
layout_mode = 2
|
offset_right = 1920.0
|
||||||
|
offset_bottom = 1080.0
|
||||||
|
theme_override_styles/panel = SubResource("StyleBoxFlat_g4v7s")
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="Control" unique_id=1237635531]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1601298347]
|
||||||
|
libraries/ = SubResource("AnimationLibrary_urqlm")
|
||||||
|
autoplay = &"transition"
|
||||||
|
|
||||||
|
[node name="ProgressBar" type="ProgressBar" parent="." unique_id=2107914636]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 1
|
anchors_preset = -1
|
||||||
anchors_preset = 15
|
anchor_top = 0.916
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
|
||||||
color = Color(0, 0, 0, 1)
|
|
||||||
|
|
||||||
[node name="ProgressBar" type="ProgressBar" parent="Control" unique_id=1865933389]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = -1
|
|
||||||
anchor_top = 0.96
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 0.98
|
|
||||||
offset_top = -27.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
show_percentage = false
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="Control" unique_id=1444927305]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = -1
|
|
||||||
anchor_left = 0.9
|
|
||||||
anchor_top = 0.9
|
|
||||||
anchor_right = 0.9
|
|
||||||
anchor_bottom = 0.9
|
|
||||||
offset_left = -219.0
|
|
||||||
offset_top = -69.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
grow_vertical = 0
|
|
||||||
theme_override_font_sizes/font_size = 50
|
|
||||||
text = "loading..."
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,9 @@ extends Node
|
||||||
|
|
||||||
@export_category("UI")
|
@export_category("UI")
|
||||||
@export var UI_SCALE: float = 1 ##rational scale of the ui
|
@export var UI_SCALE: float = 1 ##rational scale of the ui
|
||||||
@export var UI_MOVEMENT_SENSITIVITY = 0.5 ##how much the UI moves when you move the camera
|
@export var UI_MOVEMENT_SENSITIVITY = 2 ##how much the UI moves when you move the camera
|
||||||
@export var UI_MOVEMENT_SPEED = 15.0 ##how fast the UI moves when you move the camera
|
@export var UI_MOVEMENT_SPEED = 15.0 ##how fast the UI moves when you move the camera
|
||||||
|
@export var UI_MOVEMENT_SCALE_SENSITIVITY = 0.01
|
||||||
@export var UI_MOVEMENT_VELOCITY_MULTIPLIER = 2.0 ##how much the ui leans when walking or strafing
|
@export var UI_MOVEMENT_VELOCITY_MULTIPLIER = 2.0 ##how much the ui leans when walking or strafing
|
||||||
|
|
||||||
@export_category("Inventory")
|
@export_category("Inventory")
|
||||||
|
|
|
||||||
41
scripts/autoload/scene_loader.gd
Normal file
41
scripts/autoload/scene_loader.gd
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
signal progress_changed(progress)
|
||||||
|
signal load_finished
|
||||||
|
|
||||||
|
var loading_screen: PackedScene = preload("uid://046i0offx3w8")
|
||||||
|
var loaded_resource: PackedScene
|
||||||
|
var scene_path: String
|
||||||
|
var progress: Array = []
|
||||||
|
var use_sub_threads: bool = true
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
set_process(false)
|
||||||
|
|
||||||
|
func load_scene(_scene_path: String) -> void:
|
||||||
|
scene_path = _scene_path
|
||||||
|
|
||||||
|
var new_load_screen = loading_screen.instantiate()
|
||||||
|
add_child(new_load_screen)
|
||||||
|
progress_changed.connect(new_load_screen._on_progress_changed)
|
||||||
|
load_finished.connect(new_load_screen._on_load_finished)
|
||||||
|
|
||||||
|
await new_load_screen.loading_screen_ready
|
||||||
|
|
||||||
|
start_load()
|
||||||
|
|
||||||
|
func start_load() -> void:
|
||||||
|
var state = ResourceLoader.load_threaded_request(scene_path, "", use_sub_threads)
|
||||||
|
if state == OK:
|
||||||
|
set_process(true)
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
var load_status = ResourceLoader.load_threaded_get_status(scene_path, progress)
|
||||||
|
progress_changed.emit(progress[0])
|
||||||
|
match load_status:
|
||||||
|
ResourceLoader.THREAD_LOAD_INVALID_RESOURCE, ResourceLoader.THREAD_LOAD_FAILED:
|
||||||
|
set_process(false)
|
||||||
|
ResourceLoader.THREAD_LOAD_LOADED:
|
||||||
|
loaded_resource = ResourceLoader.load_threaded_get(scene_path)
|
||||||
|
get_tree().change_scene_to_packed(loaded_resource)
|
||||||
|
load_finished.emit()
|
||||||
1
scripts/autoload/scene_loader.gd.uid
Normal file
1
scripts/autoload/scene_loader.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bniwncdtbehd3
|
||||||
|
|
@ -182,7 +182,7 @@ func load_jumping_sounds():
|
||||||
#load_jumping_sounds()
|
#load_jumping_sounds()
|
||||||
#load_step_sounds()
|
#load_step_sounds()
|
||||||
|
|
||||||
signal loading_sounds
|
signal loading_sounds_progress(progress)
|
||||||
signal loading_sounds_done
|
signal loading_sounds_done
|
||||||
|
|
||||||
var is_loading:bool = false
|
var is_loading:bool = false
|
||||||
|
|
@ -233,8 +233,33 @@ func load_sounds():
|
||||||
# Because load() is synchronous, by the time the code reaches this line,
|
# Because load() is synchronous, by the time the code reaches this line,
|
||||||
# every single audio file is guaranteed to be 100% loaded.
|
# every single audio file is guaranteed to be 100% loaded.
|
||||||
loading_done.emit()
|
loading_done.emit()
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
#for now always call his ass
|
|
||||||
load_sounds()
|
|
||||||
|
|
||||||
|
func unload_sounds():
|
||||||
|
NORMAL_FOOTSTEP_SOUNDS = [] ##normal footsteps -- walking
|
||||||
|
HEAVY_FOOTSTEP_SOUNDS = [] ##heavy footsteps -- running
|
||||||
|
LIGHT_FOOTSTEP_SOUNDS = [] ##light footsteps -- crouching
|
||||||
|
SHUFFLE_FOOTSTEP_SOUNDS = [] ##shuffling -- random chance of playing while running
|
||||||
|
|
||||||
|
FLASHLIGHT_CLICK_SOUNDS = [] ##flashlight click
|
||||||
|
|
||||||
|
JUMP_LANDING_SOUNDS = []
|
||||||
|
JUMP_STARTING_SOUNDS = []
|
||||||
|
JUMP_LANDING_BREATH_SOUNDS = []
|
||||||
|
JUMP_STARTING_BREATH_SOUNDS = []
|
||||||
|
|
||||||
|
BREATHE_IN_CALM = []
|
||||||
|
BREATHE_IN_LOW = []
|
||||||
|
BREATHE_IN_MID = []
|
||||||
|
BREATHE_IN_HEAVY = []
|
||||||
|
BREATHE_IN_MAX = []
|
||||||
|
BREATHE_IN_EXHAUSTED = []
|
||||||
|
|
||||||
|
BREATHE_OUT_CALM = []
|
||||||
|
BREATHE_OUT_LOW = []
|
||||||
|
BREATHE_OUT_MID = []
|
||||||
|
BREATHE_OUT_HEAVY = []
|
||||||
|
BREATHE_OUT_MAX = []
|
||||||
|
BREATHE_OUT_EXHAUSTED = []
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
load_sounds()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue