Improves tree and ground tile appearance

Refactors tree spawning and rendering:
- Adds seasonal color variations for trees via scripts.
- Introduces `ColorStorage` to manage tree and grass colors
- Removes unused code from tree spawning logic.
- Adjusts ground tile color for better visual appeal.
- Hides debug text on ground tiles.
This commit is contained in:
Dan Baker 2025-06-28 17:21:50 +01:00
parent 734730beee
commit ea5006e8a2
28 changed files with 454 additions and 63 deletions

View file

@ -20,10 +20,6 @@ func set_tree_data(data: TreeDataResource):
tree_data = data
spawn_model()
func setup_tree(data: TreeDataResource):
# Alternative method name if you prefer
set_tree_data(data)
func spawn_model():
if not tree_data or not tree_data.model:
Log.pr("No tree data or model provided")
@ -37,7 +33,9 @@ func spawn_model():
# Instantiate the model from the TreeDataResource
model_instance = tree_data.model.instantiate()
tree_data.apply_seasonal_colors(model_instance, "spring")
add_child(model_instance)
# Create base circle after model is loaded
if not base_circle:
@ -45,6 +43,7 @@ func spawn_model():
# Re-scan for mesh instances in the new model
find_all_mesh_instances(model_instance)
update_outline_materials()
# Apply any additional properties from tree_data
@ -63,7 +62,7 @@ func apply_tree_properties():
var scale_variation = randf_range(0.8, 1.2)
model_instance.scale *= scale_variation
func setup_outline_material():
func setup_outline_material() -> void:
# Create outline material with your shader
outline_material = ShaderMaterial.new()
outline_material.shader = preload("res://outline.gdshader")