mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-21 23:18:11 +00:00
changed the difficulty stars to be skulls instead, to better reflect how LSS handles stars
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 277 B |
@@ -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:
|
||||
|
@@ -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"]
|
||||
|
Reference in New Issue
Block a user