Proc calls now use vv_get_value, which can get things you click on. (#28172)

This commit is contained in:
Charlie Nolan
2025-01-29 13:22:02 +00:00
committed by GitHub
parent 73c94dbc83
commit 529e55be05
3 changed files with 69 additions and 50 deletions
@@ -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