more work on level system

This commit is contained in:
Haze Weathers 2025-03-08 19:28:53 -05:00
parent b19ee682d1
commit dd54e286d8
13 changed files with 219 additions and 71 deletions

View file

@ -17,4 +17,5 @@ static func from_level(level: Level) -> LevelInfo:
info.title = level.title
info.id = level.id
info.order = level.order
info.scene_path = level.scene_file_path
return info

View file

@ -8,12 +8,15 @@ extends Resource
title = value
resource_name = title
@export var id: String
@export var start_scene: PackedScene
@export var end_scene: PackedScene
@export_dir var levels_dir: String:
set(value):
levels_dir = value
if Engine.is_editor_hint():
update_levels()
@export_tool_button("Update Levels") var _update_levels_action = update_levels
@export var levels: Array[LevelInfo] = []
@ -51,6 +54,8 @@ func update_levels() -> void:
file = dir.get_next()
# sort levels by level order
levels.sort_custom(func(a, b): return a.order < b.order)
emit_changed()
notify_property_list_changed()
func _popup_alert(message: String) -> void: