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:
@@ -1,7 +1,7 @@
|
||||
# Copyright © 2023-2026 Cory Petkovsek, Roope Palmroos, and Contributors.
|
||||
# Editor Region Gizmos for Terrain3D
|
||||
extends EditorNode3DGizmo
|
||||
|
||||
|
||||
var material: StandardMaterial3D
|
||||
var selection_material: StandardMaterial3D
|
||||
var region_position: Vector2
|
||||
@@ -22,34 +22,49 @@ func _init() -> void:
|
||||
material.set_flag(BaseMaterial3D.FLAG_ALBEDO_FROM_VERTEX_COLOR, true)
|
||||
material.set_shading_mode(BaseMaterial3D.SHADING_MODE_UNSHADED)
|
||||
material.set_albedo(Color.WHITE)
|
||||
|
||||
|
||||
selection_material = material.duplicate()
|
||||
selection_material.set_render_priority(0)
|
||||
|
||||
|
||||
func _redraw() -> void:
|
||||
clear()
|
||||
|
||||
|
||||
var rect_position = region_position * region_size
|
||||
|
||||
if show_rect:
|
||||
var modulate: Color = main_color if !use_secondary_color else secondary_color
|
||||
if abs(region_position.x) > Terrain3DData.REGION_MAP_SIZE*.5 or abs(region_position.y) > Terrain3DData.REGION_MAP_SIZE*.5:
|
||||
if (
|
||||
abs(region_position.x) > Terrain3DData.REGION_MAP_SIZE * .5
|
||||
or abs(region_position.y) > Terrain3DData.REGION_MAP_SIZE * .5
|
||||
):
|
||||
modulate = Color.GRAY
|
||||
draw_rect(Vector2(region_size,region_size)*.5 + rect_position, region_size, selection_material, modulate)
|
||||
|
||||
draw_rect(
|
||||
Vector2(region_size, region_size) * .5 + rect_position,
|
||||
region_size,
|
||||
selection_material,
|
||||
modulate
|
||||
)
|
||||
|
||||
for pos in grid:
|
||||
var grid_tile_position = Vector2(pos) * region_size
|
||||
if show_rect and grid_tile_position == rect_position:
|
||||
# Skip this one, otherwise focused region borders are not always visible due to draw order
|
||||
continue
|
||||
|
||||
draw_rect(Vector2(region_size,region_size)*.5 + grid_tile_position, region_size, material, grid_color)
|
||||
|
||||
|
||||
draw_rect(
|
||||
Vector2(region_size, region_size) * .5 + grid_tile_position,
|
||||
region_size,
|
||||
material,
|
||||
grid_color
|
||||
)
|
||||
|
||||
draw_rect(Vector2.ZERO, region_size * Terrain3DData.REGION_MAP_SIZE, material, border_color)
|
||||
|
||||
|
||||
func draw_rect(p_pos: Vector2, p_size: float, p_material: StandardMaterial3D, p_modulate: Color) -> void:
|
||||
func draw_rect(
|
||||
p_pos: Vector2, p_size: float, p_material: StandardMaterial3D, p_modulate: Color
|
||||
) -> void:
|
||||
var lines: PackedVector3Array = [
|
||||
Vector3(-1, 0, -1),
|
||||
Vector3(-1, 0, 1),
|
||||
@@ -60,9 +75,8 @@ func draw_rect(p_pos: Vector2, p_size: float, p_material: StandardMaterial3D, p_
|
||||
Vector3(1, 0, -1),
|
||||
Vector3(-1, 0, -1),
|
||||
]
|
||||
|
||||
|
||||
for i in lines.size():
|
||||
lines[i] = ((lines[i] / 2.0) * p_size) + Vector3(p_pos.x, 0, p_pos.y)
|
||||
|
||||
|
||||
add_lines(lines, p_material, false, p_modulate)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user