The intention is to provide the functionality provided in that library, and more. Not really big, though, so I don't think it needs its own library.
proc/timed_alert(question, title, default, time = 300, choice1, choice2, choice3)
var/timed_alert/ref_alert = new
timed_alert = ref_alert
ref_result = ref_alert.timed_alert(src, question, title, time, choice1, choice2, choice3)
if (!ref_result) ref_result = default
if (ref_alert) del(ref_alert)
proc/timed_alert(client/ref_client, question, title, time, choice1, choice2, choice3)
if (!ref_client) return
spawn (time) del src
ref_answer = alert(ref_client, question, title, choice1, choice2, choice3)
if(!ref_client || !ref_answer) return
else return ref_answer
var/delete = timed_alert("Do you really want to delete it?", "Deleting Save", "No", 100, "Yes", "No")
if (delete == "Yes")
src << "Lucky you."
If you'd like to make this a proc for mobs, too-- So that it may be used like the regular alert, you can add in this quick snippet:
proc/timed_alert(question, title, default, time, choice1, choice2, choice3)
if (client) client.timed_alert(question, title, default, time, choice1, choice2, choice3)
By adding the above to the code, you are capable of using timed alerts. Specifically, a procedure based on the alert() proc which has a default answer and a timer-- If the timer elapses, then the alert closes of its own accord and the default is returned to the person who was using the alert.
This may have issues, because it has not been extensively tested in a large number of instances, but from the tests performed it hasn't failed.
Any recommendations, improvements, suggestions, requests, and critiques are completely welcome.