Merge pull request #196 from KirbyKid256/pulls/resource-pack-expansion

Resource Pack Expansion Pt.1 - Campaign Icons and Audio
This commit is contained in:
Joe H
2025-09-19 16:07:18 +01:00
committed by GitHub
11 changed files with 72 additions and 11 deletions

View File

@@ -11,6 +11,11 @@ func _enter_tree() -> void:
i.uppercase = true
func _ready() -> void:
var animation: Animation = $AnimationPlayer.get_animation_library("").get_animation(&"Go")
var track: int = animation.find_track("AudioStreamPlayer", Animation.TYPE_AUDIO)
for key in animation.track_get_key_count(track):
var resource_getter = ResourceGetter.new() #Why do I have to make a new one each time?
animation.audio_track_set_key_stream(track, key, resource_getter.get_resource(animation.audio_track_get_key_stream(track, key)))
Global.debugged_in = false
Global.get_node("GameHUD").hide()
await get_tree().create_timer(1, false).timeout

View File

@@ -13,9 +13,15 @@ var old_campaign := ""
@export var campaign := ["SMB1", "SMBLL", "SMBS", "SMBANN", "Custom"]
func _ready() -> void:
update()
Global.level_theme_changed.connect(update)
get_starting_position()
handle_visuals()
func update() -> void:
for icon in campaign_icons:
icon.atlas = $ResourceGetter.get_resource(icon.atlas)
func _process(_delta: float) -> void:
if active:
handle_input()

View File

@@ -59,8 +59,9 @@ func setup_visuals() -> void:
var world_visited = (SaveManager.visited_levels.substr((idx + world_offset) * 4, 4) != "0000" or Global.debug_mode or idx == 0)
if world_visited == false:
level_theme = "Mystery"
var resource_getter = ResourceGetter.new() #Is it safe to be making a new one of these per icon?
i.get_node("Icon").region_rect = CustomLevelContainer.THEME_RECTS[level_theme]
i.get_node("Icon").texture = CustomLevelContainer.ICON_TEXTURES[0 if (idx <= 3 or idx >= 8) and Global.current_campaign != "SMBANN" else 1]
i.get_node("Icon").texture = resource_getter.get_resource(CustomLevelContainer.ICON_TEXTURES[0 if (idx <= 3 or idx >= 8) and Global.current_campaign != "SMBANN" else 1])
i.get_node("Icon/Number").region_rect.position.y = clamp(NUMBER_Y.find(level_theme) * 12, 0, 9999)
i.get_node("Icon/Number").region_rect.position.x = (idx + world_offset) * 12
idx += 1