Update playsound.dm
This commit is contained in:
@@ -144,6 +144,42 @@
|
|||||||
message_admins("[key_name_admin(src)] set the round end sound to [S]")
|
message_admins("[key_name_admin(src)] set the round end sound to [S]")
|
||||||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Set Round End Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Set Round End Sound") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
|
|
||||||
|
/client/proc/play_web_sound_manual()
|
||||||
|
set category = "Fun"
|
||||||
|
set name = "Manual Play Internet Sound"
|
||||||
|
if(!check_rights(R_SOUNDS))
|
||||||
|
return
|
||||||
|
|
||||||
|
var/web_sound_input = input("Enter youtube-dl fetched content URL (supported sites only, leave blank to stop playing)", "Send youtube-dl media link") as text|null
|
||||||
|
if(!istext(web_sound_input))
|
||||||
|
return
|
||||||
|
web_sound_input = trim(web_sound_input)
|
||||||
|
if(!length(web_sound_input))
|
||||||
|
log_admin("[key_name(src)] stopped web sound")
|
||||||
|
message_admins("[key_name(src)] stopped web sound")
|
||||||
|
for(var/m in player_list)
|
||||||
|
var/mob/M = m
|
||||||
|
var/client/C = M.client
|
||||||
|
if((C.prefs.toggles & SOUND_MIDI) && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||||
|
C.chatOutput.stopMusic()
|
||||||
|
return
|
||||||
|
var/freq = input(usr, "What frequency would you like the sound to play at?",, 1) as null|num
|
||||||
|
if(!freq)
|
||||||
|
return
|
||||||
|
if(web_sound_input && !findtext(web_sound_input, is_http_protocol))
|
||||||
|
to_chat(src, "<span class='boldwarning'>BLOCKED: Content URL not using http(s) protocol</span>")
|
||||||
|
to_chat(src, "<span class='warning'>The media provider returned a content URL that isn't using the HTTP or HTTPS protocol</span>")
|
||||||
|
return
|
||||||
|
|
||||||
|
SSblackbox.record_feedback("nested tally", "played_url_manual", 1, list("[ckey]", "[web_sound_input]"))
|
||||||
|
log_admin("[key_name(src)] manually played web sound: [web_sound_input]")
|
||||||
|
message_admins("[key_name(src)] manually played web sound: <a href='web_sound_input'>HREF</a>")
|
||||||
|
for(var/m in GLOB.player_list)
|
||||||
|
var/mob/M = m
|
||||||
|
var/client/C = M.client
|
||||||
|
if((C.prefs.toggles & SOUND_MIDI) && C.chatOutput && !C.chatOutput.broken && C.chatOutput.loaded)
|
||||||
|
C.chatOutput.sendMusic(web_sound_url, pitch)
|
||||||
|
|
||||||
/client/proc/stop_sounds()
|
/client/proc/stop_sounds()
|
||||||
set category = "Debug"
|
set category = "Debug"
|
||||||
set name = "Stop All Playing Sounds"
|
set name = "Stop All Playing Sounds"
|
||||||
|
|||||||
Reference in New Issue
Block a user