Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a freeze when opening the 'Create Object' panel #5125

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/modules/admin/create_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
create_mob_html = replacetext(create_mob_html, "null /* object types */", "\"[mobjs]\"")
create_mob_html = replacetext(create_mob_html, "/* href token */", RawHrefToken(forceGlobal = TRUE))

show_browser(user, replacetext(create_mob_html, "/* ref src */", "\ref[src]"), "Create Mob", "create_mob", "size=425x475")
show_browser(user, replacetext(create_mob_html, "/* ref src */", "\ref[src]"), "Create Mob", "create_mob", "size=450x525")
4 changes: 2 additions & 2 deletions code/modules/admin/create_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
create_object_html = replacetext(create_object_html, "null /* object types */", "\"[objectjs]\"")
create_object_html = replacetext(create_object_html, "/* href token */", RawHrefToken(forceGlobal = TRUE))

show_browser(user, replacetext(create_object_html, "/* ref src */", "\ref[src]"), "Create Object", "create_object", "size=425x475")
show_browser(user, replacetext(create_object_html, "/* ref src */", "\ref[src]"), "Create Object", "create_object", "size=450x525")


/datum/admins/proc/quick_create_object(mob/user)
Expand Down Expand Up @@ -46,4 +46,4 @@
quick_create_object_html = replacetext(quick_create_object_html, "null /* object types */", "\"[objectjs]\"")
quick_create_object_html = replacetext(quick_create_object_html, "/* href token */", RawHrefToken(forceGlobal = TRUE))

show_browser(user, replacetext(quick_create_object_html, "/* ref src */", "\ref[src]"), "Quick Create Object", "quick_create_object", "size=425x475")
show_browser(user, replacetext(quick_create_object_html, "/* ref src */", "\ref[src]"), "Quick Create Object", "quick_create_object", "size=450x525")
2 changes: 1 addition & 1 deletion code/modules/admin/create_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
create_turf_html = replacetext(create_turf_html, "null /* object types */", "\"[turfjs]\"")
create_turf_html = replacetext(create_turf_html, "/* href token */", RawHrefToken(forceGlobal = TRUE))

show_browser(usr, replacetext(create_turf_html, "/* ref src */", "\ref[src]"), "Create Turf", "create_turf", "size=425x475")
show_browser(usr, replacetext(create_turf_html, "/* ref src */", "\ref[src]"), "Create Turf", "create_turf", "size=450x525")
13 changes: 7 additions & 6 deletions html/create_object.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@
<form name="spawner" action="byond://?src=/* ref src */" method="get">
<input type="hidden" name="src" value="/* ref src */">
<input type="hidden" name="admin_token" value="/* href token */">
Type <input type="text" name="filter" value="" onkeypress="submitFirst(event)" style="width:350px"> <input
Type: <input type="text" name="filter" onkeypress="submitFirst(event)" style="width:350px"> <input
type="button" class="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">
A <input type="radio" class="radioButton" name="offset_type" value="absolute">
R <input type="radio" class="radioButton" name="offset_type" value="relative" checked="checked"><br>

Number: <input type="text" name="object_count" value="1" 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" style="width:180px"><br>

Where:
<select name='object_where' style="width:320px">
<option value='onfloor'>On floor below own mob</option>
<!-- <option value='inhand'>In own mob's hand</option> -->
<option value='inmarked'>In marked object</option>
</select>
<br><br>

<select name="object_list" size="18" multiple style="width:98%"></select><br>
<input type="submit" class="button" value="Spawn">
</form>
Expand All @@ -37,13 +39,11 @@
var objects = object_paths == null ? new Array() : object_paths.split(";");

document.spawner.filter.focus();
populateList(objects);

function populateList(from_list) {
object_list.options.length = 0;

var i;
for (i in from_list) {
for (var i in from_list) {
var new_option = document.createElement("option");
new_option.value = from_list[i];
new_option.text = from_list[i];
Expand Down Expand Up @@ -71,6 +71,7 @@
return false;
}

// Carriage return
if (event.keyCode == 13 || event.which == 13) {
object_list.options[0].selected = 'true';
}
Expand Down
Loading