diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm new file mode 100644 index 00000000000..807e5187b08 --- /dev/null +++ b/code/__DEFINES/vv.dm @@ -0,0 +1,21 @@ +#define VV_NUM "Number" +#define VV_TEXT "Text" +#define VV_MESSAGE "Mutiline Text" +#define VV_ICON "Icon" +#define VV_ATOM_REFERENCE "Atom Reference" +#define VV_DATUM_REFERENCE "Datum Reference" +#define VV_MOB_REFERENCE "Mob Reference" +#define VV_CLIENT "Client" +#define VV_ATOM_TYPE "Atom Typepath" +#define VV_DATUM_TYPE "Datum Typepath" +#define VV_TYPE "Custom Typepath" +#define VV_FILE "File" +#define VV_LIST "List" +#define VV_NEW_ATOM "New Atom" +#define VV_NEW_DATUM "New Datum" +#define VV_NEW_TYPE "New Custom Typepath" +#define VV_NEW_LIST "New List" +#define VV_NULL "NULL" +#define VV_RESTORE_DEFAULT "Restore to Default" +#define VV_MARKED_DATUM "Marked Datum" + diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 960d07cd04d..90aefee507f 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -169,24 +169,30 @@ Proc for attack log creation, because really why not */ /proc/add_logs(mob/user, mob/target, what_done, object=null, addition=null) - var/newhealthtxt = "" - var/coordinates = "" var/turf/attack_location = get_turf(target) - if(attack_location) - coordinates = "([attack_location.x],[attack_location.y],[attack_location.z])" - if(target && isliving(target)) - var/mob/living/L = target - newhealthtxt = " (NEWHP: [L.health])" - if(user && ismob(user)) - user.attack_log += text("\[[time_stamp()]\] Has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]") - if(user.mind) - user.mind.attack_log += text("\[[time_stamp()]\] [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]") - if(target && ismob(target)) - target.attack_log += text("\[[time_stamp()]\] Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]") - if(target.mind) - target.mind.attack_log += text("\[[time_stamp()]\] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]") - log_attack("[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][newhealthtxt][coordinates]") + var/is_mob_user = user && typecache_mob[user.type] + var/is_mob_target = target && typecache_mob[target.type] + + var/mob/living/living_target + + + if(target && isliving(target)) + living_target = target + + if(is_mob_user) + var/message = "\[[time_stamp()]\] [user ? "[user.name][(user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has [what_done] [target ? "[target.name][(is_mob_target && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]" + user.attack_log += message + if(user.mind) + user.mind.attack_log += message + + if(is_mob_target) + var/message = "\[[time_stamp()]\] [target ? "[target.name][(target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] has been [what_done] by [user ? "[user.name][(is_mob_user && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]" + target.attack_log += message + if(target.mind) + target.mind.attack_log += message + + log_attack("[user ? "[user.name][(is_mob_user && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(is_mob_target && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition][(living_target) ? " (NEWHP: [living_target.health])" : ""][(attack_location) ? "([attack_location.x],[attack_location.y],[attack_location.z])" : ""]") /proc/do_mob(mob/user , mob/target, time = 30, uninterruptible = 0, progress = 1) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 9e575f3b460..13e34807609 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1262,8 +1262,9 @@ B --><-- A closest_atom = A return closest_atom -/proc/pick_closest_path(value) - var/list/matches = get_fancy_list_of_types() + +proc/pick_closest_path(value) + var/list/matches = get_fancy_list_of_atom_types() if (!isnull(value) && value!="") matches = filter_fancy_list(matches, value) diff --git a/code/_globalvars/lists/typecache.dm b/code/_globalvars/lists/typecache.dm new file mode 100644 index 00000000000..5d2565c7f26 --- /dev/null +++ b/code/_globalvars/lists/typecache.dm @@ -0,0 +1,9 @@ +//please store common type caches here. +//type caches should only be stored here if used in mutiple places or likely to be used in mutiple places. + +//Note: typecache can only replace istype if you know for sure the thing is at least a datum. + +var/list/typecache_mob = typecacheof(list(/mob)) + + + diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index e49316ebe3c..fa7daeda4d3 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -157,8 +157,12 @@ /datum/subsystem/proc/Recover() //this is so the subsystem doesn't rapid fire to make up missed ticks causing more lag -/datum/subsystem/on_varedit(edited_var) - if (edited_var == "can_fire" && can_fire) - next_fire = world.time + wait - ..() +/datum/subsystem/vv_edit_var(var_name, var_value) + switch (var_name) + if ("can_fire") + if (var_value) + next_fire = world.time + wait + if ("queued_priority") //editing this breaks things. + return 0 + . = ..() diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 5b251a3edfa..4a39419d4f2 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1,43 +1,53 @@ -// reference: /client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0) var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRUE, "screen" = TRUE, "images" = TRUE) /datum - var/var_edited = 0 //Warrenty void if seal is broken + var/var_edited = FALSE //Warrenty void if seal is broken var/datum/reagents/reagents = null var/fingerprintslast = null -/datum/proc/on_varedit(modified_var) //called whenever a var is edited - var_edited = 1 +/datum/proc/vv_edit_var(var_name, var_value) //called whenever a var is edited + switch(var_name) + if ("vars") + return FALSE + var_edited = TRUE + vars[var_name] = var_value + +/datum/proc/vv_get_var(var_name) + switch(var_name) + if ("vars") + return debug_variable(var_name, list(), 0, src) + return debug_variable(var_name, vars[var_name], 0, src) + +//please call . = ..() first and append to the result, that way parent items are always at the top and child items are further down +//add seperaters by doing . += "---" +/datum/proc/vv_get_dropdown() + . = list() + . += "---" + .["Call Proc"] = "?_src_=vars;proc_call=\ref[src]" + .["Mark Object"] = "?_src_=vars;mark_object=\ref[src]" + /datum/proc/on_reagent_change() return + /client/proc/debug_variables(datum/D in world) set category = "Debug" set name = "View Variables" //set src in world - - if(!usr.client || !usr.client.holder) usr << "You need to be an administrator to access this." return - - var/title = "" - var/body = "" - if(!D) return - if(istype(D, /atom)) - var/atom/A = D - title = "[A.name] (\ref[A]) = [A.type]" - - #ifdef VARSICON - if (A.icon) - body += debug_variable("icon", new/icon(A.icon, A.icon_state, A.dir), 0) - #endif + var/islist = FALSE + if (istype(D, /list)) + islist = TRUE + var/title = "" + var/refid = "\ref[D]" var/icon/sprite if(istype(D,/atom)) @@ -46,175 +56,40 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU sprite = new /icon(AT.icon, AT.icon_state) usr << browse_rsc(sprite, "view_vars_sprite.png") - title = "[D] (\ref[D]) = [D.type]" - - body += {" "} - - body += "
" - - body += ""
+ title = "[D] (\ref[D]) = [(islist ? /list : D.type)]"
+ var/sprite_text
if(sprite)
- body += "
" - - body += {" " - - body += " |
Search: |
+
+ [formatted_type]
+ [marked]
+ [varedited_line]
+
+ |
+
+
+ Refresh
+
+
+ |
+
|
+
+ Search:
+
+ |
+ + + | +