This commit is contained in:
2024-11-04 17:25:09 +08:00
parent c87de7de5d
commit 471d425b23
30 changed files with 2319 additions and 584 deletions
@@ -32,6 +32,7 @@ enum Direction {
var diagonal_movement: bool = false
class NeighborInfo:
var position: Vector2i
var direction: Direction
@@ -430,6 +431,22 @@ func _on_mesh_library_changed():
validate_item_indices()
if auto_generate:
generate_grid()
_update_cell_option_buttons()
func _update_cell_option_buttons():
if not mesh_library:
return
var item_list = mesh_library.get_item_list()
for x in range(columns):
for z in range(rows):
var position = Vector3i(x, 0, z)
var cell_item = get_cell_item(position)
if cell_item != -1 and cell_item < item_list.size():
set_cell_item(position, cell_item)
else:
set_cell_item(position, 0)
func _set(property, value):
if property == "mesh_library":