Fixes 14th Novem (#10429)

* Fixes nyctophobia shuttle probably

* Fucking 4 hours Lobby music Title
This commit is contained in:
Jamie D
2020-11-16 13:57:17 +00:00
committed by GitHub
parent f0cecb0d7e
commit 22b2d66eb7
5 changed files with 20 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ SUBSYSTEM_DEF(ticker)
var/datum/game_mode/mode = null
var/login_music //music played in pregame lobby
var/login_music_data
var/round_end_sound //music/jingle played when the world reboots
var/round_end_sound_sent = TRUE //If all clients have loaded it
@@ -112,7 +113,9 @@ SUBSYSTEM_DEF(ticker)
login_music = pick(music)
else
login_music = "[global.config.directory]/title_music/sounds/[pick(music)]"*/
login_music_data = list()
login_music = choose_lobby_music()
if(!login_music)
to_chat(world, "<span class='boldwarning'>Could not load lobby music.</span>") //yogs end

View File

@@ -267,6 +267,8 @@
return //we're tied with the dark, so we don't get scared of it; don't cleanse outright to avoid cheese
var/turf/T = get_turf(quirk_holder)
var/lums = T.get_lumcount()
if(istype(T.loc, /area/shuttle))
return
if(lums <= 0.2)
if(quirk_holder.m_intent == MOVE_INTENT_RUN)
to_chat(quirk_holder, "<span class='warning'>Easy, easy, take it slow... you're in the dark...</span>")

View File

@@ -111,7 +111,7 @@
UNTIL(tgui_panel)
if(prefs && (prefs.toggles & SOUND_LOBBY))
tgui_panel?.play_music(SSticker.login_music)
tgui_panel?.play_music(SSticker.login_music_data["url"], SSticker.login_music_data)
to_chat(src, "<span class='notice'>Currently playing: </span>[SSticker.selected_lobby_music]")
/proc/get_rand_frequency()

View File

@@ -74,7 +74,6 @@
var/stop_web_sounds = FALSE
var/list/music_extra_data = list()
if(length(web_sound_input))
web_sound_input = trim(web_sound_input)
if(findtext(web_sound_input, ":") && !findtext(web_sound_input, GLOB.is_http_protocol))
to_chat(src, "<span class='boldwarning'>Non-http(s) URIs are not allowed.</span>", confidential=TRUE)

View File

@@ -4,7 +4,7 @@
/datum/controller/subsystem/ticker/proc/choose_lobby_music()
//Add/remove songs from this list individually, rather than multiple at once. This makes it easier to judge PRs that change the list, since PRs that change it up heavily are less likely to meet broad support
//Add a comment after the song link in the format [Artist - Name]
var/list/songs = list("https://www.youtube.com/watch?v=s7dTBoW5H9k", // Electric Light Orchestra - Mr. Blue Sky
var/list/songs = list("https://www.youtube.com/watch?v=lIrum6iFz6U", // Electric Light Orchestra - Mr. Blue Sky
"https://www.youtube.com/watch?v=WEhS9Y9HYjU", // Noel Harrison - The Windmills of Your Mind
"https://www.youtube.com/watch?v=UPHmazxB38g", // MashedByMachines - Sector11
"https://soundcloud.com/jeffimam/title-plasma-attack", // Jeff Imam - Title - Plasma Attack
@@ -53,14 +53,25 @@
log_world("Could not play lobby song because youtube-dl is not configured properly, check the config.")
return
var/list/output = world.shelleo("[ytdl] --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" -g --no-playlist -- \"[selected_lobby_music]\"")
var/list/output = world.shelleo("[ytdl] --geo-bypass --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --dump-single-json --no-playlist -- \"[selected_lobby_music]\"")
var/errorlevel = output[SHELLEO_ERRORLEVEL]
var/stdout = output[SHELLEO_STDOUT]
var/stderr = output[SHELLEO_STDERR]
if(!errorlevel)
var/list/data
try
data = json_decode(stdout)
catch(var/exception/e)
to_chat(src, "<span class='boldwarning'>Youtube-dl JSON parsing FAILED:</span>", confidential=TRUE)
to_chat(src, "<span class='warning'>[e]: [stdout]</span>", confidential=TRUE)
return
if(data["title"])
login_music_data["title"] = data["title"]
login_music_data["url"] = data["url"]
if(errorlevel)
to_chat(world, "<span class='boldwarning'>Youtube-dl failed.</span>")
log_world("Could not play lobby song [selected_lobby_music]: [stderr]")
return
return stdout