From 7a8225240b943a5117e883d6f6029b5ca290a78c Mon Sep 17 00:00:00 2001 From: kayomn Date: Wed, 25 Jan 2023 23:39:10 +0000 Subject: [PATCH] Add support for building menu to toolbar --- local_player.scn | 4 +- map_editor.scn | 4 +- map_editor/paint_selector_button_group.res | 2 +- map_editor/structure_button_group.res | 3 + project.godot | 82 ++------------------ terrain/paints/default_terrain_paint.res | 4 +- terrain/paints/desert_sand_terrain_paint.res | 4 +- terrain/paints/dry_mud_terrain_paint.res | 4 +- user_interface/action_prompt.gd | 1 + user_interface/selection_prompt.gd | 1 + user_interface/worker_prompt.gd | 1 + 11 files changed, 23 insertions(+), 87 deletions(-) create mode 100644 map_editor/structure_button_group.res diff --git a/local_player.scn b/local_player.scn index 84d8f30..d169f96 100644 --- a/local_player.scn +++ b/local_player.scn @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4912b4281b1cd75eef06be3477b72f9c47c2ac69e3af9ecdb661e326e9be6453 -size 673 +oid sha256:6a4fe7961f0b6694c50311a199915c2acf0b1297a8bb1cb460dbab0e0c375cd2 +size 668 diff --git a/map_editor.scn b/map_editor.scn index 4bde408..fd487c0 100644 --- a/map_editor.scn +++ b/map_editor.scn @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:854502f2bf396099a9c1b387703b268785ba2993794304fb574193ecf12cd5ca -size 8188 +oid sha256:5f0091343aa355a20889877ca201bc9e66b2e03333e793ea53a4a26767d8289c +size 8570 diff --git a/map_editor/paint_selector_button_group.res b/map_editor/paint_selector_button_group.res index 5b6b9de..1c80674 100644 --- a/map_editor/paint_selector_button_group.res +++ b/map_editor/paint_selector_button_group.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:86a92428de499a71f64905c562804c4d1c4fc8ba763dffc2ba30079ceec27ed1 +oid sha256:a62c0405f427f5da97173b050f0baba2aab0b093b45fc283749ee252aab47f6e size 208 diff --git a/map_editor/structure_button_group.res b/map_editor/structure_button_group.res new file mode 100644 index 0000000..6097737 --- /dev/null +++ b/map_editor/structure_button_group.res @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6c88793bdb0c4c2c80b7a913b1b3fc98cea238405973ca04709f9c16bec1903 +size 199 diff --git a/project.godot b/project.godot index 56234b4..986754a 100644 --- a/project.godot +++ b/project.godot @@ -8,76 +8,6 @@ config_version=5 -_global_script_classes=[{ -"base": "Control", -"class": &"ActionPrompt", -"language": &"GDScript", -"path": "res://user_interface/action_prompt.gd" -}, { -"base": "HFlowContainer", -"class": &"ItemSelection", -"language": &"GDScript", -"path": "res://user_interface/button_selection.gd" -}, { -"base": "VBoxContainer", -"class": &"MapEditorMenu", -"language": &"GDScript", -"path": "res://map_editor/map_editor_menu.gd" -}, { -"base": "Node3D", -"class": &"MeshGrid", -"language": &"GDScript", -"path": "res://mesh_grid.gd" -}, { -"base": "Node3D", -"class": &"PlayerController", -"language": &"GDScript", -"path": "res://player_controller.gd" -}, { -"base": "Control", -"class": &"SelectionPrompt", -"language": &"GDScript", -"path": "res://user_interface/selection_prompt.gd" -}, { -"base": "Node", -"class": &"Settings", -"language": &"GDScript", -"path": "res://settings.gd" -}, { -"base": "GeometryInstance3D", -"class": &"TerrainInstance3D", -"language": &"GDScript", -"path": "res://terrain/terrain_instance_3d.gd" -}, { -"base": "Node", -"class": &"TerrainMapCanvas", -"language": &"GDScript", -"path": "res://terrain/terrain_map_canvas.gd" -}, { -"base": "Resource", -"class": &"TerrainPaint", -"language": &"GDScript", -"path": "res://terrain/paints/terrain_paint.gd" -}, { -"base": "Control", -"class": &"WorkerPrompt", -"language": &"GDScript", -"path": "res://user_interface/worker_prompt.gd" -}] -_global_script_class_icons={ -"ActionPrompt": "", -"ItemSelection": "", -"MapEditorMenu": "", -"MeshGrid": "", -"PlayerController": "", -"SelectionPrompt": "", -"Settings": "", -"TerrainInstance3D": "", -"TerrainMapCanvas": "", -"TerrainPaint": "", -"WorkerPrompt": "" -} - [application] config/name="Protectorate" @@ -116,32 +46,32 @@ enabled=PackedStringArray() player_controller_left={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"echo":false,"script":null) ] } player_controller_right={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"echo":false,"script":null) ] } player_controller_forward={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"echo":false,"script":null) ] } player_controller_backward={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"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":0,"echo":false,"script":null) ] } player_controller_rotate_cw={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":0,"echo":false,"script":null) ] } player_controller_rotate_ccw={ "deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"unicode":0,"echo":false,"script":null) +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":0,"echo":false,"script":null) ] } editor_paint={ diff --git a/terrain/paints/default_terrain_paint.res b/terrain/paints/default_terrain_paint.res index e8202f5..fb94070 100644 --- a/terrain/paints/default_terrain_paint.res +++ b/terrain/paints/default_terrain_paint.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4f7bc9218bdd88690b9994999715acb1e1233299ba9fe008d835a6cc9ff592f0 -size 294 +oid sha256:e08b6ac8b5ebc3a2ef443939261f0c1b9414149f8e45dea3ca968fa6ae02e706 +size 299 diff --git a/terrain/paints/desert_sand_terrain_paint.res b/terrain/paints/desert_sand_terrain_paint.res index e60460e..8f738b1 100644 --- a/terrain/paints/desert_sand_terrain_paint.res +++ b/terrain/paints/desert_sand_terrain_paint.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c1908a2b3087d64658ebe340148554aa109658b52c1fbf662d340dec961f36a6 -size 293 +oid sha256:7b8347472c2f8fc58b36e57427084fd2e39a289f13f7e0b2d92023f88e6cc074 +size 298 diff --git a/terrain/paints/dry_mud_terrain_paint.res b/terrain/paints/dry_mud_terrain_paint.res index e6ff33e..41d29f8 100644 --- a/terrain/paints/dry_mud_terrain_paint.res +++ b/terrain/paints/dry_mud_terrain_paint.res @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:555af3c288502203b9fa4b8a71f5acdb273a988262a0bffb929a218540158561 -size 289 +oid sha256:e94e02d26626e20c9ff337427b07e8663f04d6a840e456565625c71a464373b1 +size 294 diff --git a/user_interface/action_prompt.gd b/user_interface/action_prompt.gd index d667e7f..ded869a 100644 --- a/user_interface/action_prompt.gd +++ b/user_interface/action_prompt.gd @@ -36,6 +36,7 @@ func _ready() -> void: ## ## func prompt() -> void: + LocalPlayer.override_controls(hidden) show() prompted.emit() diff --git a/user_interface/selection_prompt.gd b/user_interface/selection_prompt.gd index 1bf69ee..f9d0c41 100644 --- a/user_interface/selection_prompt.gd +++ b/user_interface/selection_prompt.gd @@ -57,6 +57,7 @@ func get_button_group() -> ButtonGroup: ## [member get_button_group] ## func prompt(initial_selection: int) -> void: + LocalPlayer.override_controls(hidden) assert(_button_group != null, "button group cannot be null") var selected_button := _button_group.get_buttons()[initial_selection] diff --git a/user_interface/worker_prompt.gd b/user_interface/worker_prompt.gd index ac4c4ea..11c1f32 100644 --- a/user_interface/worker_prompt.gd +++ b/user_interface/worker_prompt.gd @@ -23,6 +23,7 @@ var progress: Range = null ## ## func prompt(display_message: String, steps: Array) -> void: + LocalPlayer.override_controls(hidden) show() prompted.emit()