Revert "devcom code"

This reverts commit cc6c9616fd.
This commit is contained in:
betalars 2023-06-25 21:59:09 +02:00
parent cc6c9616fd
commit 164efe5302
24 changed files with 124 additions and 1497 deletions

Binary file not shown.

Binary file not shown.

View File

@ -15,6 +15,3 @@ func _on_mouse_entered():
func _on_mouse_exited():
assert(false)
func _process(delta):
if Input.is_action_just_pressed("ui_focus_prev"): $UiWrapper/UiSprite/SubViewport.update()

View File

@ -23,13 +23,12 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_just_pressed("ui_cancel"):
State.pass_focus_to($picker)
pass
func start():
$light_animation.play("light_up")
$AudioPlayer.play("intro")
State.pass_focus_to($PlayerController)
State.assign_focus_to($PlayerController)
current_mode = Modes.WALKING
func _update_scene(new_mode) -> int:
@ -38,6 +37,7 @@ func _update_scene(new_mode) -> int:
elif new_mode == Modes.FREEZE:
emit_signal("freeze")
return new_mode
func _unhandled_input(event):
@ -45,11 +45,3 @@ func _unhandled_input(event):
if event.pressed:
print("passed")
#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

View File

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

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://bvowj4l8dtceu"]
[gd_scene load_steps=4 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://vkcdj8c3ytbq" path="res://logic-scenes/board/post-it.tscn" id="2_ucudl"]

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

@ -10,15 +10,6 @@ enum {
@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 anim_players:Array
@ -46,14 +37,14 @@ func _ready():
for control in card_controls:
options.append(control.get_child(1))
anim_players.append(control.get_child(0))
selection_state = INI
selection_state = CARDS
fill_card_slots()
func fill_card_slots():
for i in range($cards.get_child_count()):
var card:Card = $cards.get_child(i).get_child(1)
card.replace_with(debug_board.get_child(0).get_child(i) as Card)
card.replace_with(debug_board.get_child(2).get_child(i) as Card)
func fill_post_slots():
var post_its: Array[PostIt] = []
@ -65,15 +56,19 @@ func fill_post_slots():
options[i].replace_with(post_its[i])
func _unhandled_input(event):
if has_focus:
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"):
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"):
curr_selection_id += 1
if event.is_action_pressed("ui_accept"):
pick(curr_selection_id)
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"):
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"):
curr_selection_id += 1
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):
print("meep")
if id == -1:
curr_selection_id = 0
return

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=65 format=3 uid="uid://brk4hjdf2x81a"]
[gd_scene load_steps=62 format=3 uid="uid://brk4hjdf2x81a"]
[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"]
@ -208,40 +208,11 @@ tracks/1/keys = {
"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"]
_data = {
"RESET": SubResource("Animation_dinvx"),
"deselect": SubResource("Animation_4dp1g"),
"pick": SubResource("Animation_76klu"),
"reveal": SubResource("Animation_3304u"),
"select": SubResource("Animation_ldr2c"),
"shuffle": SubResource("Animation_abihp"),
"unshuffle": SubResource("Animation_d68d2")
@ -426,40 +397,11 @@ tracks/1/keys = {
"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"]
_data = {
"RESET": SubResource("Animation_pcher"),
"deselect": SubResource("Animation_5q97d"),
"pick": SubResource("Animation_16dsw"),
"reveal": SubResource("Animation_orrwn"),
"select": SubResource("Animation_2c94q"),
"shuffle": SubResource("Animation_pdic8"),
"unshuffle": SubResource("Animation_sa974")
@ -668,40 +610,11 @@ tracks/1/keys = {
"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"]
_data = {
"RESET": SubResource("Animation_pf55g"),
"deselect": SubResource("Animation_6ar8x"),
"pick": SubResource("Animation_wp0c8"),
"reveal": SubResource("Animation_ep22n"),
"select": SubResource("Animation_pcu23"),
"shuffle": SubResource("Animation_vu874"),
"unshuffle": SubResource("Animation_mj8e0")
@ -1463,7 +1376,6 @@ script = ExtResource("1_pjntm")
layout_mode = 2
[node name="label" type="Label" parent="Control"]
visible = false
layout_mode = 2
offset_left = -359.0
offset_top = -256.0

View File

@ -4,7 +4,7 @@ class_name Collectable_Ui
@export var collapsed = true:
set(collapse):
if is_inside_tree() and not Engine.is_editor_hint():
if is_inside_tree():
if State.reduce_motion:
collapsed = false
return
@ -25,19 +25,21 @@ class_name Collectable_Ui
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()
has_focus = State.request_focus(self)
if has_focus:
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
has_focus = false # How did we get here?
State.focus_cleared(self)
get_viewport().gui_release_focus()
#hide()
hide()
if not visible:
show()
@export var collected: bool = false:
@ -70,8 +72,6 @@ class_name Collectable_Ui
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
@ -80,15 +80,11 @@ func _ready():
if visible and not collapsed: _show_buttons()
func _hide_buttons():
if is_inside_tree():
if not State.reduce_motion: $AnimationPlayer.play_backwards("show_buttons")
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")
if State.reduce_motion:
$AnimationPlayer.play("show_buttons")
else:
$AnimationPlayer.play("RESET")
@ -110,12 +106,4 @@ func show():
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)
State.request_focus(self, true)

View File

@ -171,7 +171,6 @@ libraries = {
[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"]

View File

@ -1,39 +0,0 @@
[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

View File

@ -7,6 +7,3 @@ extends Panel
else:
has_focus = false
State.drop_own_focus(self)
func yeet():
get_parent().remove_child(self)

View File

@ -1,11 +1,11 @@
extends RigidBody3D
var has_focus: bool = false:
var has_focus: bool = false :
set(focused):
if has_focus != focused:
if focused:
has_focus = true
if is_inside_tree():
has_focus = State.request_focus(self)
if is_inside_tree() and has_focus:
camera.make_current()
get_viewport().gui_release_focus()
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
@ -24,6 +24,7 @@ var has_focus: bool = false:
else:
jitter_strength = 0
has_focus = false
State.focus_cleared(self)
sleeping = has_focus
@ -63,7 +64,7 @@ var has_entered:bool = false
signal ui_exited
func _ready():
_handle_jitter(0)
if has_focus: _handle_jitter(0)
func _process(delta):
@ -76,7 +77,7 @@ func _process(delta):
emit_signal("ui_exited")
has_entered = false
if Input.is_action_just_pressed("ui_accept"):
State.pass_focus_to(focus_ray.get_collider())
State.assign_focus_to(focus_ray.get_collider())
func _physics_process(delta:float):
if has_focus:
@ -107,7 +108,7 @@ func _handle_movement(delta:float):
func _handle_rotation(delta:float):
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_up")-Input.get_action_strength("look_down")) * gamepad_response
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
if current_mouse_rotation.length()>0:
input_speed = current_mouse_rotation
@ -149,14 +150,14 @@ func _unhandled_input(event:InputEvent):
_handle_mouse_input(event)
get_viewport().set_input_as_handled()
if event is InputEventMouseButton and has_entered:
State.free_focus()
has_focus = false
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()
#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)
State.pass_focus_to(self)
func _on_bed_enter(_body):
if not (crouched or on_crouch_cooldown):
@ -176,8 +177,4 @@ func _on_bed_exit(_body):
await get_tree().create_timer(1.0).timeout
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

View File

@ -1,9 +1,9 @@
[gd_scene load_steps=10 format=3 uid="uid://gldtxysavetf"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="1_8giso"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://logic-scenes/startup/start_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="Script" path="res://logic-scenes/startup/volume_sliders.gd" id="3_q2gbh"]
[ext_resource type="Texture2D" uid="uid://bwicl5q0lw06q" path="res://import/interface-elements/bottom.png" id="3_s5ssh"]
[ext_resource type="Texture2D" uid="uid://bwicl5q0lw06q" path="res://logic-scenes/startup/start_bottom.png" id="3_s5ssh"]
[sub_resource type="GDScript" id="GDScript_ia432"]
script/source = "extends TabContainer

Binary file not shown.

View File

@ -1,7 +1,7 @@
[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="PackedScene" uid="uid://gldtxysavetf" path="res://logic-scenes/startup/startup.tscn" id="1_v5rpm"]
[ext_resource type="PackedScene" uid="uid://df3ppd08g84f3" 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="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"]
@ -23,8 +23,6 @@ texture = ExtResource("1_0oiki")
[node name="Startup Menu" parent="." instance=ExtResource("1_v5rpm")]
visible = false
[node name="youth room" parent="." instance=ExtResource("2_23ia3")]
[node name="Main Menu" type="Panel" parent="."]
anchors_preset = 15
anchor_right = 1.0
@ -65,5 +63,7 @@ grow_vertical = 2
layout_mode = 2
text = "new Game"
[connection signal="pressed" from="Main Menu/PanelContainer/Button" to="youth room" method="start"]
[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"]

View File

@ -38,14 +38,6 @@ theme/custom="res://logic-scenes/themes/messy.theme"
[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={
"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)

View File

@ -12,54 +12,57 @@ 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)
func request_focus(new_focus: Node, reclaim_focus: bool = false) -> bool:
# 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:
assert(is_instance_valid(new_focus))
if lock_focus or get_tree().paused:
push_error(of, " wanted to drop focus while it was locked or tree is paused.")
push_warning(new_focus.name, " attempted to get focus while tree was paused or fokus had been locked.")
return false
if not dropObject: of.has_focus = false
if not focus_list.size() == 0: _pass_focus_of(focus_list[0])
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)
if reclaim_focus:
if focus_list.has(new_focus):
while not focus_list[0] == new_focus: focus_list.pop_front()
return true
return false
else:
focus_list.push_front(new_focus)
push_warning(new_focus.name, " attempted to reclaim focus it did not previousely have.")
return true
else:
focus_list.append(new_focus)
return true
# 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 assign_focus_to(focusable: Node) -> bool:
if "focus_forward" in focusable:
assign_focus_to(focusable.focus_forward)
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 queue_for_focus(target: Object, index: int):
focus_list.insert(index, target)
func pass_focus_to_unkown(from: Node):
pass
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!")