style: apply gdformat formatting across the entire project
Auto-format all GDScript files using gdformat from gdtoolkit. This is a baseline formatting pass to ensure consistent style: - Normalizes indentation and spacing - Wraps long lines to 100 characters - Removes trailing whitespace - Standardizes blank lines between functions 68 files reformatted, 8 files left unchanged (3rd-party addon files with parse errors excluded).
This commit is contained in:
@@ -5,6 +5,7 @@ extends Button
|
||||
|
||||
signal dropped
|
||||
|
||||
|
||||
func _can_drop_data(p_position, p_data) -> bool:
|
||||
if typeof(p_data) == TYPE_DICTIONARY:
|
||||
if p_data.files.size() == 1:
|
||||
@@ -13,5 +14,6 @@ func _can_drop_data(p_position, p_data) -> bool:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _drop_data(p_position, p_data) -> void:
|
||||
dropped.emit(p_data.files[0])
|
||||
|
||||
@@ -29,19 +29,21 @@ func _init() -> void:
|
||||
func directory_setup_popup() -> void:
|
||||
dialog = load(DIRECTORY_SETUP).instantiate()
|
||||
dialog.hide()
|
||||
|
||||
|
||||
# Nodes
|
||||
select_dir_btn = dialog.get_node("Margin/VBox/DirHBox/SelectDir")
|
||||
selected_dir_le = dialog.get_node("Margin/VBox/DirHBox/LineEdit")
|
||||
|
||||
if plugin.terrain.data_directory:
|
||||
selected_dir_le.text = plugin.terrain.data_directory
|
||||
|
||||
|
||||
# Icons
|
||||
plugin.ui.set_button_editor_icon(select_dir_btn, "Folder")
|
||||
|
||||
|
||||
#Signals
|
||||
select_dir_btn.pressed.connect(_on_select_file_pressed.bind(EditorFileDialog.FILE_MODE_OPEN_DIR))
|
||||
select_dir_btn.pressed.connect(
|
||||
_on_select_file_pressed.bind(EditorFileDialog.FILE_MODE_OPEN_DIR)
|
||||
)
|
||||
dialog.confirmed.connect(_on_close_requested)
|
||||
dialog.canceled.connect(_on_close_requested)
|
||||
dialog.get_ok_button().pressed.connect(_on_ok_pressed)
|
||||
@@ -74,7 +76,7 @@ func _on_ok_pressed() -> void:
|
||||
if not DirAccess.dir_exists_absolute(selected_dir_le.text):
|
||||
push_error("Directory doesn't exist: ", selected_dir_le.text)
|
||||
return
|
||||
# Check if directory empty of terrain files
|
||||
# Check if directory empty of terrain files
|
||||
var data_found: bool = false
|
||||
var files: Array = DirAccess.get_files_at(selected_dir_le.text)
|
||||
for file in files:
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# Menu for Terrain3D
|
||||
extends HBoxContainer
|
||||
|
||||
|
||||
const DirectoryWizard: Script = preload("res://addons/terrain_3d/menu/directory_setup.gd")
|
||||
const Packer: Script = preload("res://addons/terrain_3d/menu/channel_packer.gd")
|
||||
const Baker: Script = preload("res://addons/terrain_3d/menu/baker.gd")
|
||||
@@ -32,17 +31,17 @@ func _enter_tree() -> void:
|
||||
baker.plugin = plugin
|
||||
add_child(directory_setup)
|
||||
add_child(baker)
|
||||
|
||||
|
||||
menu_button.text = "Terrain3D"
|
||||
menu_button.get_popup().add_item("Directory Setup...", MENU_DIRECTORY_SETUP)
|
||||
menu_button.get_popup().add_item("Pack Textures...", MENU_PACK_TEXTURES)
|
||||
menu_button.get_popup().add_item("Directory Setup...", MENU_DIRECTORY_SETUP)
|
||||
menu_button.get_popup().add_item("Pack Textures...", MENU_PACK_TEXTURES)
|
||||
menu_button.get_popup().add_separator("", MENU_SEPARATOR)
|
||||
menu_button.get_popup().add_item("Bake ArrayMesh...", MENU_BAKE_ARRAY_MESH)
|
||||
menu_button.get_popup().add_item("Bake Occluder3D...", MENU_BAKE_OCCLUDER)
|
||||
menu_button.get_popup().add_separator("", MENU_SEPARATOR2)
|
||||
menu_button.get_popup().add_item("Set up Navigation...", MENU_SET_UP_NAVIGATION)
|
||||
menu_button.get_popup().add_item("Bake NavMesh...", MENU_BAKE_NAV_MESH)
|
||||
|
||||
|
||||
menu_button.get_popup().id_pressed.connect(_on_menu_pressed)
|
||||
menu_button.about_to_popup.connect(_on_menu_about_to_popup)
|
||||
add_child(menu_button)
|
||||
@@ -53,7 +52,7 @@ func _on_menu_pressed(p_id: int) -> void:
|
||||
MENU_DIRECTORY_SETUP:
|
||||
directory_setup.directory_setup_popup()
|
||||
MENU_PACK_TEXTURES:
|
||||
packer.pack_textures_popup()
|
||||
packer.pack_textures_popup()
|
||||
MENU_BAKE_ARRAY_MESH:
|
||||
baker.bake_mesh_popup()
|
||||
MENU_BAKE_OCCLUDER:
|
||||
|
||||
Reference in New Issue
Block a user