mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Proc calls now use vv_get_value, which can get things you click on. (#28172)
This commit is contained in:
@@ -208,57 +208,12 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
|
||||
//this will protect us from a fair few errors ~Carn
|
||||
|
||||
while(argnum--)
|
||||
var/class = null
|
||||
// Make a list with each index containing one variable, to be given to the proc
|
||||
if(src.holder && src.holder.marked_datum)
|
||||
class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","reference in range","reference in view", "mob reference","icon","file","client","mob's area","Marked datum ([holder.marked_datum.type])","CANCEL")
|
||||
if(holder.marked_datum && class == "Marked datum ([holder.marked_datum.type])")
|
||||
class = "Marked datum"
|
||||
else
|
||||
class = input("What kind of variable?","Variable Type") in list("text","num","type","reference","mob reference","reference in range","reference in view","icon","file","client","mob's area","CANCEL")
|
||||
switch(class)
|
||||
if("CANCEL")
|
||||
return null
|
||||
var/list/value = vv_get_value(restricted_classes = list(VV_RESTORE_DEFAULT))
|
||||
var/class = value["class"]
|
||||
if(!class)
|
||||
return null
|
||||
|
||||
if("text")
|
||||
lst += clean_input("Enter new text:","Text",null)
|
||||
|
||||
if("num")
|
||||
lst += input("Enter new number:","Num",0) as num
|
||||
|
||||
if("type")
|
||||
lst += input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
||||
|
||||
if("reference")
|
||||
lst += input("Select reference:","Reference",src) as mob|obj|turf|area in world
|
||||
|
||||
if("reference in range")
|
||||
lst += input("Select reference in range:", "Reference in range", src) as mob|obj|turf|area in range(view)
|
||||
|
||||
if("reference in view")
|
||||
lst += input("Select reference in view:", "Reference in view", src) as mob|obj|turf|area in view(view)
|
||||
|
||||
if("mob reference")
|
||||
lst += input("Select reference:","Reference",usr) as mob in world
|
||||
|
||||
if("file")
|
||||
lst += input("Pick file:","File") as file
|
||||
|
||||
if("icon")
|
||||
lst += input("Pick icon:","Icon") as icon
|
||||
|
||||
if("client")
|
||||
var/list/keys = list()
|
||||
for(var/mob/M in world)
|
||||
keys += M.client
|
||||
lst += input("Please, select a player!", "Selection", null, null) as null|anything in keys
|
||||
|
||||
if("mob's area")
|
||||
var/mob/temp = input("Select mob", "Selection", usr) as mob in world
|
||||
lst += temp.loc
|
||||
|
||||
if("Marked datum")
|
||||
lst += holder.marked_datum
|
||||
lst += value["value"]
|
||||
return lst
|
||||
|
||||
/client/proc/Cell()
|
||||
|
||||
@@ -87,6 +87,9 @@ GLOBAL_PROTECT(VVmaint_only)
|
||||
VV_NEW_DATUM,
|
||||
VV_NEW_TYPE,
|
||||
VV_NEW_LIST,
|
||||
VV_VISIBLE_ATOM,
|
||||
VV_INSIDE_VISIBLE_ATOM,
|
||||
VV_VISIBLE_TURF,
|
||||
VV_NULL,
|
||||
VV_RESTORE_DEFAULT
|
||||
)
|
||||
@@ -211,6 +214,45 @@ GLOBAL_PROTECT(VVmaint_only)
|
||||
.["value"] = things[value]
|
||||
|
||||
|
||||
if(VV_VISIBLE_ATOM)
|
||||
var/atom/clicked = prompt_for_atom_click("Click an atom.")
|
||||
if(!clicked)
|
||||
.["class"] = null
|
||||
return
|
||||
.["value"] = clicked
|
||||
if(VV_INSIDE_VISIBLE_ATOM)
|
||||
var/atom/clicked = prompt_for_atom_click("Click an atom to search inside.")
|
||||
if(!clicked)
|
||||
.["class"] = null
|
||||
return
|
||||
|
||||
// Collect everything inside the atom.
|
||||
var/list/ancestors = list(clicked)
|
||||
var/list/descendants = list()
|
||||
while(length(ancestors) > 0 && length(descendants) < 100)
|
||||
var/atom/ancestor = ancestors[length(ancestors)]
|
||||
ancestors.len--
|
||||
for(var/atom/child in ancestor)
|
||||
ancestors += child
|
||||
descendants += child
|
||||
|
||||
// Prompt for which to pick.
|
||||
var/descendant = input("Pick an atom:", "Inside a Visible Atom", src) in descendants
|
||||
if(!descendant)
|
||||
.["class"] = null
|
||||
return
|
||||
.["value"] = descendant
|
||||
if(VV_VISIBLE_TURF)
|
||||
var/atom/clicked = prompt_for_atom_click("Pick a turf (or any atom on it).")
|
||||
if(!clicked)
|
||||
.["class"] = null
|
||||
return
|
||||
var/turf/where = get_turf(clicked)
|
||||
if(!where)
|
||||
.["class"] = null
|
||||
return
|
||||
.["value"] = where
|
||||
|
||||
|
||||
if(VV_CLIENT)
|
||||
.["value"] = input("Select reference:", "Reference", current_value) as null|anything in GLOB.clients
|
||||
@@ -557,6 +599,25 @@ GLOBAL_PROTECT(VVmaint_only)
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/click_intercept/pick_atom
|
||||
var/picked = null
|
||||
|
||||
/datum/click_intercept/pick_atom/InterceptClickOn(user, params, atom/object)
|
||||
picked = object
|
||||
|
||||
/client/proc/prompt_for_atom_click(prompt = "Click something!")
|
||||
to_chat(src, "<span class='notice big'>[prompt]</span>")
|
||||
var/datum/click_intercept/pick_atom/picker = new()
|
||||
click_intercept = picker
|
||||
while(isnull(picker.picked))
|
||||
if(isnull(src) || click_intercept != picker)
|
||||
return null
|
||||
sleep(1)
|
||||
|
||||
click_intercept = null
|
||||
return picker.picked
|
||||
|
||||
|
||||
/client/proc/modify_variables(atom/O, param_var_name = null, autodetect_class = 0)
|
||||
if(!check_rights(R_VAREDIT))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user