From bff1962f2702c7110c400bff6e17790ab67f9970 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Sun, 25 Mar 2012 02:43:19 -0700 Subject: [PATCH 1/2] Adds the capability to edit in objects by the UID (hexadecimal) reference, so you do not need to hunt through the list. --- code/modules/admin/verbs/modifyvariables.dm | 74 +++++++++++++++++++-- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index 4126ab5c39d..15871fcf712 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -43,7 +43,23 @@ var_value = input("Enter type:","Type") as null|anything in typesof(/obj,/mob,/area,/turf) if("reference") - var_value = input("Select reference:","Reference") as null|mob|obj|turf|area in world + switch(alert("Would you like to enter a specific object, or search for it from the world?","Choose!","Specifc UID (Hexadecimal number)", "Search")) + if("Specifc UID (Hexadecimal number)") + var/UID = input("Type in UID, without the leading 0x","Type in UID") as text|null + if(!UID) return + if(length(UID) != 7) + usr << "ERROR. UID must be 7 digits" + var/temp_variable = locate("\[0x[UID]\]") + if(!temp_variable) + usr << "ERROR. Could not locate referenced object." + return + switch(alert("You have chosen [temp_variable], in [get_area(temp_variable)]. Are you sure?","You sure?","Yes","NONOCANCEL!")) + if("Yes") + var_value = temp_variable + if("NONOCANCEL!") + return + if("Search") + var_value = input("Select reference:","Reference") as null|mob|obj|turf|area in world if("mob reference") var_value = input("Select reference:","Reference") as null|mob in world @@ -92,7 +108,23 @@ var_value = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf) if("reference") - var_value = input("Select reference:","Reference") as mob|obj|turf|area in world + switch(alert("Would you like to enter a specific object, or search for it from the world?","Choose!","Specifc UID (Hexadecimal number)", "Search")) + if("Specifc UID (Hexadecimal number)") + var/UID = input("Type in UID, without the leading 0x","Type in UID") as text|null + if(!UID) return + if(length(UID) != 7) + usr << "ERROR. UID must be 7 digits" + var/temp_variable = locate("\[0x[UID]\]") + if(!temp_variable) + usr << "ERROR. Could not locate referenced object." + return + switch(alert("You have chosen [temp_variable], in [get_area(temp_variable)]. Are you sure?","You sure?","Yes","NONOCANCEL!")) + if("Yes") + var_value = temp_variable + if("NONOCANCEL!") + return + if("Search") + var_value = input("Select reference:","Reference") as null|mob|obj|turf|area in world if("mob reference") var_value = input("Select reference:","Reference") as mob in world @@ -242,8 +274,23 @@ in typesof(/obj,/mob,/area,/turf) if("reference") - variable = input("Select reference:","Reference",\ - variable) as mob|obj|turf|area in world + switch(alert("Would you like to enter a specific object, or search for it from the world?","Choose!","Specifc UID (Hexadecimal number)", "Search")) + if("Specifc UID (Hexadecimal number)") + var/UID = input("Type in UID, without the leading 0x","Type in UID") as text|null + if(!UID) return + if(length(UID) != 7) + usr << "ERROR. UID must be 7 digits" + var/temp_variable = locate("\[0x[UID]\]") + if(!temp_variable) + usr << "ERROR. Could not locate referenced object." + return + switch(alert("You have chosen [temp_variable], in [get_area(temp_variable)]. Are you sure?","You sure?","Yes","NONOCANCEL!")) + if("Yes") + variable = temp_variable + if("NONOCANCEL!") + return + if("Search") + variable = input("Select reference:","Reference") as null|mob|obj|turf|area in world if("mob reference") variable = input("Select reference:","Reference",\ @@ -464,7 +511,24 @@ O.vars[variable] = var_new if("reference") - var/var_new = input("Select reference:","Reference",O.vars[variable]) as null|mob|obj|turf|area in world + var/var_new + switch(alert("Would you like to enter a specific object, or search for it from the world?","Choose!","Specifc UID (Hexadecimal number)", "Search")) + if("Specifc UID (Hexadecimal number)") + var/UID = input("Type in UID, without the leading 0x","Type in UID") as text|null + if(!UID) return + if(length(UID) != 7) + usr << "ERROR. UID must be 7 digits" + var/temp_variable = locate("\[0x[UID]\]") + if(!temp_variable) + usr << "ERROR. Could not locate referenced object." + return + switch(alert("You have chosen [temp_variable], in [get_area(temp_variable)]. Are you sure?","You sure?","Yes","NONOCANCEL!")) + if("Yes") + var_new = temp_variable + if("NONOCANCEL!") + return + if("Search") + var_new = input("Select reference:","Reference") as null|mob|obj|turf|area in world if(var_new==null) return O.vars[variable] = var_new From e074b9f97e48d288c5163c2d889ccba868af2e3d Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Sun, 25 Mar 2012 02:46:57 -0700 Subject: [PATCH 2/2] Adds a similar system to the proccall system. --- code/modules/admin/verbs/debug.dm | 54 +++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 75e35f462e7..00dbc514aef 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -86,7 +86,23 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that lst[i] = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf) if("reference") - lst[i] = input("Select reference:","Reference",src) as mob|obj|turf|area in world + switch(alert("Would you like to enter a specific object, or search for it from the world?","Choose!","Specifc UID (Hexadecimal number)", "Search")) + if("Specifc UID (Hexadecimal number)") + var/UID = input("Type in UID, without the leading 0x","Type in UID") as text|null + if(!UID) return + if(length(UID) != 7) + usr << "ERROR. UID must be 7 digits" + var/temp_variable = locate("\[0x[UID]\]") + if(!temp_variable) + usr << "ERROR. Could not locate referenced object." + return + switch(alert("You have chosen [temp_variable], in [get_area(temp_variable)]. Are you sure?","You sure?","Yes","NONOCANCEL!")) + if("Yes") + lst[i] = temp_variable + if("NONOCANCEL!") + return + if("Search") + lst[i] = input("Select reference:","Reference") as null|mob|obj|turf|area in world if("mob reference") lst[i] = input("Select reference:","Reference",usr) as mob in world @@ -148,7 +164,23 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that argL.Add( input("Enter type:","Type",null) in typesof(/obj,/mob,/area,/turf) ) if("reference") - argL.Add( input("Select reference:","Reference",null) as mob|obj|turf|area in world ) + switch(alert("Would you like to enter a specific object, or search for it from the world?","Choose!","Specifc UID (Hexadecimal number)", "Search")) + if("Specifc UID (Hexadecimal number)") + var/UID = input("Type in UID, without the leading 0x","Type in UID") as text|null + if(!UID) return + if(length(UID) != 7) + usr << "ERROR. UID must be 7 digits" + var/temp_variable = locate("\[0x[UID]\]") + if(!temp_variable) + usr << "ERROR. Could not locate referenced object." + return + switch(alert("You have chosen [temp_variable], in [get_area(temp_variable)]. Are you sure?","You sure?","Yes","NONOCANCEL!")) + if("Yes") + argL.Add(temp_variable) + if("NONOCANCEL!") + return + if("Search") + argL.Add(input("Select reference:","Reference") as null|mob|obj|turf|area in world) if("icon") argL.Add( input("Pick icon:","Icon",null) as icon ) @@ -200,7 +232,23 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that argL.Add( input("Enter type:","Type",null) in typesof(/obj,/mob,/area,/turf) ) if("reference") - argL.Add( input("Select reference:","Reference",null) as mob|obj|turf|area in world ) + switch(alert("Would you like to enter a specific object, or search for it from the world?","Choose!","Specifc UID (Hexadecimal number)", "Search")) + if("Specifc UID (Hexadecimal number)") + var/UID = input("Type in UID, without the leading 0x","Type in UID") as text|null + if(!UID) return + if(length(UID) != 7) + usr << "ERROR. UID must be 7 digits" + var/temp_variable = locate("\[0x[UID]\]") + if(!temp_variable) + usr << "ERROR. Could not locate referenced object." + return + switch(alert("You have chosen [temp_variable], in [get_area(temp_variable)]. Are you sure?","You sure?","Yes","NONOCANCEL!")) + if("Yes") + argL.Add(temp_variable) + if("NONOCANCEL!") + return + if("Search") + argL.Add(input("Select reference:","Reference") as null|mob|obj|turf|area in world) if("icon") argL.Add( input("Pick icon:","Icon",null) as icon )