diff --git a/code/game/machinery/tcomms/core.dm b/code/game/machinery/tcomms/core.dm
index 66c08ed0b32..59bf9c88375 100644
--- a/code/game/machinery/tcomms/core.dm
+++ b/code/game/machinery/tcomms/core.dm
@@ -121,7 +121,7 @@
// Now the actual UI stuff
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "tcomms_core.tmpl", "Telecommunications Core", 900, 525)
+ ui = new(user, src, ui_key, "tcomms_core.tmpl", "Telecommunications Core", 900, 600)
ui.open()
ui.set_auto_update(1)
@@ -132,7 +132,8 @@
// Only send NTTC settings if were on the right tab. This saves on sending overhead.
if(ui_tab == UI_TAB_CONFIG)
- // Z-level list
+ // Z-level list. Note that this will also show sectors with hidden relay links, but you cant see the relays themselves
+ // This allows the crew to realise that sectors have hidden relays
data["sectors_available"] = "Count: [length(reachable_zlevels)] | List: [jointext(reachable_zlevels, " ")]"
// Toggles
data["active"] = active
@@ -143,6 +144,8 @@
// Strings
data["nttc_setting_language"] = nttc.setting_language
data["nttc_job_indicator_type"] = nttc.job_indicator_type
+ // Network ID
+ data["network_id"] = network_id
if(ui_tab == UI_TAB_LINKS)
data["link_password"] = link_password
@@ -228,6 +231,13 @@
if(href_list["export"])
usr << browse(nttc.nttc_serialize(), "window=save_nttc")
+ // Set network ID
+ if(href_list["network_id"])
+ var/new_id = input(usr, "Please enter a new network ID", "Network ID", network_id)
+ log_action(usr, "renamed core with ID [network_id] to [new_id]")
+ to_chat(usr, "Device ID changed from [network_id] to [new_id].")
+ network_id = new_id
+
if(ui_tab == UI_TAB_LINKS)
if(href_list["unlink"])
var/obj/machinery/tcomms/relay/R = locate(href_list["unlink"])
@@ -239,7 +249,14 @@
else
to_chat(usr, "ERROR: Relay not found. Please file an issue report.")
- // Try to speed-update the UI
+ if(href_list["change_password"])
+ var/new_password = input(usr, "Please enter a new password","New Password", link_password)
+ log_action(usr, "has changed the password on core with ID [network_id] from [link_password] to [new_password]")
+ to_chat(usr, "Successfully changed password from [link_password] to [new_password].")
+ link_password = new_password
+
+
+ // Hack to speed update the nanoUI
SSnanoui.update_uis(src)
#undef UI_TAB_CONFIG
diff --git a/code/game/machinery/tcomms/relay.dm b/code/game/machinery/tcomms/relay.dm
index f373bbe4a35..721006d0c11 100644
--- a/code/game/machinery/tcomms/relay.dm
+++ b/code/game/machinery/tcomms/relay.dm
@@ -94,3 +94,84 @@
..()
if(linked_core)
linked_core.refresh_zlevels()
+
+
+//////////////
+// UI STUFF //
+//////////////
+
+/obj/machinery/tcomms/relay/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "tcomms_relay.tmpl", "Telecommunications Relay", 600, 400)
+ ui.open()
+ ui.set_auto_update(1)
+
+/obj/machinery/tcomms/relay/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
+ var/data[0]
+ // Are we on or not
+ data["active"] = active
+ // What is our network ID
+ data["network_id"] = network_id
+ // Are we linked
+ data["linked"] = linked
+ // Is the link hidden
+ data["hidden_link"] = hidden_link
+
+ // Only send linked tab stuff if we are linked. This saves on sending overhead.
+ if(linked)
+ data["linked_core_id"] = linked_core.network_id
+ data["linked_core_addr"] = "\ref[linked_core]"
+
+ else
+ for(var/obj/machinery/tcomms/core/C in GLOB.tcomms_machines)
+ data["entries"] += list(list("addr" = "\ref[C]", "net_id" = C.network_id, "sector" = C.loc.z))
+
+ return data
+
+/obj/machinery/tcomms/relay/Topic(href, href_list)
+ // Check against href exploits
+ if(..())
+ return
+
+ // All the toggle on/offs go here
+ if(href_list["toggle_active"])
+ active = !active
+ update_icon()
+
+ // Set network ID
+ if(href_list["network_id"])
+ var/new_id = input(usr, "Please enter a new network ID", "Network ID", network_id)
+ log_action(usr, "renamed core with ID [network_id] to [new_id]")
+ to_chat(usr, "Device ID changed from [network_id] to [new_id].")
+ network_id = new_id
+
+ if(linked)
+ // Only do these hrefs if we are linked to prevent bugs/exploits
+ if(href_list["toggle_hidden_link"])
+ hidden_link = !hidden_link
+ log_action(usr, "Modified hidden link for [network_id] (Now [hidden_link])")
+
+ if(href_list["unlink"])
+ var/choice = alert(usr, "Are you SURE you want to unlink this relay?\nYou wont be able to re-link without the core password", "Unlink","Yes","No")
+ if(choice == "Yes")
+ log_action(usr, "Unlinked [network_id] from [linked_core.network_id]")
+ Reset()
+ else
+ // You should only be able to link if its not linked, to prevent weirdness
+ if(href_list["link"])
+ var/obj/machinery/tcomms/core/C = locate(href_list["link"])
+ if(istype(C, /obj/machinery/tcomms/core))
+ var/user_pass = input(usr, "Please enter core password","Password Entry")
+ // Check the password
+ if(user_pass == C.link_password)
+ AddLink(C)
+ to_chat(usr, "Successfully linked to [C.network_id].")
+ else
+ to_chat(usr, "ERROR: Password incorrect.")
+ else
+ to_chat(usr, "ERROR: Core not found. Please file an issue report.")
+
+
+ // Hack to speed update the nanoUI
+ SSnanoui.update_uis(src)
diff --git a/code/game/machinery/telecomms/ntsl2.dm b/code/game/machinery/telecomms/ntsl2.dm
deleted file mode 100644
index ec938c46bfd..00000000000
--- a/code/game/machinery/telecomms/ntsl2.dm
+++ /dev/null
@@ -1,562 +0,0 @@
-#define JOB_STYLE_1 "Name (Job)"
-#define JOB_STYLE_2 "Name - Job"
-#define JOB_STYLE_3 "\[Job\] Name"
-#define JOB_STYLE_4 "(Job) Name"
-// Custom Implementations for NTTC
-/* NTTC Configuration Datum
- * This is an abstract handler for the configuration loadout. It's set up like this both for ease of transfering in and out of the UI
- * as well as allowing users to save and load configurations.
- */
-/datum/nttc_configuration
- var/regex/word_blacklist = new("(