diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index f68903e4d1..c2bebad710 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -68,9 +68,21 @@ client body += "" - body += "
" + body += "
[D]
[D.type]
" + + body += "
" - body += "
Refresh" + if(istype(D,/atom)) + body += "[D]" + else + body += "[D]" + + body += "
[D.type]" + + if(src.holder && src.holder.marked_datum && src.holder.marked_datum == D) + body += "
Marked Object" + + body += "
Refresh" //if(ismob(D)) // body += "
Show player panel

" @@ -93,13 +105,17 @@ client body += "" if(ismob(D)) body += "" + if(isobj(D) || ismob(D) || isturf(D)) + body += "" + body += "" body += "" body += "
" body += "E - Edit, tries to determine the variable type by itself.
" - body += "C - Change, asks you for the var type first.

" + body += "C - Change, asks you for the var type first.
" + body += "M - Mass modify: changes this variable for all objects of this type.
" body += "
Search:

" @@ -143,7 +159,7 @@ client var/html = "" if(DA) - html += "
  • (E) (C) " + html += "
  • (E) (C) (M) " else html += "
  • " @@ -237,15 +253,18 @@ client usr << "Can't edit an item of this type. Type must be /datum, so anything except simple variables. [DAT]" return modify_variables(DAT, href_list["varnamechange"], 0) - else if (href_list["refresh"]) - if(!href_list["datumrefresh"]) + else if (href_list["varnamemass"]) + if(!href_list["datummass"] || !href_list["varnamemass"]) + usr << "Varedit error: Not all information has been sent. Contact a coder." return - var/datum/DAT = locate(href_list["datumrefresh"]) - if(!DAT) + var/atom/A = locate(href_list["datummass"]) + if(!A) + usr << "Item not found" return - if(!istype(DAT,/datum)) + if(!istype(A,/atom)) + usr << "Can't edit an item of this type. Type must be /atom, so an object, turf, mob or area. [A]" return - src.debug_variables(DAT) + cmd_mass_modify_object_variables(A, href_list["varnamemass"]) else if (href_list["mob_player_panel"]) if(!href_list["mob_player_panel"]) return @@ -257,6 +276,27 @@ client if(!src.holder) return src.holder.show_player_panel(MOB) + href_list["datumrefresh"] = href_list["mob_player_panel"] + else if (href_list["explode"]) + if(!href_list["explode"]) + return + var/atom/A = locate(href_list["explode"]) + if(!A) + return + if(!isobj(A) && !ismob(A) && !isturf(A)) + return + src.cmd_admin_explosion(A) + href_list["datumrefresh"] = href_list["explode"] + else if (href_list["emp"]) + if(!href_list["emp"]) + return + var/atom/A = locate(href_list["emp"]) + if(!A) + return + if(!isobj(A) && !ismob(A) && !isturf(A)) + return + src.cmd_admin_emp(A) + href_list["datumrefresh"] = href_list["emp"] else if (href_list["mark_object"]) if(!href_list["mark_object"]) return @@ -266,10 +306,21 @@ client if(!src.holder) return src.holder.marked_datum = D + href_list["datumrefresh"] = href_list["mark_object"] else ..() + if (href_list["datumrefresh"]) + if(!href_list["datumrefresh"]) + return + var/datum/DAT = locate(href_list["datumrefresh"]) + if(!DAT) + return + if(!istype(DAT,/datum)) + return + src.debug_variables(DAT) + /mob/proc/Delete(atom/A in view()) set category = "Debug" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index b87bb77a0a..493ae8560a 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -210,11 +210,11 @@ return switch(alert("Temporary Ban?",,"Yes","No", "Cancel")) if("Yes") - var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num + var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null if(!mins) return if(mins >= 525600) mins = 525599 - var/reason = input(usr,"Reason?","reason","Griefer") as text + var/reason = input(usr,"Reason?","reason","Griefer") as text|null if(!reason) return AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins) @@ -231,7 +231,7 @@ del(M.client) //del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends. if("No") - var/reason = input(usr,"Reason?","reason","Griefer") as text + var/reason = input(usr,"Reason?","reason","Griefer") as text|null if(!reason) return AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 0a0e61cf1d..1b2f76df93 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -65,7 +65,7 @@ if(holder.state == 2) // if observing // Debug verbs += /client/proc/debug_variables - verbs += /client/proc/cmd_modify_object_variables + //verbs += /client/proc/cmd_modify_object_variables --Merged with view variables verbs += /client/proc/cmd_modify_ticker_variables // Admin helpers @@ -141,7 +141,7 @@ if (holder.level >= 5)//Game Admin******************************************************************** verbs += /obj/admins/proc/view_txt_log - verbs += /client/proc/cmd_mass_modify_object_variables + //verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables verbs += /client/proc/cmd_admin_list_open_jobs verbs += /client/proc/cmd_admin_direct_narrate verbs += /client/proc/cmd_admin_world_narrate @@ -155,8 +155,8 @@ verbs += /client/proc/give_spell verbs += /client/proc/cmd_admin_ninjafy verbs += /client/proc/cmd_admin_grantfullaccess - verbs += /client/proc/cmd_admin_explosion - verbs += /client/proc/cmd_admin_emp + //verbs += /client/proc/cmd_admin_explosion --now in view vars + //verbs += /client/proc/cmd_admin_emp --now in view vars verbs += /client/proc/cmd_admin_drop_everything verbs += /client/proc/make_sound verbs += /client/proc/play_local_sound @@ -168,7 +168,7 @@ verbs += /obj/admins/proc/adrev //toggle admin revives verbs += /obj/admins/proc/adspawn //toggle admin item spawning verbs += /client/proc/debug_variables - verbs += /client/proc/cmd_modify_object_variables + //verbs += /client/proc/cmd_modify_object_variables --Merged with view variables verbs += /client/proc/cmd_modify_ticker_variables verbs += /client/proc/Debug2 //debug toggle switch verbs += /client/proc/toggle_view_range @@ -230,7 +230,7 @@ verbs += /client/proc/cmd_admin_mute verbs += /client/proc/cmd_admin_pm verbs += /client/proc/cmd_admin_subtle_message - verbs += /client/proc/warn + //verbs += --useless verbs += /obj/admins/proc/announce verbs += /obj/admins/proc/startnow verbs += /client/proc/dsay @@ -245,8 +245,8 @@ verbs += /obj/admins/proc/votekill verbs += /client/proc/voting verbs += /obj/admins/proc/show_player_panel - verbs += /client/proc/cmd_admin_prison - verbs += /obj/admins/proc/unprison + //verbs += /client/proc/cmd_admin_prison --in player panel + //verbs += /obj/admins/proc/unprison --in player panel verbs += /client/proc/hide_verbs verbs += /client/proc/general_report verbs += /client/proc/air_report @@ -275,7 +275,7 @@ verbs -= /client/proc/object_talk verbs -= /client/proc/strike_team verbs -= /obj/admins/proc/view_txt_log - verbs -= /client/proc/cmd_mass_modify_object_variables + //verbs -= /client/proc/cmd_mass_modify_object_variables --Merged with view variables verbs -= /client/proc/cmd_admin_list_open_jobs verbs -= /client/proc/cmd_admin_direct_narrate verbs -= /client/proc/cmd_admin_world_narrate @@ -291,8 +291,8 @@ verbs -= /client/proc/give_spell verbs -= /client/proc/cmd_admin_ninjafy verbs -= /client/proc/cmd_admin_grantfullaccess - verbs -= /client/proc/cmd_admin_explosion - verbs -= /client/proc/cmd_admin_emp + //verbs -= /client/proc/cmd_admin_explosion --now in view vars + //verbs -= /client/proc/cmd_admin_emp --now in view vars verbs -= /client/proc/cmd_admin_drop_everything verbs -= /client/proc/make_sound verbs -= /client/proc/only_one @@ -301,7 +301,7 @@ verbs -= /obj/admins/proc/adspawn //toggle admin item spawning verbs -= /obj/admins/proc/toggleaban //abandon mob verbs -= /client/proc/debug_variables - verbs -= /client/proc/cmd_modify_object_variables + //verbs -= /client/proc/cmd_modify_object_variables --merged with view variables verbs -= /client/proc/cmd_modify_ticker_variables verbs -= /client/proc/Debug2 //debug toggle switch verbs -= /client/proc/toggle_view_range @@ -350,7 +350,7 @@ verbs -= /client/proc/cmd_admin_pm verbs -= /client/proc/cmd_admin_say verbs -= /client/proc/cmd_admin_subtle_message - verbs -= /client/proc/warn + //verbs -= /client/proc/warn --uselesss verbs -= /obj/admins/proc/announce verbs -= /obj/admins/proc/startnow verbs -= /client/proc/dsay @@ -365,8 +365,8 @@ verbs -= /obj/admins/proc/votekill verbs -= /client/proc/voting verbs -= /obj/admins/proc/show_player_panel - verbs -= /client/proc/cmd_admin_prison - verbs -= /obj/admins/proc/unprison + //verbs -= /client/proc/cmd_admin_prison --in player panel + //verbs -= /obj/admins/proc/unprison --in player panel verbs -= /client/proc/hide_verbs verbs -= /client/proc/general_report verbs -= /client/proc/air_report @@ -618,7 +618,7 @@ if(holder.level >= 4)//Badmin******************************************************************** verbs += /client/proc/debug_variables - verbs += /client/proc/cmd_modify_object_variables + //verbs += /client/proc/cmd_modify_object_variables --merged with view vairiables verbs += /client/proc/Jump verbs += /client/proc/jumptoturf verbs += /client/proc/togglebuildmodeself diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index bbfa8b1409..be19c13e14 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -1,11 +1,24 @@ -/client/proc/cmd_mass_modify_object_variables(obj/O as obj|mob|turf|area in world) +/client/proc/cmd_mass_modify_object_variables(atom/A, var/var_name) set category = "Debug" set name = "Mass Edit Variables" set desc="(target) Edit all instances of a target item's variables" - src.massmodify_variables(O) + + var/method = 0 //0 means strict type detection while 1 means this type and all subtypes (IE: /obj/item with this set to 1 will set it to ALL itms) + + if(A && A.type) + if(typesof(A.type)) + switch(input("Strict object type detection?") in list("Strictly this type","This type and subtypes", "Cancel")) + if("Strictly this type") + method = 0 + if("This type and subtypes") + method = 1 + if("Cancel") + return + + src.massmodify_variables(A, var_name, method) -/client/proc/massmodify_variables(var/atom/O) +/client/proc/massmodify_variables(var/atom/O, var/var_name = "", var/method = 0) var/list/locked = list("vars", "key", "ckey", "client") if(!src.authenticated || !src.holder) @@ -18,7 +31,13 @@ names = sortList(names) - var/variable = input("Which var?","Var") as null|anything in names + var/variable = "" + + if(!var_name) + variable = input("Which var?","Var") as null|anything in names + else + variable = var_name + if(!variable) return var/default @@ -109,21 +128,37 @@ if("restore to default") O.vars[variable] = initial(O.vars[variable]) + if(method) + if(istype(O, /mob)) + for(var/mob/M in world) + if ( istype(M , O.type) ) + M.vars[variable] = O.vars[variable] - if(istype(O, /mob)) - for(var/mob/M in world) - if (M.type == O.type) - M.vars[variable] = O.vars[variable] + else if(istype(O, /obj)) + for(var/obj/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] - else if(istype(O, /obj)) - for(var/obj/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O, /turf)) + for(var/turf/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] - else if(istype(O, /turf)) - for(var/turf/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else + if(istype(O, /mob)) + for(var/mob/M in world) + if (M.type == O.type) + M.vars[variable] = O.vars[variable] + + else if(istype(O, /obj)) + for(var/obj/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] + + else if(istype(O, /turf)) + for(var/turf/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] if("edit referenced object") return .(O.vars[variable]) @@ -132,20 +167,36 @@ O.vars[variable] = input("Enter new text:","Text",\ O.vars[variable]) as text - if(istype(O, /mob)) - for(var/mob/M in world) - if (M.type == O.type) - M.vars[variable] = O.vars[variable] + if(method) + if(istype(O, /mob)) + for(var/mob/M in world) + if ( istype(M , O.type) ) + M.vars[variable] = O.vars[variable] - else if(istype(O, /obj)) - for(var/obj/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O, /obj)) + for(var/obj/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] - else if(istype(O, /turf)) - for(var/turf/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O, /turf)) + for(var/turf/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] + else + if(istype(O, /mob)) + for(var/mob/M in world) + if (M.type == O.type) + M.vars[variable] = O.vars[variable] + + else if(istype(O, /obj)) + for(var/obj/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] + + else if(istype(O, /turf)) + for(var/turf/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] if("num") var/new_value = input("Enter new number:","Num",\ @@ -156,85 +207,159 @@ else O.vars[variable] = new_value - if(istype(O, /mob)) - for(var/mob/M in world) - if (M.type == O.type) - if(variable=="luminosity") - M.sd_SetLuminosity(new_value) - else - M.vars[variable] = O.vars[variable] + if(method) + if(istype(O, /mob)) + for(var/mob/M in world) + if ( istype(M , O.type) ) + if(variable=="luminosity") + M.sd_SetLuminosity(new_value) + else + M.vars[variable] = O.vars[variable] - else if(istype(O, /obj)) - for(var/obj/A in world) - if (A.type == O.type) - if(variable=="luminosity") - A.sd_SetLuminosity(new_value) - else - A.vars[variable] = O.vars[variable] + else if(istype(O, /obj)) + for(var/obj/A in world) + if ( istype(A , O.type) ) + if(variable=="luminosity") + A.sd_SetLuminosity(new_value) + else + A.vars[variable] = O.vars[variable] - else if(istype(O, /turf)) - for(var/turf/A in world) - if (A.type == O.type) - if(variable=="luminosity") - A.sd_SetLuminosity(new_value) - else - A.vars[variable] = O.vars[variable] + else if(istype(O, /turf)) + for(var/turf/A in world) + if ( istype(A , O.type) ) + if(variable=="luminosity") + A.sd_SetLuminosity(new_value) + else + A.vars[variable] = O.vars[variable] + + else + if(istype(O, /mob)) + for(var/mob/M in world) + if (M.type == O.type) + if(variable=="luminosity") + M.sd_SetLuminosity(new_value) + else + M.vars[variable] = O.vars[variable] + + else if(istype(O, /obj)) + for(var/obj/A in world) + if (A.type == O.type) + if(variable=="luminosity") + A.sd_SetLuminosity(new_value) + else + A.vars[variable] = O.vars[variable] + + else if(istype(O, /turf)) + for(var/turf/A in world) + if (A.type == O.type) + if(variable=="luminosity") + A.sd_SetLuminosity(new_value) + else + A.vars[variable] = O.vars[variable] if("type") O.vars[variable] = input("Enter type:","Type",O.vars[variable]) \ in typesof(/obj,/mob,/area,/turf) + if(method) + if(istype(O, /mob)) + for(var/mob/M in world) + if ( istype(M , O.type) ) + M.vars[variable] = O.vars[variable] - if(istype(O, /mob)) - for(var/mob/M in world) - if (M.type == O.type) - M.vars[variable] = O.vars[variable] + else if(istype(O, /obj)) + for(var/obj/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] - else if(istype(O, /obj)) - for(var/obj/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O, /turf)) + for(var/turf/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] + else + if(istype(O, /mob)) + for(var/mob/M in world) + if (M.type == O.type) + M.vars[variable] = O.vars[variable] - else if(istype(O, /turf)) - for(var/turf/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O, /obj)) + for(var/obj/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] + + else if(istype(O, /turf)) + for(var/turf/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] if("file") O.vars[variable] = input("Pick file:","File",O.vars[variable]) \ as file - if(istype(O, /mob)) - for(var/mob/M in world) - if (M.type == O.type) - M.vars[variable] = O.vars[variable] + if(method) + if(istype(O, /mob)) + for(var/mob/M in world) + if ( istype(M , O.type) ) + M.vars[variable] = O.vars[variable] - else if(istype(O.type, /obj)) - for(var/obj/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O.type, /obj)) + for(var/obj/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] - else if(istype(O.type, /turf)) - for(var/turf/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O.type, /turf)) + for(var/turf/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] + else + if(istype(O, /mob)) + for(var/mob/M in world) + if (M.type == O.type) + M.vars[variable] = O.vars[variable] + + else if(istype(O.type, /obj)) + for(var/obj/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] + + else if(istype(O.type, /turf)) + for(var/turf/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] if("icon") O.vars[variable] = input("Pick icon:","Icon",O.vars[variable]) \ as icon - if(istype(O, /mob)) - for(var/mob/M in world) - if (M.type == O.type) - M.vars[variable] = O.vars[variable] + if(method) + if(istype(O, /mob)) + for(var/mob/M in world) + if ( istype(M , O.type) ) + M.vars[variable] = O.vars[variable] - else if(istype(O, /obj)) - for(var/obj/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O, /obj)) + for(var/obj/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] - else if(istype(O, /turf)) - for(var/turf/A in world) - if (A.type == O.type) - A.vars[variable] = O.vars[variable] + else if(istype(O, /turf)) + for(var/turf/A in world) + if ( istype(A , O.type) ) + A.vars[variable] = O.vars[variable] + + else + if(istype(O, /mob)) + for(var/mob/M in world) + if (M.type == O.type) + M.vars[variable] = O.vars[variable] + + else if(istype(O, /obj)) + for(var/obj/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] + + else if(istype(O, /turf)) + for(var/turf/A in world) + if (A.type == O.type) + A.vars[variable] = O.vars[variable] log_admin("[key_name(src)] mass modified [original_name]'s [variable] to [O.vars[variable]]") message_admins("[key_name_admin(src)] mass modified [original_name]'s [variable] to [O.vars[variable]]", 1) \ No newline at end of file