Blueprints tgui (#82565)

## About The Pull Request

Blueprints now use a TGUI panel instead of the old HTML one.
Also did general code improvement and maintaining to blueprints in
general and also destroyed the ``areaeditor`` level, repathing it to
just 'blueprints'.
Also adds a sound when you look at structural data cause why not

Video demonstration:

https://github.com/tgstation/tgstation/assets/53777086/861773fd-3d57-472d-bc94-d67b0d4f1dbd

The 4 blueprint types:

![image](https://github.com/tgstation/tgstation/assets/53777086/bfd68eb5-c430-4608-a3f7-d6ac86727882)

## Why It's Good For The Game

Another HTML menu dead underground.
This is more responsive and doesn't require constant updating to see
which area you're in, feels less OOC (instead of saying "the blueprints
say", just say it, you ARE the blueprints).

Like, come on

![image](https://github.com/tgstation/tgstation/assets/53777086/fcf1b8b6-37c3-4c94-969f-3b121c983dc0)

Look at all this wasted space

![image](https://github.com/tgstation/tgstation/assets/53777086/1d3e61cd-bc56-4280-a3bb-0c66604e75b3)

## Changelog

🆑
refactor: Blueprints now use TGUI.
qol: Blueprints can now be used while lying down.
/🆑
This commit is contained in:
John Willard
2024-04-10 11:55:29 -07:00
committed by GitHub
parent 561002a006
commit 430896b5cf
25 changed files with 481 additions and 244 deletions
@@ -337,7 +337,7 @@
/area/ruin/powered/golem_ship)
"un" = (
/obj/structure/table/wood,
/obj/item/areaeditor/blueprints/golem{
/obj/item/blueprints/golem{
pixel_y = 3;
pixel_x = -2
},
+1 -1
View File
@@ -115,7 +115,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define UNIQUE_AREA (1<<8)
/// If people are allowed to suicide in it. Mostly for OOC stuff like minigames
#define BLOCK_SUICIDE (1<<9)
/// Can the Xenobio management console transverse this area by default?
/// If set, this area will be innately traversable by Xenobiology camera consoles.
#define XENOBIOLOGY_COMPATIBLE (1<<10)
/// If Abductors are unable to teleport in with their observation console
#define ABDUCTOR_PROOF (1<<11)
-5
View File
@@ -1,5 +0,0 @@
// Used to edit areas.
#define AREA_ERRNONE 0
#define AREA_STATION 1
#define AREA_SPACE 2
#define AREA_SPECIAL 3
+48
View File
@@ -293,3 +293,51 @@ GLOBAL_LIST_INIT(typecache_powerfailure_safe_areas, typecacheof(list(
mobs_in_area += mob
break
return mobs_in_area
/**
* rename_area
* Renames an area to the given new name, updating all machines' names and firedoors
* to properly ensure alarms and machines are named correctly at all times.
* Args:
* - area_to_rename: The area that's being renamed.
* - new_name: The name we're changing said area to.
*/
/proc/rename_area(area/area_to_rename, new_name)
var/prevname = "[area_to_rename.name]"
set_area_machinery_title(area_to_rename, new_name, prevname)
area_to_rename.name = new_name
require_area_resort() //area renamed so resort the names
if(LAZYLEN(area_to_rename.firedoors))
for(var/obj/machinery/door/firedoor/area_firedoors as anything in area_to_rename.firedoors)
area_firedoors.CalculateAffectingAreas()
area_to_rename.update_areasize()
return TRUE
/**
* Renames all machines in a defined area from the old title to the new title.
* Used when renaming an area to ensure that all machiens are labeled the new area's machine.
* Args:
* - area_renaming: The area being renamed, which we'll check turfs from to rename machines in.
* - title: The new name of the area that we're swapping into.
* - oldtitle: The old name of the area that we're replacing text from.
*/
/proc/set_area_machinery_title(area/area_renaming, title, oldtitle)
if(!oldtitle) // or replacetext goes to infinite loop
return
//stuff tied to the area to rename
var/static/list/to_rename = typecacheof(list(
/obj/machinery/airalarm,
/obj/machinery/atmospherics/components/unary/vent_scrubber,
/obj/machinery/atmospherics/components/unary/vent_pump,
/obj/machinery/door,
/obj/machinery/firealarm,
/obj/machinery/light_switch,
/obj/machinery/power/apc,
/obj/machinery/camera,
))
for(var/list/zlevel_turfs as anything in area_renaming.get_zlevel_turf_lists())
for(var/turf/area_turf as anything in zlevel_turfs)
for(var/obj/machine as anything in typecache_filter_list(area_turf.contents, to_rename))
machine.name = replacetext(machine.name, oldtitle, title)
+17
View File
@@ -413,3 +413,20 @@ Turf and target are separate in case you want to teleport some distance from a t
if(locate(type_to_find) in location)
return TRUE
return FALSE
/**
* get_blueprint_data
* Gets a list of turfs around a central turf and gets the blueprint data in a list
* Args:
* - central_turf: The center turf we're getting data from.
* - viewsize: The viewsize we're getting the turfs around central_turf of.
*/
/proc/get_blueprint_data(turf/central_turf, viewsize)
var/list/blueprint_data_returned = list()
var/list/dimensions = getviewsize(viewsize)
var/horizontal_radius = dimensions[1] / 2
var/vertical_radius = dimensions[2] / 2
for(var/turf/nearby_turf as anything in RECT_TURFS(horizontal_radius, vertical_radius, central_turf))
if(nearby_turf.blueprint_data)
blueprint_data_returned += nearby_turf.blueprint_data
return blueprint_data_returned
+1 -1
View File
@@ -258,7 +258,7 @@
return TRUE
// Station blueprints do that too, but only if the wires are not randomized.
if(user.is_holding_item_of_type(/obj/item/areaeditor/blueprints) && !randomize)
if(user.is_holding_item_of_type(/obj/item/blueprints) && !randomize)
return TRUE
return FALSE
+4 -4
View File
@@ -525,7 +525,7 @@
/datum/objective_item/steal/blueprints
name = "the station blueprints"
targetitem = /obj/item/areaeditor/blueprints
targetitem = /obj/item/blueprints
excludefromjob = list(JOB_CHIEF_ENGINEER)
item_owner = list(JOB_CHIEF_ENGINEER)
altitems = list(/obj/item/photo)
@@ -533,11 +533,11 @@
difficulty = 3
steal_hint = "The blueprints of the station, found in the Chief Engineer's locker, or on their person. A picture may suffice."
/obj/item/areaeditor/blueprints/add_stealing_item_objective()
return add_item_to_steal(src, /obj/item/areaeditor/blueprints)
/obj/item/blueprints/add_stealing_item_objective()
return add_item_to_steal(src, /obj/item/blueprints)
/datum/objective_item/steal/blueprints/check_special_completion(obj/item/I)
if(istype(I, /obj/item/areaeditor/blueprints))
if(istype(I, /obj/item/blueprints))
return TRUE
if(istype(I, /obj/item/photo))
var/obj/item/photo/P = I
+3 -2
View File
@@ -36,8 +36,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)
if(!istype(sign))
return
var/area/bar_area = get_area(src)
if(change_area_name && sign.rename_area)
rename_area(src, sign.name)
rename_area(bar_area, sign.name)
chosen_sign = sign
update_appearance()
@@ -152,7 +153,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)
/obj/machinery/barsign/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/areaeditor/blueprints) && !change_area_name)
if(istype(attacking_item, /obj/item/blueprints) && !change_area_name)
if(!panel_open)
balloon_alert(user, "open the panel first!")
return TRUE
+205 -204
View File
@@ -1,254 +1,255 @@
/obj/item/areaeditor
name = "area modification item"
///The area is a "Station" area, showing no special text.
#define AREA_STATION 1
///The area is in outdoors (lavaland/icemoon/jungle/space), therefore unclaimed territories.
#define AREA_OUTDOORS 2
///The area is special (shuttles/centcom), therefore can't be claimed.
#define AREA_SPECIAL 3
///The blueprints are currently reading the list of all wire datums.
#define LEGEND_VIEWING_LIST "watching_list"
///The blueprints are on the main page.
#define LEGEND_OFF "off"
/**
* Blueprints
* Used to see the wires of machines on the station, the roundstart layout of pipes/cables/tubes,
* as well as allowing you to rename existing areas and create new ones.
* Used by the station, cyborgs, and golems.
*/
/obj/item/blueprints
name = "station blueprints"
desc = "Blueprints of the station. There is a \"Classified\" stamp and several coffee stains on it."
icon = 'icons/obj/scrolls.dmi'
icon_state = "blueprints"
inhand_icon_state = "blueprints"
attack_verb_continuous = list("attacks", "baps", "hits")
attack_verb_simple = list("attack", "bap", "hit")
var/fluffnotice = "Nobody's gonna read this stuff!"
var/in_use = FALSE
///When using it to create a new area, this will be its type.
var/new_area_type = /area
/obj/item/areaeditor/attack_self(mob/user)
add_fingerprint(user)
. = "<BODY><HTML><head><title>[src]</title></head> \
<h2>[station_name()] [src.name]</h2> \
<small>[fluffnotice]</small><hr>"
switch(get_area_type())
if(AREA_SPACE)
. += "<p>According to the [src.name], you are now in an unclaimed territory.</p>"
if(AREA_SPECIAL)
. += "<p>This place is not noted on the [src.name].</p>"
. += "<p><a href='?src=[REF(src)];create_area=1'>Create or modify an existing area</a></p>"
/obj/item/areaeditor/Topic(href, href_list)
if(..())
return TRUE
if(!usr.can_perform_action(src) || usr != loc)
usr << browse(null, "window=blueprints")
return TRUE
if(href_list["create_area"])
if(in_use)
return
var/area/A = get_area(usr)
if(A.area_flags & NOTELEPORT)
to_chat(usr, span_warning("You cannot edit restricted areas."))
return
in_use = TRUE
create_area(usr, new_area_type)
in_use = FALSE
updateUsrDialog()
//Station blueprints!!!
/obj/item/areaeditor/blueprints
name = "station blueprints"
desc = "Blueprints of the station. There is a \"Classified\" stamp and several coffee stains on it."
icon = 'icons/obj/scrolls.dmi'
icon_state = "blueprints"
fluffnotice = "Property of Nanotrasen. For heads of staff only. Store in high-secure storage."
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
interaction_flags_atom = parent_type::interaction_flags_atom | INTERACT_ATOM_ALLOW_USER_LOCATION | INTERACT_ATOM_IGNORE_MOBILITY
///A string of flavortext to be displayed at the top of the UI, related to the type of blueprints we are.
var/fluffnotice = "Property of Nanotrasen. For heads of staff only. Store in high-secure storage."
///Boolean on whether the blueprints are currently being used, which prevents double-using them to rename/create areas.
var/in_use = FALSE
///The type of area we'll create when we make a new area. This is a typepath.
var/area/new_area_type = /area
///The legend type the blueprints are currently looking at, which is either modularly
///set by wires datums, the main page, or an overview of them all.
var/legend_viewing = LEGEND_OFF
///List of images that we're showing to a client, used for showing blueprint data.
var/list/image/showing = list()
///The client that is being shown the list of 'showing' images of blueprint data.
var/client/viewing
var/legend = FALSE //Viewing the wire legend
/obj/item/areaeditor/blueprints/Destroy()
/obj/item/blueprints/Destroy()
clear_viewer()
return ..()
/obj/item/areaeditor/blueprints/attack_self(mob/user)
/obj/item/blueprints/dropped(mob/user)
. = ..()
if(!legend)
var/area/A = get_area(user)
if(get_area_type() == AREA_STATION)
. += "<p>According to \the [src], you are now in <b>\"[html_encode(A.name)]\"</b>.</p>"
. += "<p><a href='?src=[REF(src)];edit_area=1'>Change area name</a></p>"
. += "<p><a href='?src=[REF(src)];view_legend=1'>View wire colour legend</a></p>"
if(!viewing)
. += "<p><a href='?src=[REF(src)];view_blueprints=1'>View structural data</a></p>"
else
. += "<p><a href='?src=[REF(src)];refresh=1'>Refresh structural data</a></p>"
. += "<p><a href='?src=[REF(src)];hide_blueprints=1'>Hide structural data</a></p>"
else
if(legend == TRUE)
. += "<a href='?src=[REF(src)];exit_legend=1'><< Back</a>"
. += view_wire_devices(user);
else
//legend is a wireset
. += "<a href='?src=[REF(src)];view_legend=1'><< Back</a>"
. += view_wire_set(user, legend)
var/datum/browser/popup = new(user, "blueprints", "[src]", 700, 500)
popup.set_content(.)
popup.open()
onclose(user, "blueprints")
clear_viewer()
legend_viewing = LEGEND_OFF
/obj/item/blueprints/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Blueprints", name)
ui.open()
/obj/item/areaeditor/blueprints/Topic(href, href_list)
if(..())
/obj/item/blueprints/ui_state(mob/user)
return GLOB.inventory_state
/obj/item/blueprints/ui_data(mob/user)
var/list/data = list()
switch(get_area_type(user))
if(AREA_OUTDOORS)
data["area_notice"] = "You are in unclaimed territory."
if(AREA_SPECIAL)
data["area_notice"] = "This area has no notes."
else
var/area/current_area = get_area(user)
data["area_notice"] = "You are now in \the [current_area.name]"
var/area/area_inside_of = get_area(user)
data["area_name"] = html_encode(area_inside_of.name)
data["legend"] = legend_viewing
data["viewing"] = !!viewing
data["wire_data"] = list()
if(legend_viewing != LEGEND_VIEWING_LIST && legend_viewing != LEGEND_OFF)
for(var/device in GLOB.wire_color_directory)
if("[device]" != legend_viewing)
continue
data["wires_name"] = GLOB.wire_name_directory[device]
for(var/individual_color in GLOB.wire_color_directory[device])
var/wire_name = GLOB.wire_color_directory[device][individual_color]
if(findtext(wire_name, WIRE_DUD_PREFIX)) //don't show duds
continue
data["wire_data"] += list(list(
"color" = individual_color,
"message" = wire_name,
))
return data
/obj/item/blueprints/ui_static_data(mob/user)
var/list/data = list()
data["legend_viewing_list"] = LEGEND_VIEWING_LIST
data["legend_off"] = LEGEND_OFF
data["fluff_notice"] = fluffnotice
data["station_name"] = station_name()
data["wire_devices"] = list()
for(var/wireset in GLOB.wire_color_directory)
data["wire_devices"] += list(list(
"name" = GLOB.wire_name_directory[wireset],
"ref" = wireset,
))
return data
/obj/item/blueprints/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
if(href_list["edit_area"])
if(get_area_type() != AREA_STATION)
return
if(in_use)
return
in_use = TRUE
edit_area()
in_use = FALSE
if(href_list["exit_legend"])
legend = FALSE;
if(href_list["view_legend"])
legend = TRUE;
if(href_list["view_wireset"])
legend = href_list["view_wireset"];
if(href_list["view_blueprints"])
set_viewer(usr, span_notice("You flip the blueprints over to view the complex information diagram."))
if(href_list["hide_blueprints"])
clear_viewer(usr,span_notice("You flip the blueprints over to view the simple information diagram."))
if(href_list["refresh"])
clear_viewer(usr)
set_viewer(usr)
attack_self(usr) //this is not the proper way, but neither of the old update procs work! it's too ancient and I'm tired shush.
var/mob/user = ui.user
if(!user.can_perform_action(src, NEED_LITERACY|NEED_DEXTERITY|NEED_HANDS|ALLOW_RESTING))
return TRUE
/obj/item/areaeditor/blueprints/proc/get_images(turf/central_turf, viewsize)
. = list()
var/list/dimensions = getviewsize(viewsize)
var/horizontal_radius = dimensions[1] / 2
var/vertical_radius = dimensions[2] / 2
for(var/turf/nearby_turf as anything in RECT_TURFS(horizontal_radius, vertical_radius, central_turf))
if(nearby_turf.blueprint_data)
. += nearby_turf.blueprint_data
/obj/item/areaeditor/blueprints/proc/set_viewer(mob/user, message = "")
if(user?.client)
if(viewing)
switch(action)
if("create_area")
if(in_use)
return
in_use = TRUE
create_area(user, new_area_type)
in_use = FALSE
if("edit_area")
if(get_area_type(user) != AREA_STATION)
return
if(in_use)
return
in_use = TRUE
edit_area(user)
in_use = FALSE
if("exit_legend")
legend_viewing = LEGEND_OFF
if("view_legend")
legend_viewing = LEGEND_VIEWING_LIST
if("view_wireset")
var/setting_wireset = params["view_wireset"]
for(var/device in GLOB.wire_color_directory)
if("[device]" == setting_wireset) //I know... don't change it...
legend_viewing = setting_wireset
return TRUE
if("view_blueprints")
playsound(src, 'sound/items/paper_flip.ogg', 40, TRUE)
user.balloon_alert_to_viewers("flips blueprints over")
set_viewer(user)
if("hide_blueprints")
playsound(src, 'sound/items/paper_flip.ogg', 40, TRUE)
user.balloon_alert_to_viewers("flips blueprints over")
clear_viewer()
viewing = user.client
showing = get_images(get_turf(viewing.eye || user), viewing.view)
viewing.images |= showing
if(message)
to_chat(user, message)
if("refresh")
playsound(src, 'sound/items/paper_flip.ogg', 40, TRUE)
clear_viewer()
set_viewer(user)
return TRUE
/obj/item/areaeditor/blueprints/proc/clear_viewer(mob/user, message = "")
/**
* Sets the user's client as the person viewing blueprint data, and builds blueprint data
* around the user.
* Args:
* - user: The person who's client we're giving images to.
*/
/obj/item/blueprints/proc/set_viewer(mob/user)
if(!user || !user.client)
return
if(viewing)
clear_viewer()
viewing = user.client
showing = get_blueprint_data(get_turf(viewing.eye || user), viewing.view)
viewing.images |= showing
/**
* Clears the client we're showig images to and deletes the images of blueprint data
* we made to show them.
*/
/obj/item/blueprints/proc/clear_viewer()
if(viewing)
viewing.images -= showing
viewing = null
showing.Cut()
if(message)
to_chat(user, message)
/obj/item/areaeditor/blueprints/dropped(mob/user)
..()
clear_viewer()
legend = FALSE
/obj/item/areaeditor/proc/get_area_type(area/A)
if (!A)
A = get_area(usr)
if(A.outdoors)
return AREA_SPACE
var/list/SPECIALS = list(
/**
* Gets the area type the user is currently standing in.
* Returns: AREA_STATION, AREA_OUTDOORS, or AREA_SPECIAL
* Args:
* - user: The person we're getting the area of to check if it's a special area.
*/
/obj/item/blueprints/proc/get_area_type(mob/user)
var/area/area_checking = get_area(user)
if(area_checking.outdoors)
return AREA_OUTDOORS
var/static/list/special_areas = typecacheof(list(
/area/shuttle,
/area/centcom,
/area/centcom/asteroid,
/area/centcom/tdome,
/area/centcom/wizard_station,
/area/misc/hilbertshotel,
/area/misc/hilbertshotelstorage
)
for (var/type in SPECIALS)
if ( istype(A,type) )
return AREA_SPECIAL
/area/misc/hilbertshotelstorage,
))
if(area_checking.type in special_areas)
return AREA_SPECIAL
return AREA_STATION
/obj/item/areaeditor/blueprints/proc/view_wire_devices(mob/user)
var/message = "<br>You examine the wire legend.<br>"
for(var/wireset in GLOB.wire_color_directory)
message += "<br><a href='?src=[REF(src)];view_wireset=[wireset]'>[GLOB.wire_name_directory[wireset]]</a>"
message += "</p>"
return message
/obj/item/areaeditor/blueprints/proc/view_wire_set(mob/user, wireset)
//for some reason you can't use wireset directly as a derefencer so this is the next best :/
for(var/device in GLOB.wire_color_directory)
if("[device]" == wireset) //I know... don't change it...
var/message = "<p><b>[GLOB.wire_name_directory[device]]:</b>"
for(var/Col in GLOB.wire_color_directory[device])
var/wire_name = GLOB.wire_color_directory[device][Col]
if(!findtext(wire_name, WIRE_DUD_PREFIX)) //don't show duds
message += "<p><span style='color: [Col]'>[Col]</span>: [wire_name]</p>"
message += "</p>"
return message
return ""
/obj/item/areaeditor/proc/edit_area()
var/area/A = get_area(usr)
var/prevname = "[A.name]"
var/str = tgui_input_text(usr, "New area name", "Area Creation", max_length = MAX_NAME_LEN)
if(!str || !length(str) || str == prevname) //cancel
return
if(length(str) > 50)
to_chat(usr, span_warning("The given name is too long. The area's name is unchanged."))
/**
* edit_area
* Takes input from the player and renames the area the blueprints are currently in.
*/
/obj/item/blueprints/proc/edit_area(mob/user)
var/area/area_editing = get_area(src)
var/prevname = "[area_editing.name]"
var/new_name = tgui_input_text(user, "New area name", "Area Creation", max_length = MAX_NAME_LEN)
if(isnull(new_name) || !length(new_name) || new_name == prevname)
return
rename_area(A, str)
to_chat(usr, span_notice("You rename the '[prevname]' to '[str]'."))
usr.log_message("has renamed [prevname] to [str]", LOG_GAME)
A.update_areasize()
interact()
rename_area(area_editing, new_name)
user.balloon_alert(user, "area renamed to [new_name]")
user.log_message("has renamed [prevname] to [new_name]", LOG_GAME)
return TRUE
//Blueprint Subtypes
/obj/item/areaeditor/blueprints/cyborg
///Cyborg blueprints - The same as regular but with a different fluff text.
/obj/item/blueprints/cyborg
name = "station schematics"
desc = "A digital copy of the station blueprints stored in your memory."
icon = 'icons/obj/scrolls.dmi'
icon_state = "blueprints"
fluffnotice = "Intellectual Property of Nanotrasen. For use in engineering cyborgs only. Wipe from memory upon departure from the station."
/obj/item/areaeditor/blueprints/golem
///Golem blueprints - Used to make golem areas that won't give the hazardous area debuffs.
/obj/item/blueprints/golem
name = "land claim"
desc = "Use it to build new structures in the wastes."
fluffnotice = "In memory of the Liberator's brother, Delaminator, and his Scarlet Macaw-iathan, from which this artifact was stolen."
new_area_type = /area/golem
/proc/rename_area(a, new_name)
var/area/A = get_area(a)
var/prevname = "[A.name]"
set_area_machinery_title(A, new_name, prevname)
A.name = new_name
require_area_resort() //area renamed so resort the names
///Slime blueprints - Makes areas colored and compatible with xenobiology camera consoles, one time use.
/obj/item/blueprints/slime
name = "cerulean prints"
desc = "A one use yet of blueprints made of jelly like organic material. Extends the reach of the management console."
fluffnotice = "Copyright by Science Inc. Renaming areas will allow for management consoles to traverse them."
color = "#2956B2"
if(A.firedoors)
for(var/D in A.firedoors)
var/obj/machinery/door/firedoor/FD = D
FD.CalculateAffectingAreas()
A.update_areasize()
return TRUE
/obj/item/blueprints/slime/edit_area(mob/user)
. = ..()
var/area/area = get_area(src)
for(var/list/zlevel_turfs as anything in area.get_zlevel_turf_lists())
for(var/turf/area_turf as anything in zlevel_turfs)
area_turf.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
area_turf.add_atom_colour("#2956B2", FIXED_COLOUR_PRIORITY)
area.area_flags |= XENOBIOLOGY_COMPATIBLE
qdel(src)
#undef LEGEND_VIEWING_LIST
#undef LEGEND_OFF
/proc/set_area_machinery_title(area/area, title, oldtitle)
if(!oldtitle) // or replacetext goes to infinite loop
return
#undef AREA_STATION
#undef AREA_OUTDOORS
#undef AREA_SPECIAL
//stuff tied to the area to rename
var/static/list/to_rename = typecacheof(list(
/obj/machinery/airalarm,
/obj/machinery/atmospherics/components/unary/vent_scrubber,
/obj/machinery/atmospherics/components/unary/vent_pump,
/obj/machinery/door,
/obj/machinery/firealarm,
/obj/machinery/light_switch,
/obj/machinery/power/apc,
))
for (var/list/zlevel_turfs as anything in area.get_zlevel_turf_lists())
for (var/turf/area_turf as anything in zlevel_turfs)
for(var/obj/machine as anything in typecache_filter_list(area_turf.contents, to_rename))
machine.name = replacetext(machine.name, oldtitle, title)
//TODO: much much more. Unnamed airlocks, cameras, etc.
@@ -23,7 +23,7 @@
. = ..()
// Traitor steal objective
new /obj/item/areaeditor/blueprints(src)
new /obj/item/blueprints(src)
new /obj/item/pipe_dispenser(src)
/obj/structure/closet/secure_closet/engineering_electrical
+1 -1
View File
@@ -388,7 +388,7 @@
)
head = /obj/item/clothing/head/utility/hardhat/welding
mask = /obj/item/clothing/mask/gas/atmos
l_hand = /obj/item/areaeditor/blueprints
l_hand = /obj/item/blueprints
/datum/outfit/centcom/ert/clown/party
name = "ERP Comedian"
+1 -1
View File
@@ -25,7 +25,7 @@
// in the future, this could / should be de-harcoded and
// just draw from a pool uplink, theft, and antag item typepaths
var/static/list/stash_item_paths = list(
/obj/item/areaeditor/blueprints,
/obj/item/blueprints,
/obj/item/assembly/flash,
/obj/item/card/id/advanced/gold/captains_spare,
/obj/item/card/emag,
@@ -101,7 +101,7 @@
if(default_deconstruction_crowbar(tool))
return ITEM_INTERACT_SUCCESS
///To allow boulders on a conveyer belt to move unobstructed if multiple machines are made on a single line
///To allow boulders on a conveyor belt to move unobstructed if multiple machines are made on a single line
/obj/machinery/brm/CanAllowThrough(atom/movable/mover, border_dir)
if(!anchored)
return FALSE
@@ -368,7 +368,7 @@
/obj/item/t_scanner,
/obj/item/analyzer,
/obj/item/assembly/signaler/cyborg,
/obj/item/areaeditor/blueprints/cyborg,
/obj/item/blueprints/cyborg,
/obj/item/electroadaptive_pseudocircuit,
/obj/item/stack/sheet/iron,
/obj/item/stack/sheet/glass,
+1 -1
View File
@@ -547,7 +547,7 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks())
toner_cartridge = object
balloon_alert(user, "cartridge inserted")
else if(istype(object, /obj/item/areaeditor/blueprints))
else if(istype(object, /obj/item/blueprints))
to_chat(user, span_warning("\The [object] is too large to put into the copier. You need to find something else to record the document."))
else if(istype(object, /obj/item/paperwork))
+1 -1
View File
@@ -206,7 +206,7 @@
turfs += placeholder
for(var/mob/M in placeholder)
mobs += M
if(locate(/obj/item/areaeditor/blueprints) in placeholder)
if(locate(/obj/item/blueprints) in placeholder)
blueprints = TRUE
// do this before picture is taken so we can reveal revenants for the photo
@@ -456,7 +456,7 @@
required_container = /obj/item/slime_extract/cerulean
/datum/chemical_reaction/slime/slime_territory/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume)
new /obj/item/areaeditor/blueprints/slime(get_turf(holder.my_atom))
new /obj/item/blueprints/slime(get_turf(holder.my_atom))
..()
//Sepia
+2 -2
View File
@@ -615,9 +615,9 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
if(!attached_switch)
return
INVOKE_ASYNC(src, PROC_REF(update_conveyers), port)
INVOKE_ASYNC(src, PROC_REF(update_conveyors), port)
/obj/item/circuit_component/conveyor_switch/proc/update_conveyers(datum/port/input/port)
/obj/item/circuit_component/conveyor_switch/proc/update_conveyors(datum/port/input/port)
if(!attached_switch)
return
@@ -1082,17 +1082,3 @@
turf_type = /turf/open/floor/sepia
merge_type = /obj/item/stack/tile/sepia
/obj/item/areaeditor/blueprints/slime
name = "cerulean prints"
desc = "A one use yet of blueprints made of jelly like organic material. Extends the reach of the management console."
color = "#2956B2"
/obj/item/areaeditor/blueprints/slime/edit_area()
..()
var/area/area = get_area(src)
for (var/list/zlevel_turfs as anything in area.get_zlevel_turf_lists())
for(var/turf/area_turf as anything in zlevel_turfs)
area_turf.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
area_turf.add_atom_colour("#2956B2", FIXED_COLOUR_PRIORITY)
area.area_flags |= XENOBIOLOGY_COMPATIBLE
qdel(src)
+3
View File
@@ -140,3 +140,6 @@ https://freesound.org/people/steaq/sounds/560124/
refinery.ogg, smelter.ogg, and wooping_teleport.ogg are all original works by ArcaneMusic,
with smelter.ogg using samples from rock_break alongside original sound effects from a warrior electric drill,
where refinery and wooping_teleport are modifications of that same electric drill recording.
paper_flip.ogg is made by gynation from Freesound.org, CC0
https://freesound.org/people/gynation/sounds/82378/
Binary file not shown.
-1
View File
@@ -43,7 +43,6 @@
#include "code\__DEFINES\apc_defines.dm"
#include "code\__DEFINES\appearance.dm"
#include "code\__DEFINES\arcades.dm"
#include "code\__DEFINES\area_editor.dm"
#include "code\__DEFINES\art.dm"
#include "code\__DEFINES\assemblies.dm"
#include "code\__DEFINES\assert.dm"
@@ -0,0 +1,186 @@
import { BooleanLike } from 'common/react';
import { useBackend } from '../backend';
import { Box, Button, Divider, Section, Stack } from '../components';
import { Window } from '../layouts';
type Data = {
area_notice: string;
area_name: string;
wire_data: WireData[];
legend: string;
legend_viewing_list: string;
legend_off: string;
fluff_notice: string;
station_name: string;
wires_name: string;
wire_devices: WireDevices[];
viewing: BooleanLike;
};
type WireDevices = {
name: string;
ref: string;
};
type WireData = {
color: string;
message: string;
};
export const Blueprints = () => {
const { act, data } = useBackend<Data>();
const { legend, legend_viewing_list, legend_off } = data;
return (
<Window width={450} height={340}>
<Window.Content scrollable>
{legend === legend_viewing_list ? (
<WireList />
) : legend === legend_off ? (
<MainMenu />
) : (
<WireArea />
)}
</Window.Content>
</Window>
);
};
const WireList = () => {
const { act, data } = useBackend<Data>();
const { wire_devices = [] } = data;
return (
<Section>
<Button fluid icon="chevron-left" onClick={() => act('exit_legend')}>
Back
</Button>
<Box>
{wire_devices.map((wire) => (
<Button
width="49.5%"
key={wire.ref}
onClick={() =>
act('view_wireset', {
view_wireset: wire.ref,
})
}
>
{wire.name}
</Button>
))}
</Box>
</Section>
);
};
const WireArea = () => {
const { act, data } = useBackend<Data>();
const { wires_name, wire_data = [] } = data;
return (
<Section>
<Button fluid icon="chevron-left" onClick={() => act('view_legend')}>
Back
</Button>
<Box bold>{wires_name} wires:</Box>
{wire_data.map((wire) => (
<Box ml={1} m={1} key={wire.message}>
<span style={{ color: wire.color }}>{wire.color}</span>:{' '}
{wire.message}
</Box>
))}
</Section>
);
};
const MainMenu = () => {
const { act, data } = useBackend<Data>();
const { area_notice, area_name, fluff_notice, station_name, viewing } = data;
return (
<Section title={`${station_name} blueprints`}>
<Box italic fontSize={0.9}>
{fluff_notice}
</Box>
<Divider />
<Box bold m={1.5} textAlign="center">
{area_notice}
</Box>
<Stack fill vertical>
<Stack.Item>
<Button
fluid
pb={0.75}
textAlign="center"
icon="pencil"
onClick={() => act('create_area')}
>
Create or modify an existing area
</Button>
</Stack.Item>
<Stack.Item>
<Button
fluid
pb={0.75}
textAlign="center"
icon="font"
onClick={() => act('edit_area')}
>
Change area name
</Button>
</Stack.Item>
<Stack.Item>
<Button
fluid
pb={0.75}
textAlign="center"
icon="chevron-right"
onClick={() => act('view_legend')}
>
View wire color legend
</Button>
</Stack.Item>
{viewing ? (
<>
<Stack.Item>
<Button
fluid
pb={0.75}
textAlign="center"
icon="wrench"
onClick={() => act('refresh')}
>
Refresh structural data
</Button>
</Stack.Item>
<Stack.Item>
<Button
fluid
pb={0.75}
textAlign="center"
icon="wrench"
onClick={() => act('hide_blueprints')}
>
Hide structural data
</Button>
</Stack.Item>
</>
) : (
<Stack.Item>
<Button
fluid
pb={0.75}
textAlign="center"
icon="wrench"
onClick={() => act('view_blueprints')}
>
View structural data
</Button>
</Stack.Item>
)}
</Stack>
</Section>
);
};
@@ -1,7 +1,7 @@
# removes advanced design, and moves bepis tech disks to its new type
/obj/item/disk/design_disk/adv : /obj/item/disk/design_disk{@OLD}
/obj/item/disk/design_disk/adv/@SUBTPYES : /obj/item/disk/design_disk/@SUBTYPES{@OLD}
/obj/item/disk/design_disk/adv/@SUBTYPES : /obj/item/disk/design_disk/@SUBTYPES{@OLD}
/obj/item/disk/tech_disk/major : /obj/item/disk/design_disk/bepis/remove_tech
/obj/item/disk/tech_disk/spaceloot : /obj/item/disk/design_disk/bepis
@@ -0,0 +1 @@
/obj/item/areaeditor/@SUBTYPES{@OLD} : /obj/item/blueprints/@SUBTYPES{@OLD}