Revert "TGUI alerts, lists, inputs"
This commit is contained in:
@@ -294,7 +294,7 @@
|
||||
if(!check_interactivity(M))
|
||||
return
|
||||
|
||||
var/input = reject_bad_name(tgui_input_text(usr, "What do you want to name this?", "Rename", src.name), TRUE)
|
||||
var/input = reject_bad_name(input("What do you want to name this?", "Rename", src.name) as null|text, TRUE)
|
||||
if(!check_interactivity(M))
|
||||
return
|
||||
if(src && input)
|
||||
@@ -506,7 +506,7 @@
|
||||
if(input_selection.len == 1)
|
||||
choice = input_selection[input_selection[1]]
|
||||
else
|
||||
var/selection = tgui_input_list(user, "Where do you want to insert that item?", "Interaction", input_selection)
|
||||
var/selection = input(user, "Where do you want to insert that item?", "Interaction") as null|anything in input_selection
|
||||
if(!check_interactivity(user))
|
||||
return ..()
|
||||
if(selection)
|
||||
@@ -548,7 +548,7 @@
|
||||
if(input_selection.len ==1)
|
||||
choice = input_selection[input_selection[1]]
|
||||
else
|
||||
var/selection = tgui_input_list(user, "What do you want to interact with?", "Interaction", input_selection)
|
||||
var/selection = input(user, "What do you want to interact with?", "Interaction") as null|anything in input_selection
|
||||
if(!check_interactivity(user))
|
||||
return
|
||||
if(selection)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/copy_values = FALSE
|
||||
|
||||
/obj/item/integrated_electronics/debugger/attack_self(mob/user)
|
||||
var/type_to_use = tgui_input_list(user, "Please choose a type to use.","[src] type setting", list("string","number","ref","copy","null"))
|
||||
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref","copy","null")
|
||||
if(!user.IsAdvancedToolUser())
|
||||
return
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
if("number")
|
||||
accepting_refs = FALSE
|
||||
copy_values = FALSE
|
||||
new_data = tgui_input_num(user, "Now type in a number.","[src] number writing")
|
||||
new_data = input(user, "Now type in a number.","[src] number writing") as null|num
|
||||
if(isnum(new_data) && user.IsAdvancedToolUser())
|
||||
data_to_write = new_data
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [new_data].</span>")
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
|
||||
/obj/item/integrated_electronics/detailer/attack_self(mob/user)
|
||||
var/color_choice = tgui_input_list(user, "Select color.", "Assembly Detailer", color_list)
|
||||
var/color_choice = input(user, "Select color.", "Assembly Detailer") as null|anything in color_list
|
||||
if(!color_list[color_choice])
|
||||
return
|
||||
if(!in_range(src, user))
|
||||
|
||||
@@ -177,7 +177,7 @@ D [1]/ ||
|
||||
|
||||
|
||||
/datum/integrated_io/proc/ask_for_data_type(mob/user, var/default, var/list/allowed_data_types = list("string","number","null"))
|
||||
var/type_to_use = tgui_input_list(user, "Please choose a type to use.","[src] type setting", allowed_data_types)
|
||||
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in allowed_data_types
|
||||
if(!holder.check_interactivity(user))
|
||||
return
|
||||
|
||||
@@ -189,7 +189,7 @@ D [1]/ ||
|
||||
to_chat(user, "<span class='notice'>You input "+new_data+" into the pin.</span>")
|
||||
return new_data
|
||||
if("number")
|
||||
new_data = tgui_input_num(user, "Now type in a number.","[src] number writing", isnum(default) ? default : null)
|
||||
new_data = input("Now type in a number.","[src] number writing", isnum(default) ? default : null) as null|num
|
||||
if(isnum(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
return new_data
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
if("load")
|
||||
if(cloning)
|
||||
return
|
||||
var/input = tgui_input_message(usr, "Put your code there:", "loading", null, null)
|
||||
var/input = input("Put your code there:", "loading", null, null) as message | null
|
||||
if(!check_interactivity(usr) || cloning)
|
||||
return
|
||||
if(!input)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name = "dir pin"
|
||||
|
||||
/datum/integrated_io/dir/ask_for_pin_data(mob/user)
|
||||
var/new_data = tgui_input_num(user, "Please type in a valid dir number. \
|
||||
var/new_data = input("Please type in a valid dir number. \
|
||||
Valid dirs are;\n\
|
||||
North/Fore = [NORTH],\n\
|
||||
South/Aft = [SOUTH],\n\
|
||||
@@ -12,7 +12,7 @@
|
||||
Northeast = [NORTHEAST],\n\
|
||||
Northwest = [NORTHWEST],\n\
|
||||
Southeast = [SOUTHEAST],\n\
|
||||
Southwest = [SOUTHWEST]","[src] dir writing")
|
||||
Southwest = [SOUTHWEST]","[src] dir writing") as null|num
|
||||
if(isnum(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
data = 1
|
||||
|
||||
/datum/integrated_io/index/ask_for_pin_data(mob/user)
|
||||
var/new_data = tgui_input_num(user, "Please type in an index.","[src] index writing")
|
||||
var/new_data = input("Please type in an index.","[src] index writing") as num
|
||||
if(isnum(new_data) && holder.check_interactivity(user))
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
to_chat(user, "<span class='warning'>The list is empty, there's nothing to remove.</span>")
|
||||
return
|
||||
if(!target_entry)
|
||||
target_entry = tgui_input_list(user, "Which piece of data do you want to remove?", "Remove", my_list)
|
||||
target_entry = input(user, "Which piece of data do you want to remove?", "Remove") as null|anything in my_list
|
||||
if(holder.check_interactivity(user) && target_entry)
|
||||
my_list.Remove(target_entry)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
to_chat(user, "<span class='warning'>The list is empty, there's nothing to modify.</span>")
|
||||
return
|
||||
if(!target_entry)
|
||||
target_entry = tgui_input_list(user, "Which piece of data do you want to edit?", "Edit", my_list)
|
||||
target_entry = input(user, "Which piece of data do you want to edit?", "Edit") as null|anything in my_list
|
||||
if(holder.check_interactivity(user) && target_entry)
|
||||
var/edited_entry = ask_for_data_type(user, target_entry)
|
||||
if(edited_entry)
|
||||
@@ -89,11 +89,11 @@
|
||||
to_chat(user, "<span class='warning'>The list is empty, or too small to do any meaningful swapping.</span>")
|
||||
return
|
||||
if(!first_target)
|
||||
first_target = tgui_input_list(user, "Which piece of data do you want to swap? (1)", "Swap", my_list)
|
||||
first_target = input(user, "Which piece of data do you want to swap? (1)", "Swap") as null|anything in my_list
|
||||
|
||||
if(holder.check_interactivity(user) && first_target)
|
||||
if(!second_target)
|
||||
second_target = tgui_input_list(user, "Which piece of data do you want to swap? (2)", "Swap", my_list - first_target)
|
||||
second_target = input(user, "Which piece of data do you want to swap? (2)", "Swap") as null|anything in my_list - first_target
|
||||
|
||||
if(holder.check_interactivity(user) && second_target)
|
||||
var/first_pos = my_list.Find(first_target)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name = "number pin"
|
||||
|
||||
/datum/integrated_io/number/ask_for_pin_data(mob/user)
|
||||
var/new_data = tgui_input_num(user, "Please type in a number.","[src] number writing")
|
||||
var/new_data = input("Please type in a number.","[src] number writing") as null|num
|
||||
if(isnum(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user)
|
||||
var/new_input = tgui_input_num(user, "Enter a number, please.",displayed_name)
|
||||
var/new_input = input(user, "Enter a number, please.",displayed_name) as null|num
|
||||
if(isnum(new_input) && user.IsAdvancedToolUser())
|
||||
set_pin_data(IC_OUTPUT, 1, new_input)
|
||||
push_data()
|
||||
@@ -1263,7 +1263,7 @@
|
||||
var/I = get_pin_data(IC_INPUT, k)
|
||||
if(istext(I))
|
||||
selection.Add(I)
|
||||
var/selected = tgui_input_list(user,"Choose input.","Selection", selection)
|
||||
var/selected = input(user,"Choose input.","Selection") in selection
|
||||
if(!selected)
|
||||
return
|
||||
set_pin_data(IC_OUTPUT, 1, selected)
|
||||
|
||||
@@ -104,19 +104,19 @@
|
||||
var/datum/integrated_io/O = outputs[1]
|
||||
if(!user.IsAdvancedToolUser())
|
||||
return
|
||||
var/type_to_use = tgui_input_list(user, "Please choose a type to use.","[src] type setting", list("string","number","ref", "null"))
|
||||
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
|
||||
|
||||
var/new_data = null
|
||||
switch(type_to_use)
|
||||
if("string")
|
||||
accepting_refs = FALSE
|
||||
new_data = tgui_input_text(user, "Now type in a string.","[src] string writing")
|
||||
new_data = input("Now type in a string.","[src] string writing") as null|text
|
||||
if(istext(new_data) && user.IsAdvancedToolUser())
|
||||
O.data = new_data
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
|
||||
if("number")
|
||||
accepting_refs = FALSE
|
||||
new_data = tgui_input_num(user, "Now type in a number.","[src] number writing")
|
||||
new_data = input("Now type in a number.","[src] number writing") as null|num
|
||||
if(isnum(new_data) && user.IsAdvancedToolUser())
|
||||
O.data = new_data
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
|
||||
|
||||
Reference in New Issue
Block a user