mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
## About The Pull Request Add watermark to unvetted clients, add warning to unvetted clients when attempting to join the game, eventually locking out access on September 1st. Add warning text to examine for unvetted clients ## Why It's Good For The Game The time has come ## Proof Of Testing Tested it extensively last night ## Changelog 🆑 Bubberstation Staff add: The clock is ticking. /🆑
50 lines
1.7 KiB
Plaintext
50 lines
1.7 KiB
Plaintext
/datum/tgui_alert/deadline
|
|
/// Days remaining until deadline
|
|
var/days_remaining
|
|
|
|
/datum/tgui_alert/deadline/New(mob/user, message, title, list/buttons, timeout, autofocus, ui_state, days_remaining)
|
|
. = ..()
|
|
src.days_remaining = days_remaining
|
|
|
|
/datum/tgui_alert/deadline/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if(!ui)
|
|
ui = new(user, src, "DeadlineModal")
|
|
ui.open()
|
|
|
|
/datum/tgui_alert/deadline/ui_static_data(mob/user)
|
|
. = ..()
|
|
.["days_remaining"] = days_remaining
|
|
|
|
/proc/tgui_deadline_alert(mob/user, message = "", title, list/buttons = list("Ok"), timeout = 0, autofocus = TRUE, ui_state = GLOB.always_state, days_remaining)
|
|
if (!user)
|
|
user = usr
|
|
if (!istype(user))
|
|
if (istype(user, /client))
|
|
var/client/client = user
|
|
user = client.mob
|
|
else
|
|
return null
|
|
|
|
if(isnull(user.client))
|
|
return null
|
|
|
|
// A gentle nudge - you should not be using TGUI alert for anything other than a simple message.
|
|
if(length(buttons) > 3)
|
|
log_tgui(user, "Error: TGUI Alert initiated with too many buttons. Use a list.", "TguiAlert")
|
|
return tgui_input_list(user, message, title, buttons, timeout, autofocus)
|
|
// Client does NOT have tgui_input on: Returns regular input
|
|
if(!user.client.prefs.read_preference(/datum/preference/toggle/tgui_input))
|
|
if(length(buttons) == 1)
|
|
return alert(user, message, title, buttons[1])
|
|
if(length(buttons) == 2)
|
|
return alert(user, message, title, buttons[1], buttons[2])
|
|
if(length(buttons) == 3)
|
|
return alert(user, message, title, buttons[1], buttons[2], buttons[3])
|
|
var/datum/tgui_alert/deadline/alert = new(user, message, title, buttons, timeout, autofocus, ui_state, days_remaining)
|
|
alert.ui_interact(user)
|
|
alert.wait()
|
|
if (alert)
|
|
. = alert.choice
|
|
qdel(alert)
|