devcom code
This commit is contained in:
parent
0a9fa3ef6d
commit
cc6c9616fd
Binary file not shown.
Binary file not shown.
|
|
@ -15,3 +15,6 @@ func _on_mouse_entered():
|
||||||
|
|
||||||
func _on_mouse_exited():
|
func _on_mouse_exited():
|
||||||
assert(false)
|
assert(false)
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
if Input.is_action_just_pressed("ui_focus_prev"): $UiWrapper/UiSprite/SubViewport.update()
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,13 @@ func _ready():
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
pass
|
if Input.is_action_just_pressed("ui_cancel"):
|
||||||
|
State.pass_focus_to($picker)
|
||||||
|
|
||||||
func start():
|
func start():
|
||||||
$light_animation.play("light_up")
|
$light_animation.play("light_up")
|
||||||
$AudioPlayer.play("intro")
|
$AudioPlayer.play("intro")
|
||||||
State.assign_focus_to($PlayerController)
|
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:
|
||||||
|
|
@ -37,7 +38,6 @@ func _update_scene(new_mode) -> int:
|
||||||
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):
|
func _unhandled_input(event):
|
||||||
|
|
@ -45,3 +45,11 @@ func _unhandled_input(event):
|
||||||
if event.pressed:
|
if event.pressed:
|
||||||
print("passed")
|
print("passed")
|
||||||
#State.pass_focus_to($PlayerController)
|
#State.pass_focus_to($PlayerController)
|
||||||
|
|
||||||
|
func _on_childhood_collected():
|
||||||
|
$light_animation.play("lights_out")
|
||||||
|
|
||||||
|
func _on_childhood_done():
|
||||||
|
State.pass_focus_to($picker)
|
||||||
|
$light_animation.play("light_up")
|
||||||
|
$PlayerController.on_childhood_done()
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,6 @@
|
||||||
[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
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -156,7 +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 = 3
|
frame = 1
|
||||||
script = SubResource("GDScript_8bs16")
|
script = SubResource("GDScript_8bs16")
|
||||||
|
|
||||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="BackgroundSprite"]
|
[node name="GPUParticles2D" type="GPUParticles2D" parent="BackgroundSprite"]
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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"]
|
||||||
|
|
@ -208,11 +208,40 @@ tracks/1/keys = {
|
||||||
"values": [-0.109599, 0.5044, 3.4924]
|
"values": [-0.109599, 0.5044, 3.4924]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[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="AnimationLibrary" id="AnimationLibrary_gdxmh"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_gdxmh"]
|
||||||
_data = {
|
_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")
|
||||||
|
|
@ -397,11 +426,40 @@ tracks/1/keys = {
|
||||||
"values": [0.0, 0.0436332, 3.22362]
|
"values": [0.0, 0.0436332, 3.22362]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[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="AnimationLibrary" id="AnimationLibrary_oxheu"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_oxheu"]
|
||||||
_data = {
|
_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")
|
||||||
|
|
@ -610,11 +668,40 @@ tracks/1/keys = {
|
||||||
"values": [0.10472, 0.0436332, 3.22362]
|
"values": [0.10472, 0.0436332, 3.22362]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[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="AnimationLibrary" id="AnimationLibrary_8blxm"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_8blxm"]
|
||||||
_data = {
|
_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
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ class_name Collectable_Ui
|
||||||
|
|
||||||
@export var collapsed = true:
|
@export var collapsed = true:
|
||||||
set(collapse):
|
set(collapse):
|
||||||
if is_inside_tree():
|
if is_inside_tree() and not Engine.is_editor_hint():
|
||||||
if State.reduce_motion:
|
if State.reduce_motion:
|
||||||
collapsed = false
|
collapsed = false
|
||||||
return
|
return
|
||||||
|
|
@ -25,21 +25,19 @@ class_name Collectable_Ui
|
||||||
if has_focus == focused: return
|
if has_focus == focused: return
|
||||||
|
|
||||||
if focused:
|
if focused:
|
||||||
has_focus = State.request_focus(self)
|
has_focus = true
|
||||||
if has_focus:
|
print(visible)
|
||||||
collapsed = false
|
if not visible: show()
|
||||||
if collected:
|
collapsed = false
|
||||||
$Panel/Content/Buttons/VBoxContainer/put_back.grab_focus()
|
if collected:
|
||||||
else:
|
$Panel/Content/Buttons/VBoxContainer/put_back.grab_focus()
|
||||||
$Panel/Content/Buttons/VBoxContainer/collect_or_listen.grab_focus()
|
else:
|
||||||
|
$Panel/Content/Buttons/VBoxContainer/collect_or_listen.grab_focus()
|
||||||
elif has_focus:
|
elif has_focus:
|
||||||
has_focus = false # How did we get here?
|
has_focus = false
|
||||||
State.focus_cleared(self)
|
|
||||||
get_viewport().gui_release_focus()
|
get_viewport().gui_release_focus()
|
||||||
hide()
|
#hide()
|
||||||
|
|
||||||
if not visible:
|
|
||||||
show()
|
|
||||||
|
|
||||||
|
|
||||||
@export var collected: bool = false:
|
@export var collected: bool = false:
|
||||||
|
|
@ -72,6 +70,8 @@ class_name Collectable_Ui
|
||||||
if is_inside_tree():
|
if is_inside_tree():
|
||||||
$Content/Name.text = new_notes
|
$Content/Name.text = new_notes
|
||||||
|
|
||||||
|
signal card_collected
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
#$Panel/Content/ContentNotes.visible = State.show_content_notes
|
#$Panel/Content/ContentNotes.visible = State.show_content_notes
|
||||||
|
|
@ -80,11 +80,15 @@ func _ready():
|
||||||
if visible and not collapsed: _show_buttons()
|
if visible and not collapsed: _show_buttons()
|
||||||
|
|
||||||
func _hide_buttons():
|
func _hide_buttons():
|
||||||
if not State.reduce_motion: $AnimationPlayer.play_backwards("show_buttons")
|
if is_inside_tree():
|
||||||
|
if not State.reduce_motion: $AnimationPlayer.play_backwards("show_buttons")
|
||||||
|
|
||||||
func _show_buttons():
|
func _show_buttons():
|
||||||
if State.reduce_motion:
|
if is_inside_tree():
|
||||||
$AnimationPlayer.play("show_buttons")
|
if not State.reduce_motion:
|
||||||
|
$AnimationPlayer.play("show_buttons")
|
||||||
|
else:
|
||||||
|
$AnimationPlayer.play("RESET")
|
||||||
else:
|
else:
|
||||||
$AnimationPlayer.play("RESET")
|
$AnimationPlayer.play("RESET")
|
||||||
|
|
||||||
|
|
@ -106,4 +110,12 @@ func show():
|
||||||
tween.tween_property(self, "modulate", Color(1, 1, 1), 0.4)
|
tween.tween_property(self, "modulate", Color(1, 1, 1), 0.4)
|
||||||
|
|
||||||
func _yoink_focus():
|
func _yoink_focus():
|
||||||
State.request_focus(self, true)
|
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)
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ libraries = {
|
||||||
|
|
||||||
[connection signal="resized" from="Panel/Content/Buttons/VBoxContainer" to="Panel/Content/Buttons" method="_on_v_box_container_resized"]
|
[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="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/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/skip" to="." method="_yoink_focus"]
|
||||||
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/put_back" to="." method="_yoink_focus"]
|
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/put_back" to="." method="_yoink_focus"]
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,39 @@
|
||||||
|
[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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gltf/embedded_image_handling=1
|
||||||
|
|
@ -7,3 +7,6 @@ extends Panel
|
||||||
else:
|
else:
|
||||||
has_focus = false
|
has_focus = false
|
||||||
State.drop_own_focus(self)
|
State.drop_own_focus(self)
|
||||||
|
|
||||||
|
func yeet():
|
||||||
|
get_parent().remove_child(self)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
extends RigidBody3D
|
extends RigidBody3D
|
||||||
|
|
||||||
var has_focus: bool = false :
|
var has_focus: bool = false:
|
||||||
set(focused):
|
set(focused):
|
||||||
if has_focus != focused:
|
if has_focus != focused:
|
||||||
if focused:
|
if focused:
|
||||||
has_focus = State.request_focus(self)
|
has_focus = true
|
||||||
if is_inside_tree() and has_focus:
|
if is_inside_tree():
|
||||||
camera.make_current()
|
camera.make_current()
|
||||||
get_viewport().gui_release_focus()
|
get_viewport().gui_release_focus()
|
||||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||||
|
|
@ -24,7 +24,6 @@ var has_focus: bool = false :
|
||||||
else:
|
else:
|
||||||
jitter_strength = 0
|
jitter_strength = 0
|
||||||
has_focus = false
|
has_focus = false
|
||||||
State.focus_cleared(self)
|
|
||||||
|
|
||||||
sleeping = has_focus
|
sleeping = has_focus
|
||||||
|
|
||||||
|
|
@ -64,7 +63,7 @@ var has_entered:bool = false
|
||||||
signal ui_exited
|
signal ui_exited
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
if has_focus: _handle_jitter(0)
|
_handle_jitter(0)
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
|
||||||
|
|
@ -77,7 +76,7 @@ func _process(delta):
|
||||||
emit_signal("ui_exited")
|
emit_signal("ui_exited")
|
||||||
has_entered = false
|
has_entered = false
|
||||||
if Input.is_action_just_pressed("ui_accept"):
|
if Input.is_action_just_pressed("ui_accept"):
|
||||||
State.assign_focus_to(focus_ray.get_collider())
|
State.pass_focus_to(focus_ray.get_collider())
|
||||||
|
|
||||||
func _physics_process(delta:float):
|
func _physics_process(delta:float):
|
||||||
if has_focus:
|
if has_focus:
|
||||||
|
|
@ -108,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
|
||||||
|
|
@ -150,14 +149,14 @@ func _unhandled_input(event:InputEvent):
|
||||||
_handle_mouse_input(event)
|
_handle_mouse_input(event)
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
if event is InputEventMouseButton and has_entered:
|
if event is InputEventMouseButton and has_entered:
|
||||||
has_focus = false
|
State.free_focus()
|
||||||
get_viewport().set_input_as_handled()
|
|
||||||
if event.is_action("ui_accept"):
|
|
||||||
State.assign_focus_to(focus_ray.get_collider())
|
|
||||||
get_viewport().set_input_as_handled()
|
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():
|
func _on_empty_click():
|
||||||
State.pass_focus_to(self)
|
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):
|
||||||
|
|
@ -177,4 +176,8 @@ func _on_bed_exit(_body):
|
||||||
await get_tree().create_timer(1.0).timeout
|
await get_tree().create_timer(1.0).timeout
|
||||||
on_crouch_cooldown = false
|
on_crouch_cooldown = false
|
||||||
|
|
||||||
|
func _on_childhood_collected():
|
||||||
|
$PlayerAnimationPlayer.play("mask_reveal")
|
||||||
|
|
||||||
|
func on_childhood_done():
|
||||||
|
$PlayerAnimationPlayer.play_backwards("mask_reveal")
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -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.
|
|
@ -1,7 +1,7 @@
|
||||||
[gd_scene load_steps=8 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://df3ppd08g84f3" 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"]
|
||||||
|
|
@ -23,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
|
||||||
|
|
@ -63,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"]
|
||||||
|
|
|
||||||
|
|
@ -38,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)
|
||||||
|
|
|
||||||
|
|
@ -12,57 +12,54 @@ var allow_skipping: bool = false
|
||||||
var focus_list:Array = []
|
var focus_list:Array = []
|
||||||
var lock_focus: bool = false
|
var lock_focus: bool = false
|
||||||
|
|
||||||
func request_focus(new_focus: Node, reclaim_focus: bool = false) -> bool:
|
# 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:
|
||||||
assert(is_instance_valid(new_focus))
|
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:
|
if lock_focus or get_tree().paused:
|
||||||
push_warning(new_focus.name, " attempted to get focus while tree was paused or fokus had been locked.")
|
push_error(of, " wanted to drop focus while it was locked or tree is paused.")
|
||||||
return false
|
|
||||||
|
|
||||||
if not focus_list.size() == 0: _pass_focus_of(focus_list[0])
|
if not dropObject: of.has_focus = false
|
||||||
|
|
||||||
if reclaim_focus:
|
focus_list.erase(of)
|
||||||
if focus_list.has(new_focus):
|
|
||||||
while not focus_list[0] == new_focus: focus_list.pop_front()
|
focus_list.front().has_focus = true
|
||||||
return true
|
|
||||||
else:
|
return false
|
||||||
focus_list.push_front(new_focus)
|
|
||||||
push_warning(new_focus.name, " attempted to reclaim focus it did not previousely have.")
|
func get_current_focus(): return focus_list.front()
|
||||||
return true
|
|
||||||
|
# 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:
|
else:
|
||||||
focus_list.append(new_focus)
|
if not focus_list.front() == null: focus_list.front().has_focus = false
|
||||||
return true
|
target.has_focus = true
|
||||||
|
if target.has_focus:
|
||||||
|
focus_list.push_front(target)
|
||||||
|
assert(focus_list.size() < 100)
|
||||||
|
return true
|
||||||
|
return false
|
||||||
|
|
||||||
func assign_focus_to(focusable: Node) -> bool:
|
# Currently focused element loses focus, but remains in stack.
|
||||||
if "focus_forward" in focusable:
|
func free_focus():
|
||||||
assign_focus_to(focusable.focus_forward)
|
if not focus_list.front() == null: focus_list.front().has_focus = false
|
||||||
if "has_focus" in focusable:
|
|
||||||
if not focus_list.size() == 0:
|
|
||||||
_pass_focus_of(focus_list[0])
|
|
||||||
focusable.has_focus = true
|
|
||||||
return true
|
|
||||||
else: return false
|
|
||||||
|
|
||||||
func pass_focus_to_unkown(from: Node):
|
func queue_for_focus(target: Object, index: int):
|
||||||
pass
|
focus_list.insert(index, target)
|
||||||
|
|
||||||
func drop_own_focus(node: Node):
|
|
||||||
if focus_list[0] == node:
|
|
||||||
focus_list.pop_front().has_focus = false
|
|
||||||
assert(focus_list.size() == 0)
|
|
||||||
focus_list[0].has_focus = true
|
|
||||||
else:
|
|
||||||
push_warning(node.name + " attempted to drop focus while not owning it.")
|
|
||||||
|
|
||||||
func clear_focus_stack_and_focus_on(focus: Node):
|
|
||||||
assert(is_instance_valid(focus))
|
|
||||||
if focus_list.size() > 0: focus_list[0].has_focus = false
|
|
||||||
focus_list = [focus]
|
|
||||||
focus.has_focus = true
|
|
||||||
|
|
||||||
func _pass_focus_of(previous_focus: Node):
|
|
||||||
previous_focus.has_focus = false
|
|
||||||
|
|
||||||
func focus_cleared(from: Node):
|
|
||||||
if from == focus_list[0]:
|
|
||||||
push_warning(from.name, " cleared focus without validating!")
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue