Allow custom music
- The player should be able to use his own music in the game
- The music should be categorized into menu, fight and ambient, so the player can choose different songs for different situations
- If and how the custom music will be used should be configurable:
- use only original music
- use only custom music
- use both
Here's the code snippet to make it work as well as a copy of it here in case it gets lost:
func load_ogg(file):
var path = "Z:\\godot_projects\\%s.ogg" % file
var ogg_file = File.new()
ogg_file.open(path, File.READ)
var bytes = ogg_file.get_buffer(ogg_file.get_len())
var stream = AudioStreamOGGVorbis.new()
stream.data = bytes
$AudioStreamPlayer.stream = stream
ogg_file.close()