diff --git a/src/logic-scenes/board/card-board.gd b/src/logic-scenes/board/card-board.gd index f1838a2..2a4b447 100644 --- a/src/logic-scenes/board/card-board.gd +++ b/src/logic-scenes/board/card-board.gd @@ -40,9 +40,6 @@ func _delayed_ready() ->void: board_room.card_board = self - - - func play(): check_board_completion() await closed diff --git a/src/logic-scenes/luna/playables/story_playable.gd b/src/logic-scenes/luna/playables/story_playable.gd index 575cbf8..fc92c4e 100644 --- a/src/logic-scenes/luna/playables/story_playable.gd +++ b/src/logic-scenes/luna/playables/story_playable.gd @@ -18,8 +18,8 @@ func _ready() -> void: # Clunky rebuild... story_array = story_array progress = progress - - + + func _debug_mode(): Main.curtain.open() super._debug_mode() @@ -83,7 +83,7 @@ var substring_sizes: Array[int] func _rebuild(): print("StoryPlayable.gd: %s._rebuild()" % self.name) - if is_node_ready(): + if is_node_ready(): # FIXME: node is always ready? substring_sizes = [] var p: int = 0 label.text = "[p]" @@ -103,22 +103,15 @@ func _rebuild(): func try_scroll(): 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 - #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 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 else: forward_target = label.size.y - scroll_container.size.y - if scroll_target != null: - #var tween: Tween = get_tree().create_tween() - ##tween.set_trans() - scroll_target = forward_target + + scroll_target = forward_target ## 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_container.scroll_vertical = ceili(scroll_current) - + func appear(): hide() - if animation_player.has_animation("ini"): + if animation_player.has_animation("ini"): animation_player.play("ini") await animation_player.animation_finished - + scroll_target = 0 # 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. await get_tree().process_frame await super.appear() - + func play(): print("StoryPlayable.gd: %s.play()" % self.name) @@ -232,4 +225,3 @@ func _on_text_finished(): func _emit_thunder() -> void: if State.room is YouthRoom: (State.room as YouthRoom).play_thunder() - diff --git a/src/ui/menu_main/audio_settings.gd b/src/ui/menu_main/audio_settings.gd index 12d9be2..90fd17b 100644 --- a/src/ui/menu_main/audio_settings.gd +++ b/src/ui/menu_main/audio_settings.gd @@ -86,5 +86,5 @@ func _on_exit_button_pressed() -> void: State.save_settings() 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() diff --git a/src/ui/menu_main/content_settings.gd b/src/ui/menu_main/content_settings.gd index d4bad37..819628c 100644 --- a/src/ui/menu_main/content_settings.gd +++ b/src/ui/menu_main/content_settings.gd @@ -47,5 +47,5 @@ func _on_exit_button_pressed() -> void: leave_stage.emit() 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() diff --git a/src/ui/menu_main/gameplay_settings.gd b/src/ui/menu_main/gameplay_settings.gd index 848a3a3..47f7e27 100644 --- a/src/ui/menu_main/gameplay_settings.gd +++ b/src/ui/menu_main/gameplay_settings.gd @@ -39,5 +39,5 @@ func _on_exit_button_pressed() -> void: State.save_settings() 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() diff --git a/src/ui/menu_main/privacy_settings.gd b/src/ui/menu_main/privacy_settings.gd index 95f194e..b4e16de 100644 --- a/src/ui/menu_main/privacy_settings.gd +++ b/src/ui/menu_main/privacy_settings.gd @@ -41,7 +41,7 @@ func _on_exit_button_pressed() -> void: State.save_settings() 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() func reset_all_stats(): diff --git a/src/ui/menu_main/video_settings.gd b/src/ui/menu_main/video_settings.gd index e114cfe..8e1d72a 100644 --- a/src/ui/menu_main/video_settings.gd +++ b/src/ui/menu_main/video_settings.gd @@ -286,5 +286,5 @@ func select_id_to_window_mode(item_id) -> DisplayServer.WindowMode: return item_id + 2 if item_id != 0 else 0 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() diff --git a/src/ui/save_game_list/save_game_list.tscn b/src/ui/save_game_list/save_game_list.tscn index 38c5d23..228db38 100644 --- a/src/ui/save_game_list/save_game_list.tscn +++ b/src/ui/save_game_list/save_game_list.tscn @@ -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"] +[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"] layout_mode = 3 anchors_preset = 15 @@ -63,4 +69,5 @@ alignment = 2 layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 4 +shortcut = SubResource("Shortcut_lficf") text = "Zurück" diff --git a/src/ui/settings_popup/settings_popup.tscn b/src/ui/settings_popup/settings_popup.tscn index ae4c286..f2ebcaa 100644 --- a/src/ui/settings_popup/settings_popup.tscn +++ b/src/ui/settings_popup/settings_popup.tscn @@ -245,6 +245,7 @@ _data = { [node name="SettingsPopup" type="PanelContainer"] visible = false self_modulate = Color(1, 1, 1, 0) +scale = Vector2(1, 0.57) script = ExtResource("1_87f5w") [node name="AnimationPlayer" type="AnimationPlayer" parent="."]