playlist now removes played scenes

This commit is contained in:
Derek
2025-03-01 16:11:20 -06:00
parent 3ab4160be6
commit dc7ecf83ee
11 changed files with 86 additions and 61 deletions

View File

@@ -2,24 +2,39 @@ extends Node
@onready var playlist_generator: Control = $"../Playlist Generator"
var round_id = 2
var portals = []
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
playlist_generator.load_playlist()
if GameGlobals.current_match == [] or GameGlobals.current_match == null:
playlist_generator.load_playlist()
print("CURRENT MATCH : ",GameGlobals.current_match)
for i in get_tree().current_scene.get_children():
if i.is_in_group("portal"):
portals.append(i)
print("NO REENTRY PORTALS : ",GameGlobals.no_reentry_portals)
if GameGlobals.current_match[GameGlobals.current_round_id].size() == 0:
var next_round = GameGlobals.current_round_id + 1
if next_round <= (GameGlobals.current_match.size() - 1):
GameGlobals.current_round_id = next_round
var id = 0
for i in portals:
if !GameGlobals.no_reentry_portals.has(Vector2(round_id,id)):
i.round_id = Vector2(round_id,id)
i.scene_path = str(GameGlobals.current_match[round_id][id]["level_path"])
i.scene_name = str(GameGlobals.current_match[round_id][id]["level_name"])
i.level_gamemode = load(GameGlobals.current_match[round_id][id]["gamemode_path"])
if id <= (GameGlobals.current_match[GameGlobals.current_round_id].size() - 1):
if GameGlobals.current_match[GameGlobals.current_round_id][id] != null:
var level_spawn = GameGlobals.current_match[GameGlobals.current_round_id][id]
i.index = id
i.active = true
i.scene_path = str(level_spawn["level_path"])
i.scene_name = str(level_spawn["level_name"])
i.level_gamemode = load(level_spawn["gamemode_path"])
else:
i.active = false
i.scene_name = "closed"
else:
i.active = false
i.scene_name = "closed"
id += 1
SaveLoad.save_user_data()