mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Made create-object faster and added a search button. (you can't use regexes in the search anymore, if you used this feel free to rage at me)
Signed-off-by: Mloc <colmohici@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
var/mobjs = null
|
||||
mobjs = dd_list2text(typesof(/mob), ";")
|
||||
create_mob_html = file2text('create_object.html')
|
||||
create_mob_html = dd_replacetext(create_mob_html, "<title>Create Object</title>", "<title>Create Mob</title>")
|
||||
create_mob_html = dd_replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
|
||||
|
||||
user << browse(dd_replacetext(create_mob_html, "/* ref src */", "\ref[src]"), "window=create_mob;size=425x475")
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
var/turfjs = null
|
||||
turfjs = dd_list2text(typesof(/turf), ";")
|
||||
create_turf_html = file2text('create_object.html')
|
||||
create_mob_html = dd_replacetext(create_mob_html, "<title>Create Object</title>", "<title>Create Turf</title>")
|
||||
create_turf_html = dd_replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
|
||||
|
||||
user << browse(dd_replacetext(create_turf_html, "/* ref src */", "\ref[src]"), "window=create_turf;size=425x475")
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<form name="spawner" action="byond://?src=/* ref src */" method="get">
|
||||
<input type="hidden" name="src" value="/* ref src */">
|
||||
|
||||
Type <input type="text" name="filter" value="" onkeyup="updateSearch()" onkeypress="submitFirst(event)" style="width:350px"><br>
|
||||
Type <input type="text" name="filter" value="" onkeypress="submitFirst(event)" style="width:350px"> <input type = "button" value = "Search" onclick = "updateSearch()" /><br>
|
||||
Offset: <input type="text" name="offset" value="x,y,z" style="width:250px">
|
||||
|
||||
A <input type="radio" name="offset_type" value="absolute">
|
||||
@@ -44,13 +44,13 @@
|
||||
</select>
|
||||
<br><br>
|
||||
<select name="object_list" id="object_list" size="18" multiple style="width:98%"></select><br>
|
||||
<input type="submit" value="spawn">
|
||||
<input type="submit" value="Spawn">
|
||||
</form>
|
||||
|
||||
<script language="JavaScript">
|
||||
var old_search = "";
|
||||
var object_list = document.spawner.object_list;
|
||||
var object_paths = null /* object types */;
|
||||
var object_paths = //null /* object types */;
|
||||
var objects = object_paths == null ? new Array() : object_paths.split(";");
|
||||
|
||||
document.spawner.filter.focus();
|
||||
@@ -72,19 +72,12 @@
|
||||
|
||||
function updateSearch()
|
||||
{
|
||||
if (old_search == document.spawner.filter.value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
old_search = document.spawner.filter.value;
|
||||
|
||||
|
||||
var filtered = new Array();
|
||||
var i;
|
||||
for (i in objects)
|
||||
for(var i in objects)
|
||||
{
|
||||
if(objects[i].search(old_search) < 0)
|
||||
if(objects[i].indexOf(old_search) < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user