Merge SSnanoui & Nanomanager (#2427)

Merges the NanoUI subsystem with Nanomanager, as well as cleans up some nanomanager code.
Most of the files in this commit are changed as a result of removing the nanomanager global in favor of the SSnanoui global.
This commit is contained in:
Lohikar
2017-05-23 08:33:00 -05:00
committed by skull132
parent 4d6d382967
commit 3be27b9efa
110 changed files with 449 additions and 497 deletions
@@ -74,7 +74,7 @@
data["relays"] = relays
data["focus"] = PRG.target ? PRG.target.uid : null
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_dos.tmpl", "DoS Traffic Generator", 400, 250, state = state)
ui.auto_update_layout = 1
@@ -67,7 +67,7 @@
data["armed"] = PRG.armed
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "revelation.tmpl", "Revelation Virus", 400, 250, state = state)
ui.auto_update_layout = 1
@@ -47,7 +47,7 @@
data["status_airlocks"] = status_airlocks
data["status_pistons"] = status_pistons
data["extending"] = extending
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "crushercontrol.tmpl", name, 500, 350, state = state)
ui.auto_update_layout = 1
@@ -83,7 +83,7 @@
"accesses" = accesses)))
data["regions"] = regions
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "identification_computer.tmpl", name, 600, 700, state = state)
ui.auto_update_layout = 1
@@ -221,7 +221,7 @@
if(id_card)
id_card.name = text("[id_card.registered_name]'s ID Card ([id_card.assignment])")
nanomanager.update_uis(NM)
SSnanoui.update_uis(NM)
return 1
/datum/computer_file/program/card_mod/proc/remove_nt_access(var/obj/item/weapon/card/id/id_card)
@@ -86,7 +86,7 @@
else
data["have_shuttle"] = 0
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "communication.tmpl", name, 550, 420, state = state)
ui.auto_update_layout = 1
@@ -123,11 +123,11 @@
crew_announcement.announcer = "Unknown"
if(announcment_cooldown)
usr << "Please allow at least one minute to pass between announcements"
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|text
if(!input || !can_still_topic())
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
crew_announcement.Announce(input)
announcment_cooldown = 1
@@ -139,11 +139,11 @@
if(is_autenthicated(user) && program.computer_emagged && !issilicon(usr) && ntn_comm)
if(centcomm_message_cooldown)
usr << "<span class='warning'>Arrays recycling. Please stand by.</span>"
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
var/input = sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text)
if(!input || !can_still_topic())
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
Syndicate_announce(input, usr)
usr << "<span class='notice'>Message transmitted.</span>"
@@ -155,15 +155,15 @@
if(is_autenthicated(user) && !issilicon(usr) && ntn_comm)
if(centcomm_message_cooldown)
usr << "<span class='warning'>Arrays recycling. Please stand by.</span>"
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
if(!is_relay_online())//Contact Centcom has a check, Syndie doesn't to allow for Traitor funs.
usr <<"<span class='warning'>No Emergency Bluespace Relay detected. Unable to transmit message.</span>"
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
var/input = sanitize(input("Please choose a message to transmit to [boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text)
if(!input || !can_still_topic())
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
return
Centcomm_announce(input, usr)
usr << "<span class='notice'>Message transmitted.</span>"
@@ -239,7 +239,7 @@
else
program.computer.visible_message("<span class='notice'>\The [program.computer] prints out paper.</span>")
nanomanager.update_uis(src)
SSnanoui.update_uis(src)
/datum/nano_module/program/comm/proc/post_status(var/command, var/data1, var/data2)
@@ -70,7 +70,7 @@
data["gameover"] = gameover
data["information"] = information
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "arcade_classic.tmpl", "Defeat [enemy_name]", 500, 350, state = state)
if(host.update_layout())
@@ -56,7 +56,7 @@
message = ""//Displays for one refresh only
lastuser = user
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "sudoku.tmpl", "Sudoku", width, 557, state = state)
//if(host.update_layout()) // This is necessary to ensure the status bar remains updated along with rest of the UI.
@@ -115,7 +115,7 @@
else
width = 900
var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
if (ui)
ui.close()
ui_interact(user, force_open = 1)
@@ -32,7 +32,7 @@
if(download_progress >= loaded_article.size)
downloading = 0
requires_ntnet = 0 // Turn off NTNet requirement as we already loaded the file into local memory.
nanomanager.update_uis(NM)
SSnanoui.update_uis(NM)
/datum/computer_file/program/newsbrowser/kill_program()
..()
@@ -82,7 +82,7 @@
. = 1
show_archived = !show_archived
if(.)
nanomanager.update_uis(NM)
SSnanoui.update_uis(NM)
/datum/nano_module/program/computer_newsbrowser
@@ -121,7 +121,7 @@
data["all_articles"] = all_articles
data["showing_archived"] = PRG.show_archived
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "news_browser.tmpl", "NTNet/ExoNet News Browser", 575, 700, state = state)
ui.auto_update_layout = 1
@@ -222,7 +222,7 @@
)))
data["all_channels"] = all_channels
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_chat.tmpl", "NTNet Relay Chat Client", 575, 700, state = state)
ui.auto_update_layout = 1
@@ -134,7 +134,7 @@ var/global/nttransfer_uid = 0
)))
data["servers"] = all_servers
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_transfer.tmpl", "NTNet P2P Transfer Client", 575, 700, state = state)
ui.auto_update_layout = 1
@@ -108,7 +108,7 @@
data["ai_laws"] = all_laws
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "aidiag.tmpl", "AI Maintenance Utility", 600, 400, state = state)
if(host.update_layout())
@@ -36,7 +36,7 @@
data["ntnetmaxlogs"] = ntnet_global.setting_maxlogcount
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_monitor.tmpl", "NTNet Diagnostics and Monitoring Tool", 575, 700, state = state)
if(host.update_layout())
@@ -58,7 +58,7 @@
if(current_network)
data["cameras"] = camera_repository.cameras_in_network(current_network)
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "sec_camera.tmpl", "Camera Monitoring", 900, 800, state = state)
// ui.auto_update_layout = 1 // Disabled as with suit sensors monitor - breaks the UI map. Re-enable once it's fixed somehow.
@@ -46,7 +46,7 @@ var/warrant_uid = 0
)))
data["allwarrants"] = allwarrants
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "digitalwarrant.tmpl", name, 500, 350, state = state)
ui.auto_update_layout = 1
@@ -106,7 +106,7 @@
PRG._error_message = "Unable to determine enrollment status. Contact IT department"
data["error_message"] = PRG._error_message
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_clientmanager.tmpl", "NTOS Client Manager", 575, 700, state = state)
ui.auto_update_layout = 1
@@ -55,7 +55,7 @@
)))
data["hardware"] = all_entries
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "laptop_configuration.tmpl", "NTOS Configuration Utility", 575, 700, state = state)
ui.auto_update_layout = 1
@@ -145,7 +145,7 @@
var/datum/computer_file/C = F.clone(0)
HDD.store_file(C)
if(.)
nanomanager.update_uis(NM)
SSnanoui.update_uis(NM)
/datum/nano_module/program/computer_filemanager
name = "NTOS File Manager"
@@ -200,7 +200,7 @@
)))
data["usbfiles"] = usbfiles
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "file_manager.tmpl", "NTOS File Manager", 575, 700, state = state)
ui.auto_update_layout = 1
@@ -176,7 +176,7 @@
else
data["downloadable_programs"] = list()
data["locked"] = 1
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "ntnet_downloader.tmpl", "NTNet Download Program", 575, 700, state = state)
ui.auto_update_layout = 1