Fix config variation keys for level music (#771)

This commit is contained in:
HighFlyer222
2025-12-07 19:20:58 +01:00
committed by GitHub
parent a4d888d3cd
commit e23cbbaa08
2 changed files with 7 additions and 0 deletions
@@ -263,6 +263,12 @@ func create_stream_from_json(json_path := "") -> AudioStream:
return AudioStreamOggVorbis.load_from_file(ResourceSetter.get_pure_resource_path(json_path)) return AudioStreamOggVorbis.load_from_file(ResourceSetter.get_pure_resource_path(json_path))
elif path.contains("res://"): elif path.contains("res://"):
return load(path) return load(path)
for i in Settings.file.visuals.resource_packs:
var new_path = $ResourceSetterNew.get_resource_pack_path(ResourceSetter.get_pure_resource_path(json_path), i)
if ResourceSetter.get_pure_resource_path(json_path) != new_path or $ResourceSetterNew.current_resource_pack == "":
$ResourceSetterNew.current_resource_pack = i
var bgm_file = $ResourceSetterNew.get_variation_json(JSON.parse_string(FileAccess.open(ResourceSetter.get_pure_resource_path(json_path), FileAccess.READ).get_as_text()).variations).source var bgm_file = $ResourceSetterNew.get_variation_json(JSON.parse_string(FileAccess.open(ResourceSetter.get_pure_resource_path(json_path), FileAccess.READ).get_as_text()).variations).source
path = ResourceSetter.get_pure_resource_path(json_path.replace(json_path.get_file(), bgm_file)) path = ResourceSetter.get_pure_resource_path(json_path.replace(json_path.get_file(), bgm_file))
var stream = null var stream = null
+1
View File
@@ -59,6 +59,7 @@ func update_json() -> void:
func close() -> void: func close() -> void:
ResourceSetter.cache.clear() ResourceSetter.cache.clear()
ResourceSetterNew.cache.clear() ResourceSetterNew.cache.clear()
AudioManager.current_level_theme = ""
Global.level_theme_changed.emit() Global.level_theme_changed.emit()
closed.emit() closed.emit()
clear_options() clear_options()