From b3d7ab17d3a25599d9c8734286bd9b1e972c0f32 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Sat, 4 Mar 2023 22:56:44 +0100 Subject: [PATCH] Added ability to see sensors scan info in UI without printing (#15451) * Added ability to see sensor scan info in UI * Fixup * Indentation fuckup fix * Changed variable name, merged master --- .../overmap/ships/computers/sensors.dm | 21 ++++++++-- html/changelogs/fluffy.yml | 41 +++++++++++++++++++ nano/templates/shipsensors.tmpl | 10 +++++ 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 html/changelogs/fluffy.yml diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index 303a9316d6f..8ea481ed839 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -8,6 +8,8 @@ var/obj/machinery/iff_beacon/identification circuit = /obj/item/circuitboard/ship/sensors linked_type = /obj/effect/overmap/visitable + var/contact_details = null + var/contact_name = null var/working_sound = 'sound/machines/sensors/dradis.ogg' var/datum/sound_token/sound_token @@ -153,6 +155,8 @@ data["id_name"] = linked.designation data["can_change_class"] = identification.can_change_class data["can_change_name"] = identification.can_change_name + if(contact_details) + data["contact_details"] = contact_details else data["id_status"] = "NOBEACON" //Should not really happen. @@ -239,6 +243,16 @@ visible_message(SPAN_NOTICE("\The [src] beeps, \"IFF change to ship designation registered.\"")) return TOPIC_REFRESH + if (href_list["scan-action"]) + switch(href_list["scan-action"]) + if("clear") + contact_details = null + if("print") + if(contact_details) + playsound(loc, "sound/machines/dotprinter.ogg", 30, 1) + new/obj/item/paper/(get_turf(src), contact_details, "paper (Sensor Scan - [contact_name])") + return TOPIC_HANDLED + if (href_list["scan"]) var/obj/effect/overmap/O = locate(href_list["scan"]) if(istype(O) && !QDELETED(O)) @@ -248,8 +262,9 @@ LAZYSET(last_scan, "location", "[O.x],[O.y]") LAZYSET(last_scan, "name", "[O]") to_chat(usr, SPAN_NOTICE("Successfully scanned [O].")) - new/obj/item/paper/(get_turf(src), O.get_scan_data(usr), "paper (Sensor Scan - [O])") - return TOPIC_HANDLED + contact_name = O.name + contact_details = O.get_scan_data(usr) + return TOPIC_HANDLED if (href_list["request_datalink"]) var/obj/effect/overmap/visitable/O = locate(href_list["request_datalink"]) @@ -258,7 +273,7 @@ for(var/obj/machinery/computer/ship/sensors/sensor_console in O.consoles) sensor_console.connected.datalink_requests |= src.connected - return TOPIC_HANDLED + return TOPIC_HANDLED if (href_list["accept_datalink_requests"]) var/obj/effect/overmap/visitable/O = locate(href_list["accept_datalink_requests"]) diff --git a/html/changelogs/fluffy.yml b/html/changelogs/fluffy.yml new file mode 100644 index 00000000000..24be40b18db --- /dev/null +++ b/html/changelogs/fluffy.yml @@ -0,0 +1,41 @@ +################################ +# 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 +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: FluffyGhost + +# 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: + - rscadd: "Added ability to see sensor scan info in UI before / in lieu of printing it." diff --git a/nano/templates/shipsensors.tmpl b/nano/templates/shipsensors.tmpl index 6404130607f..c48b6107d76 100644 --- a/nano/templates/shipsensors.tmpl +++ b/nano/templates/shipsensors.tmpl @@ -128,6 +128,16 @@ {{/for}} + {{if data.contact_details}} + + {{:data.contact_details}} +
+ + + {{:helper.link('Print', 'search', { 'scan-action' : 'print' })}} + {{:helper.link('Clear', 'refresh', { 'scan-action' : 'clear' })}} + +{{/if}} {{/if}}