WIP checkpoint: PC2: Wire "Enter World" from the browse list to the playable level
This commit is contained in:
@@ -135,8 +135,23 @@ func _create_world_card(world_dict: Dictionary) -> Control:
|
||||
meta_label.add_theme_font_size_override("font_size", 12)
|
||||
meta_label.add_theme_color_override("font_color", Color(0.5, 0.5, 0.5, 1.0))
|
||||
|
||||
# PC2: the only thing a world actually loads into right now is the one
|
||||
# shared playable test level (scenes/game.tscn) -- there's no per-world
|
||||
# content yet, so "Enter" doesn't need the world's id for anything.
|
||||
# Real per-world level loading is a later concern once worlds actually
|
||||
# have their own content to load.
|
||||
var enter_button := Button.new()
|
||||
enter_button.text = "Enter World"
|
||||
enter_button.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
|
||||
enter_button.pressed.connect(_on_enter_world_pressed)
|
||||
|
||||
card.add_child(name_label)
|
||||
card.add_child(desc_label)
|
||||
card.add_child(meta_label)
|
||||
card.add_child(enter_button)
|
||||
|
||||
return panel
|
||||
|
||||
|
||||
func _on_enter_world_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/game.tscn")
|
||||
|
||||
Reference in New Issue
Block a user