Disable example tracks
This commit is contained in:
parent
fcce674b1c
commit
2a2d4d4bd2
4 changed files with 14 additions and 7 deletions
|
@ -14,10 +14,6 @@ config/name="StreamMusic"
|
|||
run/main_scene="res://src/Main.tscn"
|
||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||
|
||||
[autoload]
|
||||
|
||||
TwitchGod="res://old/addons/TwitchGod.tscn"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=450
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://bgu71uk1ax8p1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://7dlyvcd62df" path="res://old/oldthumbnails/t6wexov4.bmp" id="1_cxepj"]
|
||||
[ext_resource type="Script" path="res://src/music_display.gd" id="1_g11yo"]
|
||||
[ext_resource type="Texture2D" uid="uid://d4ncsckbihfnr" path="res://art/overlay.png" id="2_q8ma0"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfl8jhj2vjs0" path="res://thumbnails/example.bmp" id="3_ddg46"]
|
||||
[ext_resource type="Texture2D" uid="uid://eagpwhcx63cx" path="res://art/info-overlay.png" id="4_64o3x"]
|
||||
[ext_resource type="Script" path="res://src/music_bar.gd" id="5_rd85y"]
|
||||
|
||||
|
@ -59,7 +59,7 @@ offset_right = 50.0
|
|||
offset_bottom = 50.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_cxepj")
|
||||
texture = ExtResource("3_ddg46")
|
||||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
|
@ -107,7 +107,7 @@ offset_right = 279.0
|
|||
offset_bottom = 308.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_cxepj")
|
||||
texture = ExtResource("3_ddg46")
|
||||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
|
|
10
src/main.gd
10
src/main.gd
|
@ -29,6 +29,11 @@ func _process(delta):
|
|||
|
||||
func _play():
|
||||
var song = _get_track()
|
||||
|
||||
if not song:
|
||||
print("NO SONG COULD BE FOUND")
|
||||
return
|
||||
|
||||
audio_stream_player.stream = load(song.track)
|
||||
audio_stream_player.play()
|
||||
music_display.show_song(song)
|
||||
|
@ -44,6 +49,9 @@ func _display():
|
|||
|
||||
|
||||
func _get_track():
|
||||
if _tracks.size() == 0:
|
||||
return null
|
||||
|
||||
return _tracks.pick_random()
|
||||
|
||||
|
||||
|
@ -67,6 +75,8 @@ func _load_directory(path: String):
|
|||
var new_tracks = instance.get_tracks()
|
||||
|
||||
for track in new_tracks:
|
||||
if track.has("disabled") and track.disabled:
|
||||
continue
|
||||
_tracks.push_back(track)
|
||||
else:
|
||||
_load_directory("res://tracks/%s" % [file_name])
|
||||
|
|
|
@ -5,6 +5,7 @@ func _init():
|
|||
"artist": "Kevin MacLeod",
|
||||
"thumbnail": preload("res://thumbnails/example.bmp"),
|
||||
"source": "https://incompetech.com/",
|
||||
"disabled": true
|
||||
}
|
||||
|
||||
_tracks = [
|
||||
|
|
Loading…
Reference in a new issue