mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 00:21:11 +01:00
Improves the Type selection (#5453)
Changes the type input to a text input and runs that through text2path
This commit is contained in:
@@ -90,7 +90,25 @@
|
||||
if(isnull(current)) return
|
||||
|
||||
if("type")
|
||||
current = input("Select type for [arguments.len+1]\th argument") as null|anything in typesof(/obj, /mob, /area, /turf)
|
||||
var/object = input("Enter a typepath for [arguments.len+1]\th argument") as null|text
|
||||
if(!object)
|
||||
return
|
||||
|
||||
var/list/types = typesof(/atom)
|
||||
var/list/matches = new()
|
||||
|
||||
for(var/path in types)
|
||||
if(findtext("[path]", object))
|
||||
matches += path
|
||||
|
||||
if(matches.len==0)
|
||||
return
|
||||
|
||||
if(matches.len==1)
|
||||
current = matches[1]
|
||||
else
|
||||
current = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
|
||||
if(isnull(current)) return
|
||||
|
||||
if("obj reference")
|
||||
|
||||
@@ -58,7 +58,24 @@ var/list/VVdynamic_lock = list(
|
||||
var_value = input("Enter new number:","Num") as null|num
|
||||
|
||||
if("type")
|
||||
var_value = input("Enter type:","Type") as null|anything in typesof(/obj,/mob,/area,/turf)
|
||||
var/object = input("Enter typepath:","Typepath") as null|text
|
||||
if(!object)
|
||||
return
|
||||
|
||||
var/list/types = typesof(/atom)
|
||||
var/list/matches = new()
|
||||
|
||||
for(var/path in types)
|
||||
if(findtext("[path]", object))
|
||||
matches += path
|
||||
|
||||
if(matches.len==0)
|
||||
return
|
||||
|
||||
if(matches.len==1)
|
||||
var_value = matches[1]
|
||||
else
|
||||
var_value = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
|
||||
if("reference")
|
||||
var_value = input("Select reference:","Reference") as null|mob|obj|turf|area in world
|
||||
@@ -107,7 +124,24 @@ var/list/VVdynamic_lock = list(
|
||||
var_value = input("Enter new number:","Num") as num
|
||||
|
||||
if("type")
|
||||
var_value = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
||||
var/object = input("Enter typepath:","Typepath") as null|text
|
||||
if(!object)
|
||||
return
|
||||
|
||||
var/list/types = typesof(/atom)
|
||||
var/list/matches = new()
|
||||
|
||||
for(var/path in types)
|
||||
if(findtext("[path]", object))
|
||||
matches += path
|
||||
|
||||
if(matches.len==0)
|
||||
return
|
||||
|
||||
if(matches.len==1)
|
||||
var_value = matches[1]
|
||||
else
|
||||
var_value = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
|
||||
if("reference")
|
||||
var_value = input("Select reference:","Reference") as mob|obj|turf|area in world
|
||||
@@ -293,49 +327,67 @@ var/list/VVdynamic_lock = list(
|
||||
return
|
||||
|
||||
if("text")
|
||||
new_var = input("Enter new text:","Text") as text
|
||||
new_var = input("Enter new text:","Text") as null|text
|
||||
if(assoc)
|
||||
L[assoc_key] = new_var
|
||||
else
|
||||
L[L.Find(variable)] = new_var
|
||||
|
||||
if("num")
|
||||
new_var = input("Enter new number:","Num") as num
|
||||
new_var = input("Enter new number:","Num") as null|num
|
||||
if(assoc)
|
||||
L[assoc_key] = new_var
|
||||
else
|
||||
L[L.Find(variable)] = new_var
|
||||
|
||||
if("type")
|
||||
new_var = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
||||
var/object = input("Enter typepath:","Typepath") as null|text
|
||||
if(!object)
|
||||
return
|
||||
|
||||
var/list/types = typesof(/atom)
|
||||
var/list/matches = new()
|
||||
|
||||
for(var/path in types)
|
||||
if(findtext("[path]", object))
|
||||
matches += path
|
||||
|
||||
if(matches.len==0)
|
||||
return
|
||||
|
||||
if(matches.len==1)
|
||||
new_var = matches[1]
|
||||
else
|
||||
new_var = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
|
||||
if(assoc)
|
||||
L[assoc_key] = new_var
|
||||
else
|
||||
L[L.Find(variable)] = new_var
|
||||
|
||||
if("reference")
|
||||
new_var = input("Select reference:","Reference") as mob|obj|turf|area in world
|
||||
new_var = input("Select reference:","Reference") as null|mob|obj|turf|area in world
|
||||
if(assoc)
|
||||
L[assoc_key] = new_var
|
||||
else
|
||||
L[L.Find(variable)] = new_var
|
||||
|
||||
if("mob reference")
|
||||
new_var = input("Select reference:","Reference") as mob in world
|
||||
new_var = input("Select reference:","Reference") as null|mob in world
|
||||
if(assoc)
|
||||
L[assoc_key] = new_var
|
||||
else
|
||||
L[L.Find(variable)] = new_var
|
||||
|
||||
if("file")
|
||||
new_var = input("Pick file:","File") as file
|
||||
new_var = input("Pick file:","File") as null|file
|
||||
if(assoc)
|
||||
L[assoc_key] = new_var
|
||||
else
|
||||
L[L.Find(variable)] = new_var
|
||||
|
||||
if("icon")
|
||||
new_var = input("Pick icon:","Icon") as icon
|
||||
new_var = input("Pick icon:","Icon") as null|icon
|
||||
if(assoc)
|
||||
L[assoc_key] = new_var
|
||||
else
|
||||
@@ -569,7 +621,27 @@ var/list/VVdynamic_lock = list(
|
||||
O.vars[variable] = var_new
|
||||
|
||||
if("type")
|
||||
var/var_new = input("Enter type:","Type",O.vars[variable]) as null|anything in typesof(/obj,/mob,/area,/turf)
|
||||
var/object = input("Enter typepath:","Type",O.vars[variable]) as null|text
|
||||
if(!object)
|
||||
return
|
||||
|
||||
var/list/types = typesof(/atom)
|
||||
var/list/matches = new()
|
||||
|
||||
for(var/path in types)
|
||||
if(findtext("[path]", object))
|
||||
matches += path
|
||||
|
||||
if(matches.len==0)
|
||||
return
|
||||
|
||||
var/var_new = null
|
||||
|
||||
if(matches.len==1)
|
||||
var_new = matches[1]
|
||||
else
|
||||
var_new = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
|
||||
if(var_new==null) return
|
||||
O.vars[variable] = var_new
|
||||
|
||||
|
||||
Reference in New Issue
Block a user