mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-23 16:42:13 +00:00
Updating spawn(Create Object) for admin panel (#5442)
Create Object now populates list of objects instantly. Compared to original 3-4 seconds of freezes. Quick Create Object was removed due to regular being extremely fast.
This commit is contained in:
committed by
Werner
parent
65f0c886c1
commit
76c630dcfb
@@ -620,7 +620,6 @@ proc/admin_notice(var/message, var/rights)
|
|||||||
dat += {"
|
dat += {"
|
||||||
<BR>
|
<BR>
|
||||||
<A href='?src=\ref[src];create_object=1'>Create Object</A><br>
|
<A href='?src=\ref[src];create_object=1'>Create Object</A><br>
|
||||||
<A href='?src=\ref[src];quick_create_object=1'>Quick Create Object</A><br>
|
|
||||||
<A href='?src=\ref[src];create_turf=1'>Create Turf</A><br>
|
<A href='?src=\ref[src];create_turf=1'>Create Turf</A><br>
|
||||||
<A href='?src=\ref[src];create_mob=1'>Create Mob</A><br>
|
<A href='?src=\ref[src];create_mob=1'>Create Mob</A><br>
|
||||||
<br><A href='?src=\ref[src];vsc=airflow'>Edit Airflow Settings</A><br>
|
<br><A href='?src=\ref[src];vsc=airflow'>Edit Airflow Settings</A><br>
|
||||||
|
|||||||
@@ -7,23 +7,4 @@
|
|||||||
create_object_html = file2text('html/create_object.html')
|
create_object_html = file2text('html/create_object.html')
|
||||||
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
|
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
|
||||||
|
|
||||||
user << browse(replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475")
|
user << browse(replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475")
|
||||||
|
|
||||||
|
|
||||||
/datum/admins/proc/quick_create_object(var/mob/user)
|
|
||||||
|
|
||||||
var/quick_create_object_html = null
|
|
||||||
var/pathtext = null
|
|
||||||
|
|
||||||
pathtext = input("Select the path of the object you wish to create.", "Path", "/obj") as null|anything in list("/obj","/obj/structure","/obj/item","/obj/item/weapon","/obj/item/clothing","/obj/machinery","/obj/mecha")
|
|
||||||
if(!pathtext)
|
|
||||||
return
|
|
||||||
var path = text2path(pathtext)
|
|
||||||
|
|
||||||
if (!quick_create_object_html)
|
|
||||||
var/objectjs = null
|
|
||||||
objectjs = jointext(typesof(path), ";")
|
|
||||||
quick_create_object_html = file2text('html/create_object.html')
|
|
||||||
quick_create_object_html = replacetext(quick_create_object_html, "null /* object types */", "\"[objectjs]\"")
|
|
||||||
|
|
||||||
user << browse(replacetext(quick_create_object_html, "/* ref src */", "\ref[src]"), "window=quick_create_object;size=425x475")
|
|
||||||
@@ -1165,10 +1165,6 @@
|
|||||||
if(!check_rights(R_SPAWN)) return
|
if(!check_rights(R_SPAWN)) return
|
||||||
return create_object(usr)
|
return create_object(usr)
|
||||||
|
|
||||||
else if(href_list["quick_create_object"])
|
|
||||||
if(!check_rights(R_SPAWN)) return
|
|
||||||
return quick_create_object(usr)
|
|
||||||
|
|
||||||
else if(href_list["create_turf"])
|
else if(href_list["create_turf"])
|
||||||
if(!check_rights(R_SPAWN)) return
|
if(!check_rights(R_SPAWN)) return
|
||||||
return create_turf(usr)
|
return create_turf(usr)
|
||||||
@@ -1491,7 +1487,7 @@
|
|||||||
else if(href_list["ac_set_signature"])
|
else if(href_list["ac_set_signature"])
|
||||||
src.admincaster_signature = sanitize(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
|
src.admincaster_signature = sanitize(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
|
||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_add_comment"])
|
else if(href_list["ac_add_comment"])
|
||||||
var/com_msg = sanitize(input(usr, "Write your Comment", "Network Comment Handler", "") as message, encode = 0, trim = 0, extra = 0)
|
var/com_msg = sanitize(input(usr, "Write your Comment", "Network Comment Handler", "") as message, encode = 0, trim = 0, extra = 0)
|
||||||
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
||||||
@@ -1505,7 +1501,7 @@
|
|||||||
to_chat(usr, "Comment successfully added!")
|
to_chat(usr, "Comment successfully added!")
|
||||||
src.admincaster_screen = 20
|
src.admincaster_screen = 20
|
||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_view_comments"])
|
else if(href_list["ac_view_comments"])
|
||||||
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
||||||
if(!istype(viewing_story))
|
if(!istype(viewing_story))
|
||||||
@@ -1513,7 +1509,7 @@
|
|||||||
src.admincaster_screen = 20
|
src.admincaster_screen = 20
|
||||||
src.admincaster_viewing_message = viewing_story
|
src.admincaster_viewing_message = viewing_story
|
||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_like"])
|
else if(href_list["ac_like"])
|
||||||
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
||||||
if((src.admincaster_signature in viewing_story.interacted) || !istype(viewing_story))
|
if((src.admincaster_signature in viewing_story.interacted) || !istype(viewing_story))
|
||||||
@@ -1521,7 +1517,7 @@
|
|||||||
viewing_story.interacted += src.admincaster_signature
|
viewing_story.interacted += src.admincaster_signature
|
||||||
viewing_story.likes += 1
|
viewing_story.likes += 1
|
||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_dislike"])
|
else if(href_list["ac_dislike"])
|
||||||
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
||||||
if((src.admincaster_signature in viewing_story.interacted) || !istype(viewing_story))
|
if((src.admincaster_signature in viewing_story.interacted) || !istype(viewing_story))
|
||||||
@@ -1529,7 +1525,7 @@
|
|||||||
viewing_story.interacted += src.admincaster_signature
|
viewing_story.interacted += src.admincaster_signature
|
||||||
viewing_story.dislikes += 1
|
viewing_story.dislikes += 1
|
||||||
src.access_news_network()
|
src.access_news_network()
|
||||||
|
|
||||||
else if(href_list["ac_setlikes"])
|
else if(href_list["ac_setlikes"])
|
||||||
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
var/datum/feed_message/viewing_story = locate(href_list["ac_story"])
|
||||||
if(!istype(viewing_story))
|
if(!istype(viewing_story))
|
||||||
|
|||||||
38
html/changelogs/Sindorman-spawn.yml
Normal file
38
html/changelogs/Sindorman-spawn.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
################################
|
||||||
|
# Example Changelog File
|
||||||
|
#
|
||||||
|
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||||
|
#
|
||||||
|
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||||
|
# When it is, any changes listed below will disappear.
|
||||||
|
#
|
||||||
|
# Valid Prefixes:
|
||||||
|
# bugfix
|
||||||
|
# wip (For works in progress)
|
||||||
|
# tweak
|
||||||
|
# soundadd
|
||||||
|
# sounddel
|
||||||
|
# rscadd (general adding of nice things)
|
||||||
|
# rscdel (general deleting of nice things)
|
||||||
|
# imageadd
|
||||||
|
# imagedel
|
||||||
|
# maptweak
|
||||||
|
# spellcheck (typo fixes)
|
||||||
|
# experiment
|
||||||
|
# balance
|
||||||
|
#################################
|
||||||
|
|
||||||
|
# Your name.
|
||||||
|
author: PoZe
|
||||||
|
|
||||||
|
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
# Any changes you've made. See valid prefix list above.
|
||||||
|
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||||
|
# SCREW THIS UP AND IT WON'T WORK.
|
||||||
|
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||||
|
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||||
|
changes:
|
||||||
|
- tweak: "Admin verb Create Object major flaw was optimized to display/search lists of all objects instantly, instead of freezing for 3-4 seconds."
|
||||||
|
- rscdel: "Since Create Object is exteremely fast now there is no need for Quick Create Object. So I removed it."
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<form name="spawner" action="byond://?src=/* ref src */" method="get">
|
<form name="spawner" action="byond://?src=/* ref src */" method="get">
|
||||||
<input type="hidden" name="src" value="/* ref src */">
|
<input type="hidden" name="src" value="/* ref src */">
|
||||||
|
<input type="hidden" name="action" value="object_list">
|
||||||
|
|
||||||
Type <input type="text" name="filter" value="" onkeypress="submitFirst(event)" style="width:280px;height:25"> <input type = "button" value = "Search" onclick = "updateSearch()" /><br>
|
Type <input type="text" name="filter" value="" onkeypress="submitFirst(event)" style="width:280px;height:25"> <input type = "button" value = "Search" onclick = "updateSearch()" /><br>
|
||||||
Offset: <input type="text" name="offset" value="x,y,z" style="width:250px">
|
Offset: <input type="text" name="offset" value="x,y,z" style="width:250px">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
Number: <input type="text" name="object_count" value="1" style="width:30px">
|
Number: <input type="text" name="object_count" value="1" style="width:30px">
|
||||||
Dir: <input type="text" name="object_dir" value="2" style="width:30px">
|
Dir: <input type="text" name="object_dir" value="2" style="width:30px">
|
||||||
Name: <input type="text" name="object_name" value="" style="width:180px"><br>
|
Name: <input type="text" name="object_name" value="" style="width:180px"><br>
|
||||||
Where:
|
Where:
|
||||||
<select name='object_where' style="width:320px">
|
<select name='object_where' style="width:320px">
|
||||||
<option value='onfloor'>On floor below own mob</option>
|
<option value='onfloor'>On floor below own mob</option>
|
||||||
@@ -43,13 +44,22 @@
|
|||||||
<option value='inmarked'>In marked object</option>
|
<option value='inmarked'>In marked object</option>
|
||||||
</select>
|
</select>
|
||||||
<br><br>
|
<br><br>
|
||||||
<select name="object_list" id="object_list" size="18" multiple style="width:98%"></select><br>
|
Number of matches: <input id="number" value="0" style="width:180px"><br>
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
<div id="selector_hs">
|
||||||
|
<select name="object_list" id="object_list" multiple size="20">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
<input type="submit" value="spawn">
|
<input type="submit" value="spawn">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
var old_search = "";
|
var old_search = "";
|
||||||
var object_list = document.spawner.object_list;
|
var object_list = document.spawner.object_list;
|
||||||
|
var object_list_container = document.getElementById('selector_hs');
|
||||||
var object_paths = null /* object types */;
|
var object_paths = null /* object types */;
|
||||||
var objects = object_paths == null ? new Array() : object_paths.split(";");
|
var objects = object_paths == null ? new Array() : object_paths.split(";");
|
||||||
|
|
||||||
@@ -58,23 +68,23 @@
|
|||||||
|
|
||||||
function populateList(from_list)
|
function populateList(from_list)
|
||||||
{
|
{
|
||||||
object_list.options.length = 0;
|
var newOpts = '';
|
||||||
|
|
||||||
var i;
|
var i;
|
||||||
for (i in from_list)
|
for (i in from_list)
|
||||||
{
|
{
|
||||||
var new_option = document.createElement("option");
|
newOpts += '<option value="' + from_list[i] + '">'
|
||||||
new_option.value = from_list[i];
|
+ from_list[i] + '</option>';
|
||||||
new_option.text = from_list[i];
|
|
||||||
object_list.options.add(new_option);
|
|
||||||
}
|
}
|
||||||
|
object_list_container.innerHTML = '<select name="object_list" id="object_list" multiple size="20">' +
|
||||||
|
newOpts + '</select>';
|
||||||
|
document.getElementById("number").value = from_list.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSearch()
|
function updateSearch()
|
||||||
{
|
{
|
||||||
if (old_search == document.spawner.filter.value)
|
if (old_search == document.spawner.filter.value)
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
old_search = document.spawner.filter.value;
|
old_search = document.spawner.filter.value;
|
||||||
@@ -93,6 +103,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
populateList(filtered);
|
populateList(filtered);
|
||||||
|
|
||||||
|
if (object_list.options.length)
|
||||||
|
object_list.options[0].selected = 'true';
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitFirst(event)
|
function submitFirst(event)
|
||||||
|
|||||||
Reference in New Issue
Block a user