mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-22 06:56:31 +00:00
## About The Pull Request Hello friends, I've been on a bit of a lighting kick recently, and I decided I clearly do not have enough things to work on as it is. This pr adds angle support to static lights, and a concepting/debug tool for playing with lights on a map. Let's start from first principles yeah? ### Why Angled Lights? Mappers, since they can't actually see a light's effect in editor, tend to go off gut. That gut is based more off what "makes sense" then how things actually work This means they'll overplace light sources, and also they tend to treat lights, particularly light "bars" (the bigger ones) as directional. So you'll have two lights on either sides of a pillar, lights inside a room with lights outside pointing out, etc.  This has annoying side effects. A lot of our map is overlit, to the point that knocking out a light does.... pretty much nothing. I find this sad, and would like to work to prevent it. I think dark and dim, while it does not suit the normal game, is amazing for vibes, and I want it to be easier to see that. Angled lights bring how lights work more in line with how mappers expect lights work, and avoids bleedover into rooms that shouldn't be bled into, working towards that goal of mine. ### How Angled Lights? This is more complex then you'd first think so we'll go step by step  Oh before we start, some catchup from the last time I touched lighting code. Instead of doing a lighting falloff calculation for each lighting corner (a block that represents the resolution of our lights) in view we instead generate cached lightsheets. These precalculate and store all possible falloffs for x and y distances from a source. This is very useful for angle work, since it makes it almost totally free. Atoms get 2 new values. light_angle and light_dir Light angle is the angle the light uses, and light_dir is a cardinal direction it displays in We take these values, and inside sheetbuilding do some optional angle work. getting the center angle, the angle of a pair of coords, and then the delta between them. This is then multiplied against the standard falloff formula, and job done. We do need some extra fenangling to make this all work nicely tho. We currently use a pixel turf var stored on the light source to do distance calculations. This is the turf we pretend the light source is on for visuals, most often used to make wall lights work nice. The trouble is it's not very granular, and doesn't always have the effect you might want. So, instead of generating and storing a pixel turf to do our distance calculations against, we store x and y offset variables. We use them to expand our working range and sheet size to ensure things visually make sense, and then offset any positions by them. I've added a way for sources to have opinions on their offsets too, and am using them for wall lights. This ensures the angle calculations don't make the wall behind a light fulldark, which would be silly. ### Debug Tool? In the interest of helping with that core problem, lights being complex to display, I've added a prototyping tool to the game. It's locked behind mapping verbs, and works about like this. Once the verb is activated, it iterates over all the sources in the world (except turfs because those are kinda silly), outlining and "freezing" them, preventing any future changes. Then, it adds 3 buttons to the owners of a light source.  The first button toggles the light on and off, as desired. The third allows you to move the source around, with a little targeting icon replacing your mouse The second tho, that's more interesting. The second button opens a debug menu for that light  There's a lot here, let's go through it. Bit on the left is a list of templates, which allow you to sample existing light types (No I have no idea why the background is fullwhite, need to work on that pre merge) You can choose one by clicking it, and hitting the upload button. This replaces your existing lighting values with the template's, alongside replacing its icon and icon state so it looks right. There are three types as of now, mostly for categorization. Bar, which are the larger typically stronger lights, Bulb, which are well, bulbs, and Misc which could be expanded, but currently just contains floor lights. Alongside that you can manually edit the power, range, color and angle of the focused light. I also have support for changing the direction of the light source, since anything that uses directional lighting would also tie light dir to it. This isn't *always* done tho, so I should maybe find a way to edit light dir too. My hope is this tool will allow for better concepting of a room's lights, and easier changing of individual object's light values to suit the right visuals. ### Lemon No Why What Ok so I applied angle lights to bars and bulbs, which means I am changing the lighting of pretty much every map in the codebase. I'm gonna uh, go check my work. Alongside this I intend to give lighting some depth. So if there's room to make a space warmer, or highlight light colors from other sources, I will do that. (Images as examples)  I also want to work on that other goal of mine, making breaking lights matter. So I'll be doing what I can to ensure you only need to break one light to make a meaningful change in the scene. This is semi complicated by one light source not ever actually reaching fullbright on its own, but we do what we must because we can.  I'm as I hope you know biased towards darker spaces, I think contrast has vibes. In particular I do not think strong lights really suit maintenance. Most of what is used there are bulbs, so I'm planning on replacing most uses with low power bulbs, to keep light impacts to rooms, alongside reducing the amount of lights placed in the main tunnels  **If you take issue with this methodology please do so NOW**, I don't want to have to do another pass over things. Oh also I'm saving station maps for last since ruins are less likely to get touched in mapping march and all. ### Misc + Finishing Thoughts Light templates support mirroring vars off typepaths using a subtype, which means all the templates added here do not require updating if the source type changes somehow. I'd like to expand the template list at some point, perhaps in future. I've opened this as a draft to make my intentions to make my changes to lights known, and to serve as motivation for all the map changes I need to do. ### Farish Future I'm unhappy with how we currently configure lights. I would like a system that more directly matches the idea of drawing falloff curves, along with allowing for different falloffs for different colors, alongside extending the idea to angle falloff. This would make out of engine lighting easier, allow for nicer looking lights (red to pink, blue to purple, etc), and improve accessibility by artists. This is slightly far off, because I have other obligations and it's kinda complicated, but I'd like to mention it cause it's one of my many pipedreams. ## Changelog 🆑 add: Added angle lighting, applies it to most wall lights! add: Adds a lighting prototyping tool, mappers go try it out (it's locked behind the mapping verb) /🆑 --------- Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
517 lines
19 KiB
Plaintext
517 lines
19 KiB
Plaintext
//- Are all the floors with or without air, as they should be? (regular or airless)
|
|
//- Does the area have an APC?
|
|
//- Does the area have an Air Alarm?
|
|
//- Does the area have a Request Console?
|
|
//- Does the area have lights?
|
|
//- Does the area have a light switch?
|
|
//- Does the area have enough intercoms?
|
|
//- Does the area have enough security cameras? (Use the 'Camera Range Display' verb under Debug)
|
|
//- Is the area connected to the scrubbers air loop?
|
|
//- Is the area connected to the vent air loop? (vent pumps)
|
|
//- Is everything wired properly?
|
|
//- Does the area have a fire alarm and firedoors?
|
|
//- Do all pod doors work properly?
|
|
//- Are accesses set properly on doors, pod buttons, etc.
|
|
//- Are all items placed properly? (not below vents, scrubbers, tables)
|
|
//- Does the disposal system work properly from all the disposal units in this room and all the units, the pipes of which pass through this room?
|
|
//- Check for any misplaced or stacked piece of pipe (air and disposal)
|
|
//- Check for any misplaced or stacked piece of wire
|
|
//- Identify how hard it is to break into the area and where the weak points are
|
|
//- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels.
|
|
|
|
GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list(
|
|
/client/proc/camera_view, //-errorage
|
|
/client/proc/sec_camera_report, //-errorage
|
|
/client/proc/intercom_view, //-errorage
|
|
/client/proc/air_status, //Air things
|
|
/client/proc/Cell, //More air things
|
|
/client/proc/atmosscan, //check plumbing
|
|
/client/proc/powerdebug, //check power
|
|
/client/proc/count_objects_on_z_level,
|
|
/client/proc/count_objects_all,
|
|
/client/proc/cmd_assume_direct_control, //-errorage
|
|
/client/proc/cmd_give_direct_control,
|
|
/client/proc/set_server_fps, //allows you to set the ticklag.
|
|
/client/proc/cmd_admin_grantfullaccess,
|
|
/client/proc/cmd_admin_areatest_all,
|
|
/client/proc/cmd_admin_areatest_station,
|
|
/client/proc/cmd_admin_areatest_station_no_maintenance,
|
|
#ifdef TESTING
|
|
/client/proc/see_dirty_varedits,
|
|
#endif
|
|
/client/proc/cmd_admin_rejuvenate,
|
|
/datum/admins/proc/show_traitor_panel,
|
|
/client/proc/disable_communication,
|
|
/client/proc/show_map_reports,
|
|
/client/proc/cmd_show_at_list,
|
|
/client/proc/cmd_show_at_markers,
|
|
/client/proc/manipulate_organs,
|
|
/client/proc/start_line_profiling,
|
|
/client/proc/stop_line_profiling,
|
|
/client/proc/show_line_profiling,
|
|
/client/proc/create_mapping_job_icons,
|
|
/client/proc/debug_z_levels,
|
|
/client/proc/place_ruin,
|
|
/client/proc/station_food_debug,
|
|
/client/proc/station_stack_debug,
|
|
/client/proc/check_for_obstructed_atmospherics,
|
|
/client/proc/modify_lights,
|
|
/client/proc/visualize_lights,
|
|
))
|
|
GLOBAL_PROTECT(admin_verbs_debug_mapping)
|
|
|
|
/client/proc/camera_view()
|
|
set category = "Mapping"
|
|
set name = "Camera Range Display"
|
|
|
|
var/on = FALSE
|
|
for(var/turf/T in world)
|
|
if(T.maptext)
|
|
on = TRUE
|
|
T.maptext = null
|
|
|
|
if(!on)
|
|
var/list/seen = list()
|
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
|
for(var/turf/T in C.can_see())
|
|
seen[T]++
|
|
for(var/turf/T in seen)
|
|
T.maptext = MAPTEXT(seen[T])
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Range") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
#ifdef TESTING
|
|
GLOBAL_LIST_EMPTY(dirty_vars)
|
|
|
|
/client/proc/see_dirty_varedits()
|
|
set category = "Mapping"
|
|
set name = "Dirty Varedits"
|
|
|
|
var/list/dat = list()
|
|
dat += "<h3>Abandon all hope ye who enter here</h3><br><br>"
|
|
for(var/thing in GLOB.dirty_vars)
|
|
dat += "[thing]<br>"
|
|
CHECK_TICK
|
|
var/datum/browser/popup = new(usr, "dirty_vars", "Dirty Varedits", 900, 750)
|
|
popup.set_content(dat.Join())
|
|
popup.open()
|
|
#endif
|
|
|
|
/client/proc/sec_camera_report()
|
|
set category = "Mapping"
|
|
set name = "Camera Report"
|
|
|
|
if(!Master)
|
|
tgui_alert(usr,"Master_controller not found.","Sec Camera Report")
|
|
return FALSE
|
|
|
|
var/list/obj/machinery/camera/CL = list()
|
|
|
|
for(var/obj/machinery/camera/C as anything in GLOB.cameranet.cameras)
|
|
CL += C
|
|
|
|
var/output = {"<B>Camera Abnormalities Report</B><HR>
|
|
<B>The following abnormalities have been detected. The ones in red need immediate attention: Some of those in black may be intentional.</B><BR><ul>"}
|
|
|
|
for(var/obj/machinery/camera/C1 in CL)
|
|
for(var/obj/machinery/camera/C2 in CL)
|
|
if(C1 != C2)
|
|
if(C1.c_tag == C2.c_tag)
|
|
output += "<li><font color='red'>c_tag match for cameras at [ADMIN_VERBOSEJMP(C1)] and [ADMIN_VERBOSEJMP(C2)] - c_tag is [C1.c_tag]</font></li>"
|
|
if(C1.loc == C2.loc && C1.dir == C2.dir && C1.pixel_x == C2.pixel_x && C1.pixel_y == C2.pixel_y)
|
|
output += "<li><font color='red'>FULLY overlapping cameras at [ADMIN_VERBOSEJMP(C1)] Networks: [json_encode(C1.network)] and [json_encode(C2.network)]</font></li>"
|
|
if(C1.loc == C2.loc)
|
|
output += "<li>Overlapping cameras at [ADMIN_VERBOSEJMP(C1)] Networks: [json_encode(C1.network)] and [json_encode(C2.network)]</li>"
|
|
var/turf/T = get_step(C1,C1.dir)
|
|
if(!T || !isturf(T) || !T.density )
|
|
if(!(locate(/obj/structure/grille) in T))
|
|
var/window_check = 0
|
|
for(var/obj/structure/window/W in T)
|
|
if (W.dir == turn(C1.dir,180) || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)) )
|
|
window_check = 1
|
|
break
|
|
if(!window_check)
|
|
output += "<li><font color='red'>Camera not connected to wall at [ADMIN_VERBOSEJMP(C1)] Network: [json_encode(C1.network)]</font></li>"
|
|
|
|
output += "</ul>"
|
|
usr << browse(output,"window=airreport;size=1000x500")
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Camera Report") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
/client/proc/intercom_view()
|
|
set category = "Mapping"
|
|
set name = "Intercom Range Display"
|
|
|
|
var/static/intercom_range_display_status = FALSE
|
|
intercom_range_display_status = !intercom_range_display_status //blame cyberboss if this breaks something //blamed
|
|
|
|
for(var/obj/effect/abstract/marker/intercom/marker in GLOB.all_abstract_markers)
|
|
qdel(marker)
|
|
|
|
if(intercom_range_display_status)
|
|
for(var/frequency in GLOB.all_radios)
|
|
for(var/obj/item/radio/intercom/intercom in GLOB.all_radios[frequency])
|
|
for(var/turf/turf in view(7,intercom.loc))
|
|
new /obj/effect/abstract/marker/intercom(turf)
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Intercom Range") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
/client/proc/show_map_reports()
|
|
set category = "Mapping"
|
|
set name = "Show map report list"
|
|
set desc = "Displays a list of map reports"
|
|
|
|
var/dat = {"<b>List of all map reports:</b><br>"}
|
|
|
|
for(var/datum/map_report/report as anything in GLOB.map_reports)
|
|
dat += "[report.tag] ([report.original_path]) - <a href='?src=[REF(report)];[HrefToken()];show=1'>View</a><br>"
|
|
|
|
usr << browse(dat, "window=map_reports")
|
|
|
|
/client/proc/cmd_show_at_list()
|
|
set category = "Mapping"
|
|
set name = "Show roundstart AT list"
|
|
set desc = "Displays a list of active turfs coordinates at roundstart"
|
|
|
|
var/dat = {"<b>Coordinate list of Active Turfs at Roundstart</b>
|
|
<br>Real-time Active Turfs list you can see in Air Subsystem at active_turfs var<br>"}
|
|
|
|
for(var/t in GLOB.active_turfs_startlist)
|
|
var/turf/T = t
|
|
dat += "[ADMIN_VERBOSEJMP(T)]\n"
|
|
dat += "<br>"
|
|
|
|
usr << browse(dat, "window=at_list")
|
|
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Roundstart Active Turfs") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
/client/proc/cmd_show_at_markers()
|
|
set category = "Mapping"
|
|
set name = "Show roundstart AT markers"
|
|
set desc = "Places a marker on all active-at-roundstart turfs"
|
|
|
|
var/count = 0
|
|
for(var/obj/effect/abstract/marker/at/AT in GLOB.all_abstract_markers)
|
|
qdel(AT)
|
|
count++
|
|
|
|
if(count)
|
|
to_chat(usr, "[count] AT markers removed.", confidential = TRUE)
|
|
else
|
|
for(var/t in GLOB.active_turfs_startlist)
|
|
new /obj/effect/abstract/marker/at(t)
|
|
count++
|
|
to_chat(usr, "[count] AT markers placed.", confidential = TRUE)
|
|
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Roundstart Active Turf Markers")
|
|
|
|
/client/proc/enable_mapping_verbs()
|
|
set category = "Debug"
|
|
set name = "Mapping verbs - Enable"
|
|
if(!check_rights(R_DEBUG))
|
|
return
|
|
remove_verb(src, /client/proc/enable_mapping_verbs)
|
|
add_verb(src, list(/client/proc/disable_mapping_verbs, GLOB.admin_verbs_debug_mapping))
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Enable Debug Verbs") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
/client/proc/disable_mapping_verbs()
|
|
set category = "Debug"
|
|
set name = "Mapping verbs - Disable"
|
|
remove_verb(src, list(/client/proc/disable_mapping_verbs, GLOB.admin_verbs_debug_mapping))
|
|
add_verb(src, /client/proc/enable_mapping_verbs)
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Disable Debug Verbs") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
/client/proc/count_objects_on_z_level()
|
|
set category = "Mapping"
|
|
set name = "Count Objects On Level"
|
|
var/level = input("Which z-level?","Level?") as text|null
|
|
if(!level)
|
|
return
|
|
var/num_level = text2num(level)
|
|
if(!num_level)
|
|
return
|
|
if(!isnum(num_level))
|
|
return
|
|
|
|
var/type_text = input("Which type path?","Path?") as text|null
|
|
if(!type_text)
|
|
return
|
|
var/type_path = text2path(type_text)
|
|
if(!type_path)
|
|
return
|
|
|
|
var/count = 0
|
|
|
|
var/list/atom/atom_list = list()
|
|
|
|
for(var/atom/A in world)
|
|
if(istype(A,type_path))
|
|
var/atom/B = A
|
|
while(!(isturf(B.loc)))
|
|
if(B?.loc)
|
|
B = B.loc
|
|
else
|
|
break
|
|
if(B)
|
|
if(B.z == num_level)
|
|
count++
|
|
atom_list += A
|
|
|
|
to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]", confidential = TRUE)
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Count Objects Zlevel") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
/client/proc/count_objects_all()
|
|
set category = "Mapping"
|
|
set name = "Count Objects All"
|
|
|
|
var/type_text = input("Which type path?","") as text|null
|
|
if(!type_text)
|
|
return
|
|
var/type_path = text2path(type_text)
|
|
if(!type_path)
|
|
return
|
|
|
|
var/count = 0
|
|
|
|
for(var/atom/A in world)
|
|
if(istype(A,type_path))
|
|
count++
|
|
|
|
to_chat(world, "There are [count] objects of type [type_path] in the game world", confidential = TRUE)
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Count Objects All") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
|
|
//This proc is intended to detect lag problems relating to communication procs
|
|
GLOBAL_VAR_INIT(say_disabled, FALSE)
|
|
/client/proc/disable_communication()
|
|
set category = "Mapping"
|
|
set name = "Disable all communication verbs"
|
|
|
|
GLOB.say_disabled = !GLOB.say_disabled
|
|
if(GLOB.say_disabled)
|
|
message_admins("[key] used 'Disable all communication verbs', killing all communication methods.")
|
|
else
|
|
message_admins("[key] used 'Disable all communication verbs', restoring all communication methods.")
|
|
|
|
//This generates the icon states for job starting location landmarks.
|
|
/client/proc/create_mapping_job_icons()
|
|
set name = "Generate job landmarks icons"
|
|
set category = "Mapping"
|
|
var/icon/final = icon()
|
|
var/mob/living/carbon/human/dummy/D = new(locate(1,1,1)) //spawn on 1,1,1 so we don't have runtimes when items are deleted
|
|
D.setDir(SOUTH)
|
|
for(var/job in subtypesof(/datum/job))
|
|
var/datum/job/JB = new job
|
|
switch(JB.title)
|
|
if(JOB_AI)
|
|
final.Insert(icon('icons/mob/silicon/ai.dmi', "ai", SOUTH, 1), "AI")
|
|
if(JOB_CYBORG)
|
|
final.Insert(icon('icons/mob/silicon/robots.dmi', "robot", SOUTH, 1), "Cyborg")
|
|
else
|
|
for(var/obj/item/I in D)
|
|
qdel(I)
|
|
randomize_human(D)
|
|
D.dress_up_as_job(JB, TRUE)
|
|
var/icon/I = icon(getFlatIcon(D), frame = 1)
|
|
final.Insert(I, JB.title)
|
|
qdel(D)
|
|
//Also add the x
|
|
for(var/x_number in 1 to 4)
|
|
final.Insert(icon('icons/hud/screen_gen.dmi', "x[x_number == 1 ? "" : x_number]"), "x[x_number == 1 ? "" : x_number]")
|
|
fcopy(final, "icons/mob/landmarks.dmi")
|
|
|
|
/client/proc/debug_z_levels()
|
|
set name = "Debug Z-Levels"
|
|
set category = "Mapping"
|
|
|
|
to_chat(src, examine_block(gather_z_level_information(append_grid = TRUE)), confidential = TRUE)
|
|
|
|
/// Returns all necessary z-level information. Argument `append_grid` allows the user to see a table showing all of the z-level linkages, which is only visible and useful in-game.
|
|
/proc/gather_z_level_information(append_grid = FALSE)
|
|
var/list/messages = list()
|
|
|
|
var/list/z_list = SSmapping.z_list
|
|
messages += "\n<b>World</b>: [world.maxx] x [world.maxy] x [world.maxz]\n"
|
|
|
|
var/list/linked_levels = list()
|
|
var/min_x = INFINITY
|
|
var/min_y = INFINITY
|
|
var/max_x = -INFINITY
|
|
var/max_y = -INFINITY
|
|
|
|
for(var/z in 1 to max(world.maxz, z_list.len))
|
|
if (z > z_list.len)
|
|
messages += "<b>[z]</b>: Unmanaged (out of bounds)"
|
|
continue
|
|
var/datum/space_level/level = z_list[z]
|
|
if (!level)
|
|
messages += "<b>[z]</b>: Unmanaged (null)"
|
|
continue
|
|
var/linkage
|
|
switch (level.linkage)
|
|
if (UNAFFECTED)
|
|
linkage = "no linkage"
|
|
if (SELFLOOPING)
|
|
linkage = "self-looping"
|
|
if (CROSSLINKED)
|
|
linkage = "linked at ([level.xi], [level.yi])"
|
|
linked_levels += level
|
|
min_x = min(min_x, level.xi)
|
|
min_y = min(min_y, level.yi)
|
|
max_x = max(max_x, level.xi)
|
|
max_y = max(max_y, level.yi)
|
|
else
|
|
linkage = "unknown linkage '[level.linkage]'"
|
|
|
|
messages += "<b>[z]</b>: [level.name], [linkage], traits: [json_encode(level.traits)]"
|
|
if (level.z_value != z)
|
|
messages += "-- z_value is [level.z_value], should be [z]"
|
|
if (level.name == initial(level.name))
|
|
messages += "-- name not set"
|
|
if (z > world.maxz)
|
|
messages += "-- exceeds max z"
|
|
|
|
var/grid[max_x - min_x + 1][max_y - min_y + 1]
|
|
for(var/datum/space_level/linked_level in linked_levels)
|
|
grid[linked_level.xi - min_x + 1][linked_level.yi - min_y + 1] = linked_level.z_value
|
|
|
|
if(append_grid)
|
|
messages += "<br><table border='1'>"
|
|
for(var/y in max_y to min_y step -1)
|
|
var/list/part = list()
|
|
for(var/x in min_x to max_x)
|
|
part += "[grid[x - min_x + 1][y - min_y + 1]]"
|
|
messages += "<tr><td>[part.Join("</td><td>")]</td></tr>"
|
|
messages += "</table>"
|
|
|
|
return messages.Join("\n")
|
|
|
|
/client/proc/station_food_debug()
|
|
set name = "Count Station Food"
|
|
set category = "Mapping"
|
|
var/list/foodcount = list()
|
|
for(var/obj/item/food/fuck_me in world)
|
|
var/turf/location = get_turf(fuck_me)
|
|
if(!location || SSmapping.level_trait(location.z, ZTRAIT_STATION))
|
|
continue
|
|
LAZYADDASSOC(foodcount, fuck_me.type, 1)
|
|
|
|
var/table_header = "<tr><th>Name</th> <th>Type</th> <th>Amount</th>"
|
|
var/table_contents = list()
|
|
for(var/atom/type as anything in foodcount)
|
|
var/foodname = initial(type.name)
|
|
var/count = foodcount[type]
|
|
table_contents += "<tr><td>[foodname]</td> <td>[type]</td> <td>[count]</td></tr>"
|
|
|
|
var/page_style = "<style>table, th, td {border: 1px solid black;border-collapse: collapse;}</style>"
|
|
var/page_contents = "[page_style]<table style=\"width:100%\">[table_header][jointext(table_contents, "")]</table>"
|
|
var/datum/browser/popup = new(mob, "fooddebug", "Station Food Count", 600, 400)
|
|
popup.set_content(page_contents)
|
|
popup.open()
|
|
|
|
/client/proc/station_stack_debug()
|
|
set name = "Count Station Stacks"
|
|
set category = "Mapping"
|
|
var/list/stackcount = list()
|
|
for(var/obj/item/stack/fuck_me in world)
|
|
var/turf/location = get_turf(fuck_me)
|
|
if(!location || SSmapping.level_trait(location.z, ZTRAIT_STATION))
|
|
continue
|
|
LAZYADDASSOC(stackcount, fuck_me.type, fuck_me.amount)
|
|
|
|
var/table_header = "<tr><th>Name</th> <th>Type</th> <th>Amount</th>"
|
|
var/table_contents = list()
|
|
for(var/atom/type as anything in stackcount)
|
|
var/stackname = initial(type.name)
|
|
var/count = stackcount[type]
|
|
table_contents += "<tr><td>[stackname]</td> <td>[type]</td> <td>[count]</td></tr>"
|
|
|
|
var/page_style = "<style>table, th, td {border: 1px solid black;border-collapse: collapse;}</style>"
|
|
var/page_contents = "[page_style]<table style=\"width:100%\">[table_header][jointext(table_contents, "")]</table>"
|
|
var/datum/browser/popup = new(mob, "stackdebug", "Station Stack Count", 600, 400)
|
|
popup.set_content(page_contents)
|
|
popup.open()
|
|
|
|
/// Check all tiles with a vent or scrubber on it and ensure that nothing is covering it up.
|
|
/client/proc/check_for_obstructed_atmospherics()
|
|
set name = "Check For Obstructed Atmospherics"
|
|
set category = "Mapping"
|
|
if(!holder)
|
|
to_chat(src, "Only administrators may use this command.", confidential = TRUE)
|
|
return
|
|
message_admins(span_adminnotice("[key_name_admin(usr)] is checking for obstructed atmospherics through the debug command."))
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Check For Obstructed Atmospherics") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
|
|
|
var/list/results = list()
|
|
|
|
results += "<h2><b>Anything that is considered to aesthetically obstruct an atmospherics machine (vent, scrubber, port) is listed below.</b> Please re-arrange to accomodate for this.</h2><br>"
|
|
|
|
// Ignore out stuff we see in normal and standard mapping that we don't care about (false alarms). Typically stuff that goes directionally off turfs or other undertile objects that we don't want to care about.
|
|
var/list/ignore_list = list(
|
|
/obj/effect,
|
|
/obj/item/shard, // it's benign enough to where we don't need to error, yet common enough to filter. fuck.
|
|
/obj/machinery/airalarm,
|
|
/obj/machinery/atmospherics/components/unary, //don't wanna flag on the vent or scrubber itself.
|
|
/obj/machinery/atmospherics/pipe,
|
|
/obj/machinery/button,
|
|
/obj/machinery/camera,
|
|
/obj/machinery/door_buttons,
|
|
/obj/machinery/door/window, // i kind of wish we didn't have to do it but we have some particularly compact areas that we need to be wary of
|
|
/obj/machinery/duct,
|
|
/obj/machinery/firealarm,
|
|
/obj/machinery/flasher,
|
|
/obj/machinery/light_switch,
|
|
/obj/machinery/light,
|
|
/obj/machinery/navbeacon,
|
|
/obj/machinery/newscaster,
|
|
/obj/machinery/portable_atmospherics,
|
|
/obj/machinery/power/apc,
|
|
/obj/machinery/power/terminal,
|
|
/obj/machinery/sparker,
|
|
/obj/machinery/status_display,
|
|
/obj/machinery/turretid,
|
|
/obj/structure/cable,
|
|
/obj/structure/disposalpipe,
|
|
/obj/structure/extinguisher_cabinet,
|
|
/obj/structure/lattice,
|
|
/obj/structure/sign,
|
|
/obj/structure/urinal, // the reason why this one gets to live and not the shower/sink is because it's pretty firmly on a wall.
|
|
/obj/structure/window/reinforced,
|
|
)
|
|
|
|
for(var/turf/iterated_turf in world)
|
|
var/obj/machinery/atmospherics/components/unary/device = locate() in iterated_turf.contents
|
|
if(!device)
|
|
continue
|
|
var/list/obj/obstruction = locate(/obj) in iterated_turf.contents
|
|
if(!is_type_in_list(obstruction, ignore_list))
|
|
results += "There is an obstruction on top of an atmospherics machine at: [ADMIN_VERBOSEJMP(iterated_turf)].<br>"
|
|
|
|
if(results.len == 1) // only the header is in the list, we're good
|
|
to_chat(src, "No obstructions detected.", confidential = TRUE)
|
|
else
|
|
var/datum/browser/popup = new(usr, "atmospherics_obstructions", "Atmospherics Obstructions", 900, 750)
|
|
popup.set_content(results.Join())
|
|
popup.open()
|
|
|
|
/client/proc/modify_lights()
|
|
set name = "Toggle Light Debug"
|
|
set category = "Mapping"
|
|
if(!check_rights(R_DEBUG))
|
|
return
|
|
if(GLOB.light_debug_enabled)
|
|
undebug_sources()
|
|
return
|
|
|
|
for(var/obj/machinery/light/fix_up as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/light))
|
|
// Only fix lights that started out fixed
|
|
if(initial(fix_up.status) == LIGHT_OK)
|
|
fix_up.fix()
|
|
CHECK_TICK
|
|
debug_sources()
|
|
|
|
/client/proc/visualize_lights()
|
|
set name = "Visualize Lighting Corners"
|
|
set category = "Mapping"
|
|
if(!check_rights(R_DEBUG))
|
|
return
|
|
|
|
display_corners()
|