Merge commit '7687c976c0838482a47a64a51a047929c6d3e67e' into card-board

This commit is contained in:
betalars 2023-06-28 01:08:01 +02:00
commit b3bc41600e
48 changed files with 1706 additions and 401 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,17 @@
extends Area3D
@onready var focus_forward = $UiWrapper/UiSprite/SubViewport/Collectable_ui
var has_mouse: bool = false
# Called when the node enters the scene tree for the first time.
func _ready():
connect("mouse_entered", Callable(self, "_on_mouse_entered"))
func _on_mouse_entered():
input_ray_pickable = false
$UiWrapper.show()
$UiWrapper/UiSprite/SubViewport/Collectable_ui.show()
has_mouse = true
func _on_mouse_exited():
assert(false)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0a806c042198b44d09f68f13291263cd78e760d66eb80874b2271f3f3ead71b0
size 1557315

View File

@ -1,19 +0,0 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://bifax0g4ibrmk"
path="res://.godot/imported/childhood.mp3-75b6bdb0d41f6eee77b33307d4512502.mp3str"
[deps]
source_file="res://base-environments/youth_room/audio/childhood.mp3"
dest_files=["res://.godot/imported/childhood.mp3-75b6bdb0d41f6eee77b33307d4512502.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fac4105ad1b9e4928e747db301476f06e0965590a4ab30273935ed09e890c15a
size 3259245

View File

@ -1,19 +0,0 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://ceoqo46r0kgfv"
path="res://.godot/imported/jui-jutsu.mp3-66c5cea1f8b020bac14c7aac58282da2.mp3str"
[deps]
source_file="res://base-environments/youth_room/audio/jui-jutsu.mp3"
dest_files=["res://.godot/imported/jui-jutsu.mp3-66c5cea1f8b020bac14c7aac58282da2.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://bwh60165c3saj"
path="res://.godot/imported/lisa_youth_voice.ogg-d6f843c1b2d0d6639f6372cb8f6f7a9a.oggvorbisstr"
[deps]
source_file="res://base-environments/youth_room/audio/lisa_youth_voice.ogg"
dest_files=["res://.godot/imported/lisa_youth_voice.ogg-d6f843c1b2d0d6639f6372cb8f6f7a9a.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -28,7 +28,7 @@ func _process(delta):
func start(): func start():
$light_animation.play("light_up") $light_animation.play("light_up")
$AudioPlayer.play("intro") $AudioPlayer.play("intro")
$PlayerController.active = true State.pass_focus_to($PlayerController)
current_mode = Modes.WALKING current_mode = Modes.WALKING
func _update_scene(new_mode) -> int: func _update_scene(new_mode) -> int:
@ -36,7 +36,11 @@ func _update_scene(new_mode) -> int:
emit_signal("freeze") emit_signal("freeze")
elif new_mode == Modes.FREEZE: elif new_mode == Modes.FREEZE:
emit_signal("freeze") emit_signal("freeze")
return new_mode return new_mode
func _unhandled_input(event):
if event is InputEventMouseButton:
if event.pressed:
print("passed")
#State.pass_focus_to($PlayerController)

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
[gd_resource type="AudioBusLayout" format=3 uid="uid://djkwd76o033io"] [gd_resource type="AudioBusLayout" format=3 uid="uid://djkwd76o033io"]
[resource] [resource]
bus/0/mute = true
bus/1/name = &"text" bus/1/name = &"text"
bus/1/solo = false bus/1/solo = false
bus/1/mute = false bus/1/mute = false

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=4 format=3 uid="uid://bvowj4l8dtceu"] [gd_scene load_steps=3 format=3 uid="uid://bvowj4l8dtceu"]
[ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="1_xrckx"] [ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="1_xrckx"]
[ext_resource type="PackedScene" uid="uid://vkcdj8c3ytbq" path="res://logic-scenes/board/post-it.tscn" id="2_ucudl"] [ext_resource type="PackedScene" uid="uid://vkcdj8c3ytbq" path="res://logic-scenes/board/post-it.tscn" id="2_ucudl"]

View File

@ -1,8 +1,7 @@
extends Area3D extends Area3D
@onready var sprite: Sprite3D = $UiSprite
@onready var s: Sprite3D = $Sprite3D @onready var viewport: SubViewport = $UiSprite/SubViewport
@onready var v: SubViewport = $Sprite3D/SubViewport
func _process(delta): func _process(delta):
var camera = get_viewport().get_camera_3d() var camera = get_viewport().get_camera_3d()
@ -16,24 +15,26 @@ func _process(delta):
func _unhandled_input(event): func _unhandled_input(event):
if event is InputEventMouse: if event is InputEventMouse:
# Handled via _on_input_event. if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_RIGHT:
assert(false)
return return
v.push_input(event) viewport.push_input(event)
func _on_input_event(_camera: Camera3D, event: InputEvent, pos: Vector3, _normal: Vector3, _shape_idx: int): func _on_input_event(_camera: Camera3D, event: InputEvent, pos: Vector3, _normal: Vector3, _shape_idx: int):
# Position of the event in Sprite3D local coordinates. # Position of the event in Sprite3D local coordinates.
var texture_3d_position = s.get_global_transform().affine_inverse() * pos var texture_3d_position = sprite.get_global_transform().affine_inverse() * pos
#if !is_zero_approx(texture_3d_position.z): #if !is_zero_approx(texture_3d_position.z):
# # Discard event because event didn't happen on the side of the Sprite3D. # # Discard event because event didn't happen on the side of the Sprite3D.
# return # return
# Position of the event relative to the texture. # Position of the event relative to the texture.
var texture_position: Vector2 = Vector2(texture_3d_position.x, -texture_3d_position.y) / s.pixel_size - s.get_item_rect().position var texture_position: Vector2 = Vector2(texture_3d_position.x, -texture_3d_position.y) / sprite.pixel_size - sprite.get_item_rect().position
# Send mouse event. # Send mouse event.
var e: InputEvent = event.duplicate() var e: InputEvent = event.duplicate()
if e is InputEventMouse: if e is InputEventMouse:
e.set_position(texture_position) e.set_position(texture_position)
e.set_global_position(texture_position) e.set_global_position(texture_position)
v.push_input(e) viewport.push_input(e)
func _on_button_pressed(): func _on_button_pressed():
print("Button pressed") print("Button pressed")

View File

@ -0,0 +1,27 @@
@tool
extends Button
func hide():
if visible == true:
var tween:Tween = create_tween()
custom_minimum_size = get_minimum_size()
var tmp = text
text = ""
tween.tween_property(self, "custom_minimum_size", Vector2(size.x, 0), 0.2)
update_minimum_size()
await tween.finished
visible = false
text = tmp
update_minimum_size()
func show():
if visible == false:
var tmp = text
var tween:Tween = create_tween()
tween.tween_property(self, "custom_minimum_size", get_minimum_size(), 0.2)
text = ""
update_minimum_size()
visible = true
await tween.finished
text = tmp

View File

@ -1,134 +1,8 @@
[gd_scene load_steps=14 format=3 uid="uid://bj3tbkmppabfq"] [gd_scene load_steps=5 format=3 uid="uid://bj3tbkmppabfq"]
[ext_resource type="Shader" path="res://vfx/particle_mixer.gdshader" id="1_g8u1t"] [ext_resource type="PackedScene" uid="uid://bdnesuqroi7ss" path="res://vfx/collectable_particles.tscn" id="1_7bqxo"]
[ext_resource type="Texture2D" uid="uid://dq7jm5ufknbb6" path="res://vfx/lens-flare-particle.png" id="2_mi0wa"] [ext_resource type="Texture2D" uid="uid://dq7jm5ufknbb6" path="res://vfx/lens-flare-particle.png" id="2_mi0wa"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lpenh"]
render_priority = 0
shader = ExtResource("1_g8u1t")
shader_parameter/particle_color = null
shader_parameter/particle_texture = ExtResource("2_mi0wa")
[sub_resource type="Gradient" id="Gradient_tjuvm"]
offsets = PackedFloat32Array(0, 0.50813, 1)
colors = PackedColorArray(1, 0.877403, 0.516545, 1, 0.94702, 0.505309, 0.59484, 1, 0.735853, 0.324231, 0.687053, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_d2t20"]
gradient = SubResource("Gradient_tjuvm")
[sub_resource type="Gradient" id="Gradient_c8r4y"]
offsets = PackedFloat32Array(0, 0.00813008, 0.52439, 1)
colors = PackedColorArray(0, 0, 0, 1, 0.0284553, 0.0284553, 0.0284553, 1, 0.244776, 0.244776, 0.244776, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_2vogp"]
gradient = SubResource("Gradient_c8r4y")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_eegys"]
emission_shape = 1
emission_sphere_radius = 0.3
spread = 180.0
gravity = Vector3(0, 0.02, 0)
initial_velocity_max = 0.2
color_ramp = SubResource("GradientTexture1D_2vogp")
color_initial_ramp = SubResource("GradientTexture1D_d2t20")
turbulence_enabled = true
turbulence_noise_strength = 0.1
turbulence_noise_scale = 2.0
turbulence_noise_speed = Vector3(0.1, 0.3, 0.5)
turbulence_noise_speed_random = 0.3
turbulence_influence_min = 0.01
turbulence_influence_max = 0.03
turbulence_initial_displacement_max = 1.0
[sub_resource type="Shader" id="Shader_p2314"]
code = "// NOTE: Shader automatically converted from Godot Engine 4.0.stable's StandardMaterial3D.
shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_disabled;
uniform vec4 albedo : source_color;
uniform sampler2D texture_albedo : source_color,filter_linear_mipmap,repeat_enable;
uniform float point_size : hint_range(0,128);
uniform float roughness : hint_range(0,1);
uniform sampler2D texture_metallic : hint_default_white,filter_linear_mipmap,repeat_enable;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_roughness_r,filter_linear_mipmap,repeat_enable;
uniform float specular;
uniform float metallic;
uniform int particles_anim_h_frames;
uniform int particles_anim_v_frames;
uniform bool particles_anim_loop;
uniform vec4 backlight : source_color;
uniform sampler2D texture_backlight : hint_default_black,filter_linear_mipmap,repeat_enable;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) ,normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]);
mat_world = mat_world * mat4(vec4(cos(INSTANCE_CUSTOM.x), -sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));
MODELVIEW_MATRIX = VIEW_MATRIX * mat_world;
MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);
float h_frames = float(particles_anim_h_frames);
float v_frames = float(particles_anim_v_frames);
float particle_total_frames = float(particles_anim_h_frames * particles_anim_v_frames);
float particle_frame = floor(INSTANCE_CUSTOM.z * float(particle_total_frames));
if (!particles_anim_loop) {
particle_frame = clamp(particle_frame, 0.0, particle_total_frames - 1.0);
} else {
particle_frame = mod(particle_frame, particle_total_frames);
}
UV /= vec2(h_frames, v_frames);
UV += vec2(mod(particle_frame, h_frames) / h_frames, floor((particle_frame + 0.5) / h_frames) / v_frames);
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
METALLIC = metallic_tex * metallic;
vec4 roughness_texture_channel = vec4(1.0,0.0,0.0,0.0);
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;
vec3 backlight_tex = texture(texture_backlight,base_uv).rgb;
BACKLIGHT = (backlight.rgb+backlight_tex);
}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fgrmi"]
render_priority = 0
shader = SubResource("Shader_p2314")
shader_parameter/albedo = Color(1, 1, 1, 1)
shader_parameter/point_size = 1.0
shader_parameter/roughness = 1.0
shader_parameter/metallic_texture_channel = Plane(1, 0, 0, 0)
shader_parameter/specular = 0.5
shader_parameter/metallic = 0.0
shader_parameter/particles_anim_h_frames = 1
shader_parameter/particles_anim_v_frames = 1
shader_parameter/particles_anim_loop = false
shader_parameter/backlight = Color(0, 0, 0, 1)
shader_parameter/uv1_scale = Vector3(1, 1, 1)
shader_parameter/uv1_offset = Vector3(0, 0, 0)
shader_parameter/uv2_scale = Vector3(1, 1, 1)
shader_parameter/uv2_offset = Vector3(0, 0, 0)
shader_parameter/texture_albedo = ExtResource("2_mi0wa")
shader_parameter/texture_backlight = ExtResource("2_mi0wa")
[sub_resource type="QuadMesh" id="QuadMesh_ea2fp"]
material = SubResource("ShaderMaterial_fgrmi")
size = Vector2(0.1, 0.1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xd7ns"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xd7ns"]
specular_mode = 2 specular_mode = 2
vertex_color_use_as_albedo = true vertex_color_use_as_albedo = true
@ -147,14 +21,7 @@ metallic_specular = 1.0
[node name="Node3D" type="Node3D"] [node name="Node3D" type="Node3D"]
[node name="collectable_particles" type="GPUParticles3D" parent="."] [node name="collectable_particles" parent="." instance=ExtResource("1_7bqxo")]
material_override = SubResource("ShaderMaterial_lpenh")
material_overlay = SubResource("ShaderMaterial_lpenh")
cast_shadow = 0
amount = 100
lifetime = 10.0
process_material = SubResource("ParticleProcessMaterial_eegys")
draw_pass_1 = SubResource("QuadMesh_ea2fp")
[node name="CSGBox3D" type="CSGBox3D" parent="."] [node name="CSGBox3D" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.66951) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.66951)

View File

@ -0,0 +1,26 @@
[gd_scene format=3 uid="uid://52mr50b01ibd"]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Button" type="Button" parent="."]
layout_mode = 0
offset_left = 495.0
offset_top = 163.0
offset_right = 634.0
offset_bottom = 235.0
text = "small boi"
[node name="Button2" type="Button" parent="."]
visible = false
layout_mode = 0
offset_left = 441.0
offset_top = 119.0
offset_right = 694.0
offset_bottom = 320.0
text = "big boi"

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://bwicl5q0lw06q" uid="uid://bwicl5q0lw06q"
path="res://.godot/imported/start_bottom.png-687c4ed67f36702eaa13bc180a11daac.ctex" path="res://.godot/imported/bottom.png-3eb31957ef51fac0c94899c57d0847c3.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://logic-scenes/startup/start_bottom.png" source_file="res://import/interface-elements/bottom.png"
dest_files=["res://.godot/imported/start_bottom.png-687c4ed67f36702eaa13bc180a11daac.ctex"] dest_files=["res://.godot/imported/bottom.png-3eb31957ef51fac0c94899c57d0847c3.ctex"]
[params] [params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://5a36ownywoa8"
path="res://.godot/imported/cursor.png-10cec2772e1d2948212bee924d0eb111.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://import/interface-elements/cursor.png"
dest_files=["res://.godot/imported/cursor.png-10cec2772e1d2948212bee924d0eb111.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cr3xaxqvj8gla"
path="res://.godot/imported/cursor_drag.png-84fc75458df1f30de98b2e854ccd3631.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://import/interface-elements/cursor_drag.png"
dest_files=["res://.godot/imported/cursor_drag.png-84fc75458df1f30de98b2e854ccd3631.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d005qvnbnishb"
path="res://.godot/imported/cursor_grab.png-f38d4369c64694a26a6f4ea70068e889.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://import/interface-elements/cursor_grab.png"
dest_files=["res://.godot/imported/cursor_grab.png-f38d4369c64694a26a6f4ea70068e889.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://djocdj0psv4wq"
path="res://.godot/imported/cursor_point.png-0b3cad564cc0e3b9bb8ca527d95e8bfb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://import/interface-elements/cursor_point.png"
dest_files=["res://.godot/imported/cursor_point.png-0b3cad564cc0e3b9bb8ca527d95e8bfb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://d0ucjqi8tx6vt" uid="uid://d0ucjqi8tx6vt"
path="res://.godot/imported/start_frame.png-e3da868bb60eabb343abc46b5c0d68c9.ctex" path="res://.godot/imported/frame.png-2a731741f972f4976de0b52bee013a7e.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://logic-scenes/startup/start_frame.png" source_file="res://import/interface-elements/frame.png"
dest_files=["res://.godot/imported/start_frame.png-e3da868bb60eabb343abc46b5c0d68c9.ctex"] dest_files=["res://.godot/imported/frame.png-2a731741f972f4976de0b52bee013a7e.ctex"]
[params] [params]

View File

@ -157,8 +157,7 @@ clip_children = 2
position = Vector2(150, 110) position = Vector2(150, 110)
scale = Vector2(0.6, 0.6) scale = Vector2(0.6, 0.6)
sprite_frames = SubResource("SpriteFrames_ckivt") sprite_frames = SubResource("SpriteFrames_ckivt")
frame = 2 frame = 4
frame_progress = 0.638341
script = SubResource("GDScript_8bs16") script = SubResource("GDScript_8bs16")
[node name="GPUParticles2D" type="GPUParticles2D" parent="BackgroundSprite"] [node name="GPUParticles2D" type="GPUParticles2D" parent="BackgroundSprite"]

View File

@ -156,6 +156,7 @@ clip_children = 2
position = Vector2(150, 110) position = Vector2(150, 110)
scale = Vector2(0.6, 0.6) scale = Vector2(0.6, 0.6)
sprite_frames = SubResource("SpriteFrames_ckivt") sprite_frames = SubResource("SpriteFrames_ckivt")
frame = 2
script = SubResource("GDScript_8bs16") script = SubResource("GDScript_8bs16")
[node name="GPUParticles2D" type="GPUParticles2D" parent="BackgroundSprite"] [node name="GPUParticles2D" type="GPUParticles2D" parent="BackgroundSprite"]

View File

@ -10,6 +10,15 @@ enum {
@onready var debug_board:Control = $"board of devs" @onready var debug_board:Control = $"board of devs"
var has_focus = false:
set(focus):
if not focus == has_focus:
if focus:
for player in anim_players: player.play("reveal")
selection_state = CARDS # fixme
self.show()
has_focus = focus
var selection_state var selection_state
var anim_players:Array var anim_players:Array
@ -37,14 +46,14 @@ func _ready():
for control in card_controls: for control in card_controls:
options.append(control.get_child(1)) options.append(control.get_child(1))
anim_players.append(control.get_child(0)) anim_players.append(control.get_child(0))
selection_state = CARDS selection_state = INI
fill_card_slots() fill_card_slots()
func fill_card_slots(): func fill_card_slots():
for i in range($cards.get_child_count()): for i in range($cards.get_child_count()):
var card:Card = $cards.get_child(i).get_child(1) var card:Card = $cards.get_child(i).get_child(1)
card.replace_with(debug_board.get_child(2).get_child(i) as Card) card.replace_with(debug_board.get_child(0).get_child(i) as Card)
func fill_post_slots(): func fill_post_slots():
var post_its: Array[PostIt] = [] var post_its: Array[PostIt] = []
@ -56,19 +65,15 @@ func fill_post_slots():
options[i].replace_with(post_its[i]) options[i].replace_with(post_its[i])
func _unhandled_input(event): func _unhandled_input(event):
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"): if has_focus:
curr_selection_id -= 1 if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"):
elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right") or event.is_action_pressed("ui_focus_prev"): curr_selection_id -= 1
curr_selection_id += 1 elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right") or event.is_action_pressed("ui_focus_prev"):
if event.is_action_pressed("ui_accept"): curr_selection_id += 1
pick(curr_selection_id) if event.is_action_pressed("ui_accept"):
pick(curr_selection_id)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func pick(id: int): func pick(id: int):
print("meep")
if id == -1: if id == -1:
curr_selection_id = 0 curr_selection_id = 0
return return

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=62 format=3 uid="uid://brk4hjdf2x81a"] [gd_scene load_steps=65 format=3 uid="uid://brk4hjdf2x81a"]
[ext_resource type="Script" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"] [ext_resource type="Script" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"]
[ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="2_dqebt"] [ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="2_dqebt"]
@ -112,6 +112,34 @@ tracks/2/keys = {
"values": [Vector2(-317, 25), Vector2(-336, -127), Vector2(-12, 0), Vector2(-12, 0), Vector2(-12, 0), Vector2(0, 968)] "values": [Vector2(-317, 25), Vector2(-336, -127), Vector2(-12, 0), Vector2(-12, 0), Vector2(-12, 0), Vector2(0, 968)]
} }
[sub_resource type="Animation" id="Animation_3304u"]
resource_name = "reveal"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(0.435275, 1),
"update": 0,
"values": [Vector2(0, 256), Vector2(-317, 25)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(0.435275, 1),
"update": 0,
"values": [0.174533, -0.109599]
}
[sub_resource type="Animation" id="Animation_ldr2c"] [sub_resource type="Animation" id="Animation_ldr2c"]
resource_name = "select" resource_name = "select"
length = 0.3 length = 0.3
@ -213,6 +241,7 @@ _data = {
"RESET": SubResource("Animation_dinvx"), "RESET": SubResource("Animation_dinvx"),
"deselect": SubResource("Animation_4dp1g"), "deselect": SubResource("Animation_4dp1g"),
"pick": SubResource("Animation_76klu"), "pick": SubResource("Animation_76klu"),
"reveal": SubResource("Animation_3304u"),
"select": SubResource("Animation_ldr2c"), "select": SubResource("Animation_ldr2c"),
"shuffle": SubResource("Animation_abihp"), "shuffle": SubResource("Animation_abihp"),
"unshuffle": SubResource("Animation_d68d2") "unshuffle": SubResource("Animation_d68d2")
@ -313,6 +342,34 @@ tracks/2/keys = {
"values": [Vector2(0, 0), Vector2(-10.0001, -123), Vector2(0, 0), Vector2(0, 0), Vector2(0, 0), Vector2(0, 1000)] "values": [Vector2(0, 0), Vector2(-10.0001, -123), Vector2(0, 0), Vector2(0, 0), Vector2(0, 0), Vector2(0, 1000)]
} }
[sub_resource type="Animation" id="Animation_orrwn"]
resource_name = "reveal"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.1, 0.4),
"transitions": PackedFloat32Array(0.517633, 1),
"update": 0,
"values": [Vector2(0, 256), Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.1, 0.4),
"transitions": PackedFloat32Array(0.517633, 1),
"update": 0,
"values": [0.349066, 0.0]
}
[sub_resource type="Animation" id="Animation_2c94q"] [sub_resource type="Animation" id="Animation_2c94q"]
resource_name = "select" resource_name = "select"
length = 0.3 length = 0.3
@ -402,6 +459,7 @@ _data = {
"RESET": SubResource("Animation_pcher"), "RESET": SubResource("Animation_pcher"),
"deselect": SubResource("Animation_5q97d"), "deselect": SubResource("Animation_5q97d"),
"pick": SubResource("Animation_16dsw"), "pick": SubResource("Animation_16dsw"),
"reveal": SubResource("Animation_orrwn"),
"select": SubResource("Animation_2c94q"), "select": SubResource("Animation_2c94q"),
"shuffle": SubResource("Animation_pdic8"), "shuffle": SubResource("Animation_pdic8"),
"unshuffle": SubResource("Animation_sa974") "unshuffle": SubResource("Animation_sa974")
@ -514,6 +572,34 @@ tracks/2/keys = {
"values": [Vector2(315, 22), Vector2(350, -123), Vector2(0, 0), Vector2(0, 0), Vector2(0, 0), Vector2(0, 1000)] "values": [Vector2(315, 22), Vector2(350, -123), Vector2(0, 0), Vector2(0, 0), Vector2(0, 0), Vector2(0, 1000)]
} }
[sub_resource type="Animation" id="Animation_ep22n"]
resource_name = "reveal"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.2, 0.5),
"transitions": PackedFloat32Array(0.482968, 1),
"update": 0,
"values": [Vector2(0, 256), Vector2(315, 22)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.2, 0.5),
"transitions": PackedFloat32Array(0.482968, 1),
"update": 0,
"values": [0.349066, 0.10472]
}
[sub_resource type="Animation" id="Animation_pcu23"] [sub_resource type="Animation" id="Animation_pcu23"]
resource_name = "select" resource_name = "select"
length = 0.3 length = 0.3
@ -615,6 +701,7 @@ _data = {
"RESET": SubResource("Animation_pf55g"), "RESET": SubResource("Animation_pf55g"),
"deselect": SubResource("Animation_6ar8x"), "deselect": SubResource("Animation_6ar8x"),
"pick": SubResource("Animation_wp0c8"), "pick": SubResource("Animation_wp0c8"),
"reveal": SubResource("Animation_ep22n"),
"select": SubResource("Animation_pcu23"), "select": SubResource("Animation_pcu23"),
"shuffle": SubResource("Animation_vu874"), "shuffle": SubResource("Animation_vu874"),
"unshuffle": SubResource("Animation_mj8e0") "unshuffle": SubResource("Animation_mj8e0")
@ -1376,6 +1463,7 @@ script = ExtResource("1_pjntm")
layout_mode = 2 layout_mode = 2
[node name="label" type="Label" parent="Control"] [node name="label" type="Label" parent="Control"]
visible = false
layout_mode = 2 layout_mode = 2
offset_left = -359.0 offset_left = -359.0
offset_top = -256.0 offset_top = -256.0

View File

@ -0,0 +1,121 @@
@tool
extends CenterContainer
class_name Collectable_Ui
@export var collapsed = true:
set(collapse):
if is_inside_tree() and not Engine.is_editor_hint():
if State.reduce_motion:
collapsed = false
return
if collapse and not collapsed:
if is_inside_tree():
_hide_buttons()
collapsed = collapse
elif not collapse and collapsed:
if is_inside_tree():
_show_buttons()
collapsed = collapse
@export var is_story: bool = false
@export var has_focus: bool = false:
set(focused):
print("set focus of card to ", focused)
if has_focus == focused: return
if focused:
has_focus = true
print(visible)
if not visible: show()
collapsed = false
if collected:
$Panel/Content/Buttons/VBoxContainer/put_back.grab_focus()
else:
$Panel/Content/Buttons/VBoxContainer/collect_or_listen.grab_focus()
elif has_focus:
has_focus = false
get_viewport().gui_release_focus()
#hide()
@export var collected: bool = false:
set(set_collected):
collected = set_collected
if set_collected:
$Panel/Content/Buttons/VBoxContainer/put_back.show()
if is_story:
$Content/Buttons/VBoxContainer/put_back.disabled = true
$Content/Buttons/VBoxContainer/collect_or_listen.text = "listen again"
if State.allow_skipping:
$Content/Buttons/VBoxContainer/skip.text = "discard cards (skip)"
else:
$Content/Buttons/VBoxContainer/collect_or_listen.disabled = true
$Content/Buttons/VBoxContainer/put_back.show()
else:
$Content/Buttons/VBoxContainer/collect_or_listen.disabled = false
@export var skipped: bool = false
@export var item_name: String = "":
set(new_name):
item_name = new_name
if is_inside_tree():
$Content/Name.text = new_name
@export var content_notes: String = "":
set(new_notes):
content_notes = new_notes
if is_inside_tree():
$Content/Name.text = new_notes
signal card_collected
# Called when the node enters the scene tree for the first time.
func _ready():
#$Panel/Content/ContentNotes.visible = State.show_content_notes
#$Panel/Content/Buttons/VBoxContainer/Summary.visible = State.provide_summaries
#$Panel/Content/Buttons/VBoxContainer/skip.visible = State.allow_skipping
if visible and not collapsed: _show_buttons()
func _hide_buttons():
if is_inside_tree():
if not State.reduce_motion: $AnimationPlayer.play_backwards("show_buttons")
func _show_buttons():
if is_inside_tree():
if not State.reduce_motion:
$AnimationPlayer.play("show_buttons")
else:
$AnimationPlayer.play("RESET")
else:
$AnimationPlayer.play("RESET")
func hide():
if visible:
_hide_buttons()
var tween = create_tween()
tween.tween_property(self, "modulate", 0, 0.4)
_hide_buttons()
await tween.finished
visible = false
func show():
if not collapsed:
_show_buttons()
modulate = Color()
visible = true
var tween = create_tween()
tween.tween_property(self, "modulate", Color(1, 1, 1), 0.4)
func _yoink_focus():
return # fixme
if not has_focus:
State.request_focus_for(self, true)
func _on_pick_button_pressed():
hide()
print("card collected!")
emit_signal("card_collected")
State.drop_focus(self)

View File

@ -1,22 +1,119 @@
[gd_scene format=3 uid="uid://cceyp2yd6o3sq"] [gd_scene load_steps=9 format=3 uid="uid://d3pb25xuef2t2"]
[node name="CenterContainer" type="CenterContainer"] [ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/messy.theme" id="1_2apkb"]
[ext_resource type="Script" path="res://logic-scenes/collectable/collectable_ui.gd" id="1_tgjc2"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="3_63j61"]
[sub_resource type="GDScript" id="GDScript_g0qhf"]
script/source = "@tool
extends Button
func hide():
if visible == true and not State.reduce_motion:
var tween:Tween = create_tween()
custom_minimum_size = get_minimum_size()
var tmp = text
text = \"\"
tween.tween_property(self, \"custom_minimum_size\", Vector2(size.x, 0), 0.2)
update_minimum_size()
await tween.finished
visible = false
text = tmp
update_minimum_size()
else:
visible = false
func show():
if visible == false and not State.reduce_motion:
var tmp = text
var tween:Tween = create_tween()
tween.tween_property(self, \"custom_minimum_size\", get_minimum_size(), 0.2)
text = \"\"
update_minimum_size()
visible = true
await tween.finished
text = tmp
else:
visible = true
"
[sub_resource type="Animation" id="Animation_rhsmi"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Panel/Content/Buttons:custom_minimum_size")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 256)]
}
[sub_resource type="Animation" id="Animation_bq4rh"]
resource_name = "invisible"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Panel/Content/Buttons:custom_minimum_size")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}
[sub_resource type="Animation" id="Animation_rx43a"]
resource_name = "show_buttons"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Panel/Content/Buttons:custom_minimum_size")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.4, 0.6),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0, 135), Vector2(0, 130)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_jad23"]
_data = {
"RESET": SubResource("Animation_rhsmi"),
"invisible": SubResource("Animation_bq4rh"),
"show_buttons": SubResource("Animation_rx43a")
}
[node name="CollectableUi" type="CenterContainer"]
anchors_preset = 15 anchors_preset = 15
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 grow_vertical = 2
theme = ExtResource("1_2apkb")
script = ExtResource("1_tgjc2")
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="Panel" type="PanelContainer" parent="."]
layout_mode = 2 layout_mode = 2
[node name="Name" type="Label" parent="VBoxContainer"] [node name="Content" type="VBoxContainer" parent="Panel"]
layout_mode = 2
[node name="Name" type="Label" parent="Panel/Content"]
layout_mode = 2 layout_mode = 2
theme_type_variation = &"HeaderLarge" theme_type_variation = &"HeaderLarge"
text = "old Mask" text = "old Mask"
horizontal_alignment = 1 horizontal_alignment = 1
[node name="Content Notes" type="RichTextLabel" parent="VBoxContainer"] [node name="ContentNotes" type="RichTextLabel" parent="Panel/Content"]
visible = false
custom_minimum_size = Vector2(256, 0) custom_minimum_size = Vector2(256, 0)
layout_mode = 2 layout_mode = 2
bbcode_enabled = true bbcode_enabled = true
@ -25,21 +122,56 @@ Food, Blood, Gore, Whatever, I need a second line.
[/center]" [/center]"
fit_content = true fit_content = true
[node name="collect_or_listen" type="Button" parent="VBoxContainer"] [node name="Buttons" type="ScrollContainer" parent="Panel/Content"]
custom_minimum_size = Vector2(0, 256)
layout_mode = 2
horizontal_scroll_mode = 0
vertical_scroll_mode = 3
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/Content/Buttons"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="collect_or_listen" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
layout_mode = 2 layout_mode = 2
tooltip_text = "Take this with you, and listen to it's story." tooltip_text = "Take this with you, and listen to it's story."
text = "Collect" text = "Collect"
script = SubResource("GDScript_g0qhf")
[node name="Summary" type="Button" parent="VBoxContainer"] [node name="Summary" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
layout_mode = 2 layout_mode = 2
tooltip_text = "Take this with you, but get a neutral description of it's story." tooltip_text = "Take this with you, but get a neutral description of it's story."
text = "get neutral summary" text = "get neutral summary"
script = SubResource("GDScript_g0qhf")
[node name="skip" type="Button" parent="VBoxContainer"] [node name="skip" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
layout_mode = 2 layout_mode = 2
tooltip_text = "Choose this to entirely skip this Item without being unable to progress in the story. Skipped Segments can still be interacted with via the Pause Screen, if you decide to change your mind." tooltip_text = "Choose this to entirely skip this Item without being unable to progress in the story. Skipped Segments can still be interacted with via the Pause Screen, if you decide to change your mind."
text = "skip" text = "skip"
script = SubResource("GDScript_g0qhf")
[node name="put_back" type="Button" parent="VBoxContainer"] [node name="put_back" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
layout_mode = 2 layout_mode = 2
text = "put back" text = "put back"
script = SubResource("GDScript_g0qhf")
[node name="StartFrame" type="TextureRect" parent="Panel"]
layout_mode = 2
mouse_filter = 2
texture = ExtResource("3_63j61")
expand_mode = 2
stretch_mode = 4
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "invisible"
libraries = {
"": SubResource("AnimationLibrary_jad23")
}
[connection signal="resized" from="Panel/Content/Buttons/VBoxContainer" to="Panel/Content/Buttons" method="_on_v_box_container_resized"]
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/collect_or_listen" to="." method="_yoink_focus"]
[connection signal="pressed" from="Panel/Content/Buttons/VBoxContainer/collect_or_listen" to="." method="_on_pick_button_pressed"]
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/Summary" to="." method="_yoink_focus"]
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/skip" to="." method="_yoink_focus"]
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/put_back" to="." method="_yoink_focus"]

Binary file not shown.

View File

@ -0,0 +1,51 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bixvvxjlt1g24"
path="res://.godot/imported/old-mask.glb-1316622a7340cbc9493e3e0eb9b621cd.scn"
[deps]
source_file="res://logic-scenes/collectable/import/old-mask.glb"
dest_files=["res://.godot/imported/old-mask.glb-1316622a7340cbc9493e3e0eb9b621cd.scn"]
[params]
nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={
"materials": {
"desk-utilities": {
"use_external/enabled": true,
"use_external/path": "res://base-environments/youth_room/import/materials/desk-utilities.tres"
}
},
"meshes": {
"old-mask_old_mask": {
"generate/lightmap_uv": 0,
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"save_to_file/enabled": true,
"save_to_file/make_streamable": "",
"save_to_file/path": "res://logic-scenes/collectable/import/old-mask.res"
}
}
}
gltf/embedded_image_handling=1

Binary file not shown.

View File

@ -0,0 +1,9 @@
extends Panel
@onready var has_focus = true:
set(focus):
if focus:
has_focus = State.request_focus(self)
else:
has_focus = false
State.drop_own_focus(self)

View File

@ -1,6 +1,32 @@
extends RigidBody3D extends RigidBody3D
@export var active: bool = true : set = set_active var has_focus: bool = false:
set(focused):
if has_focus != focused:
if focused:
has_focus = true
if is_inside_tree():
camera.make_current()
get_viewport().gui_release_focus()
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
var jitter_tween: Tween = create_tween()
jitter_tween.tween_property(self, "jitter_strength", 1, 1)
if has_entered: emit_signal("ui_entered")
elif has_focus:
camera.current = true
jitter_strength = 1
else:
if is_inside_tree() and has_focus:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
var jitter_tween: Tween = create_tween()
jitter_tween.tween_property(self, "jitter_strength", 0, 0.5)
if has_entered: emit_signal("ui_exited")
else:
jitter_strength = 0
has_focus = false
sleeping = has_focus
@export_range (0, 10) var max_speed: float = 3 @export_range (0, 10) var max_speed: float = 3
@export_range (0, 10) var max_acceleration: float = 5 @export_range (0, 10) var max_acceleration: float = 5
@export_range (0, 20) var damp: float = 10 @export_range (0, 20) var damp: float = 10
@ -30,36 +56,32 @@ var on_crouch_cooldown:bool = false
@onready var pitch:Node3D = $Yaw/Pitch @onready var pitch:Node3D = $Yaw/Pitch
@onready var mount:Node3D = $Yaw/Pitch/Mount @onready var mount:Node3D = $Yaw/Pitch/Mount
@onready var camera:Camera3D = $Yaw/Pitch/Mount/Camera3D @onready var camera:Camera3D = $Yaw/Pitch/Mount/Camera3D
@onready var focus_ray: RayCast3D = $Yaw/Pitch/Mount/Camera3D/RayCast3D
func set_active(activate): signal ui_entered
active = activate var has_entered:bool = false
if !is_inside_tree(): return signal ui_exited
if activate:
camera.make_current()
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
var jitter_tween: Tween = create_tween()
jitter_tween.tween_property(self, "jitter_strength", 1, 1)
else:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
var jitter_tween: Tween = create_tween()
jitter_tween.tween_property(self, "jitter_strength", 0, 0.5)
sleeping = active
func _ready(): func _ready():
if active:
set_active(active)
jitter_strength = 1
_handle_jitter(0) _handle_jitter(0)
func _process(delta): func _process(delta):
if Input.is_action_just_pressed("ui_cancel"):
set_active(!active) if focus_ray.get_collider() != null:
emit_signal("ui_entered")
has_entered = true
if has_entered:
if focus_ray.get_collider() == null:
emit_signal("ui_exited")
has_entered = false
if Input.is_action_just_pressed("ui_accept"):
State.pass_focus_to(focus_ray.get_collider())
func _physics_process(delta:float): func _physics_process(delta:float):
_handle_movement(delta) if has_focus:
_handle_rotation(delta) _handle_movement(delta)
_handle_rotation(delta)
if jitter_strength > 0: _handle_jitter(delta) if jitter_strength > 0: _handle_jitter(delta)
func _handle_movement(delta:float): func _handle_movement(delta:float):
@ -85,7 +107,7 @@ func _handle_movement(delta:float):
func _handle_rotation(delta:float): func _handle_rotation(delta:float):
var smoothness = min(3, 60.0/Engine.get_frames_per_second()) var smoothness = min(3, 60.0/Engine.get_frames_per_second())
var input_speed = Vector2( Input.get_action_strength("look_right")-Input.get_action_strength("look_left"), Input.get_action_strength("look_down")-Input.get_action_strength("look_up")) * gamepad_response var input_speed = Vector2( Input.get_action_strength("look_right")-Input.get_action_strength("look_left"), Input.get_action_strength("look_up")-Input.get_action_strength("look_down")) * gamepad_response
if current_mouse_rotation.length()>0: if current_mouse_rotation.length()>0:
input_speed = current_mouse_rotation input_speed = current_mouse_rotation
@ -122,9 +144,19 @@ func _handle_mouse_input(event:InputEventMouseMotion):
current_mouse_rotation = event.relative current_mouse_rotation = event.relative
func _unhandled_input(event:InputEvent): func _unhandled_input(event:InputEvent):
if active: if has_focus:
if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED: if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
_handle_mouse_input(event) _handle_mouse_input(event)
get_viewport().set_input_as_handled()
if event is InputEventMouseButton and has_entered:
State.free_focus()
get_viewport().set_input_as_handled()
#if event.is_action_pressed("ui_accept"):
# State.pass_focus_to(focus_ray.get_collider())
# get_viewport().set_input_as_handled()
func _on_empty_click():
State.request_focus_for(self, true)
func _on_bed_enter(_body): func _on_bed_enter(_body):
if not (crouched or on_crouch_cooldown): if not (crouched or on_crouch_cooldown):

View File

@ -1,10 +1,18 @@
[gd_scene load_steps=8 format=3 uid="uid://mkccbig41bqb"] [gd_scene load_steps=11 format=3 uid="uid://mkccbig41bqb"]
[ext_resource type="Script" path="res://logic-scenes/player_controller/player_controller.gd" id="1_0b4mi"] [ext_resource type="Script" path="res://logic-scenes/player_controller/player_controller.gd" id="1_0b4mi"]
[ext_resource type="ArrayMesh" uid="uid://bfc3d4g40n0wy" path="res://logic-scenes/collectable/import/old-mask.res" id="2_vnej0"]
[sub_resource type="PhysicsMaterial" id="10"] [sub_resource type="PhysicsMaterial" id="10"]
friction = 0.0 friction = 0.0
[sub_resource type="GDScript" id="GDScript_r0b38"]
script/source = "extends MeshInstance3D
func _process(delta):
rotate_y(delta/3)
"
[sub_resource type="SphereShape3D" id="8"] [sub_resource type="SphereShape3D" id="8"]
radius = 0.307047 radius = 0.307047
@ -34,6 +42,114 @@ tracks/1/keys = {
"update": 0, "update": 0,
"values": [Vector3(0, 0, 0)] "values": [Vector3(0, 0, 0)]
} }
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Yaw/Pitch/Mount/Camera3D/memory mount/old_mask2:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(5.96046e-08, 1.74846e-07, -7.10543e-15)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Yaw/Pitch/Mount/Camera3D/memory mount:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.11067, -0.0251684, -0.309266)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Yaw/Pitch/Mount/Camera3D/memory mount:rotation")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(1.49012e-07, 0, 0)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D:light_energy")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.4]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D2:light_energy")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.5]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D:visible")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/8/type = "value"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D2:layers")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/9/type = "value"
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D2:visible")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/10/type = "value"
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/path = NodePath("Yaw/Pitch/Mount/Camera3D/memory mount/old_mask2:visible")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="12"] [sub_resource type="Animation" id="12"]
resource_name = "crouch" resource_name = "crouch"
@ -63,6 +179,106 @@ tracks/1/keys = {
"values": [Vector3(0, 0, 0), Vector3(-30, 0, -10), Vector3(-20, 0, 3), Vector3(0, 0, 0), Vector3(0, 0, 0)] "values": [Vector3(0, 0, 0), Vector3(-30, 0, -10), Vector3(-20, 0, 3), Vector3(0, 0, 0), Vector3(0, 0, 0)]
} }
[sub_resource type="Animation" id="Animation_5o0sk"]
resource_name = "mask_reveal"
length = 3.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Yaw/Pitch/Mount/Camera3D/memory mount:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 3),
"transitions": PackedFloat32Array(0.366021, 1),
"update": 0,
"values": [Vector3(0.376781, -0.521269, -0.513588), Vector3(0.18, -0.025, -0.309)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Yaw/Pitch/Mount/Camera3D/memory mount:rotation")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 3),
"transitions": PackedFloat32Array(1, 0.378929),
"update": 0,
"values": [Vector3(0, -0.698132, 0), Vector3(1.49012e-07, 0, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D:light_energy")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.8, 3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 0.4]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D2:light_energy")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.2, 3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.5]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D2:layers")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Yaw/Pitch/Mount/Camera3D/SpotLight3D2:visible")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("Yaw/Pitch/Mount/Camera3D/memory mount/old_mask2:visible")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
[sub_resource type="Animation" id="14"] [sub_resource type="Animation" id="14"]
resource_name = "stand_up" resource_name = "stand_up"
length = 3.0 length = 3.0
@ -95,6 +311,7 @@ tracks/1/keys = {
_data = { _data = {
"RESET": SubResource("11"), "RESET": SubResource("11"),
"crouch": SubResource("12"), "crouch": SubResource("12"),
"mask_reveal": SubResource("Animation_5o0sk"),
"stand_up": SubResource("14") "stand_up": SubResource("14")
} }
@ -120,12 +337,55 @@ transform = Transform3D(1, 0, 0, 0, 0.5, -0.866025, 0, 0.866025, 0.5, 0, 0.25649
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.202, 0.157) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.202, 0.157)
current = true current = true
[node name="RayCast3D" type="RayCast3D" parent="Yaw/Pitch/Mount/Camera3D"]
target_position = Vector3(0, 0, -1.3)
collision_mask = 17
collide_with_areas = true
collide_with_bodies = false
[node name="memory mount" type="Node3D" parent="Yaw/Pitch/Mount/Camera3D"]
transform = Transform3D(0.8, 0, 0, 0, 0.8, -7.15258e-08, 0, 1.1921e-07, 0.48, 0.11067, -0.0251684, -0.309266)
[node name="old_mask2" type="MeshInstance3D" parent="Yaw/Pitch/Mount/Camera3D/memory mount"]
transform = Transform3D(1, 1.75271e-14, 1.74846e-07, -7.10543e-15, 1, -5.96046e-08, -1.74846e-07, 5.96046e-08, 1, 0.0250661, 0, 0)
visible = false
mesh = ExtResource("2_vnej0")
skeleton = NodePath("")
script = SubResource("GDScript_r0b38")
[node name="OmniLight3D" type="OmniLight3D" parent="Yaw/Pitch/Mount/Camera3D/memory mount/old_mask2"]
transform = Transform3D(1, -3.8743e-07, 5.96046e-08, 3.57628e-07, 1, 8.9407e-08, -5.96046e-08, -8.9407e-08, 1, 0.083235, -0.219628, 0.176047)
light_color = Color(0.972549, 0.752941, 0.592157, 1)
light_energy = 0.1
light_specular = 0.0
omni_range = 0.457129
omni_attenuation = 0.659754
[node name="SpotLight3D" type="SpotLight3D" parent="Yaw/Pitch/Mount/Camera3D"]
transform = Transform3D(0.584488, 0.621177, -0.522028, 0.363951, 0.374307, 0.852897, 0.725199, -0.688501, -0.00729993, 0.0601956, 0.21754, -0.271749)
visible = false
light_color = Color(0.97599, 0.669299, 0.509314, 1)
light_energy = 0.4
light_size = 0.1
shadow_enabled = true
spot_range = 0.394683
spot_angle = 27.7927
[node name="SpotLight3D2" type="SpotLight3D" parent="Yaw/Pitch/Mount/Camera3D"]
transform = Transform3D(0.456583, 0.0747244, 0.886537, 0.819566, -0.423063, -0.386432, 0.346185, 0.903014, -0.254405, 0.475638, -0.147216, -0.329875)
visible = false
light_color = Color(0.317647, 0.427451, 1, 1)
light_energy = 1.5
light_size = 0.1
shadow_enabled = true
spot_range = 0.624277
spot_angle = 22.1657
[node name="PlayerCollision" type="CollisionShape3D" parent="."] [node name="PlayerCollision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.322255, 0) transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.322255, 0)
shape = SubResource("8") shape = SubResource("8")
[node name="PlayerAnimationPlayer" type="AnimationPlayer" parent="."] [node name="PlayerAnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "RESET"
libraries = { libraries = {
"": SubResource("AnimationLibrary_xbx3w") "": SubResource("AnimationLibrary_xbx3w")
} }

View File

@ -1,9 +1,9 @@
[gd_scene load_steps=10 format=3 uid="uid://gldtxysavetf"] [gd_scene load_steps=10 format=3 uid="uid://gldtxysavetf"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://logic-scenes/startup/start_frame.png" id="1_8giso"] [ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="1_8giso"]
[ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/messy.theme" id="1_b01tw"] [ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/messy.theme" id="1_b01tw"]
[ext_resource type="Script" path="res://logic-scenes/startup/volume_sliders.gd" id="3_q2gbh"] [ext_resource type="Script" path="res://logic-scenes/startup/volume_sliders.gd" id="3_q2gbh"]
[ext_resource type="Texture2D" uid="uid://bwicl5q0lw06q" path="res://logic-scenes/startup/start_bottom.png" id="3_s5ssh"] [ext_resource type="Texture2D" uid="uid://bwicl5q0lw06q" path="res://import/interface-elements/bottom.png" id="3_s5ssh"]
[sub_resource type="GDScript" id="GDScript_ia432"] [sub_resource type="GDScript" id="GDScript_ia432"]
script/source = "extends TabContainer script/source = "extends TabContainer

Binary file not shown.

View File

@ -1,10 +1,11 @@
[gd_scene load_steps=7 format=3 uid="uid://befxf8uruwnrl"] [gd_scene load_steps=8 format=3 uid="uid://befxf8uruwnrl"]
[ext_resource type="Texture2D" uid="uid://balmcptv73l2j" path="res://dev-util/menu_background.png" id="1_0oiki"] [ext_resource type="Texture2D" uid="uid://balmcptv73l2j" path="res://dev-util/menu_background.png" id="1_0oiki"]
[ext_resource type="PackedScene" uid="uid://cq2s8oa1ql28l" path="res://logic-scenes/startup/startup.tscn" id="1_v5rpm"] [ext_resource type="PackedScene" uid="uid://gldtxysavetf" path="res://logic-scenes/startup/startup.tscn" id="1_v5rpm"]
[ext_resource type="PackedScene" uid="uid://b3b0gyvklqn50" path="res://base-environments/youth_room/youth_room.tscn" id="2_23ia3"] [ext_resource type="PackedScene" uid="uid://b3b0gyvklqn50" path="res://base-environments/youth_room/youth_room.tscn" id="2_23ia3"]
[ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/messy.theme" id="3_8hrj7"] [ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/messy.theme" id="3_8hrj7"]
[ext_resource type="Texture2D" uid="uid://d3ewjumh0b0g6" path="res://logic-scenes/main menu/logo.png" id="4_kslkj"] [ext_resource type="Texture2D" uid="uid://d3ewjumh0b0g6" path="res://logic-scenes/main menu/logo.png" id="4_kslkj"]
[ext_resource type="Script" path="res://logic-scenes/main menu/Main Menu.gd" id="4_vj0j6"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_njt06"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_njt06"]
@ -22,6 +23,8 @@ texture = ExtResource("1_0oiki")
[node name="Startup Menu" parent="." instance=ExtResource("1_v5rpm")] [node name="Startup Menu" parent="." instance=ExtResource("1_v5rpm")]
visible = false visible = false
[node name="youth room" parent="." instance=ExtResource("2_23ia3")]
[node name="Main Menu" type="Panel" parent="."] [node name="Main Menu" type="Panel" parent="."]
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -30,6 +33,7 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme = ExtResource("3_8hrj7") theme = ExtResource("3_8hrj7")
theme_override_styles/panel = SubResource("StyleBoxEmpty_njt06") theme_override_styles/panel = SubResource("StyleBoxEmpty_njt06")
script = ExtResource("4_vj0j6")
[node name="TextureRect" type="TextureRect" parent="Main Menu"] [node name="TextureRect" type="TextureRect" parent="Main Menu"]
layout_mode = 1 layout_mode = 1
@ -61,7 +65,5 @@ grow_vertical = 2
layout_mode = 2 layout_mode = 2
text = "new Game" text = "new Game"
[node name="youth room" parent="." instance=ExtResource("2_23ia3")]
[connection signal="pressed" from="Main Menu/PanelContainer/Button" to="Main Menu" method="hide"]
[connection signal="pressed" from="Main Menu/PanelContainer/Button" to="youth room" method="start"] [connection signal="pressed" from="Main Menu/PanelContainer/Button" to="youth room" method="start"]
[connection signal="pressed" from="Main Menu/PanelContainer/Button" to="Main Menu" method="hide"]

View File

@ -20,12 +20,17 @@ config/icon="res://icon.png"
State="*res://singletons/global_state.gd" State="*res://singletons/global_state.gd"
[debug]
gdscript/warnings/native_method_override=0
[display] [display]
window/size/viewport_width=1440 window/size/viewport_width=1440
window/size/viewport_height=1080 window/size/viewport_height=1080
window/stretch/mode="canvas_items" window/stretch/mode="canvas_items"
window/stretch/aspect="expand" window/stretch/aspect="expand"
mouse_cursor/custom_image="res://import/interface-elements/cursor.png"
[gui] [gui]
@ -33,6 +38,14 @@ theme/custom="res://logic-scenes/themes/messy.theme"
[input] [input]
ui_accept={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":4194309,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194310,"physical_keycode":0,"key_label":0,"unicode":4194310,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
]
}
player_right={ player_right={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)

View File

@ -6,4 +6,60 @@ var simplified_navigation:bool = false
var enable_subtitles: bool = false var enable_subtitles: bool = false
var reduce_motion: bool = false var reduce_motion: bool = false
var show_content_notes: bool = false var show_content_notes: bool = false
var show_prompts: bool = false var provide_summaries: bool = false
var allow_skipping: bool = false
var focus_list:Array = []
var lock_focus: bool = false
# Intented for use when me wants focus for itself, can reclaim focus, thus dropping the stack that focused.
func request_focus_for(me: Object, reclaim: bool = false) -> bool:
if reclaim:
focus_list.front().has_focus = false
if focus_list.has(me):
while focus_list.pop_front() != me: break
me.has_focus = true
return me.has_focus
push_warning(me, " wanted to reclaim focus, but was not on list.")
return pass_focus_to(me)
# Element no longer wants focus, if Element itself is also dropped, this option can be chosen aswell.
func drop_focus(of:Object, dropObject: bool = false) -> bool:
if lock_focus or get_tree().paused:
push_error(of, " wanted to drop focus while it was locked or tree is paused.")
if not dropObject: of.has_focus = false
focus_list.erase(of)
focus_list.front().has_focus = true
return false
func get_current_focus(): return focus_list.front()
# Used to put a new target on top of the Focus Stack.
func pass_focus_to(target:Object) -> bool:
if "focus_forward" in target:
pass_focus_to(target.focus_forward)
if lock_focus or get_tree().paused:
push_error(target, " requested focus while it was locked or tree is paused.")
elif !is_instance_valid(target):
push_error("Focus instance not valid")
elif !"has_focus" in target:
push_error(target, " has no has focus method")
else:
if not focus_list.front() == null: focus_list.front().has_focus = false
target.has_focus = true
if target.has_focus:
focus_list.push_front(target)
assert(focus_list.size() < 100)
return true
return false
# Currently focused element loses focus, but remains in stack.
func free_focus():
if not focus_list.front() == null: focus_list.front().has_focus = false
func queue_for_focus(target: Object, index: int):
focus_list.insert(index, target)

View File

@ -1,30 +1,138 @@
[gd_scene load_steps=4 format=3 uid="uid://bdnesuqroi7ss"] [gd_scene load_steps=12 format=3 uid="uid://bdnesuqroi7ss"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nbr3v"] [ext_resource type="Shader" path="res://vfx/particle_mixer.gdshader" id="1_i6oe2"]
blend_mode = 1 [ext_resource type="Texture2D" uid="uid://dq7jm5ufknbb6" path="res://vfx/lens-flare-particle.png" id="2_h5y3k"]
billboard_mode = 3
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_d61lg"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_lpenh"]
render_priority = 0
shader = ExtResource("1_i6oe2")
shader_parameter/particle_color = null
shader_parameter/particle_texture = ExtResource("2_h5y3k")
[sub_resource type="Gradient" id="Gradient_tjuvm"]
offsets = PackedFloat32Array(0, 0.50813, 1)
colors = PackedColorArray(1, 0.877403, 0.516545, 1, 0.94702, 0.505309, 0.59484, 1, 0.735853, 0.324231, 0.687053, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_d2t20"]
gradient = SubResource("Gradient_tjuvm")
[sub_resource type="Gradient" id="Gradient_c8r4y"]
offsets = PackedFloat32Array(0, 0.00813008, 0.52439, 1)
colors = PackedColorArray(0, 0, 0, 1, 0.0284553, 0.0284553, 0.0284553, 1, 0.244776, 0.244776, 0.244776, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_2vogp"]
gradient = SubResource("Gradient_c8r4y")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_eegys"]
emission_shape = 1 emission_shape = 1
emission_sphere_radius = 1.0 emission_sphere_radius = 0.3
spread = 180.0 spread = 180.0
gravity = Vector3(0, 1, 0) gravity = Vector3(0, 0.02, 0)
initial_velocity_min = 0.2 initial_velocity_max = 0.2
initial_velocity_max = 1.0 color_ramp = SubResource("GradientTexture1D_2vogp")
color_initial_ramp = SubResource("GradientTexture1D_d2t20")
turbulence_enabled = true turbulence_enabled = true
turbulence_noise_strength = 0.1
turbulence_noise_scale = 2.0
turbulence_noise_speed = Vector3(0.1, 0.3, 0.5) turbulence_noise_speed = Vector3(0.1, 0.3, 0.5)
turbulence_noise_speed_random = 0.3 turbulence_noise_speed_random = 0.3
turbulence_influence_min = 0.05 turbulence_influence_min = 0.01
turbulence_influence_max = 0.03
turbulence_initial_displacement_max = 1.0 turbulence_initial_displacement_max = 1.0
[sub_resource type="Shader" id="Shader_p2314"]
code = "// NOTE: Shader automatically converted from Godot Engine 4.0.stable's StandardMaterial3D.
shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_disabled;
uniform vec4 albedo : source_color;
uniform sampler2D texture_albedo : source_color,filter_linear_mipmap,repeat_enable;
uniform float point_size : hint_range(0,128);
uniform float roughness : hint_range(0,1);
uniform sampler2D texture_metallic : hint_default_white,filter_linear_mipmap,repeat_enable;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_roughness_r,filter_linear_mipmap,repeat_enable;
uniform float specular;
uniform float metallic;
uniform int particles_anim_h_frames;
uniform int particles_anim_v_frames;
uniform bool particles_anim_loop;
uniform vec4 backlight : source_color;
uniform sampler2D texture_backlight : hint_default_black,filter_linear_mipmap,repeat_enable;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;
void vertex() {
UV=UV*uv1_scale.xy+uv1_offset.xy;
mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) ,normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]);
mat_world = mat_world * mat4(vec4(cos(INSTANCE_CUSTOM.x), -sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));
MODELVIEW_MATRIX = VIEW_MATRIX * mat_world;
MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);
float h_frames = float(particles_anim_h_frames);
float v_frames = float(particles_anim_v_frames);
float particle_total_frames = float(particles_anim_h_frames * particles_anim_v_frames);
float particle_frame = floor(INSTANCE_CUSTOM.z * float(particle_total_frames));
if (!particles_anim_loop) {
particle_frame = clamp(particle_frame, 0.0, particle_total_frames - 1.0);
} else {
particle_frame = mod(particle_frame, particle_total_frames);
}
UV /= vec2(h_frames, v_frames);
UV += vec2(mod(particle_frame, h_frames) / h_frames, floor((particle_frame + 0.5) / h_frames) / v_frames);
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
METALLIC = metallic_tex * metallic;
vec4 roughness_texture_channel = vec4(1.0,0.0,0.0,0.0);
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
SPECULAR = specular;
vec3 backlight_tex = texture(texture_backlight,base_uv).rgb;
BACKLIGHT = (backlight.rgb+backlight_tex);
}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fgrmi"]
render_priority = 0
shader = SubResource("Shader_p2314")
shader_parameter/albedo = Color(1, 1, 1, 1)
shader_parameter/point_size = 1.0
shader_parameter/roughness = 1.0
shader_parameter/metallic_texture_channel = Plane(1, 0, 0, 0)
shader_parameter/specular = 0.5
shader_parameter/metallic = 0.0
shader_parameter/particles_anim_h_frames = 1
shader_parameter/particles_anim_v_frames = 1
shader_parameter/particles_anim_loop = false
shader_parameter/backlight = Color(0, 0, 0, 1)
shader_parameter/uv1_scale = Vector3(1, 1, 1)
shader_parameter/uv1_offset = Vector3(0, 0, 0)
shader_parameter/uv2_scale = Vector3(1, 1, 1)
shader_parameter/uv2_offset = Vector3(0, 0, 0)
shader_parameter/texture_albedo = ExtResource("2_h5y3k")
shader_parameter/texture_backlight = ExtResource("2_h5y3k")
[sub_resource type="QuadMesh" id="QuadMesh_ea2fp"] [sub_resource type="QuadMesh" id="QuadMesh_ea2fp"]
material = SubResource("ShaderMaterial_fgrmi")
size = Vector2(0.1, 0.1)
[node name="collectable_particles" type="GPUParticles3D"] [node name="collectable_particles" type="GPUParticles3D"]
material_override = SubResource("StandardMaterial3D_nbr3v") material_override = SubResource("ShaderMaterial_lpenh")
amount = 30 cast_shadow = 0
amount = 50
lifetime = 10.0 lifetime = 10.0
process_material = SubResource("ParticleProcessMaterial_d61lg") process_material = SubResource("ParticleProcessMaterial_eegys")
draw_pass_1 = SubResource("QuadMesh_ea2fp") draw_pass_1 = SubResource("QuadMesh_ea2fp")

View File

@ -4,6 +4,7 @@ render_mode blend_add, specular_disabled;
uniform sampler2D particle_texture; uniform sampler2D particle_texture;
uniform vec4 particle_color : source_color; uniform vec4 particle_color : source_color;
uniform sampler2D DEPTH_TEXTURE: hint_depth_texture;
void vertex() { void vertex() {
mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) ,normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]); mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) ,normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]);
@ -14,9 +15,13 @@ void vertex() {
} }
void fragment() { void fragment() {
ALBEDO = texture(particle_texture,UV/2.0).xyz * COLOR.xyz; float depth = texture(DEPTH_TEXTURE, SCREEN_UV).r;
depth = PROJECTION_MATRIX[3][2] / (depth + PROJECTION_MATRIX[2][2]);
depth += VERTEX.z;
depth = max(0.0,min(1.0, (depth*10.0 - 0.1)));
ALBEDO = texture(particle_texture,UV/2.0).xyz * COLOR.xyz * depth;
EMISSION = ALBEDO/8.0; EMISSION = ALBEDO/8.0;
BACKLIGHT = ALBEDO; BACKLIGHT = ALBEDO;
SPECULAR = 0.0; SPECULAR = 0.0;
} }