diff --git a/Assets/Sprites/UI/DifficultyStars.png b/Assets/Sprites/UI/DifficultyStars.png index 5c80918..c66bbce 100644 Binary files a/Assets/Sprites/UI/DifficultyStars.png and b/Assets/Sprites/UI/DifficultyStars.png differ diff --git a/Scripts/UI/CustomLevelContainer.gd b/Scripts/UI/CustomLevelContainer.gd index 46b18f5..9b62e1e 100644 --- a/Scripts/UI/CustomLevelContainer.gd +++ b/Scripts/UI/CustomLevelContainer.gd @@ -11,7 +11,8 @@ var level_time := 0 var game_style := "SMBLL" var difficulty := 0 var file_path := "" - +var is_downloaded := false +var level_id := "" var idx := 0 const CAMPAIGN_RECTS := { @@ -54,8 +55,11 @@ func _ready() -> void: update_visuals() func update_visuals() -> void: - %LevelIcon.texture = ResourceSetter.get_resource(ICON_TEXTURES[level_time]) - %LevelIcon.region_rect = THEME_RECTS[level_theme] + if is_downloaded: + %LevelIcon.texture = ImageTexture.create_from_image(Image.load_from_file("user://custom_levels/downloaded/thumbnails/" + level_id + ".png")) + else: + %LevelIcon.texture = ResourceSetter.get_resource(ICON_TEXTURES[level_time]) + %LevelIcon.region_rect = THEME_RECTS[level_theme] %LevelName.text = level_name if level_name != "" else "(Unnamed Level)" %LevelAuthor.text = "By " + (level_author if level_author != "" else "Player") @@ -64,7 +68,7 @@ func update_visuals() -> void: var idx := 0 for i in %DifficultyStars.get_children(): - i.region_rect.position.x = 24 if idx > difficulty else [0, 0, 8, 8, 16][difficulty] + i.region_rect.position.x = 32 if idx > difficulty else [0, 8, 8, 16, 24][difficulty] idx += 1 func _process(_delta: float) -> void: diff --git a/Scripts/UI/CustomLevelList.gd b/Scripts/UI/CustomLevelList.gd index 77dcddb..eceed53 100644 --- a/Scripts/UI/CustomLevelList.gd +++ b/Scripts/UI/CustomLevelList.gd @@ -57,6 +57,9 @@ func get_levels(path := "user://custom_levels") -> void: file.close() var data = json["Levels"][0]["Data"].split("=") var info = json["Info"] + container.is_downloaded = path.contains("/downloaded/") + if container.is_downloaded: + container.level_id = path.get_file().replace(".lvl", "") container.level_name = info["Name"] container.level_author = info["Author"] container.level_desc = info["Description"]