// Keep these two together, they *must* be defined on both
// If /client ever becomes /datum/client or similar, they can be merged
/datum/proc/get_view_variables_header()
return span_bold("[src]")
/atom/get_view_variables_header()
return {"
"} + span_bold("[src]") + {"
"} + span_small("<<") + {"
"} + span_small("[dir2text(dir)]") + {"
"} + span_small(">>") + {"
"}
/mob/living/get_view_variables_header()
return {"
"} + span_bold("[src]") + {"
"} + span_small("
<< [dir2text(dir)] >>") + {"
"} + span_small("
[ckey ? ckey : "No ckey"] / [real_name ? real_name : "No real name"]") + {"
"} + span_small("BRUTE:[getBruteLoss()]") + {"
"} + span_small("FIRE:[getFireLoss()]") + {"
"} + span_small("TOXIN:[getToxLoss()]") + {"
"} + span_small("OXY:[getOxyLoss()]") + {"
"} + span_small("CLONE:[getCloneLoss()]") + {"
"} + span_small("BRAIN:[getBrainLoss()]") + {"
"}
//This entire file needs to be removed eventually
/datum/proc/get_view_variables_options()
return ""
/mob/get_view_variables_options()
return ..() + {"
"}
/mob/living/carbon/human/get_view_variables_options()
return ..() + {"
"}
/obj/get_view_variables_options()
return ..() + {"
"}
/turf/get_view_variables_options()
return ..() + {"
"}
/obj/item/pda/get_view_variables_options()
return ..() + {"
"}
/datum/proc/get_variables()
. = vars - VV_hidden()
if(!usr || !check_rights(R_ADMIN|R_DEBUG, FALSE))
. -= VV_secluded()
/datum/proc/get_variable_value(varname)
return vars[varname]
/datum/proc/set_variable_value(varname, value)
vars[varname] = value
/datum/proc/get_initial_variable_value(varname)
return initial(vars[varname])
/datum/proc/make_view_variables_variable_entry(var/varname, var/value, var/hide_watch = 0)
return {"
(E)
(C)
(M)
[hide_watch ? "" : "(W)"]
"}
// No mass editing of clients
/client/make_view_variables_variable_entry(var/varname, var/value, var/hide_watch = 0)
return {"
(E)
(C)
[hide_watch ? "" : "(W)"]
"}
// These methods are all procs and don't use stored lists to avoid VV exploits
// The following vars cannot be viewed by anyone
/datum/proc/VV_hidden()
return list()
// The following vars can only be viewed by R_ADMIN|R_DEBUG
/datum/proc/VV_secluded()
return list()
/datum/configuration/VV_secluded()
return vars
// The following vars cannot be edited by anyone
/datum/proc/VV_static()
return list("parent_type")
/atom/VV_static()
return ..() + list("bound_x", "bound_y", "bound_height", "bound_width", "bounds", "step_x", "step_y", "step_size")
/client/VV_static()
return ..() + list("holder", "prefs")
/datum/admins/VV_static()
return vars
// The following vars require R_DEBUG to edit
/datum/proc/VV_locked()
return list("vars", "cuffed")
/client/VV_locked()
return list("vars", "mob")
/mob/VV_locked()
return ..() + list("client")
// The following vars require R_FUN|R_DEBUG to edit
/datum/proc/VV_icon_edit_lock()
return list()
/atom/VV_icon_edit_lock()
return ..() + list("icon", "icon_state", "overlays", "underlays")
// The following vars require R_SPAWN|R_DEBUG to edit
/datum/proc/VV_ckey_edit()
return list()
/mob/VV_ckey_edit()
return list("key", "ckey")
/client/VV_ckey_edit()
return list("key", "ckey")
/datum/proc/may_edit_var(var/user, var/var_to_edit) //User must be a CLIENT that is passed to this.
if(!user)
return FALSE
if(ismob(user)) //Failsafe catch in case someone feeds a mob into us.
var/mob/living = user
user = living.client
if(!(var_to_edit in vars))
to_chat(user, span_warning("\The [src] does not have a var '[var_to_edit]'"))
return FALSE
if(var_to_edit in VV_static())
return FALSE
if((var_to_edit in VV_secluded()) && !check_rights_for(user, R_ADMIN|R_DEBUG))
return FALSE
if((var_to_edit in VV_locked()) && !check_rights_for(user, R_DEBUG))
return FALSE
if((var_to_edit in VV_ckey_edit()) && !check_rights_for(user, R_SPAWN|R_DEBUG))
return FALSE
if((var_to_edit in VV_icon_edit_lock()) && !check_rights_for(user, R_FUN|R_DEBUG))
return FALSE
return TRUE
/proc/forbidden_varedit_object_types()
return list(
/datum/admins //Admins editing their own admin-power object? Yup, sounds like a good idea.
)