mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
powder that makes you say yes
This commit is contained in:
@@ -15,11 +15,7 @@
|
|||||||
* * timeout - The timeout of the number input, after which the modal will close and qdel itself. Set to zero for no timeout.
|
* * timeout - The timeout of the number input, after which the modal will close and qdel itself. Set to zero for no timeout.
|
||||||
* * round_value - whether the inputted number is rounded down into an integer.
|
* * round_value - whether the inputted number is rounded down into an integer.
|
||||||
*/
|
*/
|
||||||
<<<<<<< refs/remotes/Upstream/master
|
|
||||||
/proc/tgui_input_number(mob/user, message, title = "Number Input", default = 0, max_value = 10000, min_value = 0, timeout = 0, round_value = TRUE)
|
|
||||||
=======
|
|
||||||
/proc/tgui_input_number(mob/user, message, title = "Number Input", default = 0, max_value = INFINITY, min_value = -INFINITY, timeout = 0, round_value = FALSE)
|
/proc/tgui_input_number(mob/user, message, title = "Number Input", default = 0, max_value = INFINITY, min_value = -INFINITY, timeout = 0, round_value = FALSE)
|
||||||
>>>>>>> Input Fixes
|
|
||||||
if (!user)
|
if (!user)
|
||||||
user = usr
|
user = usr
|
||||||
if (!istype(user))
|
if (!istype(user))
|
||||||
@@ -139,12 +135,8 @@
|
|||||||
if("submit")
|
if("submit")
|
||||||
if(!isnum(params["entry"]))
|
if(!isnum(params["entry"]))
|
||||||
CRASH("A non number was input into tgui input number by [usr]")
|
CRASH("A non number was input into tgui input number by [usr]")
|
||||||
<<<<<<< refs/remotes/Upstream/master
|
|
||||||
var/choice = round_value ? round(params["entry"]) : params["entry"]
|
|
||||||
=======
|
|
||||||
//var/choice = round_value ? round(params["entry"]) : params["entry"]
|
//var/choice = round_value ? round(params["entry"]) : params["entry"]
|
||||||
var/choice = params["entry"]
|
var/choice = params["entry"]
|
||||||
>>>>>>> Input Fixes
|
|
||||||
if(choice > max_value)
|
if(choice > max_value)
|
||||||
CRASH("A number greater than the max value was input into tgui input number by [usr]")
|
CRASH("A number greater than the max value was input into tgui input number by [usr]")
|
||||||
if(choice < min_value)
|
if(choice < min_value)
|
||||||
@@ -172,14 +164,9 @@
|
|||||||
* * default - The default value pre-populated in the input box.
|
* * default - The default value pre-populated in the input box.
|
||||||
* * callback - The callback to be invoked when a choice is made.
|
* * callback - The callback to be invoked when a choice is made.
|
||||||
* * timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout.
|
* * timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout.
|
||||||
<<<<<<< refs/remotes/Upstream/master
|
|
||||||
*/
|
|
||||||
/proc/tgui_input_number_async(mob/user, message, title, default, datum/callback/callback, timeout = 60 SECONDS)
|
|
||||||
=======
|
|
||||||
* * round_value - whether the inputted number is rounded down into an integer.
|
* * round_value - whether the inputted number is rounded down into an integer.
|
||||||
*/
|
*/
|
||||||
/proc/tgui_input_number_async(mob/user, message, title, default, datum/callback/callback, timeout = 60 SECONDS, round_value = FALSE)
|
/proc/tgui_input_number_async(mob/user, message, title, default, datum/callback/callback, timeout = 60 SECONDS, round_value = FALSE)
|
||||||
>>>>>>> Input Fixes
|
|
||||||
if (istext(user))
|
if (istext(user))
|
||||||
stack_trace("tgui_input_num_async() received text for user instead of mob")
|
stack_trace("tgui_input_num_async() received text for user instead of mob")
|
||||||
return
|
return
|
||||||
@@ -191,11 +178,7 @@
|
|||||||
user = client.mob
|
user = client.mob
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
<<<<<<< refs/remotes/Upstream/master
|
|
||||||
var/datum/tgui_input_number/async/input = new(user, message, title, default, callback, timeout)
|
|
||||||
=======
|
|
||||||
var/datum/tgui_input_number/async/input = new(user, message, title, default, callback, timeout, round_value)
|
var/datum/tgui_input_number/async/input = new(user, message, title, default, callback, timeout, round_value)
|
||||||
>>>>>>> Input Fixes
|
|
||||||
input.tgui_interact(user)
|
input.tgui_interact(user)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -207,13 +190,8 @@
|
|||||||
/// The callback to be invoked by the tgui_text_input upon having a choice made.
|
/// The callback to be invoked by the tgui_text_input upon having a choice made.
|
||||||
var/datum/callback/callback
|
var/datum/callback/callback
|
||||||
|
|
||||||
<<<<<<< refs/remotes/Upstream/master
|
|
||||||
/datum/tgui_input_number/async/New(mob/user, message, title, default, callback, timeout)
|
|
||||||
..(user, title, message, default, timeout)
|
|
||||||
=======
|
|
||||||
/datum/tgui_input_number/async/New(mob/user, message, title, default, callback, timeout, round_value)
|
/datum/tgui_input_number/async/New(mob/user, message, title, default, callback, timeout, round_value)
|
||||||
..(user, title, message, default, timeout, round_value)
|
..(user, title, message, default, timeout, round_value)
|
||||||
>>>>>>> Input Fixes
|
|
||||||
src.callback = callback
|
src.callback = callback
|
||||||
|
|
||||||
/datum/tgui_input_number/async/Destroy(force, ...)
|
/datum/tgui_input_number/async/Destroy(force, ...)
|
||||||
@@ -230,4 +208,4 @@
|
|||||||
callback?.InvokeAsync(src.entry)
|
callback?.InvokeAsync(src.entry)
|
||||||
|
|
||||||
/datum/tgui_input_number/async/wait()
|
/datum/tgui_input_number/async/wait()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user