mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #1994 from CHOMPStationBot/upstream-merge-10375
[MIRROR] Split jukebox into two files, commit one
This commit is contained in:
@@ -38,21 +38,36 @@ var/global/list/all_lobby_tracks = list()
|
||||
// Read the jukebox configuration file on system startup.
|
||||
/hook/startup/proc/load_jukebox_tracks()
|
||||
var/jukebox_track_file = "config/jukebox.json"
|
||||
var/jukebox_track_file_private = "config/jukebox_private.json" // Uncommitted
|
||||
|
||||
if(!fexists(jukebox_track_file))
|
||||
warning("File not found: [jukebox_track_file]")
|
||||
return 1
|
||||
|
||||
var/list/jsonData = json_decode(file2text(jukebox_track_file))
|
||||
|
||||
if(!istype(jsonData))
|
||||
warning("Failed to read tracks from [jukebox_track_file], json_decode failed.")
|
||||
return 1
|
||||
|
||||
// Optional
|
||||
if(fexists(jukebox_track_file_private))
|
||||
var/list/jsonData_private = json_decode(file2text(jukebox_track_file_private))
|
||||
if(istype(jsonData_private))
|
||||
jsonData += jsonData_private // Pack more tracks in
|
||||
else
|
||||
warning("Failed to read tracks from [jukebox_track_file_private], json_decode failed.")
|
||||
//return 1 // Not worth failing over, as this file is optional
|
||||
|
||||
for(var/entry in jsonData)
|
||||
if(!istext(entry["url"]))
|
||||
warning("[jukebox_track_file] entry [entry]: bad or missing 'url'")
|
||||
warning("Jukebox entry [entry]: bad or missing 'url'")
|
||||
continue
|
||||
if(!istext(entry["title"]))
|
||||
warning("[jukebox_track_file] entry [entry]: bad or missingg 'title'")
|
||||
warning("Jukebox entry [entry]: bad or missing 'title'")
|
||||
continue
|
||||
if(!isnum(entry["duration"]))
|
||||
warning("[jukebox_track_file] entry [entry]: bad or missing 'duration'")
|
||||
warning("Jukebox entry [entry]: bad or missing 'duration'")
|
||||
continue
|
||||
var/datum/track/T = new(entry["url"], entry["title"], entry["duration"])
|
||||
if(istext(entry["artist"]))
|
||||
|
||||
1
config/.gitignore
vendored
1
config/.gitignore
vendored
@@ -6,3 +6,4 @@
|
||||
#!custom_sprites.txt
|
||||
#!alienwhitelist.txt
|
||||
#!jobwhitelist.txt
|
||||
#!jukebox.json
|
||||
|
||||
42
config/example/jukebox.json
Normal file
42
config/example/jukebox.json
Normal file
@@ -0,0 +1,42 @@
|
||||
[
|
||||
{
|
||||
"url": "https://s.put.re/bkZYkYwX.mp3",
|
||||
"title": "Flip-Flap (Title One)",
|
||||
"duration": 1500,
|
||||
"artist": "X-CEED",
|
||||
"secret": false,
|
||||
"lobby": true,
|
||||
"jukebox": false,
|
||||
"genre": "Jazz"
|
||||
},
|
||||
{
|
||||
"url": "https://s.put.re/EzLP21Mp.mp3",
|
||||
"title": "Robocop Theme (Title Two)",
|
||||
"duration": 1180,
|
||||
"artist": "Cboyardee",
|
||||
"secret": false,
|
||||
"lobby": true,
|
||||
"jukebox": false,
|
||||
"genre": "Electronic"
|
||||
},
|
||||
{
|
||||
"url": "https://s.put.re/uDpZrL1L.mp3",
|
||||
"title": "Tin Tin on the Moon (Remix)",
|
||||
"duration": 2320,
|
||||
"artist": "Jeroen Tel (Remixed by Cuboos)",
|
||||
"secret": false,
|
||||
"lobby": true,
|
||||
"jukebox": true,
|
||||
"genre": "Electronic"
|
||||
},
|
||||
{
|
||||
"url": "https://s.put.re/nNXTd9ko.mp3",
|
||||
"title": "Phoron Will Make Us Rich",
|
||||
"duration": 1370,
|
||||
"artist": "Earthcrusher",
|
||||
"secret": false,
|
||||
"lobby": true,
|
||||
"jukebox": true,
|
||||
"genre": "Electronic"
|
||||
}
|
||||
]
|
||||
@@ -1,30 +0,0 @@
|
||||
#Jukebox configuration file
|
||||
#Sound file | Song Title | <0 = normal or 1 = secret>
|
||||
|
||||
# Normal songs
|
||||
sound/music/jukebox/SongAboutHares.ogg | A Song About Hares | 0
|
||||
sound/music/jukebox/BelowTheAsteroids.ogg | Below The Asteroids | 0
|
||||
sound/ambience/ambispace.ogg | Beyond | 0
|
||||
sound/music/clouds.s3m | Clouds of Fire | 0
|
||||
sound/music/title2.ogg | D`Bert | 0
|
||||
sound/ambience/song_game.ogg | D`Fort | 0
|
||||
sound/music/jukebox/DuckTalesMoon.mid | Duck Tales - Moon | 0
|
||||
sound/music/space.ogg | Endless Space | 0
|
||||
sound/music/main.ogg | Floating | 0
|
||||
sound/music/jukebox/Fly_Me_To_The_Moon.ogg | Fly Me To The Moon | 0
|
||||
sound/music/jukebox/Cantina.ogg | Mad About Me | 0
|
||||
sound/music/jukebox/MinorTurbulenceFull.ogg | Minor Turbulence | 0
|
||||
sound/music/jukebox/OdeToGreed.ogg | Ode to Greed | 0
|
||||
sound/misc/TestLoop1.ogg | Part A | 0
|
||||
sound/music/jukebox/Ransacked.ogg | Ransacked | 0
|
||||
sound/music/jukebox/russianrapdisco.ogg | Russkiy rep Diskoteka | 0
|
||||
sound/music/title1.ogg | Scratch | 0
|
||||
sound/music/space_oddity.ogg | Space Oddity | 0
|
||||
sound/music/THUNDERDOME.ogg | Thunderdome | 0
|
||||
sound/music/traitor.ogg | Trai`Tor | 0
|
||||
sound/music/jukebox/WelcomeToJurassicPark.mid | Welcome To Jurassic Park | 0
|
||||
|
||||
# Secret songs!
|
||||
sound/music/jukebox/bandit_radio.ogg | Bandit Radio | 1
|
||||
sound/music/space_asshole.ogg | Space Asshole | 1
|
||||
sound/music/THUNDERDOME.ogg | THUNDERDOME | 1
|
||||
1
config/example/jukebox_private.json
Normal file
1
config/example/jukebox_private.json
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
1
config/jukebox.json
Normal file
1
config/jukebox.json
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
Reference in New Issue
Block a user