Skip to content

Commit

Permalink
Fix #231 - add toolbar settings to bottom panel using native method
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Nov 5, 2023
1 parent c8d7b66 commit ac9fc8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions project/addons/terrain_3d/editor/components/ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func _enter_tree() -> void:
toolbar_settings.hide()

plugin.add_control_to_container(EditorPlugin.CONTAINER_SPATIAL_EDITOR_SIDE_LEFT, toolbar)
plugin.add_control_to_bottom(toolbar_settings)
plugin.add_control_to_container(EditorPlugin.CONTAINER_SPATIAL_EDITOR_BOTTOM, toolbar_settings)

decal = Decal.new()
add_child(decal)
Expand All @@ -58,7 +58,7 @@ func _enter_tree() -> void:

func _exit_tree() -> void:
plugin.remove_control_from_container(EditorPlugin.CONTAINER_SPATIAL_EDITOR_SIDE_LEFT, toolbar)
toolbar_settings.get_parent().remove_child(toolbar_settings)
plugin.remove_control_from_container(EditorPlugin.CONTAINER_SPATIAL_EDITOR_BOTTOM, toolbar_settings)
toolbar.queue_free()
toolbar_settings.queue_free()
decal.queue_free()
Expand Down
8 changes: 0 additions & 8 deletions project/addons/terrain_3d/editor/editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ func update_region_grid() -> void:
region_gizmo.region_size = 1024
region_gizmo.grid = [Vector2i.ZERO]


func add_control_to_bottom(control: Control) -> void:
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, control)
var container = control.get_parent().get_parent().get_parent().get_parent()
control.get_parent().remove_child(control)
container.add_child(control)
container.move_child(control, 2)


# Signal handlers

Expand Down

0 comments on commit ac9fc8a

Please sign in to comment.