More standard tgui input conversions (#63464)

This commit is contained in:
Jeremiah
2021-12-24 03:04:18 -08:00
committed by GitHub
parent 36e5fcadd3
commit dcab86ba2c
64 changed files with 246 additions and 215 deletions
+3 -1
View File
@@ -517,8 +517,10 @@
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
var/max = get_amount()
var/stackmaterial = round(tgui_input_number(user, "How many sheets do you wish to take out of this stack?", "Stack Split", max_value = max))
if(isnull(stackmaterial))
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
stackmaterial = min(max, stackmaterial)
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user)))
if(stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user)))
return SECONDARY_ATTACK_CONTINUE_CHAIN
split_stack(user, stackmaterial)
to_chat(user, span_notice("You take [stackmaterial] sheets out of the stack."))