diff --git a/code/modules/supply/supply_console.dm b/code/modules/supply/supply_console.dm index 91c8fe261717..83f08bcdbd8d 100644 --- a/code/modules/supply/supply_console.dm +++ b/code/modules/supply/supply_console.dm @@ -282,8 +282,7 @@ return amount = clamp(round(num_input), 1, MULTIPLE_CRATE_MAX) - var/timeout = world.time + (60 SECONDS) // If you dont type the reason within a minute, theres bigger problems here - var/reason = tgui_input_text(user, "Reason", "Why do you require this item?", encode = FALSE, timeout = timeout) + var/reason = tgui_input_text(user, "Reason", "Why do you require this item?", encode = FALSE, timeout = 60 SECONDS) if(!reason || (!is_public && !is_authorized(user)) || ..()) return reason = sanitize(copytext_char(reason, 1, 75)) // very long reasons are bad diff --git a/code/modules/tgui/tgui_input/alert_input.dm b/code/modules/tgui/tgui_input/alert_input.dm index ef1afd04630d..f349dd48c766 100644 --- a/code/modules/tgui/tgui_input/alert_input.dm +++ b/code/modules/tgui/tgui_input/alert_input.dm @@ -62,6 +62,8 @@ var/start_time /// The lifespan of the tgui_alert, after which the window will close and delete itself. var/timeout + /// The attached timer that handles this objects timeout deletion + var/deletion_timer /// The bool that controls if this modal should grab window focus var/autofocus /// Boolean field describing if the tgui_alert was closed by the user. @@ -79,11 +81,12 @@ if(timeout) src.timeout = timeout start_time = world.time - QDEL_IN(src, timeout) + deletion_timer = QDEL_IN(src, timeout) /datum/tgui_alert/Destroy(force) SStgui.close_uis(src) state = null + deltimer(deletion_timer) return ..() /** diff --git a/code/modules/tgui/tgui_input/list_input.dm b/code/modules/tgui/tgui_input/list_input.dm index dd642861baf4..f43ceffdaafa 100644 --- a/code/modules/tgui/tgui_input/list_input.dm +++ b/code/modules/tgui/tgui_input/list_input.dm @@ -65,6 +65,8 @@ var/start_time /// The lifespan of the tgui_list_input, after which the window will close and delete itself. var/timeout + /// The attached timer that handles this objects timeout deletion + var/deletion_timer /// Boolean field describing if the tgui_list_input was closed by the user. var/closed /// The TGUI UI state that will be returned in ui_state(). Default: always_state @@ -98,11 +100,12 @@ if(timeout) src.timeout = timeout start_time = world.time - QDEL_IN(src, timeout) + deletion_timer = QDEL_IN(src, timeout) /datum/tgui_list_input/Destroy(force) SStgui.close_uis(src) state = null + deltimer(deletion_timer) return ..() /** diff --git a/code/modules/tgui/tgui_input/number_input.dm b/code/modules/tgui/tgui_input/number_input.dm index 7e4a49832a38..5afa06d6516d 100644 --- a/code/modules/tgui/tgui_input/number_input.dm +++ b/code/modules/tgui/tgui_input/number_input.dm @@ -66,6 +66,8 @@ var/start_time /// The lifespan of the number input, after which the window will close and delete itself. var/timeout + /// The attached timer that handles this objects timeout deletion + var/deletion_timer /// The title of the TGUI window var/title /// The TGUI UI state that will be returned in ui_state(). Default: always_state @@ -83,7 +85,7 @@ if(timeout) src.timeout = timeout start_time = world.time - QDEL_IN(src, timeout) + deletion_timer = QDEL_IN(src, timeout) /// Checks for empty numbers - bank accounts, etc. if(max_value == 0) @@ -101,6 +103,7 @@ /datum/tgui_input_number/Destroy(force) SStgui.close_uis(src) state = null + deltimer(deletion_timer) return ..() /** diff --git a/code/modules/tgui/tgui_input/text_input.dm b/code/modules/tgui/tgui_input/text_input.dm index 9e00d25414a9..b3a7d32b0904 100644 --- a/code/modules/tgui/tgui_input/text_input.dm +++ b/code/modules/tgui/tgui_input/text_input.dm @@ -74,6 +74,8 @@ var/start_time /// The lifespan of the text input, after which the window will close and delete itself. var/timeout + /// The attached timer that handles this objects timeout deletion + var/deletion_timer /// The title of the TGUI window var/title /// The TGUI UI state that will be returned in ui_state(). Default: always_state @@ -91,11 +93,12 @@ if(timeout) src.timeout = timeout start_time = world.time - QDEL_IN(src, timeout) + deletion_timer = QDEL_IN(src, timeout) /datum/tgui_input_text/Destroy(force) SStgui.close_uis(src) state = null + deltimer(deletion_timer) return ..() /**