Compare commits
3 Commits
92879b6bbf
...
14453c12b9
| Author | SHA1 | Date |
|---|---|---|
|
|
14453c12b9 | |
|
|
0de7f96064 | |
|
|
c0f3bd40a9 |
|
|
@ -40,12 +40,10 @@ func _delayed_ready() ->void:
|
||||||
board_room.card_board = self
|
board_room.card_board = self
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func play():
|
func play():
|
||||||
check_board_completion()
|
check_board_completion()
|
||||||
await closed
|
await closed
|
||||||
|
print("CardBoard.gd: closing")
|
||||||
_finalize_board_state()
|
_finalize_board_state()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -390,8 +388,9 @@ func handle_drop(draggable: Draggable) -> int:
|
||||||
|
|
||||||
|
|
||||||
# Takes the inputs for control inputs
|
# Takes the inputs for control inputs
|
||||||
func _gui_input(event : InputEvent) -> void:
|
func _input(event : InputEvent) -> void:
|
||||||
if event.is_action_pressed("ui_cancel"):
|
if event.is_action_pressed("ui_cancel"):
|
||||||
|
print("CardBoard.gd: ui_cancel")
|
||||||
closed.emit()
|
closed.emit()
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ var tween : Tween = null
|
||||||
|
|
||||||
|
|
||||||
func animate_home() -> void:
|
func animate_home() -> void:
|
||||||
z_index = 50
|
z_index = 100
|
||||||
if tween: tween.kill()
|
if tween: tween.kill()
|
||||||
tween = create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_QUART)
|
tween = create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_QUART)
|
||||||
tween.tween_property(self, "position", home, 0.5)
|
tween.tween_property(self, "position", home, 0.5)
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ unique_name_in_owner = true
|
||||||
self_modulate = Color(1, 1, 1, 0)
|
self_modulate = Color(1, 1, 1, 0)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
mouse_filter = 1
|
mouse_filter = 2
|
||||||
|
|
||||||
[node name="NoteZone" type="Control" parent="HBoxContainer"]
|
[node name="NoteZone" type="Control" parent="HBoxContainer"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
[ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_l4ogr"]
|
[ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_l4ogr"]
|
||||||
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="4_x6cxt"]
|
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="4_x6cxt"]
|
||||||
|
|
||||||
[sub_resource type="InputEventKey" id="InputEventKey_ckmi5"]
|
[sub_resource type="InputEventKey" id="InputEventKey_j3x3g"]
|
||||||
device = -1
|
device = -1
|
||||||
physical_keycode = 88
|
physical_keycode = 88
|
||||||
unicode = 120
|
unicode = 120
|
||||||
|
|
||||||
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_x6cxt"]
|
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_ckmi5"]
|
||||||
device = -1
|
device = -1
|
||||||
button_index = 2
|
button_index = 2
|
||||||
pressed = true
|
pressed = true
|
||||||
|
|
@ -156,7 +156,7 @@ stretch_mode = 5
|
||||||
script = ExtResource("4_x6cxt")
|
script = ExtResource("4_x6cxt")
|
||||||
action = "skip"
|
action = "skip"
|
||||||
icon = 0
|
icon = 0
|
||||||
events = Array[InputEvent]([null, SubResource("InputEventKey_ckmi5"), SubResource("InputEventJoypadButton_x6cxt")])
|
events = Array[InputEvent]([null, SubResource("InputEventKey_j3x3g"), SubResource("InputEventJoypadButton_ckmi5")])
|
||||||
metadata/_custom_type_script = "uid://bbs1u7ojno7xo"
|
metadata/_custom_type_script = "uid://bbs1u7ojno7xo"
|
||||||
|
|
||||||
[node name="SkipButton" type="Button" parent="Control/HSplitContainer"]
|
[node name="SkipButton" type="Button" parent="Control/HSplitContainer"]
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ func _ready() -> void:
|
||||||
# Clunky rebuild...
|
# Clunky rebuild...
|
||||||
story_array = story_array
|
story_array = story_array
|
||||||
progress = progress
|
progress = progress
|
||||||
|
|
||||||
|
|
||||||
func _debug_mode():
|
func _debug_mode():
|
||||||
Main.curtain.open()
|
Main.curtain.open()
|
||||||
super._debug_mode()
|
super._debug_mode()
|
||||||
|
|
@ -83,7 +83,7 @@ var substring_sizes: Array[int]
|
||||||
|
|
||||||
func _rebuild():
|
func _rebuild():
|
||||||
print("StoryPlayable.gd: %s._rebuild()" % self.name)
|
print("StoryPlayable.gd: %s._rebuild()" % self.name)
|
||||||
if is_node_ready():
|
if is_node_ready(): # FIXME: node is always ready?
|
||||||
substring_sizes = []
|
substring_sizes = []
|
||||||
var p: int = 0
|
var p: int = 0
|
||||||
label.text = "[p]"
|
label.text = "[p]"
|
||||||
|
|
@ -103,22 +103,15 @@ func _rebuild():
|
||||||
func try_scroll():
|
func try_scroll():
|
||||||
var forward_target: float
|
var forward_target: float
|
||||||
|
|
||||||
#print( "max lines: " + str(max_lines))
|
|
||||||
#print( "current lines: " + str(label.get_character_line(label.visible_characters)))
|
|
||||||
|
|
||||||
var visible_ratio: float = float(label.get_character_line(label.visible_characters)) / max_lines
|
var visible_ratio: float = float(label.get_character_line(label.visible_characters)) / max_lines
|
||||||
|
|
||||||
#print("Tried scrolling with ratio of %f. Comparing %f against %f" % [visible_ratio, label.size.y * visible_ratio - scroll_container.scroll_vertical, scroll_container.size.y * 0.9])
|
|
||||||
|
|
||||||
if label.size.y * visible_ratio + scroll_container.scroll_vertical > scroll_container.size.y * 0.9:
|
if label.size.y * visible_ratio + scroll_container.scroll_vertical > scroll_container.size.y * 0.9:
|
||||||
if scroll_container.scroll_vertical + scroll_container.size.y * 0.9 < label.size.y:
|
if scroll_container.scroll_vertical + scroll_container.size.y * 0.9 < label.size.y:
|
||||||
forward_target = scroll_container.scroll_vertical + scroll_container.size.y * 0.8
|
forward_target = scroll_container.scroll_vertical + scroll_container.size.y * 0.8
|
||||||
else:
|
else:
|
||||||
forward_target = label.size.y - scroll_container.size.y
|
forward_target = label.size.y - scroll_container.size.y
|
||||||
if scroll_target != null:
|
|
||||||
#var tween: Tween = get_tree().create_tween()
|
scroll_target = forward_target
|
||||||
##tween.set_trans()
|
|
||||||
scroll_target = forward_target
|
|
||||||
|
|
||||||
|
|
||||||
## frame rate independent FIR smoothing filter used for small or dynamic card adjustments
|
## frame rate independent FIR smoothing filter used for small or dynamic card adjustments
|
||||||
|
|
@ -131,13 +124,13 @@ func _process(delta: float) -> void:
|
||||||
scroll_current = _smooth(scroll_current, scroll_target, delta)
|
scroll_current = _smooth(scroll_current, scroll_target, delta)
|
||||||
scroll_container.scroll_vertical = ceili(scroll_current)
|
scroll_container.scroll_vertical = ceili(scroll_current)
|
||||||
|
|
||||||
|
|
||||||
func appear():
|
func appear():
|
||||||
hide()
|
hide()
|
||||||
if animation_player.has_animation("ini"):
|
if animation_player.has_animation("ini"):
|
||||||
animation_player.play("ini")
|
animation_player.play("ini")
|
||||||
await animation_player.animation_finished
|
await animation_player.animation_finished
|
||||||
|
|
||||||
scroll_target = 0
|
scroll_target = 0
|
||||||
|
|
||||||
# FIXME: find out why this needs to be set to prevent scenes from being fully revealed
|
# FIXME: find out why this needs to be set to prevent scenes from being fully revealed
|
||||||
|
|
@ -153,7 +146,7 @@ func appear():
|
||||||
# Wait and get ready.
|
# Wait and get ready.
|
||||||
await get_tree().process_frame
|
await get_tree().process_frame
|
||||||
await super.appear()
|
await super.appear()
|
||||||
|
|
||||||
func play():
|
func play():
|
||||||
print("StoryPlayable.gd: %s.play()" % self.name)
|
print("StoryPlayable.gd: %s.play()" % self.name)
|
||||||
|
|
||||||
|
|
@ -185,12 +178,13 @@ func play():
|
||||||
|
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
|
if not visible: return
|
||||||
if event.is_action_pressed("ui_text_scroll_down"):
|
if event.is_action_pressed("ui_text_scroll_down"):
|
||||||
accept_event()
|
accept_event()
|
||||||
scroll_target += 40
|
scroll_target += 40
|
||||||
all_text_revealed = animation_complete
|
all_text_revealed = animation_complete
|
||||||
|
|
||||||
if event.is_action_released("ui_text_scroll_up"):
|
if event.is_action_pressed("ui_text_scroll_up"):
|
||||||
accept_event()
|
accept_event()
|
||||||
scroll_target -= 40
|
scroll_target -= 40
|
||||||
all_text_revealed = all_text_revealed or animation_complete
|
all_text_revealed = all_text_revealed or animation_complete
|
||||||
|
|
@ -231,4 +225,3 @@ func _on_text_finished():
|
||||||
|
|
||||||
func _emit_thunder() -> void:
|
func _emit_thunder() -> void:
|
||||||
if State.room is YouthRoom: (State.room as YouthRoom).play_thunder()
|
if State.room is YouthRoom: (State.room as YouthRoom).play_thunder()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,8 @@ ui_text_scroll_down={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
|
||||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":16,"position":Vector2(246, 6),"global_position":Vector2(255, 54),"factor":1.0,"button_index":5,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
|
||||||
, 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":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
, 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":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":16,"position":Vector2(246, 6),"global_position":Vector2(255, 54),"factor":1.0,"button_index":5,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||||
, 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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
, 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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":12,"pressure":0.0,"pressed":true,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":12,"pressure":0.0,"pressed":true,"script":null)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -86,5 +86,5 @@ func _on_exit_button_pressed() -> void:
|
||||||
State.save_settings()
|
State.save_settings()
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("ui_cancel") and focused:
|
if event.is_action_pressed("ui_cancel") and focused and is_visible_in_tree():
|
||||||
leave_stage.emit()
|
leave_stage.emit()
|
||||||
|
|
|
||||||
|
|
@ -47,5 +47,5 @@ func _on_exit_button_pressed() -> void:
|
||||||
leave_stage.emit()
|
leave_stage.emit()
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("ui_cancel") and focused:
|
if event.is_action_pressed("ui_cancel") and focused and is_visible_in_tree():
|
||||||
leave_stage.emit()
|
leave_stage.emit()
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,5 @@ func _on_exit_button_pressed() -> void:
|
||||||
State.save_settings()
|
State.save_settings()
|
||||||
|
|
||||||
func _gui_input(event: InputEvent) -> void:
|
func _gui_input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("ui_cancel") and focused:
|
if event.is_action_pressed("ui_cancel") and focused and is_visible_in_tree():
|
||||||
leave_stage.emit()
|
leave_stage.emit()
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ func _on_exit_button_pressed() -> void:
|
||||||
State.save_settings()
|
State.save_settings()
|
||||||
|
|
||||||
func _gui_input(event: InputEvent) -> void:
|
func _gui_input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("ui_cancel") and focused:
|
if event.is_action_pressed("ui_cancel") and focused and is_visible_in_tree():
|
||||||
leave_stage.emit()
|
leave_stage.emit()
|
||||||
|
|
||||||
func reset_all_stats():
|
func reset_all_stats():
|
||||||
|
|
|
||||||
|
|
@ -286,5 +286,5 @@ func select_id_to_window_mode(item_id) -> DisplayServer.WindowMode:
|
||||||
return item_id + 2 if item_id != 0 else 0
|
return item_id + 2 if item_id != 0 else 0
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("ui_cancel") and focused:
|
if event.is_action_pressed("ui_cancel") and focused and is_visible_in_tree():
|
||||||
_on_exit_button_pressed()
|
_on_exit_button_pressed()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
[gd_scene load_steps=2 format=3 uid="uid://bsjc1ry0qpe61"]
|
[gd_scene load_steps=4 format=3 uid="uid://bsjc1ry0qpe61"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dugfwcvp7i01k" path="res://ui/menu_main/save_game_list.gd" id="1_w1a7u"]
|
[ext_resource type="Script" uid="uid://dugfwcvp7i01k" path="res://ui/menu_main/save_game_list.gd" id="1_w1a7u"]
|
||||||
|
|
||||||
|
[sub_resource type="InputEventAction" id="InputEventAction_4wrxo"]
|
||||||
|
action = &"ui_cancel"
|
||||||
|
|
||||||
|
[sub_resource type="Shortcut" id="Shortcut_lficf"]
|
||||||
|
events = [SubResource("InputEventAction_4wrxo")]
|
||||||
|
|
||||||
[node name="SaveGameList" type="Control"]
|
[node name="SaveGameList" type="Control"]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
|
|
@ -63,4 +69,5 @@ alignment = 2
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 4
|
||||||
size_flags_vertical = 4
|
size_flags_vertical = 4
|
||||||
|
shortcut = SubResource("Shortcut_lficf")
|
||||||
text = "Zurück"
|
text = "Zurück"
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,7 @@ _data = {
|
||||||
[node name="SettingsPopup" type="PanelContainer"]
|
[node name="SettingsPopup" type="PanelContainer"]
|
||||||
visible = false
|
visible = false
|
||||||
self_modulate = Color(1, 1, 1, 0)
|
self_modulate = Color(1, 1, 1, 0)
|
||||||
|
scale = Vector2(1, 0.57)
|
||||||
script = ExtResource("1_87f5w")
|
script = ExtResource("1_87f5w")
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue