diff --git a/.godot/editor/editor_layout.cfg b/.godot/editor/editor_layout.cfg index a049571ab80ef34deb5685d7d9ce86012e121aa6..aced0f8a15bff872442cd2adb3ea4e95a8466e14 100644 --- a/.godot/editor/editor_layout.cfg +++ b/.godot/editor/editor_layout.cfg @@ -29,14 +29,14 @@ dock_5="Inspector,Node,History" open_scenes=PackedStringArray("res://main.tscn", "res://scenes/scene_manager.tscn", "res://scenes/game.tscn", "res://scenes/ui/pop_up_label.tscn", "res://scenes/screens/title_screen.tscn", "res://scenes/screens/select_piece_screen.tscn", "res://scenes/ui/menu_button.tscn") current_scene="res://main.tscn" center_split_offset=-570 -selected_default_debugger_tab_idx=1 -selected_main_editor_idx=0 +selected_default_debugger_tab_idx=0 +selected_main_editor_idx=2 selected_bottom_panel_item=0 [ScriptEditor] open_scripts=["res://scripts/Assassin.gd", "res://scripts/game.gd", "res://scripts/main/main.gd", "res://scripts/screens/menu_button.gd", "res://scripts/Pawn.gd", "res://scripts/Piece.gd", "res://scripts/ui/pop_up_label.gd", "res://scripts/Queen.gd", "res://scripts/Rook.gd", "res://scripts/run_data/run_data.gd", "res://scripts/scene_manager.gd", "res://scripts/screens/select_piece_screen.gd", "res://scripts/screens/title_screen.gd"] -selected_script="res://scripts/main/main.gd" +selected_script="res://scripts/screens/menu_button.gd" open_help=[] script_split_offset=70 list_split_offset=0 diff --git a/.godot/editor/filesystem_update4 b/.godot/editor/filesystem_update4 index cd6df3968d5376a1be94581c38e38104bb17fa97..48973db77fd2a2cbe53b6c68535299c26503ee24 100644 --- a/.godot/editor/filesystem_update4 +++ b/.godot/editor/filesystem_update4 @@ -20,3 +20,4 @@ res://scenes/screens/select_piece_screen.tscn res://scripts/screens/select_piece_screen.gd res://scenes/ui/menu_button.tscn res://scripts/screens/title_screen.gd +res://scripts/screens/menu_button.gd diff --git a/.godot/editor/script_editor_cache.cfg b/.godot/editor/script_editor_cache.cfg index e55808060e77b897ba3711634f4120a00210a812..938b186e74a595ea08ec5d3c40ba67646d1d5e41 100644 --- a/.godot/editor/script_editor_cache.cfg +++ b/.godot/editor/script_editor_cache.cfg @@ -147,7 +147,7 @@ state={ "folded_lines": Array[int]([]), "h_scroll_position": 0, "row": 17, -"scroll_position": 6.0, +"scroll_position": 0.0, "selection": false, "syntax_highlighter": "GDScript" } @@ -157,10 +157,10 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 1, +"column": 22, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 14, +"row": 6, "scroll_position": 0.0, "selection": false, "syntax_highlighter": "GDScript" @@ -171,11 +171,11 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 0, +"column": 1, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 18, -"scroll_position": 6.0, +"row": 15, +"scroll_position": 6.3, "selection": false, "syntax_highlighter": "GDScript" } diff --git a/.godot/global_script_class_cache.cfg b/.godot/global_script_class_cache.cfg index f1f9a7ce0a5f0a81b899837010eaa8c9f1d07a4e..0baf76cfef5ad0015e277b24efb239104fb0d7a1 100644 --- a/.godot/global_script_class_cache.cfg +++ b/.godot/global_script_class_cache.cfg @@ -53,6 +53,12 @@ list=Array[Dictionary]([{ "language": &"GDScript", "path": "res://scripts/Rook.gd" }, { +"base": &"Control", +"class": &"SelectPieceScreen", +"icon": "", +"language": &"GDScript", +"path": "res://scripts/screens/select_piece_screen.gd" +}, { "base": &"Button", "class": &"TitleButton", "icon": "", diff --git a/scripts/screens/menu_button.gd b/scripts/screens/menu_button.gd index a668985084314d8431fd895de80d0eafc57d3b2f..306eea32d3919c88d742d67b0256c188572afca5 100644 --- a/scripts/screens/menu_button.gd +++ b/scripts/screens/menu_button.gd @@ -12,9 +12,8 @@ func _ready() -> void: angle_x_max = deg_to_rad(angle_x_max) angle_y_max = deg_to_rad(angle_y_max) - # Sets the size to any texture size so 3d effect works on all sizes - size.x = menu_btn_texture.size.x - size.y = menu_btn_texture.size.y + set_button_size() + menu_btn_texture.material = menu_btn_texture.material.duplicate() func _on_gui_input(event: InputEvent) -> void: @@ -46,6 +45,11 @@ func _on_mouse_exited() -> void: func get_texture_rect() -> TextureRect: return $MenuTexture - + func set_image(image_path: String) -> void: $MenuTexture.texture = load(image_path) + +# Sets the size to any texture size so 3d effect works on all sizes +func set_button_size() -> void: + await get_tree().process_frame + size = menu_btn_texture.texture.get_size() diff --git a/scripts/screens/select_piece_screen.gd b/scripts/screens/select_piece_screen.gd index cb61604b889f66c0beb9fd1b86ff8ba2efdae4f8..e09c6b16dcc8bc6313b6b48242b90933d57af0a6 100644 --- a/scripts/screens/select_piece_screen.gd +++ b/scripts/screens/select_piece_screen.gd @@ -1,4 +1,5 @@ extends Control +class_name SelectPieceScreen @onready var scene_manager: Node = $"../SceneManager" @onready var start_button: TitleButton = $StartButton @@ -7,9 +8,6 @@ func _ready() -> void: # Temp image start_button.set_image("res://assets/ui/title_screen/play_button.png") -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass func _on_start_pressed() -> void: RunData.start_run()