Merge pull request #268 from KirbyKid256/pulls/fixed-title-bgm-looping

Fixed Title and Boo Race BGM Looping
This commit is contained in:
Joe H
2025-09-19 16:01:35 +01:00
committed by GitHub
7 changed files with 36 additions and 4 deletions

View File

@@ -0,0 +1,10 @@
{
"Normal": {
"source": "BooMenu.mp3",
"loop": 4.797
},
"Hurry": {
"source": "BooMenu.mp3",
"loop": 4.797
}
}

View File

@@ -0,0 +1,7 @@
{
"variations": {
"default": {
"source": "BooMenu.bgm"
}
}
}

View File

@@ -1,7 +1,7 @@
{ {
"variations": { "variations": {
"SMB1": {"source": "TitleSMB.mp3"}, "SMB1": {"source": "TitleSMB.mp3"},
"SMBLL": {"source": "TitleSMBLL.mp3"}, "SMBLL": {"source": "TitleSMBLL.bgm"},
"SMBS": {"source": "TitleSMBS.mp3"}, "SMBS": {"source": "TitleSMBS.mp3"},
"SMBANN": {"source": "TitleANN.mp3"} "SMBANN": {"source": "TitleANN.mp3"}
} }

View File

@@ -0,0 +1,4 @@
{
"Normal": {"source": "TitleSMBLL.mp3", "loop": 11.735},
"Hurry": {"source": "TitleSMBLL.mp3", "loop": 11.735}
}

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=45 format=3 uid="uid://b7no88iaujhh3"] [gd_scene load_steps=46 format=3 uid="uid://b7no88iaujhh3"]
[ext_resource type="Script" uid="uid://b08qfwj5jk6g1" path="res://Scripts/Parts/PlayerSprite.gd" id="1_0b6w1"] [ext_resource type="Script" uid="uid://b08qfwj5jk6g1" path="res://Scripts/Parts/PlayerSprite.gd" id="1_0b6w1"]
[ext_resource type="Script" uid="uid://b3ol0iyjcb5n1" path="res://Scripts/UI/BooRaceMenu.gd" id="1_nk4wu"] [ext_resource type="Script" uid="uid://b3ol0iyjcb5n1" path="res://Scripts/UI/BooRaceMenu.gd" id="1_nk4wu"]
@@ -20,6 +20,7 @@
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="8_xx8pl"] [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="8_xx8pl"]
[ext_resource type="StyleBox" uid="uid://comkghpj0djcl" path="res://Resources/UI/Panel.tres" id="9_mm3k3"] [ext_resource type="StyleBox" uid="uid://comkghpj0djcl" path="res://Resources/UI/Panel.tres" id="9_mm3k3"]
[ext_resource type="Texture2D" uid="uid://3p2l7rec0gh5" path="res://Assets/Sprites/UI/Cursor.png" id="10_nk4wu"] [ext_resource type="Texture2D" uid="uid://3p2l7rec0gh5" path="res://Assets/Sprites/UI/Cursor.png" id="10_nk4wu"]
[ext_resource type="JSON" path="res://Assets/Audio/BGM/BooMenu.json" id="11_kqv8e"]
[ext_resource type="PackedScene" uid="uid://bxp1l23w1kq41" path="res://Scenes/Prefabs/UI/BooSelect.tscn" id="12_pinst"] [ext_resource type="PackedScene" uid="uid://bxp1l23w1kq41" path="res://Scenes/Prefabs/UI/BooSelect.tscn" id="12_pinst"]
[ext_resource type="JSON" path="res://Assets/Sprites/Enemies/RaceBoo.json" id="12_tgnw3"] [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/RaceBoo.json" id="12_tgnw3"]
[ext_resource type="PackedScene" uid="uid://ci678koo0peoa" path="res://Scenes/Prefabs/UI/CharacterSelect.tscn" id="13_u5tsp"] [ext_resource type="PackedScene" uid="uid://ci678koo0peoa" path="res://Scenes/Prefabs/UI/CharacterSelect.tscn" id="13_u5tsp"]
@@ -283,9 +284,16 @@ metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[node name="Music" type="AudioStreamPlayer" parent="."] [node name="Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource("1_uucdm") stream = ExtResource("1_uucdm")
autoplay = true
bus = &"Music" bus = &"Music"
[node name="ResourceSetterNew" type="Node" parent="Music" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("8_xx8pl")
node_to_affect = NodePath("..")
property_name = "stream"
mode = 2
resource_json = ExtResource("11_kqv8e")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]
anchors_preset = 8 anchors_preset = 8
anchor_left = 0.5 anchor_left = 0.5

View File

@@ -304,7 +304,9 @@ func load_image_from_path(path := "") -> ImageTexture:
func load_audio_from_path(path := "") -> AudioStream: func load_audio_from_path(path := "") -> AudioStream:
var stream = null var stream = null
if path.contains("res://"): if path.contains(".bgm"):
stream = AudioManager.generate_interactive_stream(JSON.parse_string(FileAccess.get_file_as_string(path)))
elif path.contains("res://"):
return load(path) return load(path)
if path.contains(".wav"): if path.contains(".wav"):
stream = AudioStreamWAV.load_from_file(path) stream = AudioStreamWAV.load_from_file(path)

View File

@@ -56,6 +56,7 @@ func _ready() -> void:
Level.can_set_time = true Level.can_set_time = true
setup_visuals() setup_visuals()
%LevelLabels.get_child(BooRaceHandler.current_level_id).grab_focus() %LevelLabels.get_child(BooRaceHandler.current_level_id).grab_focus()
$Music.play()
func _exit_tree() -> void: func _exit_tree() -> void:
Global.get_node("GameHUD").show() Global.get_node("GameHUD").show()