Merge pull request #4910 from Heroman3003/reverting-it-all-not-really

Un-kevinzes nanoui and chemistry subsystems back into processes for greater good
This commit is contained in:
Spades
2019-04-05 16:33:29 -04:00
committed by GitHub
129 changed files with 389 additions and 350 deletions
+1 -1
View File
@@ -448,7 +448,7 @@
usr << "This can only be done on mobs with clients"
return
SSnanoui.send_resources(H.client)
GLOB.nanomanager.send_resources(H.client)
usr << "Resource files sent"
H << "Your NanoUI Resource files have been refreshed"
+2 -2
View File
@@ -152,7 +152,7 @@
log_client_to_db()
send_resources()
SSnanoui.send_resources(src)
GLOB.nanomanager.send_resources(src)
if(!void)
void = new()
@@ -166,7 +166,7 @@
src.changes()
hook_vr("client_new",list(src)) //VOREStation Code
if(config.paranoia_logging)
if(isnum(player_age) && player_age == 0)
log_and_message_admins("PARANOIA: [key_name(src)] has connected here for the first time.")
+1 -1
View File
@@ -23,7 +23,7 @@
/obj/item/clothing/glasses/omnihud/dropped()
if(arscreen)
SSnanoui.close_uis(src)
GLOB.nanomanager.close_uis(src)
..()
/obj/item/clothing/glasses/omnihud/emp_act(var/severity)
+1 -1
View File
@@ -616,7 +616,7 @@
if(module_list.len)
data["modules"] = module_list
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 480, 550, state = nano_state)
ui.set_initial_data(data)
@@ -61,7 +61,7 @@
data["bloodsamp_desc"] = (bloodsamp ? (bloodsamp.desc ? bloodsamp.desc : "No information on record.") : "")
data["lidstate"] = closed
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data)
if (!ui)
ui = new(user, src, ui_key, "dnaforensics.tmpl", "QuikScan DNA Analyzer", 540, 326)
ui.set_initial_data(data)
+3 -3
View File
@@ -53,7 +53,7 @@
O.loc = src
held_card = O
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
attack_hand(user)
@@ -107,7 +107,7 @@
if (accounts.len > 0)
data["accounts"] = accounts
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640)
ui.set_initial_data(data)
@@ -117,7 +117,7 @@
if(..())
return 1
var/datum/nanoui/ui = SSnanoui.get_open_ui(usr, src, "main")
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(usr, src, "main")
if(href_list["choice"])
switch(href_list["choice"])
+2 -2
View File
@@ -284,7 +284,7 @@
var/list/medicineReagents = list()
for(var/path in typesof(/datum/chemical_reaction) - /datum/chemical_reaction)
var/datum/chemical_reaction/CR = path // Stupid casting required for reading
var/datum/reagent/R = SSchemistry.chemical_reagents[initial(CR.result)]
var/datum/reagent/R = chemical_reagents_list[initial(CR.result)]
if(R && R.scannable)
medicineReagents += R
for(var/i in 1 to differentTypes)
@@ -298,7 +298,7 @@
var/list/drinkReagents = list()
for(var/path in typesof(/datum/chemical_reaction) - /datum/chemical_reaction)
var/datum/chemical_reaction/CR = path // Stupid casting required for reading
var/datum/reagent/R = SSchemistry.chemical_reagents[initial(CR.result)]
var/datum/reagent/R = chemical_reagents_list[initial(CR.result)]
if(istype(R, /datum/reagent/drink) || istype(R, /datum/reagent/ethanol))
drinkReagents += R
for(var/i in 1 to differentTypes)
+5 -5
View File
@@ -216,7 +216,7 @@
overlays.Cut()
if(panel_open)
overlays += image(icon, icon_panel)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
return
if(wrenchable && default_unfasten_wrench(user, O, 20))
@@ -282,11 +282,11 @@
var/datum/stored_item/item = new/datum/stored_item(src, O.type, O.name)
item.add_product(O)
item_records.Add(item)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/smartfridge/proc/vend(datum/stored_item/I)
I.get_product(get_turf(src))
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
attack_hand(user)
@@ -321,7 +321,7 @@
if(items.len > 0)
data["contents"] = items
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
ui.set_initial_data(data)
@@ -331,7 +331,7 @@
if(..()) return 0
var/mob/user = usr
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
src.add_fingerprint(user)
+2 -2
View File
@@ -68,14 +68,14 @@
//Reagents can be resolved to nicer names as well
for(var/Rp in food_recipes)
for(var/rid in food_recipes[Rp]["Reagents"])
var/datum/reagent/Rd = SSchemistry.chemical_reagents[rid]
var/datum/reagent/Rd = chemical_reagents_list[rid]
var/R_name = Rd.name
var/amt = food_recipes[Rp]["Reagents"][rid]
food_recipes[Rp]["Reagents"] -= rid
food_recipes[Rp]["Reagents"][R_name] = amt
for(var/Rp in drink_recipes)
for(var/rid in drink_recipes[Rp]["Reagents"])
var/datum/reagent/Rd = SSchemistry.chemical_reagents[rid]
var/datum/reagent/Rd = chemical_reagents_list[rid]
var/R_name = Rd.name
var/amt = drink_recipes[Rp]["Reagents"][rid]
drink_recipes[Rp]["Reagents"] -= rid
+2 -2
View File
@@ -112,7 +112,7 @@
else
data["gravity"] = null
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "holodeck.tmpl", src.name, 400, 550)
ui.set_initial_data(data)
@@ -152,7 +152,7 @@
src.add_fingerprint(usr)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/computer/HolodeckControl/emag_act(var/remaining_charges, var/mob/user as mob)
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
+1 -1
View File
@@ -437,7 +437,7 @@
for(var/x=1;x<=additional_chems;x++)
var/new_chem = pick(SSchemistry.chemical_reagents)
var/new_chem = pick(chemical_reagents_list)
if(new_chem in banned_chems)
continue
banned_chems += new_chem
+2 -2
View File
@@ -162,7 +162,7 @@
data["hasGenetics"] = 0
data["sourceName"] = 0
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "botany_isolator.tmpl", "Lysis-isolation Centrifuge UI", 470, 450)
ui.set_initial_data(data)
@@ -292,7 +292,7 @@
else
data["loaded"] = 0
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "botany_editor.tmpl", "Bioballistic Delivery UI", 470, 450)
ui.set_initial_data(data)
+1 -1
View File
@@ -201,7 +201,7 @@
medicalActive1 = null
medicalActive2 = null
medical_cannotfind = 0
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
usr << "<span class='notice'>You reset your record-viewing software.</span>"
/mob/living/silicon/pai/cancel_camera()
@@ -90,7 +90,7 @@ var/global/list/default_pai_software = list()
data["emotions"] = emotions
data["current_emotion"] = card.current_emotion
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "pai_interface.tmpl", "pAI Software Interface", 450, 600)
ui.set_initial_data(data)
@@ -36,7 +36,7 @@
data["prime"] = user.pai_law0
data["supplemental"] = user.pai_laws
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_directives.tmpl", "pAI Directives", 450, 600)
@@ -102,7 +102,7 @@
data["channels"] = channels
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
ui = new(user, user, id, "pai_radio.tmpl", "Radio Configuration", 300, 150)
ui.set_initial_data(data)
@@ -128,7 +128,7 @@
// This is dumb, but NanoUI breaks if it has no data to send
data["manifest"] = PDA_Manifest
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "crew_manifest.tmpl", "Crew Manifest", 450, 600)
@@ -178,7 +178,7 @@
data["messages"] = messages
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_messenger.tmpl", "Digital Messenger", 450, 600)
@@ -236,7 +236,7 @@
data["medical"] = M ? M.fields : null
data["could_not_find"] = user.medical_cannotfind
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_medrecords.tmpl", "Medical Records", 450, 600)
@@ -290,7 +290,7 @@
data["security"] = S ? S.fields : null
data["could_not_find"] = user.security_cannotfind
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_secrecords.tmpl", "Security Records", 450, 600)
@@ -340,7 +340,7 @@
data["progress_b"] = user.hackprogress % 10
data["aborted"] = user.hack_aborted
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_doorjack.tmpl", "Door Jack", 300, 150)
@@ -431,7 +431,7 @@
gases[++gases.len] = gas
data["gas"] = gases
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_atmosphere.tmpl", "Atmosphere Sensor", 350, 300)
@@ -505,7 +505,7 @@
data["frequency"] = format_frequency(user.sradio.frequency)
data["code"] = user.sradio.code
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_signaller.tmpl", "Signaller", 320, 150)
@@ -184,12 +184,12 @@
dat += "<h3>Injector</h3>"
if(patient)// && patient.health > min_health) //Not necessary, leave the buttons on, but the feedback during injection will give more information.
for(var/re in injection_chems)
var/datum/reagent/C = SSchemistry.chemical_reagents[re]
var/datum/reagent/C = chemical_reagents_list[re]
if(C)
dat += "<A href='?src=\ref[src];inject=[C.id]'>Inject [C.name]</A><BR>"
else
for(var/re in injection_chems)
var/datum/reagent/C = SSchemistry.chemical_reagents[re]
var/datum/reagent/C = chemical_reagents_list[re]
if(C)
dat += "<span class='linkOff'>Inject [C.name]</span><BR>"
@@ -393,7 +393,7 @@
patient.reagents.add_reagent(chem, inject_amount)
drain(750) //-750 charge per injection
var/units = round(patient.reagents.get_reagent_amount(chem))
to_chat(hound, "<span class='notice'>Injecting [units] unit\s of [SSchemistry.chemical_reagents[chem]] into occupant.</span>") //If they were immersed, the reagents wouldn't leave with them.
to_chat(hound, "<span class='notice'>Injecting [units] unit\s of [chemical_reagents_list[chem]] into occupant.</span>") //If they were immersed, the reagents wouldn't leave with them.
//For if the dogborg's existing patient uh, doesn't make it.
/obj/item/device/dogborg/sleeper/proc/update_patient()
+1 -1
View File
@@ -1,5 +1,5 @@
/mob/Logout()
SSnanoui.user_logout(src) // this is used to clean up (remove) this user's Nano UIs
GLOB.nanomanager.user_logout(src) // this is used to clean up (remove) this user's Nano UIs
player_list -= src
update_client_z(null)
log_access_out(src)
+1 -1
View File
@@ -18,7 +18,7 @@
src.remoter_state = null
// Force an UI update before we go, ensuring that any windows we may have opened for the remote target closes.
SSnanoui.update_uis(remote_target.nano_container())
GLOB.nanomanager.update_uis(remote_target.nano_container())
remote_target = null
return ..()
+1 -1
View File
@@ -80,7 +80,7 @@
"lost_sources" = lost_sources.len ? sanitize(english_list(lost_sources, nothing_text = "", and_text = ", ")) : ""))
data["categories"] = categories
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "alarm_monitor.tmpl", "Alarm Monitoring Console", 800, 800, state = state)
ui.set_initial_data(data)
+1 -1
View File
@@ -48,7 +48,7 @@
data["alarms"] = alarms
data["map_levels"] = using_map.get_map_levels(T.z)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 625, 625, state = state)
// adding a template with the key "mapContent" enables the map ui functionality
+1 -1
View File
@@ -25,7 +25,7 @@
for(var/z in (data["map_levels"] | T.z)) // Always show crew from the current Z even if we can't show a map
data["crewmembers"] += crew_repository.health_data(z)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.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)
@@ -145,7 +145,7 @@
data["change_hair_color"] = can_change(APPEARANCE_HAIR_COLOR)
data["change_facial_hair_color"] = can_change(APPEARANCE_FACIAL_HAIR_COLOR)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state)
ui.set_initial_data(data)
+1 -1
View File
@@ -176,7 +176,7 @@
data["channels"] = channels
data["law_sets"] = package_multiple_laws(data["isAdmin"] ? admin_laws : player_laws)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "law_manager.tmpl", sanitize("[src] - [owner]"), 800, is_malf(user) ? 600 : 400, state = state)
ui.set_initial_data(data)
+1 -1
View File
@@ -28,7 +28,7 @@
data["focus"] = focus.return_reading_data()
data["map_levels"] = using_map.get_map_levels(T.z)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 500, state = state)
// adding a template with the key "mapContent" enables the map ui functionality
+1 -1
View File
@@ -38,7 +38,7 @@
data["hide_smes_details"] = hide_SMES_details
data["hide_breakers"] = hide_breakers
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "rcon.tmpl", "RCON Console", 600, 400, state = state)
ui.set_initial_data(data)
+46 -11
View File
@@ -1,3 +1,38 @@
GLOBAL_DATUM_INIT(nanomanager, /datum/nanomanager, new) // NanoManager, the manager for Nano UIs.
// This is the window/UI manager for Nano UI
// There should only ever be one (global) instance of nanomanger
/datum/nanomanager
// a list of current open /nanoui UIs, grouped by src_object and ui_key
var/open_uis[0]
// a list of current open /nanoui UIs, not grouped, for use in processing
var/list/processing_uis = list()
// a list of asset filenames which are to be sent to the client on user logon
var/list/asset_files = list()
/**
* Create a new nanomanager instance.
* This proc generates a list of assets which are to be sent to each client on connect
*
* @return /nanomanager new nanomanager object
*/
/datum/nanomanager/New()
var/list/nano_asset_dirs = list(\
"nano/css/",\
"nano/images/",\
"nano/js/",\
"nano/templates/"\
)
var/list/filenames = null
for (var/path in nano_asset_dirs)
filenames = flist(path)
for(var/filename in filenames)
if(copytext(filename, length(filename)) != "/") // filenames which end in "/" are actually directories, which we want to ignore
if(fexists(path + filename))
asset_files.Add(fcopy_rsc(path + filename)) // add this file to asset_files for sending to clients when they connect
return
/**
* Get an open /nanoui ui for the current user, src_object and ui_key and try to update it with data
@@ -11,7 +46,7 @@
*
* @return /nanoui Returns the found ui, for null if none exists
*/
/datum/controller/subsystem/nanoui/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data, var/force_open = 0)
/datum/nanomanager/proc/try_update_ui(var/mob/user, src_object, ui_key, var/datum/nanoui/ui, data, var/force_open = 0)
if (isnull(ui)) // no ui has been passed, so we'll search for one
{
ui = get_open_ui(user, src_object, ui_key)
@@ -36,7 +71,7 @@
*
* @return /nanoui Returns the found ui, or null if none exists
*/
/datum/controller/subsystem/nanoui/proc/get_open_ui(var/mob/user, src_object, ui_key)
/datum/nanomanager/proc/get_open_ui(var/mob/user, src_object, ui_key)
var/src_object_key = "\ref[src_object]"
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
//testing("nanomanager/get_open_ui mob [user.name] [src_object:name] [ui_key] - there are no uis open")
@@ -59,7 +94,7 @@
*
* @return int The number of uis updated
*/
/datum/controller/subsystem/nanoui/proc/update_uis(src_object)
/datum/nanomanager/proc/update_uis(src_object)
var/src_object_key = "\ref[src_object]"
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
return 0
@@ -79,7 +114,7 @@
*
* @return int The number of uis close
*/
/datum/controller/subsystem/nanoui/proc/close_uis(src_object)
/datum/nanomanager/proc/close_uis(src_object)
var/src_object_key = "\ref[src_object]"
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
return 0
@@ -101,7 +136,7 @@
*
* @return int The number of uis updated
*/
/datum/controller/subsystem/nanoui/proc/update_user_uis(var/mob/user, src_object = null, ui_key = null)
/datum/nanomanager/proc/update_user_uis(var/mob/user, src_object = null, ui_key = null)
if (isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
return 0 // has no open uis
@@ -122,7 +157,7 @@
*
* @return int The number of uis closed
*/
/datum/controller/subsystem/nanoui/proc/close_user_uis(var/mob/user, src_object = null, ui_key = null)
/datum/nanomanager/proc/close_user_uis(var/mob/user, src_object = null, ui_key = null)
if (isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
//testing("nanomanager/close_user_uis mob [user.name] has no open uis")
return 0 // has no open uis
@@ -145,7 +180,7 @@
*
* @return nothing
*/
/datum/controller/subsystem/nanoui/proc/ui_opened(var/datum/nanoui/ui)
/datum/nanomanager/proc/ui_opened(var/datum/nanoui/ui)
var/src_object_key = "\ref[ui.src_object]"
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
open_uis[src_object_key] = list(ui.ui_key = list())
@@ -166,7 +201,7 @@
*
* @return int 0 if no ui was removed, 1 if removed successfully
*/
/datum/controller/subsystem/nanoui/proc/ui_closed(var/datum/nanoui/ui)
/datum/nanomanager/proc/ui_closed(var/datum/nanoui/ui)
var/src_object_key = "\ref[ui.src_object]"
if (isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
return 0 // wasn't open
@@ -193,7 +228,7 @@
*/
//
/datum/controller/subsystem/nanoui/proc/user_logout(var/mob/user)
/datum/nanomanager/proc/user_logout(var/mob/user)
//testing("nanomanager/user_logout user [user.name]")
return close_user_uis(user)
@@ -206,7 +241,7 @@
*
* @return nothing
*/
/datum/controller/subsystem/nanoui/proc/user_transferred(var/mob/oldMob, var/mob/newMob)
/datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob)
//testing("nanomanager/user_transferred from mob [oldMob.name] to mob [newMob.name]")
if (!oldMob || isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0)
//testing("nanomanager/user_transferred mob [oldMob.name] has no open uis")
@@ -232,7 +267,7 @@
* @return nothing
*/
/datum/controller/subsystem/nanoui/proc/send_resources(client)
/datum/nanomanager/proc/send_resources(client)
for(var/file in asset_files)
client << browse_rsc(file) // send the file to the client
+3 -3
View File
@@ -412,7 +412,7 @@ nanoui is used to open and update nano browser uis
winset(user, "mapwindow.map", "focus=true") // return keyboard focus to map
on_close_winset()
//onclose(user, window_id)
SSnanoui.ui_opened(src)
GLOB.nanomanager.ui_opened(src)
/**
* Reinitialise this UI, potentially with a different template and/or initial data
@@ -433,7 +433,7 @@ nanoui is used to open and update nano browser uis
*/
/datum/nanoui/proc/close()
is_auto_updating = 0
SSnanoui.ui_closed(src)
GLOB.nanomanager.ui_closed(src)
user << browse(null, "window=[window_id]")
for(var/datum/nanoui/child in children)
child.close()
@@ -492,7 +492,7 @@ nanoui is used to open and update nano browser uis
map_update = 1
if ((src_object && src_object.Topic(href, href_list, state)) || map_update)
SSnanoui.update_uis(src_object) // update all UIs attached to src_object
GLOB.nanomanager.update_uis(src_object) // update all UIs attached to src_object
/**
* Process this UI, updating the entire UI or just the status (aka visibility)
+3 -3
View File
@@ -167,7 +167,7 @@
shut_up = !shut_up
add_fingerprint(usr)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
// Also special treatment!
/obj/machinery/vending/nifsoft_shop/vend(datum/stored_item/vending_product/R, mob/user)
@@ -179,7 +179,7 @@
vend_ready = 0 //One thing at a time!!
status_message = "Installing..."
status_error = 0
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if(R.category & CAT_COIN)
if(!coin)
@@ -215,5 +215,5 @@
status_error = 0
vend_ready = 1
currently_vending = null
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
return 1
@@ -52,7 +52,7 @@
data["engines_info"] = enginfo
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "engines_control.tmpl", "[linked.name] Engines Control", 380, 530)
ui.set_initial_data(data)
+1 -1
View File
@@ -104,7 +104,7 @@
data["locations"] = locations
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "helm.tmpl", "[linked.name] Helm Control", 380, 530)
ui.set_initial_data(data)
@@ -103,7 +103,7 @@
"can_force" = can_go && shuttle.can_force(),
)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "shuttle_control_console_exploration.tmpl", "[shuttle_tag] Shuttle Control", 470, 310)
+2 -2
View File
@@ -57,7 +57,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
data["cooldown"] = sendcooldown
data["destination"] = destination
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "fax.tmpl", src.name, 500, 500)
ui.set_initial_data(data)
@@ -116,7 +116,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
if(href_list["logout"])
authenticated = 0
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/photocopier/faxmachine/proc/sendfax(var/destination)
if(stat & (BROKEN|NOPOWER))
+2 -2
View File
@@ -50,7 +50,7 @@
else
data["isSilicon"] = null
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "photocopier.tmpl", src.name, 300, 250)
ui.set_initial_data(data)
@@ -118,7 +118,7 @@
toner -= 5
sleep(15)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/photocopier/attackby(obj/item/O as obj, mob/user as mob)
if(istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo) || istype(O, /obj/item/weapon/paper_bundle))
+1 -1
View File
@@ -822,7 +822,7 @@
)
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
+1 -1
View File
@@ -211,7 +211,7 @@
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
+1 -1
View File
@@ -327,7 +327,7 @@
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560)
ui.set_initial_data(data)
+1 -1
View File
@@ -328,7 +328,7 @@
data["outputting"] = 0 // smes is not outputting
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -333,7 +333,7 @@
data["ambient_pressure"] = round(env.return_pressure())
data["detonating"] = grav_pulling
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "supermatter_crystal.tmpl", "Supermatter Crystal", 500, 300)
ui.set_initial_data(data)
+1 -1
View File
@@ -363,7 +363,7 @@
data["temp"] = compressor.gas_contained.temperature
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
+16 -13
View File
@@ -12,24 +12,27 @@
my_atom = A
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
if(!SSchemistry.chemical_reagents)
if(!chemical_reagents_list)
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
var/paths = typesof(/datum/reagent) - /datum/reagent
SSchemistry.chemical_reagents = list()
chemical_reagents_list = list()
for(var/path in paths)
var/datum/reagent/D = new path()
if(!D.name)
continue
SSchemistry.chemical_reagents[D.id] = D
chemical_reagents_list[D.id] = D
/datum/reagents/Destroy()
STOP_PROCESSING(SSchemistry, src)
. = ..()
if(chemistryProcess)
chemistryProcess.active_holders -= src
for(var/datum/reagent/R in reagent_list)
qdel(R)
reagent_list.Cut()
reagent_list = null
if(my_atom && my_atom.reagents == src)
my_atom.reagents = null
return ..()
/* Internal procs */
@@ -77,14 +80,15 @@
return
/datum/reagents/proc/handle_reactions()
START_PROCESSING(SSchemistry, src)
if(chemistryProcess)
chemistryProcess.mark_for_update(src)
//returns 1 if the holder should continue reactiong, 0 otherwise.
/datum/reagents/process()
/datum/reagents/proc/process_reactions()
if(QDELETED(my_atom)) //No container, no reaction.
return PROCESS_KILL
return 0
if(my_atom.flags & NOREACT) // No reactions here
return PROCESS_KILL
return 0
var/reaction_occured
var/list/effect_reactions = list()
@@ -94,7 +98,7 @@
//need to rebuild this to account for chain reactions
for(var/datum/reagent/R in reagent_list)
eligible_reactions |= SSchemistry.chemical_reactions[R.id]
eligible_reactions |= chemical_reactions_list[R.id]
for(var/datum/chemical_reaction/C in eligible_reactions)
if(C.can_happen(src) && C.process(src))
@@ -110,8 +114,7 @@
C.post_reaction(src)
update_total()
if(!reaction_occured)
return PROCESS_KILL
return reaction_occured
/* Holder-to-chemical */
@@ -133,7 +136,7 @@
if(my_atom)
my_atom.on_reagent_change()
return 1
var/datum/reagent/D = SSchemistry.chemical_reagents[id]
var/datum/reagent/D = chemical_reagents_list[id]
if(D)
var/datum/reagent/R = new D.type()
reagent_list += R
+2 -2
View File
@@ -134,7 +134,7 @@
data["bottleSpritesAmount"] = list(1, 2, 3, 4) //how many bottle sprites there are. Sprites are taken from chemical.dmi and can be found in nano/images/pill.png
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "chem_master.tmpl", src.name, 575, 400)
ui.set_initial_data(data)
@@ -282,7 +282,7 @@
else if(href_list["bottle_sprite"])
bottlesprite = href_list["bottle_sprite"]
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/chem_master/attack_ai(mob/user as mob)
return src.attack_hand(user)
@@ -1,3 +1,12 @@
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
/proc/initialize_chemical_reagents()
var/paths = typesof(/datum/reagent) - /datum/reagent
chemical_reagents_list = list()
for(var/path in paths)
var/datum/reagent/D = new path()
if(!D.name)
continue
chemical_reagents_list[D.id] = D
@@ -1,3 +1,22 @@
//Chemical Reactions - Initialises all /datum/chemical_reaction into a list
// It is filtered into multiple lists within a list.
// For example:
// chemical_reaction_list["phoron"] is a list of all reactions relating to phoron
// Note that entries in the list are NOT duplicated. So if a reaction pertains to
// more than one chemical it will still only appear in only one of the sublists.
/proc/initialize_chemical_reactions()
var/paths = typesof(/datum/chemical_reaction) - /datum/chemical_reaction
chemical_reactions_list = list()
for(var/path in paths)
var/datum/chemical_reaction/D = new path()
if(D.required_reagents && D.required_reagents.len)
var/reagent_id = D.required_reagents[1]
if(!chemical_reactions_list[reagent_id])
chemical_reactions_list[reagent_id] = list()
chemical_reactions_list[reagent_id] += D
//helper that ensures the reaction rate holds after iterating
//Ex. REACTION_RATE(0.3) means that 30% of the reagents will react each chemistry tick (~2 seconds by default).
#define REACTION_RATE(rate) (1.0 - (1.0-rate)**(1.0/PROCESS_REACTION_ITER))
+1 -1
View File
@@ -18,7 +18,7 @@
. = ..()
if(spawn_reagent)
reagents.add_reagent(spawn_reagent, volume)
var/datum/reagent/R = SSchemistry.chemical_reagents[spawn_reagent]
var/datum/reagent/R = chemical_reagents_list[spawn_reagent]
setLabel(R.name)
/obj/item/weapon/reagent_containers/chem_disp_cartridge/examine(mob/user)
@@ -1,4 +1,4 @@
/client/proc/spawn_chemdisp_cartridge(size in list("small", "medium", "large"), reagent in SSchemistry.chemical_reagents)
/client/proc/spawn_chemdisp_cartridge(size in list("small", "medium", "large"), reagent in chemical_reagents_list)
set name = "Spawn Chemical Dispenser Cartridge"
set category = "Admin"
@@ -8,6 +8,6 @@
if("medium") C = new /obj/item/weapon/reagent_containers/chem_disp_cartridge/medium(usr.loc)
if("large") C = new /obj/item/weapon/reagent_containers/chem_disp_cartridge(usr.loc)
C.reagents.add_reagent(reagent, C.volume)
var/datum/reagent/R = SSchemistry.chemical_reagents[reagent]
var/datum/reagent/R = chemical_reagents_list[reagent]
C.setLabel(R.name)
log_admin("[key_name(usr)] spawned a [size] reagent container containing [reagent] at ([usr.x],[usr.y],[usr.z])")
@@ -55,12 +55,12 @@
C.loc = src
cartridges[C.label] = C
cartridges = sortAssoc(cartridges)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/chemical_dispenser/proc/remove_cartridge(label)
. = cartridges[label]
cartridges -= label
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/chemical_dispenser/attackby(obj/item/weapon/W, mob/user)
if(W.is_wrench())
@@ -106,7 +106,7 @@
user.drop_from_inventory(RC)
RC.loc = src
to_chat(user, "<span class='notice'>You set \the [RC] on \the [src].</span>")
SSnanoui.update_uis(src) // update all UIs attached to src
GLOB.nanomanager.update_uis(src) // update all UIs attached to src
else
return ..()
@@ -140,7 +140,7 @@
data["chemicals"] = chemicals
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "chem_disp.tmpl", ui_title, 390, 680)
ui.set_initial_data(data)
@@ -13,7 +13,7 @@
process_tick = 15
. = 0
for(var/id in dispense_reagents)
var/datum/reagent/R = SSchemistry.chemical_reagents[id]
var/datum/reagent/R = chemical_reagents_list[id]
if(!R)
crash_with("[src] at [x],[y],[z] failed to find reagent '[id]'!")
dispense_reagents -= id
@@ -25,7 +25,7 @@
C.reagents.add_reagent(id, to_restore)
. = 1
if(.)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/chemical_dispenser
dispense_reagents = list(
@@ -39,7 +39,7 @@
for(var/T in reagent_ids)
reagent_volumes[T] = volume
var/datum/reagent/R = SSchemistry.chemical_reagents[T]
var/datum/reagent/R = chemical_reagents_list[T]
reagent_names += R.name
START_PROCESSING(SSobj, src)
@@ -112,14 +112,14 @@
if(t)
playsound(loc, 'sound/effects/pop.ogg', 50, 0)
mode = t
var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]]
var/datum/reagent/R = chemical_reagents_list[reagent_ids[mode]]
usr << "<span class='notice'>Synthesizer is now producing '[R.name]'.</span>"
/obj/item/weapon/reagent_containers/borghypo/examine(mob/user)
if(!..(user, 2))
return
var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]]
var/datum/reagent/R = chemical_reagents_list[reagent_ids[mode]]
user << "<span class='notice'>It is currently producing [R.name] and has [reagent_volumes[reagent_ids[mode]]] out of [volume] units left.</span>"
+2 -2
View File
@@ -198,7 +198,7 @@
data["coredumped"] = SStranscore.core_dumped
data["emergency"] = disk ? 1 : 0
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "sleever.tmpl", "Resleeving Control Console", 400, 450)
ui.set_initial_data(data)
@@ -375,7 +375,7 @@
menu = href_list["menu"]
temp = ""
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
add_fingerprint(usr)
// In here because only relevant to computer
+1 -1
View File
@@ -141,7 +141,7 @@
data["disk"] = disk ? 1 : 0
data["diskStored"] = disk && disk.stored ? 1 : 0
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "body_designer.tmpl", "Body Design Console", 400, 600)
ui.set_initial_data(data)
+2 -2
View File
@@ -187,7 +187,7 @@ var/list/infomorph_emotions = list(
medicalActive1 = null
medicalActive2 = null
medical_cannotfind = 0
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
usr << "<span class='notice'>You reset your record-viewing software.</span>"
/*
@@ -509,7 +509,7 @@ var/global/list/default_infomorph_software = list()
data["emotions"] = emotions
data["current_emotion"] = card.current_emotion
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open, key_state)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open, key_state)
if (!ui)
ui = new(user, src, ui_key, "pai_interface.tmpl", "Card Software Interface", 450, 600, state = key_state)
ui.set_initial_data(data)
@@ -34,7 +34,7 @@
// This is dumb, but NanoUI breaks if it has no data to send
data["manifest"] = PDA_Manifest
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_manifest.tmpl", "Crew Manifest", 450, 600)
@@ -66,7 +66,7 @@
data["medical"] = M ? M.fields : null
data["could_not_find"] = user.medical_cannotfind
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_medrecords.tmpl", "Medical Records", 450, 600)
@@ -120,7 +120,7 @@
data["security"] = S ? S.fields : null
data["could_not_find"] = user.security_cannotfind
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_secrecords.tmpl", "Security Records", 450, 600)
@@ -170,7 +170,7 @@
data["progress_b"] = user.hackprogress % 10
data["aborted"] = user.hack_aborted
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_doorjack.tmpl", "Door Jack", 300, 150)
@@ -270,7 +270,7 @@
gases[++gases.len] = gas
data["gas"] = gases
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_atmosphere.tmpl", "Atmosphere Sensor", 350, 300)
@@ -314,7 +314,7 @@
data["frequency"] = format_frequency(user.sradio.frequency)
data["code"] = user.sradio.code
ui = SSnanoui.try_update_ui(user, user, id, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)
// Don't copy-paste this unless you're making a pAI software module!
ui = new(user, user, id, "pai_signaller.tmpl", "Signaller", 320, 150)
+2 -2
View File
@@ -79,7 +79,7 @@
// Permit emergency recall of the shuttle if its stranded in a zone with just dead people.
data["can_recall_shuttle"] = (shuttle_control && shuttle_control.z == BELT_Z && !curZoneOccupied)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "zone_console.tmpl", src.name, 600, 400)
ui.set_initial_data(data)
@@ -100,7 +100,7 @@
failsafe_shuttle_recall()
src.add_fingerprint(usr)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/computer/roguezones/proc/scan_for_new_zone()
if(scanning) return
+2 -2
View File
@@ -55,7 +55,7 @@
"is_armed" = pod.arming_controller.armed,
)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "escape_pod_console.tmpl", name, 470, 290)
@@ -102,7 +102,7 @@
"armed" = armed,
)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "escape_pod_berth_console.tmpl", name, 470, 290)
+1 -1
View File
@@ -57,7 +57,7 @@
"can_force" = shuttle.can_force(),
)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "shuttle_control_console.tmpl", "[shuttle_tag] Shuttle Control", 470, 310)
+1 -1
View File
@@ -233,7 +233,7 @@
"user" = debug? user : null,
)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "escape_shuttle_control_console.tmpl", "Shuttle Control", 470, 420)
+1 -1
View File
@@ -350,7 +350,7 @@
"sensors" = sensors
)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "flight.tmpl", "[shuttle.visible_name] Flight Computer", 500, 500)
+1 -1
View File
@@ -116,7 +116,7 @@
data["lastTeleData"]["distance"] = last_tele_data.distance
data["lastTeleData"]["time"] = last_tele_data.time
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "telescience_console.tmpl", src.name, 400, 450)
ui.set_initial_data(data)
+5 -5
View File
@@ -26,7 +26,7 @@
O.loc = src
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
src.attack_hand(user)
@@ -74,7 +74,7 @@
data["antibodies"] = antigens2string(A.data["antibodies"], none=null)
data["is_antibody_sample"] = 1
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "isolation_centrifuge.tmpl", src.name, 400, 500)
ui.set_initial_data(data)
@@ -98,7 +98,7 @@
if (..()) return 1
var/mob/user = usr
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
src.add_fingerprint(user)
@@ -160,7 +160,7 @@
sample.reagents.remove_reagent("blood", amt)
sample.reagents.add_reagent("antibodies", amt, data)
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
update_icon()
ping("\The [src] pings, \"Antibody isolated.\"")
@@ -170,7 +170,7 @@
dish.virus2 = virus2
virus2 = null
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
update_icon()
ping("\The [src] pings, \"Pathogen isolated.\"")
+5 -5
View File
@@ -81,7 +81,7 @@
else
data["info"] = "No dish loaded."
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "disease_splicer.tmpl", src.name, 400, 600)
ui.set_initial_data(data)
@@ -95,12 +95,12 @@
scanning -= 1
if(!scanning)
ping("\The [src] pings, \"Analysis complete.\"")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if(splicing)
splicing -= 1
if(!splicing)
ping("\The [src] pings, \"Splicing operation complete.\"")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if(burning)
burning -= 1
if(!burning)
@@ -122,13 +122,13 @@
d.species = species_buffer
ping("\The [src] pings, \"Backup disk saved.\"")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/computer/diseasesplicer/Topic(href, href_list)
if(..()) return 1
var/mob/user = usr
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
src.add_fingerprint(user)
+11 -11
View File
@@ -29,7 +29,7 @@
O.loc = src
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
src.attack_hand(user)
return
@@ -45,7 +45,7 @@
O.loc = src
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
src.attack_hand(user)
@@ -85,7 +85,7 @@
for (var/ID in virus)
data["blood_already_infected"] = virus[ID]
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "dish_incubator.tmpl", src.name, 400, 600)
ui.set_initial_data(data)
@@ -104,7 +104,7 @@
foodsupply -= 1
dish.growth += 3
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if(radiation)
if(radiation > 50 & prob(5))
@@ -117,24 +117,24 @@
else if(prob(5))
dish.virus2.minormutate()
radiation -= 1
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if(toxins && prob(5))
dish.virus2.infectionchance -= 1
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if(toxins > 50)
dish.growth = 0
dish.virus2 = null
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
else if(!dish)
on = 0
icon_state = "incubator"
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if(beaker)
if(foodsupply < 100 && beaker.reagents.remove_reagent("virusfood",5))
if(foodsupply + 10 <= 100)
foodsupply += 10
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
if (locate(/datum/reagent/toxin) in beaker.reagents.reagent_list && toxins < 100)
for(var/datum/reagent/toxin/T in beaker.reagents.reagent_list)
@@ -143,13 +143,13 @@
if(toxins > 100)
toxins = 100
break
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
/obj/machinery/disease2/incubator/Topic(href, href_list)
if (..()) return 1
var/mob/user = usr
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
src.add_fingerprint(user)
+1 -1
View File
@@ -354,7 +354,7 @@
data = pick("bicaridine", "kelotane", "anti_toxin", "inaprovaline", "space_drugs", "sugar",
"tramadol", "dexalin", "cryptobiolin", "impedrezene", "hyperzine", "ethylredoxrazine",
"mindbreaker", "glucose")
var/datum/reagent/R = SSchemistry.chemical_reagents[data]
var/datum/reagent/R = chemical_reagents_list[data]
name = "[initial(name)] ([initial(R.name)])"
/datum/disease2/effect/chem_synthesis/activate(var/mob/living/carbon/mob,var/multiplier)
+4 -4
View File
@@ -43,7 +43,7 @@
S.loc = src
user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
update_icon()
src.attack_hand(user)
@@ -103,7 +103,7 @@
"name" = entry.fields["name"], \
"description" = replacetext(desc, "\n", ""))
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "pathogenic_isolator.tmpl", src.name, 400, 500)
ui.set_initial_data(data)
@@ -119,14 +119,14 @@
virus2 = null
ping("\The [src] pings, \"Viral strain isolated.\"")
SSnanoui.update_uis(src)
GLOB.nanomanager.update_uis(src)
update_icon()
/obj/machinery/disease2/isolator/Topic(href, href_list)
if (..()) return 1
var/mob/user = usr
var/datum/nanoui/ui = SSnanoui.get_open_ui(user, src, "main")
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
src.add_fingerprint(user)
@@ -150,7 +150,7 @@
data["rad_shield_on"] = rad_shield
// update the ui if it exists, returns null if no ui is passed/found
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm