refactored the way levels are listed in the toolbox
This commit is contained in:
@@ -26,6 +26,9 @@ func add_levels_to_container() -> void:
|
||||
file_name = file_name.trim_suffix(".tscn") # Remove the ".tscn" extension
|
||||
file_name = file_name.replace("_", " ") # Replace underscores with spaces
|
||||
file_name = file_name.capitalize() # Convert to proper case
|
||||
if file_path.contains("/gyms/"): file_name = "[GYM] " + file_name
|
||||
if file_path.contains("/museums/"): file_name = "[MUS] " + file_name
|
||||
if file_path.contains("/zoos/"): file_name = "[ZOO] " + file_name
|
||||
var button_name := str(file_name)
|
||||
level_buttons_container.add_item(button_name)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ item_0/text = "1 - ExampleLevel"
|
||||
|
||||
[node name="SceneLister" type="Node" parent="." unique_id=149935027]
|
||||
script = ExtResource("3_stdqw")
|
||||
files = Array[String](["res://maps/level1.tscn", "res://maps/city.tscn", "res://maps/GYMs/metrics.tscn"])
|
||||
files = Array[String](["res://maps/gyms/metrics.tscn", "res://maps/zoos/grounded_flying_ennemies.tscn"])
|
||||
directory = "res://maps"
|
||||
|
||||
[connection signal="item_activated" from="Control/LevelButtonsContainer" to="." method="_on_level_buttons_container_item_activated"]
|
||||
|
||||
@@ -109,7 +109,7 @@ text = "Restart current
|
||||
|
||||
[node name="SelectLevel" type="Button" parent="MarginContainer/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin/LevelSelectionSection/LevelSelectionContainer" unique_id=2015444126]
|
||||
layout_mode = 2
|
||||
text = "Select levet
|
||||
text = "Select level
|
||||
"
|
||||
|
||||
[connection signal="toggled" from="MarginContainer/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerUtilsContainer/PlayerInvicibleToggle" to="." method="_on_player_invicible_toggled"]
|
||||
|
||||
Reference in New Issue
Block a user