diff --git a/p0ng/scripts/characters/paddle/ai_paddle/idle_state.gd b/p0ng/scripts/characters/paddle/ai_paddle/idle_state.gd index e2c48af..f875dd5 100644 --- a/p0ng/scripts/characters/paddle/ai_paddle/idle_state.gd +++ b/p0ng/scripts/characters/paddle/ai_paddle/idle_state.gd @@ -11,7 +11,7 @@ var _is_ready: bool # ============================================================================ # #region Godot builtins func _ready() -> void: - _cooldown_timer.connect("timeout", _on_cooldown_timer_timeout) + _cooldown_timer.timeout.connect(_on_cooldown_timer_timeout) #endregion # ============================================================================ # diff --git a/p0ng/scripts/core/state_machine/state_matchine.gd b/p0ng/scripts/core/state_machine/state_matchine.gd index 8e1e377..4c29c40 100644 --- a/p0ng/scripts/core/state_machine/state_matchine.gd +++ b/p0ng/scripts/core/state_machine/state_matchine.gd @@ -23,7 +23,7 @@ func _ready() -> void: var children: Array[Node] = get_children() for child in children: if child is State: - child.connect("transitioned", _on_child_state_transitioned) + child.transitioned.connect(_on_child_state_transitioned) _states[child.name.to_lower()] = child if _states.is_empty(): print_debug("State machine has no states") diff --git a/p0ng/scripts/main.gd b/p0ng/scripts/main.gd index 4c78549..b0886ed 100644 --- a/p0ng/scripts/main.gd +++ b/p0ng/scripts/main.gd @@ -18,7 +18,7 @@ func _process(_delta: float) -> void: _current_scene = load(GameScene2D.GAME_SCENE[_current_scene_key]).instantiate() add_child(_current_scene) move_child(_current_scene, 0) - _current_scene.connect("scene_finished", _on_scene_finished) + _current_scene.scene_finished.connect(_on_scene_finished) #endregion # ============================================================================ # diff --git a/p0ng/scripts/scenes/game/game.gd b/p0ng/scripts/scenes/game/game.gd index f620fb4..97bff9a 100644 --- a/p0ng/scripts/scenes/game/game.gd +++ b/p0ng/scripts/scenes/game/game.gd @@ -46,7 +46,7 @@ var _game_point_state: int #region Godot builtins func _ready() -> void: _game_mode = Global.current_game_mode - _game_ui.connect("acted", _on_game_ui_acted) + _game_ui.acted.connect(_on_game_ui_acted) _spawn_paddes() _configure_world() _configure_game() @@ -213,8 +213,8 @@ func _spawn_paddes() -> void: func _spawn_ball() -> void: ball = Ball.instantiate() ball.position = _ball_spawn.position - ball.connect("body_entered", _on_ball_body_entered) - ball.connect("body_exited", _on_ball_body_exited) + ball.body_entered.connect(_on_ball_body_entered) + ball.body_exited.connect(_on_ball_body_exited) _current_ball_speed = Global.BALL_SPEED_INITIAL _round_started = false add_child(ball) @@ -256,9 +256,9 @@ func _despawn_ball() -> void: func _configure_world() -> void: - $World/LeftBound.connect("body_entered", _on_left_bound_body_entered) - $World/RightBound.connect("body_entered", _on_right_bound_body_entered) - $World/VerticalSeparator.connect("body_entered", _on_vertical_separator_body_entered) + $World/LeftBound.body_entered.connect(_on_left_bound_body_entered) + $World/RightBound.body_entered.connect(_on_right_bound_body_entered) + $World/VerticalSeparator.body_entered.connect(_on_vertical_separator_body_entered) func _configure_game() -> void: diff --git a/p0ng/scripts/scenes/game/game_ui.gd b/p0ng/scripts/scenes/game/game_ui.gd index 87d1a8f..06ddaf8 100644 --- a/p0ng/scripts/scenes/game/game_ui.gd +++ b/p0ng/scripts/scenes/game/game_ui.gd @@ -51,10 +51,10 @@ func _ready() -> void: for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) _endgame_dialog.modulate = Color(1.0, 1.0, 1.0, 0.0) _endgame_dialog.visible = false diff --git a/p0ng/scripts/scenes/game/side_select.gd b/p0ng/scripts/scenes/game/side_select.gd index 70bfec0..7b0df1f 100644 --- a/p0ng/scripts/scenes/game/side_select.gd +++ b/p0ng/scripts/scenes/game/side_select.gd @@ -11,13 +11,13 @@ extends GameScene2D # ============================================================================ # #region Godot builtins func _ready() -> void: - _ui_back_button.connect("pressed", _on_back_button_pressed) - _ui_left_button.connect("mouse_entered", _on_focused_left_side) - _ui_left_button.connect("focus_entered", _on_focused_left_side) - _ui_left_button.connect("pressed", _on_selected_left_side) - _ui_right_button.connect("mouse_entered", _on_focused_right_side) - _ui_right_button.connect("focus_entered", _on_focused_right_side) - _ui_right_button.connect("pressed", _on_selected_right_side) + _ui_back_button.pressed.connect(_on_back_button_pressed) + _ui_left_button.mouse_entered.connect(_on_focused_left_side) + _ui_left_button.focus_entered.connect(_on_focused_left_side) + _ui_left_button.pressed.connect(_on_selected_left_side) + _ui_right_button.mouse_entered.connect(_on_focused_right_side) + _ui_right_button.focus_entered.connect(_on_focused_right_side) + _ui_right_button.pressed.connect(_on_selected_right_side) _ui_left_button.grab_focus() #endregion # ============================================================================ # diff --git a/p0ng/scripts/scenes/game/side_select_ui.gd b/p0ng/scripts/scenes/game/side_select_ui.gd index d83d047..ff15a15 100644 --- a/p0ng/scripts/scenes/game/side_select_ui.gd +++ b/p0ng/scripts/scenes/game/side_select_ui.gd @@ -6,6 +6,6 @@ extends UI func _ready() -> void: for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) #endregion # ============================================================================ # diff --git a/p0ng/scripts/scenes/main_menu/game_title.gd b/p0ng/scripts/scenes/main_menu/game_title.gd index dac7a67..cd91a9c 100644 --- a/p0ng/scripts/scenes/main_menu/game_title.gd +++ b/p0ng/scripts/scenes/main_menu/game_title.gd @@ -10,10 +10,10 @@ var _rng: RandomNumberGenerator = RandomNumberGenerator.new() # ============================================================================ # #region Godot builtins func _ready() -> void: - $Walls/TopWall.connect("body_entered", _on_top_wall_body_entered) - $Walls/LeftWall.connect("body_entered", _on_left_wall_body_entered) - $Walls/BottomWall.connect("body_entered", _on_bottom_wall_body_entered) - $Walls/RightWall.connect("body_entered", _on_right_wall_body_entered) + $Walls/TopWall.body_entered.connect(_on_top_wall_body_entered) + $Walls/LeftWall.body_entered.connect(_on_left_wall_body_entered) + $Walls/BottomWall.body_entered.connect(_on_bottom_wall_body_entered) + $Walls/RightWall.body_entered.connect(_on_right_wall_body_entered) var ball_speed = _rng.randf_range(60.0, 60.0) var ball_velocity = Vector2.RIGHT * ball_speed diff --git a/p0ng/scripts/scenes/main_menu/main_menu.gd b/p0ng/scripts/scenes/main_menu/main_menu.gd index 3e855ac..bd1c5a6 100644 --- a/p0ng/scripts/scenes/main_menu/main_menu.gd +++ b/p0ng/scripts/scenes/main_menu/main_menu.gd @@ -4,7 +4,7 @@ extends GameScene2D # ============================================================================ # #region Godot builtins func _ready() -> void: - $UI/MainMenuUI.connect("acted", _on_main_menu_ui_acted) + $UI/MainMenuUI.acted.connect(_on_main_menu_ui_acted) #endregion # ============================================================================ # diff --git a/p0ng/scripts/scenes/main_menu/main_menu_ui.gd b/p0ng/scripts/scenes/main_menu/main_menu_ui.gd index 5145e73..7572878 100644 --- a/p0ng/scripts/scenes/main_menu/main_menu_ui.gd +++ b/p0ng/scripts/scenes/main_menu/main_menu_ui.gd @@ -10,22 +10,22 @@ extends UI func _ready() -> void: %GameVersionLabel.text += ProjectSettings.get_setting("application/config/version") %StartButton.grab_focus() - %StartButton.connect("pressed", _on_main_menu_start_button_pressed) + %StartButton.pressed.connect(_on_main_menu_start_button_pressed) if Global.os_platform in [ "Mobile", "Web" ]: UI.deactivate_control(%QuitButton) else: - %QuitButton.connect("pressed", _on_main_menu_quit_button_pressed) - %SettingsButton.connect("pressed", _on_main_menu_settings_button_pressed) - %OnePlayerButton.connect("pressed", _on_start_menu_one_player_button_pressed) - %TwoPlayersButton.connect("pressed", _on_start_menu_two_players_button_pressed) + %QuitButton.pressed.connect(_on_main_menu_quit_button_pressed) + %SettingsButton.pressed.connect(_on_main_menu_settings_button_pressed) + %OnePlayerButton.pressed.connect(_on_start_menu_one_player_button_pressed) + %TwoPlayersButton.pressed.connect(_on_start_menu_two_players_button_pressed) _start_menu.get_node("BackButton").connect("pressed", _on_start_menu_back_button_pressed) for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) func _process(_delta: float) -> void: diff --git a/p0ng/scripts/scenes/settings_menu/resolution_popup.gd b/p0ng/scripts/scenes/settings_menu/resolution_popup.gd index c9d78ab..62ecff8 100644 --- a/p0ng/scripts/scenes/settings_menu/resolution_popup.gd +++ b/p0ng/scripts/scenes/settings_menu/resolution_popup.gd @@ -15,7 +15,7 @@ var resolution_option_items: Array = Array() func _ready() -> void: visible = false if Global.os_platform == "Desktop": - option_button.connect("pressed", _on_option_button_pressed) + option_button.pressed.connect(_on_option_button_pressed) var resolution_popup_button_group: ButtonGroup = ButtonGroup.new() var resolution_popup_container: Container = $ScrollContainer/VBoxContainer @@ -31,7 +31,7 @@ func _ready() -> void: resolution_key, resolution_popup_button_group ) - resolution_option_item.connect("selected", _on_resolution_option_item_selected) + resolution_option_item.selected.connect(_on_resolution_option_item_selected) resolution_option_item.add_to_group("ui_accepted_buttons") resolution_popup_container.add_child(resolution_option_item) diff --git a/p0ng/scripts/scenes/settings_menu/settings_menu.gd b/p0ng/scripts/scenes/settings_menu/settings_menu.gd index eba2dbc..22f6f6b 100644 --- a/p0ng/scripts/scenes/settings_menu/settings_menu.gd +++ b/p0ng/scripts/scenes/settings_menu/settings_menu.gd @@ -8,8 +8,8 @@ extends GameScene2D #region Godot builtins func _ready() -> void: _ui_load_config() - _ui.connect("acted", _on_main_menu_ui_acted) - _ui.connect("acted_with_data", _on_main_menu_ui_acted_with_data) + _ui.acted.connect(_on_main_menu_ui_acted) + _ui.acted_with_data.connect(_on_main_menu_ui_acted_with_data) #endregion # ============================================================================ # diff --git a/p0ng/scripts/scenes/settings_menu/settings_menu_ui.gd b/p0ng/scripts/scenes/settings_menu/settings_menu_ui.gd index d065b47..3fee0b6 100644 --- a/p0ng/scripts/scenes/settings_menu/settings_menu_ui.gd +++ b/p0ng/scripts/scenes/settings_menu/settings_menu_ui.gd @@ -19,7 +19,7 @@ func _ready() -> void: _main.get_node("SoundsButton").connect("pressed", _on_main_sounds_button_pressed) _main.get_node("ResetButton").connect("pressed", _on_main_reset_button_pressed) if Global.os_platform == "Desktop": - _resolution_popup.connect("resolution_selected", _on_resolution_popup_resolution_selected) + _resolution_popup.resolution_selected.connect(_on_resolution_popup_resolution_selected) _graphics.get_node("Fullscreen/ToggleButton")\ .connect("toggled", _on_graphics_fullscreen_toggled) _graphics.get_node("PostProcessing/ToggleButton")\ @@ -61,25 +61,25 @@ func _ready() -> void: for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) for child in get_tree().get_nodes_in_group("ui_selected_buttons"): assert(child is Button, "ui_selected_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_selected_button_pressed) + child.pressed.connect(_on_ui_selected_button_pressed) for child in get_tree().get_nodes_in_group("ui_accepted_buttons"): assert( (child is Button) or (child is Slider), "ui_accepted_buttons group must contain only Buttons or Slider" ) if child is Slider: - child.connect("value_changed", _on_slider_updated) + child.value_changed.connect(_on_slider_updated) else: - child.connect("pressed", _on_ui_accepted_button_pressed) + child.pressed.connect(_on_ui_accepted_button_pressed) for child in get_tree().get_nodes_in_group("ui_disabled_buttons"): assert(child is Button, "ui_disabled_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_disabled_button_pressed) + child.pressed.connect(_on_ui_disabled_button_pressed) func _process(_delta: float) -> void: @@ -275,8 +275,8 @@ func _update_graphics_save_button() -> void: graphics_save_button.disconnect("pressed", _on_ui_disabled_button_pressed) graphics_save_button.remove_from_group("ui_disabled_buttons") graphics_save_button.add_to_group("ui_accepted_buttons") - graphics_save_button.connect("pressed", _on_ui_accepted_button_pressed) - graphics_save_button.connect("pressed", _on_graphics_menu_save_button_pressed) + graphics_save_button.pressed.connect(_on_ui_accepted_button_pressed) + graphics_save_button.pressed.connect(_on_graphics_menu_save_button_pressed) [ false, _, false ]: graphics_message_label.text = "" graphics_save_button.flat = true @@ -284,7 +284,7 @@ func _update_graphics_save_button() -> void: graphics_save_button.disconnect("pressed", _on_ui_accepted_button_pressed) graphics_save_button.remove_from_group("ui_accepted_buttons") graphics_save_button.add_to_group("ui_disabled_buttons") - graphics_save_button.connect("pressed", _on_ui_disabled_button_pressed) + graphics_save_button.pressed.connect(_on_ui_disabled_button_pressed) graphics_save_button.disconnect("pressed", _on_graphics_menu_save_button_pressed) @@ -304,8 +304,8 @@ func _update_sounds_save_button() -> void: sounds_save_button.disconnect("pressed", _on_ui_disabled_button_pressed) sounds_save_button.remove_from_group("ui_disabled_buttons") sounds_save_button.add_to_group("ui_accepted_buttons") - sounds_save_button.connect("pressed", _on_ui_accepted_button_pressed) - sounds_save_button.connect("pressed", _on_sounds_menu_save_button_pressed) + sounds_save_button.pressed.connect(_on_ui_accepted_button_pressed) + sounds_save_button.pressed.connect(_on_sounds_menu_save_button_pressed) [ false, _, false ]: sounds_message_label.text = "" sounds_save_button.flat = true @@ -313,7 +313,7 @@ func _update_sounds_save_button() -> void: sounds_save_button.disconnect("pressed", _on_ui_accepted_button_pressed) sounds_save_button.remove_from_group("ui_accepted_buttons") sounds_save_button.add_to_group("ui_disabled_buttons") - sounds_save_button.connect("pressed", _on_ui_disabled_button_pressed) + sounds_save_button.pressed.connect(_on_ui_disabled_button_pressed) sounds_save_button.disconnect("pressed", _on_sounds_menu_save_button_pressed) #endregion # ============================================================================ # diff --git a/p0ng/scripts/scenes/software_cursor.gd b/p0ng/scripts/scenes/software_cursor.gd index 683fb21..4293e7d 100644 --- a/p0ng/scripts/scenes/software_cursor.gd +++ b/p0ng/scripts/scenes/software_cursor.gd @@ -26,7 +26,7 @@ func _ready() -> void: Input.mouse_mode = Input.MOUSE_MODE_HIDDEN process_mode = Node.PROCESS_MODE_ALWAYS idle_timer.autostart = true - idle_timer.connect("timeout", _on_idle_timer_timeout) + idle_timer.timeout.connect(_on_idle_timer_timeout) func _process(_delta: float) -> void: diff --git a/ssssss/scripts/core/state_machine/state_matchine.gd b/ssssss/scripts/core/state_machine/state_matchine.gd index 8e1e377..4c29c40 100644 --- a/ssssss/scripts/core/state_machine/state_matchine.gd +++ b/ssssss/scripts/core/state_machine/state_matchine.gd @@ -23,7 +23,7 @@ func _ready() -> void: var children: Array[Node] = get_children() for child in children: if child is State: - child.connect("transitioned", _on_child_state_transitioned) + child.transitioned.connect(_on_child_state_transitioned) _states[child.name.to_lower()] = child if _states.is_empty(): print_debug("State machine has no states") diff --git a/ssssss/scripts/main.gd b/ssssss/scripts/main.gd index 4c78549..b0886ed 100644 --- a/ssssss/scripts/main.gd +++ b/ssssss/scripts/main.gd @@ -18,7 +18,7 @@ func _process(_delta: float) -> void: _current_scene = load(GameScene2D.GAME_SCENE[_current_scene_key]).instantiate() add_child(_current_scene) move_child(_current_scene, 0) - _current_scene.connect("scene_finished", _on_scene_finished) + _current_scene.scene_finished.connect(_on_scene_finished) #endregion # ============================================================================ # diff --git a/ssssss/scripts/scenes/game/game_ui.gd b/ssssss/scripts/scenes/game/game_ui.gd index 3eda8b0..273ec24 100644 --- a/ssssss/scripts/scenes/game/game_ui.gd +++ b/ssssss/scripts/scenes/game/game_ui.gd @@ -45,10 +45,10 @@ func _ready() -> void: for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) _endgame_dialog.modulate = Color(1.0, 1.0, 1.0, 0.0) _endgame_dialog.visible = false diff --git a/ssssss/scripts/scenes/level_select/level_select_ui.gd b/ssssss/scripts/scenes/level_select/level_select_ui.gd index 6419cc1..3fbc47d 100644 --- a/ssssss/scripts/scenes/level_select/level_select_ui.gd +++ b/ssssss/scripts/scenes/level_select/level_select_ui.gd @@ -53,8 +53,8 @@ func _on_load_succeeded() -> void: level_select_button.toggle_mode = true level_select_button.custom_minimum_size = Vector2(180, 0) level_select_button.add_to_group("ui_selected_buttons") - level_select_button.connect("pressed", _on_level_select_button_pressed) - level_select_button.connect("pressed", _on_ui_selected_button_pressed) + level_select_button.pressed.connect(_on_level_select_button_pressed) + level_select_button.pressed.connect(_on_ui_selected_button_pressed) %LevelListContainer.add_child(level_select_button) _level_select_buttons.append(level_select_button) diff --git a/ssssss/scripts/scenes/main_menu/main_menu.gd b/ssssss/scripts/scenes/main_menu/main_menu.gd index eca45e1..b6855b1 100644 --- a/ssssss/scripts/scenes/main_menu/main_menu.gd +++ b/ssssss/scripts/scenes/main_menu/main_menu.gd @@ -5,7 +5,7 @@ extends GameScene2D #region Godot builtins func _ready() -> void: %GameTitle/Sprite2D/AnimationPlayer.play("default") - $UI/MainMenuUI.connect("acted", _on_main_menu_ui_acted) + $UI/MainMenuUI.acted.connect(_on_main_menu_ui_acted) #endregion # ============================================================================ # diff --git a/ssssss/scripts/scenes/main_menu/main_menu_ui.gd b/ssssss/scripts/scenes/main_menu/main_menu_ui.gd index 37e58a6..07879f7 100644 --- a/ssssss/scripts/scenes/main_menu/main_menu_ui.gd +++ b/ssssss/scripts/scenes/main_menu/main_menu_ui.gd @@ -10,22 +10,22 @@ extends UI func _ready() -> void: %GameVersionLabel.text += ProjectSettings.get_setting("application/config/version") %StartButton.grab_focus() - %StartButton.connect("pressed", _on_main_menu_start_button_pressed) + %StartButton.pressed.connect(_on_main_menu_start_button_pressed) if Global.os_platform in [ "Mobile", "Web" ]: UI.deactivate_control(%QuitButton) else: - %QuitButton.connect("pressed", _on_main_menu_quit_button_pressed) - %SettingsButton.connect("pressed", _on_main_menu_settings_button_pressed) - %ClassicModeButton.connect("pressed", _on_start_menu_classic_mode_button_pressed) - %ChaosModeButton.connect("pressed", _on_start_menu_chaos_mode_button_pressed) + %QuitButton.pressed.connect(_on_main_menu_quit_button_pressed) + %SettingsButton.pressed.connect(_on_main_menu_settings_button_pressed) + %ClassicModeButton.pressed.connect(_on_start_menu_classic_mode_button_pressed) + %ChaosModeButton.pressed.connect(_on_start_menu_chaos_mode_button_pressed) _start_menu.get_node("BackButton").connect("pressed", _on_start_menu_back_button_pressed) for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) func _process(_delta: float) -> void: diff --git a/ssssss/scripts/scenes/settings_menu/resolution_popup.gd b/ssssss/scripts/scenes/settings_menu/resolution_popup.gd index c9d78ab..62ecff8 100644 --- a/ssssss/scripts/scenes/settings_menu/resolution_popup.gd +++ b/ssssss/scripts/scenes/settings_menu/resolution_popup.gd @@ -15,7 +15,7 @@ var resolution_option_items: Array = Array() func _ready() -> void: visible = false if Global.os_platform == "Desktop": - option_button.connect("pressed", _on_option_button_pressed) + option_button.pressed.connect(_on_option_button_pressed) var resolution_popup_button_group: ButtonGroup = ButtonGroup.new() var resolution_popup_container: Container = $ScrollContainer/VBoxContainer @@ -31,7 +31,7 @@ func _ready() -> void: resolution_key, resolution_popup_button_group ) - resolution_option_item.connect("selected", _on_resolution_option_item_selected) + resolution_option_item.selected.connect(_on_resolution_option_item_selected) resolution_option_item.add_to_group("ui_accepted_buttons") resolution_popup_container.add_child(resolution_option_item) diff --git a/ssssss/scripts/scenes/settings_menu/settings_menu.gd b/ssssss/scripts/scenes/settings_menu/settings_menu.gd index eba2dbc..22f6f6b 100644 --- a/ssssss/scripts/scenes/settings_menu/settings_menu.gd +++ b/ssssss/scripts/scenes/settings_menu/settings_menu.gd @@ -8,8 +8,8 @@ extends GameScene2D #region Godot builtins func _ready() -> void: _ui_load_config() - _ui.connect("acted", _on_main_menu_ui_acted) - _ui.connect("acted_with_data", _on_main_menu_ui_acted_with_data) + _ui.acted.connect(_on_main_menu_ui_acted) + _ui.acted_with_data.connect(_on_main_menu_ui_acted_with_data) #endregion # ============================================================================ # diff --git a/ssssss/scripts/scenes/settings_menu/settings_menu_ui.gd b/ssssss/scripts/scenes/settings_menu/settings_menu_ui.gd index e504eaa..b5ed84a 100644 --- a/ssssss/scripts/scenes/settings_menu/settings_menu_ui.gd +++ b/ssssss/scripts/scenes/settings_menu/settings_menu_ui.gd @@ -19,7 +19,7 @@ func _ready() -> void: _main.get_node("SoundsButton").connect("pressed", _on_main_sounds_button_pressed) _main.get_node("ResetButton").connect("pressed", _on_main_reset_button_pressed) if Global.os_platform == "Desktop": - _resolution_popup.connect("resolution_selected", _on_resolution_popup_resolution_selected) + _resolution_popup.resolution_selected.connect(_on_resolution_popup_resolution_selected) _graphics.get_node("Fullscreen/ToggleButton")\ .connect("toggled", _on_graphics_fullscreen_toggled) _graphics.get_node("PostProcessing/ToggleButton")\ @@ -61,25 +61,25 @@ func _ready() -> void: for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) for child in get_tree().get_nodes_in_group("ui_selected_buttons"): assert(child is Button, "ui_selected_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_selected_button_pressed) + child.pressed.connect(_on_ui_selected_button_pressed) for child in get_tree().get_nodes_in_group("ui_accepted_buttons"): assert( (child is Button) or (child is Slider), "ui_accepted_buttons group must contain only Buttons or Slider" ) if child is Slider: - child.connect("value_changed", _on_slider_updated) + child.value_changed.connect(_on_slider_updated) else: - child.connect("pressed", _on_ui_accepted_button_pressed) + child.pressed.connect(_on_ui_accepted_button_pressed) for child in get_tree().get_nodes_in_group("ui_disabled_buttons"): assert(child is Button, "ui_disabled_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_disabled_button_pressed) + child.pressed.connect(_on_ui_disabled_button_pressed) func _process(_delta: float) -> void: @@ -275,8 +275,8 @@ func _update_graphics_save_button() -> void: graphics_save_button.disconnect("pressed", _on_ui_disabled_button_pressed) graphics_save_button.remove_from_group("ui_disabled_buttons") graphics_save_button.add_to_group("ui_accepted_buttons") - graphics_save_button.connect("pressed", _on_ui_accepted_button_pressed) - graphics_save_button.connect("pressed", _on_graphics_menu_save_button_pressed) + graphics_save_button.pressed.connect(_on_ui_accepted_button_pressed) + graphics_save_button.pressed.connect(_on_graphics_menu_save_button_pressed) [ false, _, false ]: graphics_message_label.text = "" graphics_save_button.flat = true @@ -284,7 +284,7 @@ func _update_graphics_save_button() -> void: graphics_save_button.disconnect("pressed", _on_ui_accepted_button_pressed) graphics_save_button.remove_from_group("ui_accepted_buttons") graphics_save_button.add_to_group("ui_disabled_buttons") - graphics_save_button.connect("pressed", _on_ui_disabled_button_pressed) + graphics_save_button.pressed.connect(_on_ui_disabled_button_pressed) graphics_save_button.disconnect("pressed", _on_graphics_menu_save_button_pressed) @@ -304,8 +304,8 @@ func _update_sounds_save_button() -> void: sounds_save_button.disconnect("pressed", _on_ui_disabled_button_pressed) sounds_save_button.remove_from_group("ui_disabled_buttons") sounds_save_button.add_to_group("ui_accepted_buttons") - sounds_save_button.connect("pressed", _on_ui_accepted_button_pressed) - sounds_save_button.connect("pressed", _on_sounds_menu_save_button_pressed) + sounds_save_button.pressed.connect(_on_ui_accepted_button_pressed) + sounds_save_button.pressed.connect(_on_sounds_menu_save_button_pressed) [ false, _, false ]: sounds_message_label.text = "" sounds_save_button.flat = true @@ -313,7 +313,7 @@ func _update_sounds_save_button() -> void: sounds_save_button.disconnect("pressed", _on_ui_accepted_button_pressed) sounds_save_button.remove_from_group("ui_accepted_buttons") sounds_save_button.add_to_group("ui_disabled_buttons") - sounds_save_button.connect("pressed", _on_ui_disabled_button_pressed) + sounds_save_button.pressed.connect(_on_ui_disabled_button_pressed) sounds_save_button.disconnect("pressed", _on_sounds_menu_save_button_pressed) #endregion # ============================================================================ # diff --git a/ssssss/scripts/scenes/software_cursor.gd b/ssssss/scripts/scenes/software_cursor.gd index 683fb21..4293e7d 100644 --- a/ssssss/scripts/scenes/software_cursor.gd +++ b/ssssss/scripts/scenes/software_cursor.gd @@ -26,7 +26,7 @@ func _ready() -> void: Input.mouse_mode = Input.MOUSE_MODE_HIDDEN process_mode = Node.PROCESS_MODE_ALWAYS idle_timer.autostart = true - idle_timer.connect("timeout", _on_idle_timer_timeout) + idle_timer.timeout.connect(_on_idle_timer_timeout) func _process(_delta: float) -> void: diff --git a/template/scripts/core/state_machine/state_matchine.gd b/template/scripts/core/state_machine/state_matchine.gd index 8e1e377..4c29c40 100644 --- a/template/scripts/core/state_machine/state_matchine.gd +++ b/template/scripts/core/state_machine/state_matchine.gd @@ -23,7 +23,7 @@ func _ready() -> void: var children: Array[Node] = get_children() for child in children: if child is State: - child.connect("transitioned", _on_child_state_transitioned) + child.transitioned.connect(_on_child_state_transitioned) _states[child.name.to_lower()] = child if _states.is_empty(): print_debug("State machine has no states") diff --git a/template/scripts/main.gd b/template/scripts/main.gd index 4c78549..b0886ed 100644 --- a/template/scripts/main.gd +++ b/template/scripts/main.gd @@ -18,7 +18,7 @@ func _process(_delta: float) -> void: _current_scene = load(GameScene2D.GAME_SCENE[_current_scene_key]).instantiate() add_child(_current_scene) move_child(_current_scene, 0) - _current_scene.connect("scene_finished", _on_scene_finished) + _current_scene.scene_finished.connect(_on_scene_finished) #endregion # ============================================================================ # diff --git a/template/scripts/scenes/main_menu/main_menu.gd b/template/scripts/scenes/main_menu/main_menu.gd index 947787c..88f25a5 100644 --- a/template/scripts/scenes/main_menu/main_menu.gd +++ b/template/scripts/scenes/main_menu/main_menu.gd @@ -4,7 +4,7 @@ extends GameScene2D # ============================================================================ # #region Godot builtins func _ready() -> void: - $UI/MainMenuUI.connect("acted", _on_main_menu_ui_acted) + $UI/MainMenuUI.acted.connect(_on_main_menu_ui_acted) #endregion # ============================================================================ # diff --git a/template/scripts/scenes/main_menu/main_menu_ui.gd b/template/scripts/scenes/main_menu/main_menu_ui.gd index 0b49145..3a17e46 100644 --- a/template/scripts/scenes/main_menu/main_menu_ui.gd +++ b/template/scripts/scenes/main_menu/main_menu_ui.gd @@ -10,22 +10,22 @@ extends UI func _ready() -> void: %GameVersionLabel.text += ProjectSettings.get_setting("application/config/version") %StartButton.grab_focus() - %StartButton.connect("pressed", _on_main_menu_start_button_pressed) + %StartButton.pressed.connect(_on_main_menu_start_button_pressed) if Global.os_platform in [ "Mobile", "Web" ]: UI.deactivate_control(%QuitButton) else: - %QuitButton.connect("pressed", _on_main_menu_quit_button_pressed) - %SettingsButton.connect("pressed", _on_main_menu_settings_button_pressed) - %Mode1Button.connect("pressed", _on_start_menu_mode_1_button_pressed) - %Mode2Button.connect("pressed", _on_start_menu_mode_2_button_pressed) + %QuitButton.pressed.connect(_on_main_menu_quit_button_pressed) + %SettingsButton.pressed.connect(_on_main_menu_settings_button_pressed) + %Mode1Button.pressed.connect(_on_start_menu_mode_1_button_pressed) + %Mode2Button.pressed.connect(_on_start_menu_mode_2_button_pressed) _start_menu.get_node("BackButton").connect("pressed", _on_start_menu_back_button_pressed) for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) func _process(_delta: float) -> void: diff --git a/template/scripts/scenes/settings_menu/resolution_popup.gd b/template/scripts/scenes/settings_menu/resolution_popup.gd index c9d78ab..62ecff8 100644 --- a/template/scripts/scenes/settings_menu/resolution_popup.gd +++ b/template/scripts/scenes/settings_menu/resolution_popup.gd @@ -15,7 +15,7 @@ var resolution_option_items: Array = Array() func _ready() -> void: visible = false if Global.os_platform == "Desktop": - option_button.connect("pressed", _on_option_button_pressed) + option_button.pressed.connect(_on_option_button_pressed) var resolution_popup_button_group: ButtonGroup = ButtonGroup.new() var resolution_popup_container: Container = $ScrollContainer/VBoxContainer @@ -31,7 +31,7 @@ func _ready() -> void: resolution_key, resolution_popup_button_group ) - resolution_option_item.connect("selected", _on_resolution_option_item_selected) + resolution_option_item.selected.connect(_on_resolution_option_item_selected) resolution_option_item.add_to_group("ui_accepted_buttons") resolution_popup_container.add_child(resolution_option_item) diff --git a/template/scripts/scenes/settings_menu/settings_menu.gd b/template/scripts/scenes/settings_menu/settings_menu.gd index eba2dbc..22f6f6b 100644 --- a/template/scripts/scenes/settings_menu/settings_menu.gd +++ b/template/scripts/scenes/settings_menu/settings_menu.gd @@ -8,8 +8,8 @@ extends GameScene2D #region Godot builtins func _ready() -> void: _ui_load_config() - _ui.connect("acted", _on_main_menu_ui_acted) - _ui.connect("acted_with_data", _on_main_menu_ui_acted_with_data) + _ui.acted.connect(_on_main_menu_ui_acted) + _ui.acted_with_data.connect(_on_main_menu_ui_acted_with_data) #endregion # ============================================================================ # diff --git a/template/scripts/scenes/settings_menu/settings_menu_ui.gd b/template/scripts/scenes/settings_menu/settings_menu_ui.gd index 7001631..fdd8ac7 100644 --- a/template/scripts/scenes/settings_menu/settings_menu_ui.gd +++ b/template/scripts/scenes/settings_menu/settings_menu_ui.gd @@ -19,7 +19,7 @@ func _ready() -> void: _main.get_node("SoundsButton").connect("pressed", _on_main_sounds_button_pressed) _main.get_node("ResetButton").connect("pressed", _on_main_reset_button_pressed) if Global.os_platform == "Desktop": - _resolution_popup.connect("resolution_selected", _on_resolution_popup_resolution_selected) + _resolution_popup.resolution_selected.connect(_on_resolution_popup_resolution_selected) _graphics.get_node("Fullscreen/ToggleButton")\ .connect("toggled", _on_graphics_fullscreen_toggled) _graphics.get_node("PostProcessing/ToggleButton")\ @@ -61,25 +61,25 @@ func _ready() -> void: for child in get_tree().get_nodes_in_group("ui_container_slider_buttons"): assert(child is Button, "ui_container_slider_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_container_slider_button_pressed) + child.pressed.connect(_on_ui_container_slider_button_pressed) for child in get_tree().get_nodes_in_group("ui_scene_changer_buttons"): assert(child is Button, "ui_scene_changer_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_scene_changer_button_pressed) + child.pressed.connect(_on_ui_scene_changer_button_pressed) for child in get_tree().get_nodes_in_group("ui_selected_buttons"): assert(child is Button, "ui_selected_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_selected_button_pressed) + child.pressed.connect(_on_ui_selected_button_pressed) for child in get_tree().get_nodes_in_group("ui_accepted_buttons"): assert( (child is Button) or (child is Slider), "ui_accepted_buttons group must contain only Buttons or Slider" ) if child is Slider: - child.connect("value_changed", _on_slider_updated) + child.value_changed.connect(_on_slider_updated) else: - child.connect("pressed", _on_ui_accepted_button_pressed) + child.pressed.connect(_on_ui_accepted_button_pressed) for child in get_tree().get_nodes_in_group("ui_disabled_buttons"): assert(child is Button, "ui_disabled_buttons group must contain only Buttons") - child.connect("pressed", _on_ui_disabled_button_pressed) + child.pressed.connect(_on_ui_disabled_button_pressed) func _process(_delta: float) -> void: @@ -275,8 +275,8 @@ func _update_graphics_save_button() -> void: graphics_save_button.disconnect("pressed", _on_ui_disabled_button_pressed) graphics_save_button.remove_from_group("ui_disabled_buttons") graphics_save_button.add_to_group("ui_accepted_buttons") - graphics_save_button.connect("pressed", _on_ui_accepted_button_pressed) - graphics_save_button.connect("pressed", _on_graphics_menu_save_button_pressed) + graphics_save_button.pressed.connect(_on_ui_accepted_button_pressed) + graphics_save_button.pressed.connect(_on_graphics_menu_save_button_pressed) [ false, _, false ]: graphics_message_label.text = "" graphics_save_button.flat = true @@ -284,7 +284,7 @@ func _update_graphics_save_button() -> void: graphics_save_button.disconnect("pressed", _on_ui_accepted_button_pressed) graphics_save_button.remove_from_group("ui_accepted_buttons") graphics_save_button.add_to_group("ui_disabled_buttons") - graphics_save_button.connect("pressed", _on_ui_disabled_button_pressed) + graphics_save_button.pressed.connect(_on_ui_disabled_button_pressed) graphics_save_button.disconnect("pressed", _on_graphics_menu_save_button_pressed) @@ -304,8 +304,8 @@ func _update_sounds_save_button() -> void: sounds_save_button.disconnect("pressed", _on_ui_disabled_button_pressed) sounds_save_button.remove_from_group("ui_disabled_buttons") sounds_save_button.add_to_group("ui_accepted_buttons") - sounds_save_button.connect("pressed", _on_ui_accepted_button_pressed) - sounds_save_button.connect("pressed", _on_sounds_menu_save_button_pressed) + sounds_save_button.pressed.connect(_on_ui_accepted_button_pressed) + sounds_save_button.pressed.connect(_on_sounds_menu_save_button_pressed) [ false, _, false ]: sounds_message_label.text = "" sounds_save_button.flat = true @@ -313,7 +313,7 @@ func _update_sounds_save_button() -> void: sounds_save_button.disconnect("pressed", _on_ui_accepted_button_pressed) sounds_save_button.remove_from_group("ui_accepted_buttons") sounds_save_button.add_to_group("ui_disabled_buttons") - sounds_save_button.connect("pressed", _on_ui_disabled_button_pressed) + sounds_save_button.pressed.connect(_on_ui_disabled_button_pressed) sounds_save_button.disconnect("pressed", _on_sounds_menu_save_button_pressed) #endregion # ============================================================================ # diff --git a/template/scripts/scenes/software_cursor.gd b/template/scripts/scenes/software_cursor.gd index 683fb21..4293e7d 100644 --- a/template/scripts/scenes/software_cursor.gd +++ b/template/scripts/scenes/software_cursor.gd @@ -26,7 +26,7 @@ func _ready() -> void: Input.mouse_mode = Input.MOUSE_MODE_HIDDEN process_mode = Node.PROCESS_MODE_ALWAYS idle_timer.autostart = true - idle_timer.connect("timeout", _on_idle_timer_timeout) + idle_timer.timeout.connect(_on_idle_timer_timeout) func _process(_delta: float) -> void: