diff --git a/code/_macros.dm b/code/_macros.dm index a534d96df48..3cc39e58cbb 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -43,6 +43,8 @@ #define isslime(A) istype(A, /mob/living/carbon/slime) #define to_chat(target, message) target << message +#define MAP_IMAGE_PATH "nano/images/" +#define map_image_file_name(z_level) "Aurora-[z_level].png" #define to_world(message) world << message #define sound_to(target, sound) target << sound #define to_file(file_entry, file_content) file_entry << file_content diff --git a/code/datums/repositories/crew.dm b/code/datums/repositories/crew.dm index 6fbe1863da7..ebbbafc44cb 100644 --- a/code/datums/repositories/crew.dm +++ b/code/datums/repositories/crew.dm @@ -1,4 +1,5 @@ var/global/datum/repository/crew/crew_repository = new() +var/list/map_levels = list(3,4,6) /datum/repository/crew var/list/cache_data @@ -7,16 +8,15 @@ var/global/datum/repository/crew/crew_repository = new() cache_data = list() ..() -/datum/repository/crew/proc/health_data(var/turf/T) +/datum/repository/crew/proc/health_data(var/z_level) var/list/crewmembers = list() - if(!T) + if(!z_level) return crewmembers - var/z_level = "[T.z]" - var/datum/cache_entry/cache_entry = cache_data[z_level] + var/datum/cache_entry/cache_entry = cache_data[num2text(z_level)] if(!cache_entry) cache_entry = new/datum/cache_entry - cache_data[z_level] = cache_entry + cache_data[num2text(z_level)] = cache_entry if(world.time < cache_entry.timestamp) return cache_entry.data @@ -24,13 +24,13 @@ var/global/datum/repository/crew/crew_repository = new() var/tracked = scan() for(var/obj/item/clothing/under/C in tracked) var/turf/pos = get_turf(C) - if((C) && (C.has_sensor) && (pos) && (T && pos.z == T.z) && (C.sensor_mode != SUIT_SENSOR_OFF)) + if((C) && (C.has_sensor) && (pos) && (pos.z == z_level) && (C.sensor_mode != SUIT_SENSOR_OFF)) if(istype(C.loc, /mob/living/carbon/human)) var/mob/living/carbon/human/H = C.loc if(H.w_uniform != C) continue - var/list/crewmemberData = list("dead"=0, "oxy"=-1, "tox"=-1, "fire"=-1, "brute"=-1, "area"="", "x"=-1, "y"=-1, "ref" = "\ref[H]") + var/list/crewmemberData = list("dead"=0, "oxy"=-1, "tox"=-1, "fire"=-1, "brute"=-1, "area"="", "x"=-1, "y"=-1, "z"=-1, "level"="", "ref" = "\ref[H]") crewmemberData["sensor_type"] = C.sensor_mode crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown") @@ -51,6 +51,7 @@ var/global/datum/repository/crew/crew_repository = new() crewmemberData["area"] = sanitize(A.name) crewmemberData["x"] = pos.x crewmemberData["y"] = pos.y + crewmemberData["z"] = pos.z crewmembers[++crewmembers.len] = crewmemberData diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 1d1f3e56d1a..c090716a00c 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -639,3 +639,31 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept return signal +/proc/telecomms_process_active() + + // First, we want to generate a new radio signal + var/datum/signal/signal = new + signal.transmission_method = 2 // 2 would be a subspace transmission. + + // --- Finally, tag the actual signal with the appropriate values --- + signal.data = list( + "slow" = 0, // how much to sleep() before broadcasting - simulates net lag + "message" = "TEST", + "compression" = rand(45, 50), // If the signal is compressed, compress our message too. + "traffic" = 0, // dictates the total traffic sum that the signal went through + "type" = 4, // determines what type of radio input it is: test broadcast + "reject" = 0, + "done" = 0, + "level" = 5 // The level it is being broadcasted at. + ) + signal.frequency = PUB_FREQ// Common channel + + //#### Sending the signal to all subspace receivers ####// + for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + R.receive_signal(signal) + + //world<< "Done: [signal.data["done"]]" + + return signal + + diff --git a/code/modules/nano/modules/crew_monitor.dm b/code/modules/nano/modules/crew_monitor.dm index 9008c860312..5ea89950262 100644 --- a/code/modules/nano/modules/crew_monitor.dm +++ b/code/modules/nano/modules/crew_monitor.dm @@ -3,10 +3,7 @@ /datum/nano_module/crew_monitor/Topic(href, href_list) if(..()) return 1 - var/turf/T = get_turf(nano_host()) // TODO: Allow setting any config.contact_levels from the interface. - if (!T || !(T.z in config.player_levels)) - usr << "Unable to establish a connection: You're too far away from the station!" - return 0 + if(href_list["track"]) if(isAI(usr)) var/mob/living/silicon/ai/AI = usr @@ -17,15 +14,20 @@ /datum/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) var/list/data = host.initial_data() - var/turf/T = get_turf(nano_host()) - data["isAI"] = isAI(user) - data["crewmembers"] = crew_repository.health_data(T) + // This checks if TCOMS is online using the test proc. If it isn't, the suit sensor data isn't loaded. + var/datum/signal/signal + signal = telecomms_process_active() + if(signal.data["done"] == 1) + data["isAI"] = isAI(user) + data["crewmembers"] = list() + for(var/z_level in map_levels) + data["crewmembers"] += crew_repository.health_data(z_level) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800, state = state) - // adding a template with the key "mapContent" enables the map ui functionality ui.add_template("mapContent", "crew_monitor_map_content.tmpl") // adding a template with the key "mapHeader" replaces the map header content diff --git a/code/modules/nano/nanomapgen.dm b/code/modules/nano/nanomapgen.dm index e0e65eba6ce..120fdfeeee8 100644 --- a/code/modules/nano/nanomapgen.dm +++ b/code/modules/nano/nanomapgen.dm @@ -74,7 +74,7 @@ world.log << "NanoMapGen: [count] tiles done" sleep(1) - var/mapFilename = "nanomap_z[currentZ]-new.png" + var/mapFilename = "new_Aurora[currentZ]" world.log << "NanoMapGen: sending [mapFilename] to client" diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index b1dffe62962..a80747638b2 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -44,7 +44,7 @@ nanoui is used to open and update nano browser uis // show the map ui, this is used by the default layout var/show_map = 0 // the map z level to display - var/map_z_level = 1 + var/map_z_level = 3 // initial data, containing the full data structure, must be sent to the ui (the data structure cannot be extended later on) var/list/initial_data[0] // set to 1 to update the ui automatically every master_controller tick @@ -185,7 +185,9 @@ nanoui is used to open and update nano browser uis "autoUpdateLayout" = auto_update_layout, "autoUpdateContent" = auto_update_content, "showMap" = show_map, + "mapName" = "Aurora", "mapZLevel" = map_z_level, + "mapZLevels" = map_levels, "user" = list("name" = user.name) ) return config_data @@ -488,8 +490,12 @@ nanoui is used to open and update nano browser uis map_update = 1 if(href_list["mapZLevel"]) - set_map_z_level(text2num(href_list["mapZLevel"])) - map_update = 1 + var/map_z = (text2num(href_list["mapZLevel"])) + if(map_z in map_levels) + set_map_z_level(map_z) + map_update = 1 + else + return if ((src_object && src_object.Topic(href, href_list, state)) || map_update) nanomanager.update_uis(src_object) // update all UIs attached to src_object diff --git a/nano/images/Aurora-3.png b/nano/images/Aurora-3.png new file mode 100644 index 00000000000..b420e6ca470 Binary files /dev/null and b/nano/images/Aurora-3.png differ diff --git a/nano/images/Aurora-4.png b/nano/images/Aurora-4.png new file mode 100644 index 00000000000..debe76a4c0f Binary files /dev/null and b/nano/images/Aurora-4.png differ diff --git a/nano/images/Aurora-6.png b/nano/images/Aurora-6.png new file mode 100644 index 00000000000..2b05e54d6b0 Binary files /dev/null and b/nano/images/Aurora-6.png differ diff --git a/nano/js/nano_base_callbacks.js b/nano/js/nano_base_callbacks.js index fb5a86ee3db..889c6a80424 100644 --- a/nano/js/nano_base_callbacks.js +++ b/nano/js/nano_base_callbacks.js @@ -87,8 +87,8 @@ NanoBaseCallbacks = function () marginTop: '-' + Math.floor(uiMapHeight / 2) + 'px' }); }); - - $('#uiMapImage').attr('src', 'nanomap_z' + updateData['config']['mapZLevel'] + '.png'); + + $('#uiMapImage').attr('src', updateData['config']['mapName'] + '-' + updateData['config']['mapZLevel'] + '.png'); return updateData; } diff --git a/nano/templates/crew_monitor.tmpl b/nano/templates/crew_monitor.tmpl index cd3a0146524..4bbf18c0656 100644 --- a/nano/templates/crew_monitor.tmpl +++ b/nano/templates/crew_monitor.tmpl @@ -1,30 +1,32 @@ - - - -{{:helper.link('Show Tracker Map', 'pin-s', {'showMap' : 1})}} - - {{for data.crewmembers}} - {{if value.sensor_type == 1}} - {{if data.isAI}}{{/if}} - {{else value.sensor_type == 2}} - {{if data.isAI}}{{/if}} - {{else value.sensor_type == 3}} - {{if data.isAI}}{{/if}} - {{/if}} - {{/for}} -
{{:value.name}} ({{:value.assignment}}){{:value.dead ? "Deceased" : "Living"}}Not Available{{:helper.link('Track', null, {}, 'disabled')}}
{{:value.name}} ({{:value.assignment}}){{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}})Not Available{{:helper.link('Track', null, {}, 'disabled')}}
{{:value.name}} ({{:value.assignment}}){{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}}){{:value.area}}({{:value.x}}, {{:value.y}}){{:helper.link('Track', null, {'track' : value.ref})}}
+ + + +{{:helper.link('Show Tracker Map', 'pin-s', {'showMap' : 1})}} + + {{for data.crewmembers}} + {{if value.sensor_type == 1}} + {{if data.isAI}}{{/if}} + {{else value.sensor_type == 2}} + {{if data.isAI}}{{/if}} + {{else value.sensor_type == 3}} + {{if data.isAI}}{{/if}} + {{/if}} + {{empty}} + " Unable to establish a connection to telecommunications!" + {{/for}} +
{{:value.name}} ({{:value.assignment}}){{:value.dead ? "Deceased" : "Living"}}Not Available{{:helper.link('Track', null, {}, 'disabled')}}
{{:value.name}} ({{:value.assignment}}){{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}})Not Available{{:helper.link('Track', null, {}, 'disabled')}}
{{:value.name}} ({{:value.assignment}}){{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}}){{:value.area}}({{:value.x}}, {{:value.y}}, {{:value.z}}){{:helper.link('Track', null, {'track' : value.ref})}}
\ No newline at end of file diff --git a/nano/templates/crew_monitor_map_header.tmpl b/nano/templates/crew_monitor_map_header.tmpl index f9f5e2f707d..d997087bbf6 100644 --- a/nano/templates/crew_monitor_map_header.tmpl +++ b/nano/templates/crew_monitor_map_header.tmpl @@ -3,6 +3,13 @@ Title: Crew Monitoring Console (Map header) Used In File(s): \code\game\machinery\computer\crew.dm --> {{:helper.link('Show Detail List', 'script', {'showMap' : 0})}} +{{:helper.link('Hide Map', 'close', {'showMap' : 0})}} +
+ Z Level:  + {{for config.mapZLevels :zValue:zIndex}} + {{:helper.link(zValue, 'close', {'mapZLevel' : zValue}, null, config.mapZLevel == zValue ? 'selected' : null)}} + {{/for}} +
Zoom Level:  diff --git a/nano/templates/layout_default.tmpl b/nano/templates/layout_default.tmpl index 53701e30307..766fc39dac8 100644 --- a/nano/templates/layout_default.tmpl +++ b/nano/templates/layout_default.tmpl @@ -39,6 +39,13 @@