fix: no double escape press / settings menu doesnt steal focus
This commit is contained in:
parent
0de7f96064
commit
14453c12b9
|
|
@ -40,9 +40,6 @@ func _delayed_ready() ->void:
|
|||
board_room.card_board = self
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func play():
|
||||
check_board_completion()
|
||||
await closed
|
||||
|
|
|
|||
|
|
@ -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,21 +103,14 @@ 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
|
||||
|
||||
|
||||
|
|
@ -232,4 +225,3 @@ func _on_text_finished():
|
|||
|
||||
func _emit_thunder() -> void:
|
||||
if State.room is YouthRoom: (State.room as YouthRoom).play_thunder()
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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="."]
|
||||
|
|
|
|||
Loading…
Reference in New Issue