From cff0528673dcab2c760b9ad1a67fd6629875bfde Mon Sep 17 00:00:00 2001 From: Markolie Date: Tue, 8 Nov 2016 16:23:13 +0100 Subject: [PATCH 01/70] Verb category changes, telecoms verb fix --- code/game/gamemodes/cult/ritual.dm | 9 ++++++++- code/game/gamemodes/gameticker.dm | 2 +- code/modules/admin/admin.dm | 4 ++-- code/modules/admin/admin_verbs.dm | 2 +- code/modules/admin/buildmode.dm | 3 ++- code/modules/admin/verbs/adminsay.dm | 4 ++-- code/modules/admin/verbs/deadsay.dm | 2 +- code/modules/admin/verbs/freeze.dm | 23 +++++++++++++---------- code/modules/admin/verbs/randomverbs.dm | 18 +++++++++--------- code/modules/karma/karma.dm | 6 +++--- 10 files changed, 42 insertions(+), 31 deletions(-) diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index e60b7406675..ab25f22a8fd 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -6,13 +6,20 @@ var/runedec = 0 var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", "self", "see", "other", "hide") /client/proc/check_words() // -- Urist - set category = "Special Verbs" + set category = "Admin" set name = "Check Rune Words" set desc = "Check the rune-word meaning" + + if(!check_rights(R_ADMIN)) + return + if(!cultwords["travel"]) runerandom() for(var/word in engwords) to_chat(usr, "[cultwords[word]] is [word]") + + log_and_message_admins("checked the rune words.") + feedback_add_details("admin_verb","CRW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /proc/runerandom() //randomizes word meaning var/list/runewords=list("ire","ego","nahlizet","certum","veri","jatkaa","mgar","balaq", "karazet", "geeri") ///"orkan" and "allaq" removed. diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 5deb2bafa0f..328facd08c6 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -414,7 +414,7 @@ var/round_start_time = 0 var/dat dat += {"Karma Reminder

Karma Reminder


You have not yet spent your karma for the round, surely there is a player who was worthy of receiving
- your reward? Look under 'Special Verbs' for the 'Award Karma' button, and use it once a round for best results!"} + your reward? Look under 'OOC' for the 'Award Karma' button, and use it once a round for best results!"} player << browse(dat, "window=karmareminder;size=400x300") diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index dcbb5c74c4d..6f1d4dc65a8 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -540,9 +540,9 @@ var/global/nologevent = 0 world.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "end_error", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay) /datum/admins/proc/announce() - set category = "Special Verbs" + set category = "Admin" set name = "Announce" - set desc="Announce your desires to the world" + set desc = "Announce your desires to the world" if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index fda1382d4df..ba46a995ffd 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -534,7 +534,7 @@ var/list/admin_verbs_snpc = list( #undef AUTOBANTIME /client/proc/drop_bomb() // Some admin dickery that can probably be done better -- TLE - set category = "Special Verbs" + set category = "Event" set name = "Drop Bomb" set desc = "Cause an explosion of varying strength at your location." diff --git a/code/modules/admin/buildmode.dm b/code/modules/admin/buildmode.dm index 87721320af5..8ad4bfcbb0e 100644 --- a/code/modules/admin/buildmode.dm +++ b/code/modules/admin/buildmode.dm @@ -396,7 +396,8 @@ /proc/togglebuildmode(mob/M as mob in player_list) set name = "Toggle Build Mode" - set category = "Special Verbs" + set category = "Event" + if(M.client) if(istype(M.client.click_intercept,/datum/click_intercept/buildmode)) var/datum/click_intercept/buildmode/B = M.client.click_intercept diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 67130872222..7c7569e5907 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -1,5 +1,5 @@ /client/proc/cmd_admin_say(msg as text) - set category = "Special Verbs" + set category = "Admin" set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite set hidden = 1 if(!check_rights(R_ADMIN)) return @@ -17,7 +17,7 @@ feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_mentor_say(msg as text) - set category = "Special Verbs" + set category = "Admin" set name = "Msay" set hidden = 1 diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 690cac87536..3874e26e9de 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -1,5 +1,5 @@ /client/proc/dsay(msg as text) - set category = "Special Verbs" + set category = "Admin" set name = "Dsay" //Gave this shit a shorter name so you only have to time out "dsay" rather than "dead say" to use it --NeoFite set hidden = 1 diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm index fb93cd3512d..b0c63544634 100644 --- a/code/modules/admin/verbs/freeze.dm +++ b/code/modules/admin/verbs/freeze.dm @@ -7,13 +7,15 @@ //////////////////////////////////////////////////////////////////////////////// var/global/list/frozen_mob_list = list() /client/proc/freeze(var/mob/living/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Freeze" - if(!holder) - to_chat(src, "Error: Freeze: Only administrators may use this command.") + + if(!check_rights(R_ADMIN)) return - if(!istype(M)) return - if(!check_rights(R_ADMIN)) return + + if(!istype(M)) + return + if(M in frozen_mob_list) M.admin_unFreeze(src) else @@ -83,14 +85,15 @@ var/global/list/frozen_mob_list = list() //////////////////////////Freeze Mech /client/proc/freezemecha(var/obj/mecha/O as obj in mechas_list) - set category = "Special Verbs" + set category = "Admin" set name = "Freeze Mech" - if(!holder) - to_chat(src, "Only administrators may use this command.") - return + + if(!check_rights(R_ADMIN)) + return + var/obj/mecha/M = O if(!istype(M,/obj/mecha)) - to_chat(src, "This can only be used on Mechs!") + to_chat(src, "This can only be used on mechs!") return else if(usr) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index b776eb9a649..79ee34fb635 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -139,7 +139,7 @@ feedback_add_details("admin_verb","DIRN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_godmode(mob/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Godmode" if(!check_rights(R_ADMIN)) @@ -287,7 +287,7 @@ Works kind of like entering the game with a new character. Character receives a Traitors and the like can also be revived with the previous role mostly intact. /N */ /client/proc/respawn_character() - set category = "Special Verbs" + set category = "Event" set name = "Respawn Character" set desc = "Respawn a person that has been gibbed/dusted/killed. They must be a ghost for this to work and preferably should not have a body to go back into." @@ -520,7 +520,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_rejuvenate(mob/living/M as mob in mob_list) - set category = "Special Verbs" + set category = "Event" set name = "Rejuvenate" if(!check_rights(R_REJUVINATE)) @@ -659,7 +659,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/cmd_admin_emp(atom/O as obj|mob|turf in view()) - set category = "Special Verbs" + set category = "Event" set name = "EM Pulse" if(!check_rights(R_DEBUG|R_EVENT)) @@ -682,7 +682,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/cmd_admin_gib(mob/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Gib" if(!check_rights(R_ADMIN|R_EVENT)) @@ -722,7 +722,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_check_contents(mob/living/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Check Contents" if(!check_rights(R_ADMIN)) @@ -734,7 +734,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","CC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/toggle_view_range() - set category = "Special Verbs" + set category = "Admin" set name = "Change View Range" set desc = "switches between 1x and custom views" @@ -806,7 +806,7 @@ Traitors and the like can also be revived with the previous role mostly intact. message_admins("[key_name_admin(usr)] has [shuttle_master.emergencyNoEscape ? "denied" : "allowed"] the shuttle to be called.") /client/proc/cmd_admin_attack_log(mob/M as mob in mob_list) - set category = "Special Verbs" + set category = "Admin" set name = "Attack Log" if(!check_rights(R_ADMIN)) @@ -875,7 +875,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Reset Telecomms Scripts" set desc = "Blanks all telecomms scripts from all telecomms servers" - if(!check_rights(R_ADMIN, 1, src)) + if(!check_rights(R_ADMIN)) return var/confirm = alert(src, "You sure you want to blank all NTSL scripts?", "Confirm", "Yes", "No") diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm index e8c047c98bc..d1f3f5d98c3 100644 --- a/code/modules/karma/karma.dm +++ b/code/modules/karma/karma.dm @@ -84,7 +84,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma_list() set name = "Award Karma" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "Special Verbs" + set category = "OOC" if(!can_give_karma()) return @@ -113,7 +113,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma(var/mob/M) set name = "Award Karma to Player" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "Special Verbs" + set category = "OOC" if(!M) to_chat(usr, "Please right click a mob to award karma directly, or use the 'Award Karma' verb to select a player from the player listing.") @@ -144,7 +144,7 @@ var/list/karma_spenders = list() /client/verb/check_karma() set name = "Check Karma" - set category = "Special Verbs" + set category = "OOC" set desc = "Reports how much karma you have accrued." var/currentkarma=verify_karma() From 42dd03b2cf97ea18e65064d35ca23f8f34d37da6 Mon Sep 17 00:00:00 2001 From: Markolie Date: Tue, 8 Nov 2016 16:31:48 +0100 Subject: [PATCH 02/70] Fix up buildmode log --- code/modules/admin/buildmode.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/admin/buildmode.dm b/code/modules/admin/buildmode.dm index 8ad4bfcbb0e..72461ed6ae1 100644 --- a/code/modules/admin/buildmode.dm +++ b/code/modules/admin/buildmode.dm @@ -405,7 +405,7 @@ log_admin("[key_name(usr)] has left build mode.") else new/datum/click_intercept/buildmode(M.client) - message_admins("[key_name(usr)] has entered build mode.") + message_admins("[key_name_admin(usr)] has entered build mode.") log_admin("[key_name(usr)] has entered build mode.") /datum/click_intercept/buildmode/InterceptClickOn(user,params,atom/object) //Click Intercept From 64a2e876a705f0fe090aac2ccda1b350ce9f9b2d Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Wed, 9 Nov 2016 04:54:55 -0500 Subject: [PATCH 03/70] Adds switch-layer rendering functionality for facial hair, glasses and head accessories. Glasses will now overlay hair only in certain circumstances. Hair that is short (has glasses_over set) will have glasses rendered on top of it rather than the default behaviour of below it. --- code/__DEFINES/misc.dm | 35 +++++++------ code/game/dna/dna2_helpers.dm | 8 +-- .../mob/living/carbon/human/appearance.dm | 1 + .../mob/living/carbon/human/update_icons.dm | 45 +++++++++++------ .../mob/new_player/sprite_accessories.dm | 50 +++++++++++++++++++ 5 files changed, 101 insertions(+), 38 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index dad6165400f..2f4b5718208 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -196,7 +196,7 @@ //Human Overlays Indexes///////// #define MUTANTRACE_LAYER 1 -#define TAIL_UNDERLIMBS_LAYER 2 +#define TAIL_UNDERLIMBS_LAYER 2 //Tail split-rendering. #define LIMBS_LAYER 3 #define MARKINGS_LAYER 4 #define UNDERWEAR_LAYER 5 @@ -211,21 +211,24 @@ #define BELT_LAYER 14 //Possible make this an overlay of somethign required to wear a belt? #define SUIT_STORE_LAYER 15 #define BACK_LAYER 16 -#define HAIR_LAYER 17 //TODO: make part of head layer? -#define HEAD_ACCESSORY_LAYER 18 -#define FHAIR_LAYER 19 -#define TAIL_LAYER 20 //bs12 specific. this hack is probably gonna come back to haunt me -#define GLASSES_LAYER 21 -#define FACEMASK_LAYER 22 -#define HEAD_LAYER 23 -#define COLLAR_LAYER 24 -#define HANDCUFF_LAYER 25 -#define LEGCUFF_LAYER 26 -#define L_HAND_LAYER 27 -#define R_HAND_LAYER 28 -#define TARGETED_LAYER 29 //BS12: Layer for the target overlay from weapon targeting system -#define FIRE_LAYER 30 //If you're on fire -#define TOTAL_LAYERS 30 +#define HEAD_ACCESSORY_LAYER 17 +#define FHAIR_LAYER 18 +#define GLASSES_LAYER 19 +#define HAIR_LAYER 20 //TODO: make part of head layer? +#define HEAD_ACC_OVER_LAYER 21 //Select-layer rendering. +#define FHAIR_OVER_LAYER 22 //Select-layer rendering. +#define GLASSES_OVER_LAYER 23 //Select-layer rendering. +#define TAIL_LAYER 24 //bs12 specific. this hack is probably gonna come back to haunt me +#define FACEMASK_LAYER 25 +#define HEAD_LAYER 26 +#define COLLAR_LAYER 27 +#define HANDCUFF_LAYER 28 +#define LEGCUFF_LAYER 29 +#define L_HAND_LAYER 30 +#define R_HAND_LAYER 31 +#define TARGETED_LAYER 32 //BS12: Layer for the target overlay from weapon targeting system +#define FIRE_LAYER 33 //If you're on fire +#define TOTAL_LAYERS 33 ///Access Region Codes/// #define REGION_ALL 0 diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 2c5fdbbb5b1..e38fdca5b8d 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -174,13 +174,7 @@ if((tail_marks > 0) && (tail_marks <= number_tail_marks)) H.m_styles["tail"] = marking_styles_list[tail_marks] - H.force_update_limbs() - H.update_eyes() - H.update_hair() - H.update_fhair() - H.update_markings() - H.update_tail_layer() - H.update_head_accessory() + H.regenerate_icons() return 1 else diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index eb58d39ea7c..ad1ab28c435 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -43,6 +43,7 @@ H.h_style = hair_style update_hair() + update_inv_glasses() return 1 /mob/living/carbon/human/proc/change_facial_hair(var/facial_hair_style) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 037e5234d27..48555229aad 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -395,6 +395,7 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/proc/update_head_accessory(var/update_icons=1) //Reset our head accessory overlays_standing[HEAD_ACCESSORY_LAYER] = null + overlays_standing[HEAD_ACC_OVER_LAYER] = null var/obj/item/organ/external/head/head_organ = get_organ("head") if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED) ) @@ -408,9 +409,8 @@ var/global/list/damage_icon_parts = list() //base icons var/icon/head_accessory_standing = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s") - if(head_organ.ha_style && (head_organ.species.bodyflags & HAS_HEAD_ACCESSORY)) - var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[head_organ.ha_style] + var/datum/sprite_accessory/head_accessory/head_accessory_style = head_accessory_styles_list[head_organ.ha_style] if(head_accessory_style && head_accessory_style.species_allowed) if(head_organ.species.name in head_accessory_style.species_allowed) var/icon/head_accessory_s = new/icon("icon" = head_accessory_style.icon, "icon_state" = "[head_accessory_style.icon_state]_s") @@ -418,11 +418,14 @@ var/global/list/damage_icon_parts = list() head_accessory_s.Blend(rgb(head_organ.r_headacc, head_organ.g_headacc, head_organ.b_headacc), ICON_ADD) head_accessory_standing = head_accessory_s //head_accessory_standing.Blend(head_accessory_s, ICON_OVERLAY) //Having it this way preserves animations. Useful for animated antennae. + + if(head_accessory_style.over_hair) //Select which layer to use based on the properties of the head accessory style. + overlays_standing[HEAD_ACC_OVER_LAYER] = image(head_accessory_standing) + else + overlays_standing[HEAD_ACCESSORY_LAYER] = image(head_accessory_standing) else //warning("Invalid ha_style for [species.name]: [ha_style]") - overlays_standing[HEAD_ACCESSORY_LAYER] = image(head_accessory_standing) - if(update_icons) update_icons() @@ -446,7 +449,7 @@ var/global/list/damage_icon_parts = list() //var/icon/debrained_s = new /icon("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s") if(head_organ.h_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic()))) - var/datum/sprite_accessory/hair_style = hair_styles_list[head_organ.h_style] + var/datum/sprite_accessory/hair/hair_style = hair_styles_list[head_organ.h_style] //if(!src.get_int_organ(/obj/item/organ/internal/brain) && src.get_species() != "Machine" )//make it obvious we have NO BRAIN // hair_standing.Blend(debrained_s, ICON_OVERLAY) if(hair_style && hair_style.species_allowed) @@ -477,7 +480,8 @@ var/global/list/damage_icon_parts = list() //FACIAL HAIR OVERLAY /mob/living/carbon/human/proc/update_fhair(var/update_icons=1) //Reset our facial hair - overlays_standing[FHAIR_LAYER] = null + overlays_standing[FHAIR_LAYER] = null + overlays_standing[FHAIR_OVER_LAYER] = null var/obj/item/organ/external/head/head_organ = get_organ("head") if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED)) @@ -493,7 +497,7 @@ var/global/list/damage_icon_parts = list() var/icon/face_standing = new /icon('icons/mob/human_face.dmi',"bald_s") if(head_organ.f_style) - var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[head_organ.f_style] + var/datum/sprite_accessory/facial_hair/facial_hair_style = facial_hair_styles_list[head_organ.f_style] if(facial_hair_style && facial_hair_style.species_allowed) if((head_organ.species.name in facial_hair_style.species_allowed) || (head_organ.species.flags & ALL_RPARTS)) //If the head's species is in the list of allowed species for the hairstyle, or the head's species is one flagged to have bodies comprised wholly of cybernetics... var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s") @@ -509,11 +513,14 @@ var/global/list/damage_icon_parts = list() facial_s.Blend(facial_secondary_s, ICON_OVERLAY) face_standing.Blend(facial_s, ICON_OVERLAY) + + if(facial_hair_style.over_hair) //Select which layer to use based on the properties of the facial hair style. + overlays_standing[FHAIR_OVER_LAYER] = image(face_standing) + else + overlays_standing[FHAIR_LAYER] = image(face_standing) else //warning("Invalid f_style for [species.name]: [f_style]") - overlays_standing[FHAIR_LAYER] = image(face_standing) - if(update_icons) update_icons() /mob/living/carbon/human/update_mutations(var/update_icons=1) @@ -736,6 +743,8 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/update_inv_glasses(var/update_icons=1) + overlays_standing[GLASSES_LAYER] = null + overlays_standing[GLASSES_OVER_LAYER] = null if(client && hud_used) var/obj/screen/inventory/inv = hud_used.inv_slots[slot_glasses] @@ -743,20 +752,26 @@ var/global/list/damage_icon_parts = list() inv.update_icon() if(glasses) + var/image/new_glasses + var/obj/item/organ/external/head/head_organ = get_organ("head") if(client && hud_used && hud_used.hud_shown) if(hud_used.inventory_shown) //if the inventory is open ... glasses.screen_loc = ui_glasses //...draw the item in the inventory screen client.screen += glasses //Either way, add the item to the HUD if(glasses.icon_override) - overlays_standing[GLASSES_LAYER] = image("icon" = glasses.icon_override, "icon_state" = "[glasses.icon_state]") - else if(glasses.sprite_sheets && glasses.sprite_sheets[species.name]) - overlays_standing[GLASSES_LAYER]= image("icon" = glasses.sprite_sheets[species.name], "icon_state" = "[glasses.icon_state]") + new_glasses = image("icon" = glasses.icon_override, "icon_state" = "[glasses.icon_state]") + else if(glasses.sprite_sheets && glasses.sprite_sheets[head_organ.species.name]) + new_glasses = image("icon" = glasses.sprite_sheets[head_organ.species.name], "icon_state" = "[glasses.icon_state]") else - overlays_standing[GLASSES_LAYER]= image("icon" = 'icons/mob/eyes.dmi', "icon_state" = "[glasses.icon_state]") + new_glasses = image("icon" = 'icons/mob/eyes.dmi', "icon_state" = "[glasses.icon_state]") + + var/datum/sprite_accessory/hair/hair_style = hair_styles_list[head_organ.h_style] + if(hair_style && hair_style.glasses_over) //Select which layer to use based on the properties of the hair style. Hair styles with hair that don't overhang the arms of the glasses should have glasses_over set to a positive value. + overlays_standing[GLASSES_OVER_LAYER] = new_glasses + else + overlays_standing[GLASSES_LAYER] = new_glasses - else - overlays_standing[GLASSES_LAYER] = null if(update_icons) update_icons() /mob/living/carbon/human/update_inv_ears(var/update_icons=1) diff --git a/code/modules/mob/new_player/sprite_accessories.dm b/code/modules/mob/new_player/sprite_accessories.dm index 0e8f3456335..2e40b49db36 100644 --- a/code/modules/mob/new_player/sprite_accessories.dm +++ b/code/modules/mob/new_player/sprite_accessories.dm @@ -65,19 +65,23 @@ /datum/sprite_accessory/hair icon = 'icons/mob/human_face.dmi' // default icon for all hairs + var/glasses_over //Hair styles with hair that don't overhang the arms of glasses should have glasses_over set to a positive value. /datum/sprite_accessory/hair/bald name = "Bald" icon_state = "bald" species_allowed = list("Human", "Unathi", "Vox", "Diona", "Kidan", "Grey", "Plasmaman", "Skeleton", "Vulpkanin", "Tajaran") + glasses_over = 1 /datum/sprite_accessory/hair/short name = "Short Hair" // try to capatilize the names please~ icon_state = "hair_a" // you do not need to define _s or _l sub-states, game automatically does this for you + glasses_over = 1 /datum/sprite_accessory/hair/cut name = "Cut Hair" icon_state = "hair_c" + glasses_over = 1 /datum/sprite_accessory/hair/long name = "Shoulder-length Hair" @@ -123,6 +127,7 @@ name = "Ponytail male" icon_state = "hair_ponytailm" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/ponytail2 name = "Ponytail female" @@ -132,16 +137,19 @@ /datum/sprite_accessory/hair/ponytail3 name = "Ponytail alt" icon_state = "hair_ponytail3" + glasses_over = 1 /datum/sprite_accessory/hair/sideponytail name = "Side Ponytail" icon_state = "hair_stail" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/highponytail name = "High Ponytail" icon_state = "hair_highponytail" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/wisp name = "Wisp" @@ -157,11 +165,13 @@ icon_state = "hair_pompadour" gender = MALE species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/quiff name = "Quiff" icon_state = "hair_quiff" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/bedhead name = "Bedhead" @@ -197,6 +207,7 @@ name = "Bowl" icon_state = "hair_bowlcut" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/braid2 name = "Long Braid" @@ -219,20 +230,24 @@ icon_state = "hair_buzzcut" gender = MALE species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/crew name = "Crewcut" icon_state = "hair_crewcut" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/combover name = "Combover" icon_state = "hair_combover" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/devillock name = "Devil Lock" icon_state = "hair_devilock" + glasses_over = 1 /datum/sprite_accessory/hair/dreadlocks name = "Dreadlocks" @@ -249,6 +264,7 @@ /datum/sprite_accessory/hair/afro2 name = "Afro 2" icon_state = "hair_afro2" + glasses_over = 1 /datum/sprite_accessory/hair/afro_large name = "Big Afro" @@ -259,6 +275,7 @@ name = "Flat Top" icon_state = "hair_sergeant" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/emo name = "Emo" @@ -276,31 +293,37 @@ name = "Hitop" icon_state = "hair_hitop" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/mohawk name = "Mohawk" icon_state = "hair_d" species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/jensen name = "Adam Jensen Hair" icon_state = "hair_jensen" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/cia name = "CIA" icon_state = "hair_cia" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/mulder name = "Mulder" icon_state = "hair_mulder" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/gelled name = "Gelled Back" icon_state = "hair_gelled" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/gentle name = "Gentle" @@ -311,6 +334,7 @@ name = "Spiky" icon_state = "hair_spikey" species_allowed = list("Human", "Slime People", "Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/kusanagi name = "Kusanagi Hair" @@ -320,6 +344,7 @@ name = "Pigtails" icon_state = "hair_kagami" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/himecut name = "Hime Cut" @@ -335,6 +360,7 @@ name = "Odango" icon_state = "hair_odango" gender = FEMALE + glasses_over = 1 /datum/sprite_accessory/hair/ombre name = "Ombre" @@ -349,11 +375,13 @@ /datum/sprite_accessory/hair/skinhead name = "Skinhead" icon_state = "hair_skinhead" + glasses_over = 1 /datum/sprite_accessory/hair/balding name = "Balding Hair" icon_state = "hair_e" gender = MALE // turnoff! + glasses_over = 1 /datum/sprite_accessory/hair/longemo name = "Long Emo" @@ -385,6 +413,7 @@ name = "Unshaven Mohawk" icon_state = "hair_unshavenmohawk" gender = MALE + glasses_over = 1 /datum/sprite_accessory/hair/drills name = "Twincurls" @@ -401,6 +430,7 @@ /datum/sprite_accessory/hair/ipc species_allowed = list("Machine") + glasses_over = 1 /datum/sprite_accessory/hair/ipc/ipc_screen_pink name = "Pink IPC Screen" @@ -547,6 +577,7 @@ /datum/sprite_accessory/hair/unathi species_allowed = list("Unathi") + glasses_over = 1 /datum/sprite_accessory/hair/unathi/una_horns name = "Unathi Horns" @@ -593,6 +624,7 @@ /datum/sprite_accessory/hair/tajara species_allowed = list("Tajaran") + glasses_over = 1 /datum/sprite_accessory/hair/tajara/taj_hair_clean name = "Tajara Clean" @@ -601,11 +633,13 @@ /datum/sprite_accessory/hair/tajara/taj_hair_bangs name = "Tajara Bangs" icon_state = "hair_bangs" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_braid name = "Tajara Braid" icon_state = "hair_tbraid" secondary_theme = "beads" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_shaggy name = "Tajara Shaggy" @@ -642,22 +676,27 @@ /datum/sprite_accessory/hair/tajara/taj_hair_curls name = "Tajara Curly" icon_state = "hair_curly" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_retro name = "Tajaran Ladies' Retro" icon_state = "hair_ladies_retro" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_victory name = "Tajara Victory Curls" icon_state = "hair_victory" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_bob name = "Tajara Bob" icon_state = "hair_tbob" + glasses_over = null /datum/sprite_accessory/hair/tajara/taj_hair_fingercurl name = "Tajara Finger Curls" icon_state = "hair_fingerwave" + glasses_over = null /datum/sprite_accessory/hair/vulpkanin species_allowed = list("Vulpkanin") @@ -694,6 +733,7 @@ /datum/sprite_accessory/hair/vulpkanin/vulp_hair_bun name = "Bun" icon_state = "bun" + glasses_over = 1 /datum/sprite_accessory/hair/vulpkanin/vulp_hair_jagged name = "Jagged" @@ -706,6 +746,7 @@ /datum/sprite_accessory/hair/vulpkanin/vulp_hair_hawk name = "Hawk" icon_state = "hawk" + glasses_over = 1 /datum/sprite_accessory/hair/vulpkanin/vulp_hair_anita name = "Anita" @@ -718,6 +759,7 @@ /datum/sprite_accessory/hair/vulpkanin/vulp_hair_spike name = "Spike" icon_state = "spike" + glasses_over = 1 /datum/sprite_accessory/hair/vulpkanin/vulp_hair_braided name = "Braided" @@ -726,6 +768,7 @@ /datum/sprite_accessory/hair/vox species_allowed = list("Vox") + glasses_over = 1 /datum/sprite_accessory/hair/vox/vox_quills_short name = "Short Vox Quills" @@ -787,6 +830,7 @@ /datum/sprite_accessory/hair/wryn species_allowed = list("Wryn") + glasses_over = 1 /datum/sprite_accessory/hair/wryn/wry_antennae_default name = "Antennae" @@ -794,6 +838,7 @@ /datum/sprite_accessory/hair/nucleation species_allowed = list("Nucleation") + glasses_over = 1 /datum/sprite_accessory/hair/nucleation/nuc_crystals name = "Nucleation Crystals" @@ -835,6 +880,7 @@ /datum/sprite_accessory/facial_hair icon = 'icons/mob/human_face.dmi' gender = MALE // barf (unless you're a dorf, dorfs dig chix /w beards :P) + var/over_hair /datum/sprite_accessory/facial_hair/shaved name = "Shaved" @@ -1024,6 +1070,7 @@ /datum/sprite_accessory/facial_hair/unathi species_allowed = list("Unathi") gender = NEUTER + over_hair = 1 /datum/sprite_accessory/facial_hair/unathi/una_spines_long name = "Long Spines" @@ -1594,6 +1641,7 @@ icon = 'icons/mob/body_accessory.dmi' species_allowed = list("Unathi", "Vulpkanin", "Tajaran", "Machine") icon_state = "accessory_none" + var/over_hair /datum/sprite_accessory/head_accessory/none name = "None" @@ -1602,6 +1650,7 @@ /datum/sprite_accessory/head_accessory/unathi species_allowed = list("Unathi") + over_hair = 1 /datum/sprite_accessory/head_accessory/unathi/simple name = "Simple" @@ -1701,6 +1750,7 @@ /datum/sprite_accessory/head_accessory/ipc species_allowed = list("Machine") + over_hair = 1 /datum/sprite_accessory/head_accessory/ipc/ipc_antennae name = "Antennae" From 3437ea0e579699d2503e1f983783c95b4b3d00a2 Mon Sep 17 00:00:00 2001 From: Markolie Date: Wed, 30 Nov 2016 22:18:16 +0100 Subject: [PATCH 04/70] Move karma to own tab --- code/modules/karma/karma.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm index d1f3f5d98c3..bbb663064fe 100644 --- a/code/modules/karma/karma.dm +++ b/code/modules/karma/karma.dm @@ -84,7 +84,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma_list() set name = "Award Karma" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "OOC" + set category = "Karma" if(!can_give_karma()) return @@ -113,7 +113,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma(var/mob/M) set name = "Award Karma to Player" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "OOC" + set category = "Karma" if(!M) to_chat(usr, "Please right click a mob to award karma directly, or use the 'Award Karma' verb to select a player from the player listing.") @@ -144,8 +144,8 @@ var/list/karma_spenders = list() /client/verb/check_karma() set name = "Check Karma" - set category = "OOC" set desc = "Reports how much karma you have accrued." + set category = "Karma" var/currentkarma=verify_karma() to_chat(usr, {"
You have [currentkarma] available."}) From 945225b6e8e95801ae382da6ccf8ddd508c9a09c Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 3 Dec 2016 06:24:47 -0800 Subject: [PATCH 05/70] Runtime & bug fixes - Fixes a runtime in preferences.dm created by the Patreon PRs, triggered when an ERT, SIT, or any other clientless mob uses "var/datum/preferences/A = new()". - Fixes a bug where, if a SIT is spawned with the 'choose manually' option, one fewer person than intended is pulled in. - Fixes syndicate headset not being included in the SIT member's notes. - Deletes commented code. --- .../admin/verbs/infiltratorteam_syndicate.dm | 17 ++++++----------- code/modules/client/preference/preferences.dm | 7 +++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/code/modules/admin/verbs/infiltratorteam_syndicate.dm b/code/modules/admin/verbs/infiltratorteam_syndicate.dm index e49a2f72939..86a899ab847 100644 --- a/code/modules/admin/verbs/infiltratorteam_syndicate.dm +++ b/code/modules/admin/verbs/infiltratorteam_syndicate.dm @@ -21,8 +21,8 @@ var/global/sent_syndicate_infiltration_team = 0 var/pick_manually = 0 if(alert("Pick the team members manually? If you select yes, you pick from ghosts. If you select no, ghosts get offered the chance to join.",,"Yes","No")=="Yes") pick_manually = 1 - var/list/teamsizeoptions = list(1,2,3,4,5) - var/teamsize = input(src, "How many team members, not counting the team leader?") as null|anything in teamsizeoptions + var/list/teamsizeoptions = list(2,3,4,5,6) + var/teamsize = input(src, "How many team members, including the team leader?") as null|anything in teamsizeoptions if(!(teamsize in teamsizeoptions)) alert("Invalid team size specified. Aborting.") return @@ -102,11 +102,11 @@ var/global/sent_syndicate_infiltration_team = 0 to_chat(new_syndicate_infiltrator, "As team leader, it is up to you to organize your team! Give the job to someone else if you can't handle it. Only your ID opens the exit door.") else to_chat(new_syndicate_infiltrator, "Your team leader is: [team_leader]. They are in charge!") - teamsize-- + teamsize-- to_chat(new_syndicate_infiltrator, "You have more helpful information stored in your Notes.") new_syndicate_infiltrator.mind.store_memory("Mission: [input] ") new_syndicate_infiltrator.mind.store_memory("Team Leader: [team_leader] ") - new_syndicate_infiltrator.mind.store_memory("Starting Equipment:
- Chameleon Jumpsuit ((right click to Change Color))
- Agent ID card ((disguise as another job))
- Uplink Implant ((top left of screen))
- Dust Implant ((destroys your body on death))
- Combat Gloves ((insulated, disguised as black gloves))
- Anything bought with your uplink implant") + new_syndicate_infiltrator.mind.store_memory("Starting Equipment:
- Syndicate Headset ((.h for your radio))
- Chameleon Jumpsuit ((right click to Change Color))
- Agent ID card ((disguise as another job))
- Uplink Implant ((top left of screen))
- Dust Implant ((destroys your body on death))
- Combat Gloves ((insulated, disguised as black gloves))
- Anything bought with your uplink implant") var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] opshud.join_hud(new_syndicate_infiltrator.mind.current) ticker.mode.set_antag_hud(new_syndicate_infiltrator.mind.current, "hudoperative") @@ -145,8 +145,7 @@ var/global/sent_syndicate_infiltration_team = 0 var/datum/preferences/A = new() //Randomize appearance A.real_name = syndicate_infiltrator_name A.copy_to(new_syndicate_infiltrator) - - new_syndicate_infiltrator.dna.ready_dna(new_syndicate_infiltrator) //Creates DNA. + new_syndicate_infiltrator.dna.ready_dna(new_syndicate_infiltrator) //Creates mind stuff. new_syndicate_infiltrator.mind_initialize() @@ -154,7 +153,6 @@ var/global/sent_syndicate_infiltration_team = 0 new_syndicate_infiltrator.mind.special_role = "Syndicate Infiltrator" ticker.mode.traitors |= new_syndicate_infiltrator.mind //Adds them to extra antag list new_syndicate_infiltrator.equip_syndicate_infiltrator(syndicate_leader_selected, uplink_tc, is_mgmt) - qdel(spawn_location) return new_syndicate_infiltrator // --------------------------------------------------------------------------------------------------------- @@ -180,9 +178,6 @@ var/global/sent_syndicate_infiltration_team = 0 U.hidden_uplink.uses = 500 else U.hidden_uplink.uses = num_tc - // Storage - //var/obj/item/weapon/implant/storage/T = new /obj/item/weapon/implant/storage(src) - //T.implant(src) // Dust var/obj/item/weapon/implant/dust/D = new /obj/item/weapon/implant/dust(src) D.implant(src) @@ -196,7 +191,7 @@ var/global/sent_syndicate_infiltration_team = 0 // Other gear equip_to_slot_or_del(new /obj/item/clothing/shoes/syndigaloshes(src), slot_shoes) - var/obj/item/weapon/card/id/syndicate/W = new(src) //Untrackable by AI + var/obj/item/weapon/card/id/syndicate/W = new(src) if (flag_mgmt) W.icon_state = "commander" else diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 6414cdde907..8de9a6b53e9 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -213,15 +213,14 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts /datum/preferences/New(client/C) b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") + max_gear_slots = config.max_loadout_points if(istype(C)) if(!IsGuestKey(C.key)) unlock_content = C.IsByondMember() if(unlock_content) max_save_slots = MAX_SAVE_SLOTS_MEMBER - - max_gear_slots = config.max_loadout_points - if(C.donator_level >= DONATOR_LEVEL_ONE) - max_gear_slots += 5 + if(C.donator_level >= DONATOR_LEVEL_ONE) + max_gear_slots += 5 var/loaded_preferences_successfully = load_preferences(C) if(loaded_preferences_successfully) From 1980ecf62a17e573cee2c15ec05d849f979c36a1 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 3 Dec 2016 20:48:37 -0800 Subject: [PATCH 06/70] Makes cryopod auto-eject work with mech limbs - People with mechanical limbs are now auto-ejected properly from cryotubes once their organic parts have been healed. --- code/game/machinery/cryo.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 99ff973ca76..bb1d91cdc5d 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -122,7 +122,14 @@ ..() if(autoeject) if(occupant) - if(occupant.health >= 100) + var/mech_damage = 0 + if(istype(occupant, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = occupant + for(var/obj/item/organ/external/O in H.organs) + if(O.status & ORGAN_ROBOT) + mech_damage += O.brute_dam + mech_damage += O.burn_dam + if(occupant.health >= (100 - mech_damage)) on = 0 go_out() playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) From 947840cc5cad64afb0f4a8f1ecddf63d0c1960cf Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 5 Dec 2016 02:04:47 -0800 Subject: [PATCH 07/70] Fixes #3628 - Disablers no longer blow up mechs --- code/game/mecha/mecha.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index c8f93bc74ce..ed189eb62ea 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -565,6 +565,8 @@ if(prob(deflect_chance * deflection) && (Proj.damage_type == BRUTE || Proj.damage_type == BURN)) visible_message("[src]'s armour deflects [Proj]!") + else if (Proj.damage_type == STAMINA) + visible_message("[src]'s armour is undamaged by [Proj]!") else visible_message("[src] is hit by [Proj].") take_damage(Proj.damage * dam_coeff, Proj.flag) From d5e3e14dc9edd8d8615602a93d67f4f1452f0a47 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 5 Dec 2016 14:21:32 -0800 Subject: [PATCH 08/70] Requested changes - Creates "has_organic_damage" proc and updates cryopod and medibot to use it. - For non-human mobs, this proc returns 1 for damaged mobs and 0 for full-health mobs. - For human mobs, this proc returns 1 for mobs with damage to organic parts, and 0 for mobs that are either full health, or have only got damage to robotic limbs. --- code/game/machinery/cryo.dm | 9 +-------- code/modules/mob/living/carbon/human/human_organs.dm | 9 +++++++++ code/modules/mob/living/living.dm | 4 ++++ code/modules/mob/living/simple_animal/bot/medbot.dm | 3 +++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index bb1d91cdc5d..67414971337 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -122,14 +122,7 @@ ..() if(autoeject) if(occupant) - var/mech_damage = 0 - if(istype(occupant, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = occupant - for(var/obj/item/organ/external/O in H.organs) - if(O.status & ORGAN_ROBOT) - mech_damage += O.brute_dam - mech_damage += O.burn_dam - if(occupant.health >= (100 - mech_damage)) + if(!occupant.has_organic_damage()) on = 0 go_out() playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 50f1e7cd342..2f07fdacd07 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -201,3 +201,12 @@ I use this to standardize shadowling dethrall code return null var/obj/item/organ/internal/O = get_int_organ(organ_name) return O.parent_organ + +/mob/living/carbon/human/has_organic_damage() + var/odmg = 0 + for(var/obj/item/organ/external/O in organs) + if(O.status & ORGAN_ROBOT) + odmg += O.brute_dam + odmg += O.burn_dam + return (health < (100 - odmg)) + diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 6be18445b44..62102a2f662 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -287,6 +287,10 @@ adjustFireLoss(burn) src.updatehealth() +/mob/living/proc/has_organic_damage() + return (maxHealth - health) + + /mob/living/proc/restore_all_organs() return diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index 92fe2c761bc..df3ae448cf6 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -368,6 +368,9 @@ if(declare_crit && C.health <= 0) //Critical condition! Call for help! declare(C) + if(!C.has_organic_damage()) + return 0 + //If they're injured, we're using a beaker, and don't have one of our WONDERCHEMS. if((reagent_glass) && (use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15)))) for(var/datum/reagent/R in reagent_glass.reagents.reagent_list) From 9e7a30d7867ce9e2b4ad5edfb6915d2f77bccf81 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 5 Dec 2016 15:00:30 -0800 Subject: [PATCH 09/70] Requested changes --- code/game/mecha/mecha.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index ed189eb62ea..20cedf6895f 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -563,10 +563,10 @@ dam_coeff = B.damage_coeff break - if(prob(deflect_chance * deflection) && (Proj.damage_type == BRUTE || Proj.damage_type == BURN)) - visible_message("[src]'s armour deflects [Proj]!") - else if (Proj.damage_type == STAMINA) + if(Proj.damage_type != BRUTE && Proj.damage_type != BURN) visible_message("[src]'s armour is undamaged by [Proj]!") + else if(prob(deflect_chance * deflection)) + visible_message("[src]'s armour deflects [Proj]!") else visible_message("[src] is hit by [Proj].") take_damage(Proj.damage * dam_coeff, Proj.flag) From 73af7f94b89a981eadf53d200f9b344f621e70e4 Mon Sep 17 00:00:00 2001 From: Markolie Date: Tue, 6 Dec 2016 13:13:46 +0100 Subject: [PATCH 10/70] Prevents AI units from clicking on things they can't see --- code/__DEFINES/admin.dm | 19 +++++++++++++++- code/__HELPERS/matrices.dm | 36 +++++++++++++++++++++++++++++++ code/__HELPERS/unsorted.dm | 44 ++++++++++++++++++++++++++++++++++++++ code/_onclick/ai.dm | 8 ++++++- 4 files changed, 105 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 49ef7a72855..2efab1b9132 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -43,4 +43,21 @@ #define R_MAXPERMISSION 32768 //This holds the maximum value for a permission. It is used in iteration, so keep it updated. -#define R_HOST 65535 \ No newline at end of file +#define R_HOST 65535 + +#define ADMIN_QUE(user) "(?)" +#define ADMIN_FLW(user) "(FLW)" +#define ADMIN_PP(user) "(PP)" +#define ADMIN_VV(atom) "(VV)" +#define ADMIN_SM(user) "(SM)" +#define ADMIN_TP(user) "(TP)" +#define ADMIN_BSA(user) "(BSA)" +#define ADMIN_CENTCOM_REPLY(user) "(RPLY)" +#define ADMIN_SYNDICATE_REPLY(user) "(RPLY)" +#define ADMIN_SC(user) "(SC)" +#define ADMIN_LOOKUP(user) "[key_name_admin(user)][ADMIN_QUE(user)]" +#define ADMIN_LOOKUPFLW(user) "[key_name_admin(user)][ADMIN_QUE(user)] [ADMIN_FLW(user)]" +#define ADMIN_FULLMONTY(user) "[key_name_admin(user)] [ADMIN_QUE(user)] [ADMIN_PP(user)] [ADMIN_VV(user)] [ADMIN_SM(user)] [ADMIN_FLW(user)] [ADMIN_TP(user)]" +#define ADMIN_JMP(src) "(JMP)" +#define COORD(src) "[src ? "([src.x],[src.y],[src.z])" : "nonexistent location"]" +#define ADMIN_COORDJMP(src) "[src ? "[COORD(src)] [ADMIN_JMP(src)]" : "nonexistent location"]" \ No newline at end of file diff --git a/code/__HELPERS/matrices.dm b/code/__HELPERS/matrices.dm index 94668321c60..3b370f8a945 100644 --- a/code/__HELPERS/matrices.dm +++ b/code/__HELPERS/matrices.dm @@ -24,3 +24,39 @@ animate(transform = matrices[i], time = speed) //doesn't have an object argument because this is "Stacking" with the animate call above //3 billion% intentional + +//Dumps the matrix data in format a-f +/matrix/proc/tolist() + . = list() + . += a + . += b + . += c + . += d + . += e + . += f + +//Dumps the matrix data in a matrix-grid format +/* + a d 0 + b e 0 + c f 1 +*/ +/matrix/proc/togrid() + . = list() + . += a + . += d + . += 0 + . += b + . += e + . += 0 + . += c + . += f + . += 1 + +//The X pixel offset of this matrix +/matrix/proc/get_x_shift() + . = c + +//The Y pixel offset of this matrix +/matrix/proc/get_y_shift() + . = f \ No newline at end of file diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index de091cb8584..e0d25da3ffd 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1009,6 +1009,50 @@ proc/get_mob_with_client_list() else if(zone == "l_foot") return "left foot" else if(zone == "r_foot") return "right foot" else return zone + +/* + + Gets the turf this atom's *ICON* appears to inhabit + It takes into account: + * Pixel_x/y + * Matrix x/y + + NOTE: if your atom has non-standard bounds then this proc + will handle it, but: + * if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked + (this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off) + * if the bounds are odd, the true middle turf of the atom is returned + +*/ + +/proc/get_turf_pixel(atom/movable/AM) + if(!istype(AM)) + return + + //Find AM's matrix so we can use it's X/Y pixel shifts + var/matrix/M = matrix(AM.transform) + + var/pixel_x_offset = AM.pixel_x + M.get_x_shift() + var/pixel_y_offset = AM.pixel_y + M.get_y_shift() + + //Irregular objects + if(AM.bound_height != world.icon_size || AM.bound_width != world.icon_size) + var/icon/AMicon = icon(AM.icon, AM.icon_state) + pixel_x_offset += ((AMicon.Width()/world.icon_size)-1)*(world.icon_size*0.5) + pixel_y_offset += ((AMicon.Height()/world.icon_size)-1)*(world.icon_size*0.5) + qdel(AMicon) + + //DY and DX + var/rough_x = round(round(pixel_x_offset,world.icon_size)/world.icon_size) + var/rough_y = round(round(pixel_y_offset,world.icon_size)/world.icon_size) + + //Find coordinates + var/turf/T = get_turf(AM) //use AM's turfs, as it's coords are the same as AM's AND AM's coords are lost if it is inside another atom + var/final_x = T.x + rough_x + var/final_y = T.y + rough_y + + if(final_x || final_y) + return locate(final_x, final_y, T.z) //Finds the distance between two atoms, in pixels //centered = 0 counts from turf edge to edge diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index cdce17f6277..f3ae2fdea48 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -31,9 +31,15 @@ return next_click = world.time + 1 - if(control_disabled || stat) return + + var/turf/pixel_turf = get_turf_pixel(A) + if(pixel_turf && !cameranet.checkTurfVis(pixel_turf)) + log_admin("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(A)])") + message_admins("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([ADMIN_COORDJMP(A)]))") + send2irc_adminless_only("NOCHEAT", "[key_name(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(A)]))") + return var/list/modifiers = params2list(params) if(modifiers["shift"] && modifiers["ctrl"]) From 806e7456350904a450c4d5b14896d33583daeec6 Mon Sep 17 00:00:00 2001 From: athompson11 Date: Tue, 6 Dec 2016 09:50:43 -0600 Subject: [PATCH 11/70] Rejuvenate now properly handles broken Robot components Fixes #5953 by giving the robot mob an override for rejuvenate that fixes broken components. --- code/modules/mob/living/silicon/robot/robot.dm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 335ecbcd1f6..7c04826d739 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -84,7 +84,7 @@ var/list/robot_verbs_default = list( var/ionpulse = 0 // Jetpack-like effect. var/ionpulse_on = 0 // Jetpack-like effect. var/datum/effect/system/ion_trail_follow/ion_trail // Ionpulse effect. - + var/datum/action/item_action/toggle_research_scanner/scanner = null /mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0, var/alien = 0) @@ -960,11 +960,11 @@ var/list/robot_verbs_default = list( /mob/living/silicon/robot/proc/allowed(obj/item/I) var/obj/dummy = new /obj(null) // Create a dummy object to check access on as to avoid having to snowflake check_access on every mob dummy.req_access = req_access - + if(dummy.check_access(I)) qdel(dummy) return 1 - + qdel(dummy) return 0 @@ -1456,3 +1456,14 @@ var/list/robot_verbs_default = list( disable_component("comms", 160) if(2) disable_component("comms", 60) +/mob/living/silicon/robot/rejuvenate() + ..() + var/brute = 1000 + var/burn = 1000 + var/list/datum/robot_component/borked_parts = get_damaged_components(brute,burn,1) + for(var/datum/robot_component/borked_part in borked_parts) + brute = borked_part.brute_damage + burn = borked_part.electronics_damage + borked_part.installed = 1 + borked_part.wrapped = new borked_part.external_type + borked_part.heal_damage(brute,burn) From c093b0e4887e22f75a7a71774ba7e5a06d1c7791 Mon Sep 17 00:00:00 2001 From: Markolie Date: Wed, 7 Dec 2016 07:50:34 +0100 Subject: [PATCH 12/70] Fix incorrect OOC reference --- code/game/gamemodes/gameticker.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 328facd08c6..7e4dd5e9182 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -414,7 +414,7 @@ var/round_start_time = 0 var/dat dat += {"Karma Reminder

Karma Reminder


You have not yet spent your karma for the round, surely there is a player who was worthy of receiving
- your reward? Look under 'OOC' for the 'Award Karma' button, and use it once a round for best results!"} + your reward? Look under 'Karma' for the 'Award Karma' button, and use it once a round for best results!"} player << browse(dat, "window=karmareminder;size=400x300") From b1a4195b4054125cdec46ce282dc1ee3ca622007 Mon Sep 17 00:00:00 2001 From: Markolie Date: Wed, 7 Dec 2016 07:53:20 +0100 Subject: [PATCH 13/70] Fix up \ref's --- code/__DEFINES/admin.dm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 2efab1b9132..0397b5bcdde 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -45,16 +45,16 @@ #define R_HOST 65535 -#define ADMIN_QUE(user) "(?)" -#define ADMIN_FLW(user) "(FLW)" -#define ADMIN_PP(user) "(PP)" -#define ADMIN_VV(atom) "(VV)" -#define ADMIN_SM(user) "(SM)" -#define ADMIN_TP(user) "(TP)" -#define ADMIN_BSA(user) "(BSA)" -#define ADMIN_CENTCOM_REPLY(user) "(RPLY)" -#define ADMIN_SYNDICATE_REPLY(user) "(RPLY)" -#define ADMIN_SC(user) "(SC)" +#define ADMIN_QUE(user) "(?)" +#define ADMIN_FLW(user) "(FLW)" +#define ADMIN_PP(user) "(PP)" +#define ADMIN_VV(atom) "(VV)" +#define ADMIN_SM(user) "(SM)" +#define ADMIN_TP(user) "(TP)" +#define ADMIN_BSA(user) "(BSA)" +#define ADMIN_CENTCOM_REPLY(user) "(RPLY)" +#define ADMIN_SYNDICATE_REPLY(user) "(RPLY)" +#define ADMIN_SC(user) "(SC)" #define ADMIN_LOOKUP(user) "[key_name_admin(user)][ADMIN_QUE(user)]" #define ADMIN_LOOKUPFLW(user) "[key_name_admin(user)][ADMIN_QUE(user)] [ADMIN_FLW(user)]" #define ADMIN_FULLMONTY(user) "[key_name_admin(user)] [ADMIN_QUE(user)] [ADMIN_PP(user)] [ADMIN_VV(user)] [ADMIN_SM(user)] [ADMIN_FLW(user)] [ADMIN_TP(user)]" From a2bde2d187c9ddfdf303d03956fe749863c45e05 Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Wed, 7 Dec 2016 10:51:43 +0000 Subject: [PATCH 14/70] Mining Vendor no longer gobbles up IDs - When unpowered, Mining Vendors no longer accept IDs --- code/modules/mining/equipment_locker.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 56f71c94cb9..d59688d53b4 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -437,6 +437,8 @@ return /obj/machinery/mineral/equipment_vendor/attackby(obj/item/I as obj, mob/user as mob, params) + if(!powered()) + return if(istype(I, /obj/item/weapon/mining_voucher)) RedeemVoucher(I, user) return From d865b601d8ff57e226935b993526665c9ec2bc86 Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Wed, 7 Dec 2016 11:17:34 +0000 Subject: [PATCH 15/70] Unpowered Mining Machine Deconstruction - Both the Mining Vendor and the ORM can now be deconstructed when unpowered --- code/modules/mining/equipment_locker.dm | 43 +++++++++++-------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index d59688d53b4..74d2fde901b 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -105,6 +105,18 @@ i++ /obj/machinery/mineral/ore_redemption/attackby(var/obj/item/weapon/W, var/mob/user, params) + if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W)) + updateUsrDialog() + return + if(exchange_parts(user, W)) + return + if(panel_open) + if(istype(W, /obj/item/weapon/crowbar)) + empty_content() + default_deconstruction_crowbar(W) + return + if(default_unfasten_wrench(user, W)) + return if(!powered()) return if(istype(W,/obj/item/weapon/card/id)) @@ -116,23 +128,6 @@ inserted_id = I interact(user) return - - if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W)) - updateUsrDialog() - return - - if(exchange_parts(user, W)) - return - - if(panel_open) - if(istype(W, /obj/item/weapon/crowbar)) - empty_content() - default_deconstruction_crowbar(W) - return - - if(default_unfasten_wrench(user, W)) - return - ..() /obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O) @@ -437,6 +432,13 @@ return /obj/machinery/mineral/equipment_vendor/attackby(obj/item/I as obj, mob/user as mob, params) + if(default_deconstruction_screwdriver(user, "mining-open", "mining", I)) + updateUsrDialog() + return + if(panel_open) + if(istype(I, /obj/item/weapon/crowbar)) + default_deconstruction_crowbar(I) + return 1 if(!powered()) return if(istype(I, /obj/item/weapon/mining_voucher)) @@ -451,13 +453,6 @@ inserted_id = C interact(user) return - if(default_deconstruction_screwdriver(user, "mining-open", "mining", I)) - updateUsrDialog() - return - if(panel_open) - if(istype(I, /obj/item/weapon/crowbar)) - default_deconstruction_crowbar(I) - return 1 ..() /obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer) From e23b10081ee4e4fc35defe28ff2975abfce4d20d Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Wed, 7 Dec 2016 12:45:57 +0000 Subject: [PATCH 16/70] Maintanability of powered checks - Powered check no longer blanket bans everything but deconstruction --- code/modules/mining/equipment_locker.dm | 49 ++++++++++++++----------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index 74d2fde901b..c8eb4a8db1b 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -117,17 +117,18 @@ return if(default_unfasten_wrench(user, W)) return - if(!powered()) - return if(istype(W,/obj/item/weapon/card/id)) - var/obj/item/weapon/card/id/I = usr.get_active_hand() - if(istype(I) && !istype(inserted_id)) - if(!user.drop_item()) - return - I.loc = src - inserted_id = I - interact(user) - return + if(!powered()) + return + else + var/obj/item/weapon/card/id/I = usr.get_active_hand() + if(istype(I) && !istype(inserted_id)) + if(!user.drop_item()) + return + I.loc = src + inserted_id = I + interact(user) + return ..() /obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O) @@ -439,20 +440,24 @@ if(istype(I, /obj/item/weapon/crowbar)) default_deconstruction_crowbar(I) return 1 - if(!powered()) - return if(istype(I, /obj/item/weapon/mining_voucher)) - RedeemVoucher(I, user) - return + if(!powered()) + return + else + RedeemVoucher(I, user) + return if(istype(I,/obj/item/weapon/card/id)) - var/obj/item/weapon/card/id/C = usr.get_active_hand() - if(istype(C) && !istype(inserted_id)) - if(!usr.drop_item()) - return - C.loc = src - inserted_id = C - interact(user) - return + if(!powered()) + return + else + var/obj/item/weapon/card/id/C = usr.get_active_hand() + if(istype(C) && !istype(inserted_id)) + if(!usr.drop_item()) + return + C.loc = src + inserted_id = C + interact(user) + return ..() /obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer) From 88946a0b77cf5a8999ed5ad2df6e1aa9bb2fc447 Mon Sep 17 00:00:00 2001 From: Markolie Date: Wed, 7 Dec 2016 16:52:10 +0100 Subject: [PATCH 17/70] Switching karma back to the "OOC" tab --- code/game/gamemodes/gameticker.dm | 2 +- code/modules/karma/karma.dm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 7e4dd5e9182..328facd08c6 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -414,7 +414,7 @@ var/round_start_time = 0 var/dat dat += {"Karma Reminder

Karma Reminder


You have not yet spent your karma for the round, surely there is a player who was worthy of receiving
- your reward? Look under 'Karma' for the 'Award Karma' button, and use it once a round for best results!"} + your reward? Look under 'OOC' for the 'Award Karma' button, and use it once a round for best results!"} player << browse(dat, "window=karmareminder;size=400x300") diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm index bbb663064fe..bdd73533c82 100644 --- a/code/modules/karma/karma.dm +++ b/code/modules/karma/karma.dm @@ -84,7 +84,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma_list() set name = "Award Karma" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "Karma" + set category = "OOC" if(!can_give_karma()) return @@ -113,7 +113,7 @@ var/list/karma_spenders = list() /mob/verb/spend_karma(var/mob/M) set name = "Award Karma to Player" set desc = "Let the gods know whether someone's been nice. Can only be used once per round." - set category = "Karma" + set category = "OOC" if(!M) to_chat(usr, "Please right click a mob to award karma directly, or use the 'Award Karma' verb to select a player from the player listing.") @@ -145,7 +145,7 @@ var/list/karma_spenders = list() /client/verb/check_karma() set name = "Check Karma" set desc = "Reports how much karma you have accrued." - set category = "Karma" + set category = "OOC" var/currentkarma=verify_karma() to_chat(usr, {"
You have [currentkarma] available."}) From ec574a418b66560c40c31c95930cf2763d8c23e2 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Wed, 7 Dec 2016 12:33:37 -0500 Subject: [PATCH 18/70] Automatic changelog generation for PR #5858 [ci skip] --- html/changelogs/AutoChangeLog-pr-5858.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5858.yml diff --git a/html/changelogs/AutoChangeLog-pr-5858.yml b/html/changelogs/AutoChangeLog-pr-5858.yml new file mode 100644 index 00000000000..02b79cefb06 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5858.yml @@ -0,0 +1,4 @@ +author: "Markolie" +delete-after: True +changes: + - tweak: "Verbs have been cleaned up: all karma verbs can now be found under \"OOC\" instead of \"Special Verbs\". Most admin verbs have been moved out of \"Special Verbs\" as well." From 1afdfe3933396edb1a70874cb309929316321b80 Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Wed, 7 Dec 2016 18:03:45 +0000 Subject: [PATCH 19/70] Adresses the forceMove(src) - See above title --- code/modules/mining/equipment_locker.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index c8eb4a8db1b..fb98f3a8c15 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -125,7 +125,7 @@ if(istype(I) && !istype(inserted_id)) if(!user.drop_item()) return - I.loc = src + I.forceMove(src) inserted_id = I interact(user) return @@ -454,7 +454,7 @@ if(istype(C) && !istype(inserted_id)) if(!usr.drop_item()) return - C.loc = src + C.forceMove(src) inserted_id = C interact(user) return From 89fa3555e8fc98dc06475588756a62e381a4f078 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Wed, 7 Dec 2016 13:10:04 -0500 Subject: [PATCH 20/70] Automatic changelog generation for PR #5960 [ci skip] --- html/changelogs/AutoChangeLog-pr-5960.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5960.yml diff --git a/html/changelogs/AutoChangeLog-pr-5960.yml b/html/changelogs/AutoChangeLog-pr-5960.yml new file mode 100644 index 00000000000..8acaa4d75bf --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5960.yml @@ -0,0 +1,5 @@ +author: "TullyBurnalot" +delete-after: True +changes: + - bugfix: "Unpowered Mining Vendors no longer accept IDs" + - bugfix: "Ore Redemption Machine and Mining Vendor can now be deconstructed if unpowered" From 11130bcb70ab5f92f18a35f11336111dac743baf Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Wed, 7 Dec 2016 13:13:00 -0500 Subject: [PATCH 21/70] Automatic changelog compile, [ci skip] --- html/changelog.html | 11 +++++++++++ html/changelogs/.all_changelog.yml | 8 ++++++++ html/changelogs/AutoChangeLog-pr-5858.yml | 4 ---- html/changelogs/AutoChangeLog-pr-5960.yml | 5 ----- 4 files changed, 19 insertions(+), 9 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-5858.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5960.yml diff --git a/html/changelog.html b/html/changelog.html index aaecde3bc11..ce12ceec7be 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,17 @@ -->
+

07 December 2016

+

Markolie updated:

+
    +
  • Verbs have been cleaned up: all karma verbs can now be found under "OOC" instead of "Special Verbs". Most admin verbs have been moved out of "Special Verbs" as well.
  • +
+

TullyBurnalot updated:

+
    +
  • Unpowered Mining Vendors no longer accept IDs
  • +
  • Ore Redemption Machine and Mining Vendor can now be deconstructed if unpowered
  • +
+

06 December 2016

Markolie updated:

    diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index 781a18d0ea8..a4290989c94 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -3144,3 +3144,11 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. - bugfix: The track button on the AI crew monitor now works. - bugfix: Permanent door electrification by alt-clicking a door as an AI or setting it manually now works again. +2016-12-07: + Markolie: + - tweak: 'Verbs have been cleaned up: all karma verbs can now be found under "OOC" + instead of "Special Verbs". Most admin verbs have been moved out of "Special + Verbs" as well.' + TullyBurnalot: + - bugfix: Unpowered Mining Vendors no longer accept IDs + - bugfix: Ore Redemption Machine and Mining Vendor can now be deconstructed if unpowered diff --git a/html/changelogs/AutoChangeLog-pr-5858.yml b/html/changelogs/AutoChangeLog-pr-5858.yml deleted file mode 100644 index 02b79cefb06..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5858.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Markolie" -delete-after: True -changes: - - tweak: "Verbs have been cleaned up: all karma verbs can now be found under \"OOC\" instead of \"Special Verbs\". Most admin verbs have been moved out of \"Special Verbs\" as well." diff --git a/html/changelogs/AutoChangeLog-pr-5960.yml b/html/changelogs/AutoChangeLog-pr-5960.yml deleted file mode 100644 index 8acaa4d75bf..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5960.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "TullyBurnalot" -delete-after: True -changes: - - bugfix: "Unpowered Mining Vendors no longer accept IDs" - - bugfix: "Ore Redemption Machine and Mining Vendor can now be deconstructed if unpowered" From b22c97293abb2c9211468827d7a5516d0e407231 Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Tue, 6 Dec 2016 02:47:31 -0500 Subject: [PATCH 22/70] Refines Cloning, Fixes a Couple Genetics-related Bugs. Characters will now be correctly assigned their species' genetic quirks at spawn. Cloning will now correctly assign a characters species' genetic quirks. Changing a character's species (via C.M.A. or whatever might call the set_species proc) will now correctly assign their species' genetic quirks. --- code/game/dna/genes/goon_powers.dm | 2 +- code/game/machinery/cloning.dm | 29 ++++----- code/modules/client/preference/preferences.dm | 63 ++++++++++--------- code/modules/mob/living/carbon/human/human.dm | 1 + 4 files changed, 49 insertions(+), 46 deletions(-) diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm index 1ada7c0f5ac..36c9af1c48c 100644 --- a/code/game/dna/genes/goon_powers.dm +++ b/code/game/dna/genes/goon_powers.dm @@ -619,7 +619,7 @@ numbers += H.mind.initial_account.account_number numbers += H.mind.initial_account.remote_access_pin if(numbers.len>0) - to_chat(usr, "b>Numbers: You sense the number[numbers.len>1?"s":""] [english_list(numbers)] [numbers.len>1?"are":"is"] important to [M.name].") + to_chat(usr, "Numbers: You sense the number[numbers.len>1?"s":""] [english_list(numbers)] [numbers.len>1?"are":"is"] important to [M.name].") to_chat(usr, "Thoughts: [M.name] is currently [thoughts].") if(EMPATH in M.mutations) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 0cc1e8a0afe..0e0eaaf6985 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -205,7 +205,7 @@ clonemind = locate(R.mind) if(!istype(clonemind)) //not a mind return 0 - if( clonemind.current && clonemind.current.stat != DEAD ) //mind is associated with a non-dead body + if(clonemind.current && clonemind.current.stat != DEAD) //mind is associated with a non-dead body return 0 if(clonemind.active) //somebody is using that mind if(ckey(clonemind.key) != R.ckey) @@ -229,12 +229,21 @@ spawn(30) eject_wait = 0 + if(!R.dna) + R.dna = new /datum/dna() + var/mob/living/carbon/human/H = new /mob/living/carbon/human(src, R.dna.species) occupant = H if(!R.dna.real_name) //to prevent null names - R.dna.real_name = "clone ([rand(0,999)])" - H.real_name = R.dna.real_name + R.dna.real_name = H.real_name + else + H.real_name = R.dna.real_name + + H.dna = R.dna.Clone() + + for(var/datum/language/L in R.languages) + H.add_language(L.name) //Get the clone body ready H.adjustCloneLoss(190) //new damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite @@ -256,31 +265,23 @@ beginning to regenerate in a cloning pod. You will become conscious when it is complete."}) - if(!R.dna) - H.dna = new /datum/dna() - H.dna.real_name = H.real_name - H.dna.ready_dna(H) - else - H.dna = R.dna.Clone() + domutcheck(H, null, MUTCHK_FORCED) //Ensures species that get powers by the species proc handle_dna keep them + if(efficiency > 2 && efficiency < 5 && prob(25)) randmutb(H) if(efficiency > 5 && prob(20)) randmutg(H) if(efficiency < 3 && prob(50)) randmutb(H) + H.dna.UpdateSE() H.dna.UpdateUI() - H.set_species(R.dna.species) H.sync_organ_dna(1) // It's literally a fresh body as you can get, so all organs properly belong to it H.UpdateAppearance() - H.update_body() update_icon() - for(var/datum/language/L in R.languages) - H.add_language(L.name) - H.suiciding = 0 attempting = 0 return 1 diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 6414cdde907..b86728b0564 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -2099,37 +2099,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts I.robotize() character.dna.b_type = b_type - if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT) - character.dna.SetSEState(FATBLOCK,1,1) - character.mutations += FAT - character.mutations += OBESITY - character.overeatduration = 600 - - if(disabilities & DISABILITY_FLAG_NEARSIGHTED) - character.dna.SetSEState(GLASSESBLOCK,1,1) - character.disabilities|=NEARSIGHTED - - if(disabilities & DISABILITY_FLAG_EPILEPTIC) - character.dna.SetSEState(EPILEPSYBLOCK,1,1) - character.disabilities|=EPILEPSY - - if(disabilities & DISABILITY_FLAG_DEAF) - character.dna.SetSEState(DEAFBLOCK,1,1) - character.disabilities|=DEAF - - if(disabilities & DISABILITY_FLAG_BLIND) - character.dna.SetSEState(BLINDBLOCK,1,1) - character.disabilities|=BLIND - - if(disabilities & DISABILITY_FLAG_MUTE) - character.dna.SetSEState(MUTEBLOCK,1,1) - character.disabilities |= MUTE - - S.handle_dna(character) - - if(character.dna.dirtySE) - character.dna.UpdateSE() - domutcheck(character) // Wheelchair necessary? var/obj/item/organ/external/l_foot = character.get_organ("l_foot") @@ -2170,6 +2139,38 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts character.change_eye_color(r_eyes, g_eyes, b_eyes) + if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT) + character.dna.SetSEState(FATBLOCK,1,1) + character.mutations += FAT + character.mutations += OBESITY + character.overeatduration = 600 + + if(disabilities & DISABILITY_FLAG_NEARSIGHTED) + character.dna.SetSEState(GLASSESBLOCK,1,1) + character.disabilities |= NEARSIGHTED + + if(disabilities & DISABILITY_FLAG_EPILEPTIC) + character.dna.SetSEState(EPILEPSYBLOCK,1,1) + character.disabilities |= EPILEPSY + + if(disabilities & DISABILITY_FLAG_DEAF) + character.dna.SetSEState(DEAFBLOCK,1,1) + character.disabilities |= DEAF + + if(disabilities & DISABILITY_FLAG_BLIND) + character.dna.SetSEState(BLINDBLOCK,1,1) + character.disabilities |= BLIND + + if(disabilities & DISABILITY_FLAG_MUTE) + character.dna.SetSEState(MUTEBLOCK,1,1) + character.disabilities |= MUTE + + S.handle_dna(character) + + if(character.dna.dirtySE) + character.dna.UpdateSE() + domutcheck(character, null, MUTCHK_FORCED) + character.dna.ready_dna(character, flatten_SE = 0) character.sync_organ_dna(assimilate=1) character.UpdateAppearance() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 170673d2395..98d82ac2da9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1594,6 +1594,7 @@ dna.real_name = real_name species.handle_post_spawn(src) + species.handle_dna(src) //Give them whatever special dna business they got. spawn(0) overlays.Cut() From 39a8d9e1491f90065c496d10030d8ff9de96af4f Mon Sep 17 00:00:00 2001 From: Alffd Date: Thu, 8 Dec 2016 22:38:54 -0500 Subject: [PATCH 23/70] Changelog fixes Adds missing changelog entries. --- html/changelogs/AutoChangeLog-pr-5938.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5938.yml diff --git a/html/changelogs/AutoChangeLog-pr-5938.yml b/html/changelogs/AutoChangeLog-pr-5938.yml new file mode 100644 index 00000000000..82fff3a552d --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5938.yml @@ -0,0 +1,8 @@ +author: "Kyep" +delete-after: True +changes: + - bugfix: Ensures cryo pods will properly auto-eject people whose organic parts (limbs) have been healed, but who still have damaged mechanical limbs. + - bugfix: Disabler shots no longer damage mechs. + - bugfix: On impact, both taser and disabler shots now produce a message saying that the mech is undamaged by them, instead of a message saying they 'hit'. + - bugfix: Fixed runtimes created when SIT, ERT, and some other mobs are spawned. + - bugfix: Fixed a bug causing SITs to be spawned with one less person than desired in some cases. From cd71a83dec31a1cea9fba707f9b44605596ef2b1 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Thu, 8 Dec 2016 23:00:11 -0500 Subject: [PATCH 24/70] Automatic changelog compile, [ci skip] --- html/changelog.html | 10 ++++++++++ html/changelogs/.all_changelog.yml | 10 ++++++++++ html/changelogs/AutoChangeLog-pr-5938.yml | 8 -------- 3 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-5938.yml diff --git a/html/changelog.html b/html/changelog.html index ce12ceec7be..9b4d1d8e268 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,16 @@ -->
    +

    08 December 2016

    +

    Kyep updated:

    +
      +
    • Ensures cryo pods will properly auto-eject people whose organic parts (limbs) have been healed, but who still have damaged mechanical limbs.
    • +
    • Disabler shots no longer damage mechs.
    • +
    • On impact, both taser and disabler shots now produce a message saying that the mech is undamaged by them, instead of a message saying they 'hit'.
    • +
    • Fixed runtimes created when SIT, ERT, and some other mobs are spawned.
    • +
    • Fixed a bug causing SITs to be spawned with one less person than desired in some cases.
    • +
    +

    07 December 2016

    Markolie updated:

      diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index a4290989c94..9ce1bbab711 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -3152,3 +3152,13 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. TullyBurnalot: - bugfix: Unpowered Mining Vendors no longer accept IDs - bugfix: Ore Redemption Machine and Mining Vendor can now be deconstructed if unpowered +2016-12-08: + Kyep: + - bugfix: Ensures cryo pods will properly auto-eject people whose organic parts + (limbs) have been healed, but who still have damaged mechanical limbs. + - bugfix: Disabler shots no longer damage mechs. + - bugfix: On impact, both taser and disabler shots now produce a message saying + that the mech is undamaged by them, instead of a message saying they 'hit'. + - bugfix: Fixed runtimes created when SIT, ERT, and some other mobs are spawned. + - bugfix: Fixed a bug causing SITs to be spawned with one less person than desired + in some cases. diff --git a/html/changelogs/AutoChangeLog-pr-5938.yml b/html/changelogs/AutoChangeLog-pr-5938.yml deleted file mode 100644 index 82fff3a552d..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5938.yml +++ /dev/null @@ -1,8 +0,0 @@ -author: "Kyep" -delete-after: True -changes: - - bugfix: Ensures cryo pods will properly auto-eject people whose organic parts (limbs) have been healed, but who still have damaged mechanical limbs. - - bugfix: Disabler shots no longer damage mechs. - - bugfix: On impact, both taser and disabler shots now produce a message saying that the mech is undamaged by them, instead of a message saying they 'hit'. - - bugfix: Fixed runtimes created when SIT, ERT, and some other mobs are spawned. - - bugfix: Fixed a bug causing SITs to be spawned with one less person than desired in some cases. From 5d93968b3563f6fb28d7bb9b52d2ca49e248c91d Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Fri, 9 Dec 2016 22:19:03 +0000 Subject: [PATCH 25/70] Fixes self-propelled throwing - Throwing mobs over your back no longer pushes you as well; they just helpfully teleport over you --- code/modules/mob/living/carbon/carbon.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f62df2ab76b..76946fbe00b 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -537,6 +537,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, thrown_thing = throwable_mob var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors var/turf/end_T = get_turf(target) + throwable_mob.forceMove(start_T) if(start_T && end_T) var/start_T_descriptor = "tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]" var/end_T_descriptor = "tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]" From b25f3c045262cdfa16dca5d652c7e0462437a1af Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Fri, 9 Dec 2016 23:19:24 +0000 Subject: [PATCH 26/70] Medbot Buckle Certification - Medbots no longer move automatically if buckled --- code/modules/mob/living/simple_animal/bot/medbot.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index df3ae448cf6..ad938b29b5d 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -26,6 +26,7 @@ var/mob/living/carbon/oldpatient = null var/oldloc = null var/last_found = 0 + var/last_warning = 0 var/last_newpatient_speak = 0 //Don't spam the "HEY I'M COMING" messages var/injection_amount = 15 //How much reagent do we inject at a time? var/heal_threshold = 10 //Start healing when they have this much damage in a category @@ -253,6 +254,13 @@ oldpatient = user /mob/living/simple_animal/bot/medbot/process_scan(mob/living/carbon/human/H) + if(buckled) + if((last_warning + 300) < world.time) + var/message = ("Movement restrained! Unit on standby!") + speak(message) + playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) + last_warning = world.time + return if(H.stat == 2) return From 6488d869bae6ffe31baf77784c1d03f9d62d4af4 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Fri, 9 Dec 2016 18:22:27 -0500 Subject: [PATCH 27/70] Automatic changelog generation for PR #5879 [ci skip] --- html/changelogs/AutoChangeLog-pr-5879.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5879.yml diff --git a/html/changelogs/AutoChangeLog-pr-5879.yml b/html/changelogs/AutoChangeLog-pr-5879.yml new file mode 100644 index 00000000000..e2c9ab9cfcb --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5879.yml @@ -0,0 +1,6 @@ +author: "KasparoVy" +delete-after: True +changes: + - rscadd: "You can now define whether a hair style will cover glasses or not. Only long hair styles should cover glasses (default behaviour)." + - rscadd: "You can now define whether a facial hair style/head accessory will be rendered on top of hair or not." + - bugfix: "Glasses no longer render on top of all hair styles, only sufficiently short ones." From e19266a89b64cb9292b6c5cda733e603195886d4 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Fri, 9 Dec 2016 19:00:11 -0500 Subject: [PATCH 28/70] Automatic changelog compile, [ci skip] --- html/changelog.html | 8 ++++++++ html/changelogs/.all_changelog.yml | 8 ++++++++ html/changelogs/AutoChangeLog-pr-5879.yml | 6 ------ 3 files changed, 16 insertions(+), 6 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-5879.yml diff --git a/html/changelog.html b/html/changelog.html index 9b4d1d8e268..5f7d8607c83 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,14 @@ -->
      +

      09 December 2016

      +

      KasparoVy updated:

      +
        +
      • You can now define whether a hair style will cover glasses or not. Only long hair styles should cover glasses (default behaviour).
      • +
      • You can now define whether a facial hair style/head accessory will be rendered on top of hair or not.
      • +
      • Glasses no longer render on top of all hair styles, only sufficiently short ones.
      • +
      +

      08 December 2016

      Kyep updated:

        diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index 9ce1bbab711..a3b6a5c8aea 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -3162,3 +3162,11 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. - bugfix: Fixed runtimes created when SIT, ERT, and some other mobs are spawned. - bugfix: Fixed a bug causing SITs to be spawned with one less person than desired in some cases. +2016-12-09: + KasparoVy: + - rscadd: You can now define whether a hair style will cover glasses or not. Only + long hair styles should cover glasses (default behaviour). + - rscadd: You can now define whether a facial hair style/head accessory will be + rendered on top of hair or not. + - bugfix: Glasses no longer render on top of all hair styles, only sufficiently + short ones. diff --git a/html/changelogs/AutoChangeLog-pr-5879.yml b/html/changelogs/AutoChangeLog-pr-5879.yml deleted file mode 100644 index e2c9ab9cfcb..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5879.yml +++ /dev/null @@ -1,6 +0,0 @@ -author: "KasparoVy" -delete-after: True -changes: - - rscadd: "You can now define whether a hair style will cover glasses or not. Only long hair styles should cover glasses (default behaviour)." - - rscadd: "You can now define whether a facial hair style/head accessory will be rendered on top of hair or not." - - bugfix: "Glasses no longer render on top of all hair styles, only sufficiently short ones." From 440d9fa3f2b680e4b46c9c2d73ae433937a910d3 Mon Sep 17 00:00:00 2001 From: Kyep Date: Fri, 9 Dec 2016 23:10:28 -0800 Subject: [PATCH 29/70] Fixes xenomorph walls taking damage from disablers --- code/game/objects/effects/aliens.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 3c1a16787c0..d7086b53ccc 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -79,9 +79,12 @@ /obj/structure/alien/resin/bullet_act(obj/item/projectile/Proj) - health -= Proj.damage - ..() - healthcheck() + if(Proj.damage_type != BRUTE && Proj.damage_type != BURN) + ..() + else + health -= Proj.damage + ..() + healthcheck() /obj/structure/alien/resin/ex_act(severity) From 49956eb241be7bf665eaa99dc8b409912c6a3861 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 10 Dec 2016 16:57:52 -0800 Subject: [PATCH 30/70] Tiger request --- code/game/objects/effects/aliens.dm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index d7086b53ccc..106c451ca09 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -79,12 +79,10 @@ /obj/structure/alien/resin/bullet_act(obj/item/projectile/Proj) - if(Proj.damage_type != BRUTE && Proj.damage_type != BURN) - ..() - else + if(Proj.damage_type == BRUTE || Proj.damage_type == BURN) health -= Proj.damage - ..() - healthcheck() + ..() + healthcheck() /obj/structure/alien/resin/ex_act(severity) From 322e2e16bf34e126bf8ed54e3144c43ea8093646 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 12 Dec 2016 13:45:38 +0100 Subject: [PATCH 31/70] No charge-free shooting for pods, take 2 Checks if the charge actually gets deducted from the battery, if not, the pod weapon won't shoot --- code/modules/spacepods/equipment.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/spacepods/equipment.dm b/code/modules/spacepods/equipment.dm index 55342fad0e6..427a6db798a 100644 --- a/code/modules/spacepods/equipment.dm +++ b/code/modules/spacepods/equipment.dm @@ -8,7 +8,9 @@ to_chat(usr, "Missing equipment or weapons.") my_atom.verbs -= text2path("[type]/proc/fire_weapons") return - my_atom.battery.use(shot_cost) + if(!my_atom.battery.use(shot_cost)) + to_chat(usr, "Insufficient charge to fire the weapons") + return var/olddir for(var/i = 0; i < shots_per; i++) if(olddir != my_atom.dir) From 7001b653b7c1caf2d9894811c9740d3fb6af1a37 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Mon, 12 Dec 2016 08:41:46 -0500 Subject: [PATCH 32/70] Automatic changelog generation for PR #5969 [ci skip] --- html/changelogs/AutoChangeLog-pr-5969.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5969.yml diff --git a/html/changelogs/AutoChangeLog-pr-5969.yml b/html/changelogs/AutoChangeLog-pr-5969.yml new file mode 100644 index 00000000000..30ae348901f --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5969.yml @@ -0,0 +1,4 @@ +author: "Kyep" +delete-after: True +changes: + - bugfix: "Xenomorph resin walls no longer take damage from disabler beams. Only proper BRUTE or BURN damage hurts them now." From 2955061429c0cc7d2f639c70708d409fa3c18019 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Mon, 12 Dec 2016 17:59:13 -0500 Subject: [PATCH 33/70] Automatic changelog generation for PR #5966 [ci skip] --- html/changelogs/AutoChangeLog-pr-5966.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5966.yml diff --git a/html/changelogs/AutoChangeLog-pr-5966.yml b/html/changelogs/AutoChangeLog-pr-5966.yml new file mode 100644 index 00000000000..3c8c3d8a6f5 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5966.yml @@ -0,0 +1,4 @@ +author: "TullyBurnalot" +delete-after: True +changes: + - bugfix: "Throwing mobs behind you force moves them to behind you before actually throwing them, preventing throw-shoving" From 8a7129660d21e88bc87659e30441a8d4b6d739dd Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Mon, 12 Dec 2016 23:00:39 -0500 Subject: [PATCH 34/70] Automatic changelog compile, [ci skip] --- html/changelog.html | 10 ++++++++++ html/changelogs/.all_changelog.yml | 7 +++++++ html/changelogs/AutoChangeLog-pr-5966.yml | 4 ---- html/changelogs/AutoChangeLog-pr-5969.yml | 4 ---- 4 files changed, 17 insertions(+), 8 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-5966.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5969.yml diff --git a/html/changelog.html b/html/changelog.html index 5f7d8607c83..e5b33949b04 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,16 @@ -->
        +

        12 December 2016

        +

        Kyep updated:

        +
          +
        • Xenomorph resin walls no longer take damage from disabler beams. Only proper BRUTE or BURN damage hurts them now.
        • +
        +

        TullyBurnalot updated:

        +
          +
        • Throwing mobs behind you force moves them to behind you before actually throwing them, preventing throw-shoving
        • +
        +

        09 December 2016

        KasparoVy updated:

          diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index a3b6a5c8aea..c50256330ec 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -3170,3 +3170,10 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. rendered on top of hair or not. - bugfix: Glasses no longer render on top of all hair styles, only sufficiently short ones. +2016-12-12: + Kyep: + - bugfix: Xenomorph resin walls no longer take damage from disabler beams. Only + proper BRUTE or BURN damage hurts them now. + TullyBurnalot: + - bugfix: Throwing mobs behind you force moves them to behind you before actually + throwing them, preventing throw-shoving diff --git a/html/changelogs/AutoChangeLog-pr-5966.yml b/html/changelogs/AutoChangeLog-pr-5966.yml deleted file mode 100644 index 3c8c3d8a6f5..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5966.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "TullyBurnalot" -delete-after: True -changes: - - bugfix: "Throwing mobs behind you force moves them to behind you before actually throwing them, preventing throw-shoving" diff --git a/html/changelogs/AutoChangeLog-pr-5969.yml b/html/changelogs/AutoChangeLog-pr-5969.yml deleted file mode 100644 index 30ae348901f..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5969.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Kyep" -delete-after: True -changes: - - bugfix: "Xenomorph resin walls no longer take damage from disabler beams. Only proper BRUTE or BURN damage hurts them now." From f43ad384d1d435fec621d397042d2d3ed452be19 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Tue, 13 Dec 2016 09:15:03 -0500 Subject: [PATCH 35/70] Fixes ED-209 Crafting Oversight --- code/modules/crafting/recipes.dm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index 6f946146aa4..288dcfcd9c5 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -71,12 +71,11 @@ /obj/item/clothing/suit/armor/vest = 1, /obj/item/robot_parts/l_leg = 1, /obj/item/robot_parts/r_leg = 1, - /obj/item/stack/sheet/metal = 5, - /obj/item/stack/cable_coil = 5, + /obj/item/stack/sheet/metal = 1, + /obj/item/stack/cable_coil = 1, /obj/item/weapon/gun/energy/gun/advtaser = 1, /obj/item/weapon/stock_parts/cell = 1, - /obj/item/device/assembly/prox_sensor = 1, - /obj/item/robot_parts/r_arm = 1) + /obj/item/device/assembly/prox_sensor = 1) tools = list(/obj/item/weapon/weldingtool, /obj/item/weapon/screwdriver) time = 60 category = CAT_ROBOT From 202607acb25844327f7fe4061766685f12a6d3ea Mon Sep 17 00:00:00 2001 From: TullyBurnalot Date: Tue, 13 Dec 2016 15:12:55 +0000 Subject: [PATCH 36/70] Removes copypasta code --- code/modules/mob/living/simple_animal/bot/medbot.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index ad938b29b5d..4eafbf50065 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -256,8 +256,7 @@ /mob/living/simple_animal/bot/medbot/process_scan(mob/living/carbon/human/H) if(buckled) if((last_warning + 300) < world.time) - var/message = ("Movement restrained! Unit on standby!") - speak(message) + speak("Movement restrained! Unit on standby!") playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) last_warning = world.time return From 1b1049196f916db62be44c20dda85abd55f63739 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Tue, 13 Dec 2016 10:38:10 -0500 Subject: [PATCH 37/70] Automatic changelog generation for PR #5967 [ci skip] --- html/changelogs/AutoChangeLog-pr-5967.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5967.yml diff --git a/html/changelogs/AutoChangeLog-pr-5967.yml b/html/changelogs/AutoChangeLog-pr-5967.yml new file mode 100644 index 00000000000..97bcc128cbe --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5967.yml @@ -0,0 +1,4 @@ +author: "TullyBurnalot" +delete-after: True +changes: + - bugfix: "Medbots no longer run after injured mobs if buckled. They also inform nearby players of this" From ac2d26b548c38f01b2292704d3839117b087f2e6 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Tue, 13 Dec 2016 11:00:34 -0500 Subject: [PATCH 38/70] Automatic changelog compile, [ci skip] --- html/changelog.html | 6 ++++++ html/changelogs/.all_changelog.yml | 4 ++++ html/changelogs/AutoChangeLog-pr-5967.yml | 4 ---- 3 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-5967.yml diff --git a/html/changelog.html b/html/changelog.html index e5b33949b04..61d50b86cbf 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,12 @@ -->
          +

          13 December 2016

          +

          TullyBurnalot updated:

          +
            +
          • Medbots no longer run after injured mobs if buckled. They also inform nearby players of this
          • +
          +

          12 December 2016

          Kyep updated:

            diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index c50256330ec..2506da5d6ae 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -3177,3 +3177,7 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. TullyBurnalot: - bugfix: Throwing mobs behind you force moves them to behind you before actually throwing them, preventing throw-shoving +2016-12-13: + TullyBurnalot: + - bugfix: Medbots no longer run after injured mobs if buckled. They also inform + nearby players of this diff --git a/html/changelogs/AutoChangeLog-pr-5967.yml b/html/changelogs/AutoChangeLog-pr-5967.yml deleted file mode 100644 index 97bcc128cbe..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5967.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "TullyBurnalot" -delete-after: True -changes: - - bugfix: "Medbots no longer run after injured mobs if buckled. They also inform nearby players of this" From d548691246a608b924125967725bdad10292afce Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Wed, 14 Dec 2016 01:45:00 -0500 Subject: [PATCH 39/70] Automatic changelog generation for PR #5980 [ci skip] --- html/changelogs/AutoChangeLog-pr-5980.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5980.yml diff --git a/html/changelogs/AutoChangeLog-pr-5980.yml b/html/changelogs/AutoChangeLog-pr-5980.yml new file mode 100644 index 00000000000..3dfa79a86e4 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5980.yml @@ -0,0 +1,4 @@ +author: "Fox McCloud" +delete-after: True +changes: + - bugfix: "Fixes the personal crafting cost of ED-209's being too expensive" From 23717e9949c3cd33adac0d3ff9a8ecb80ce85e32 Mon Sep 17 00:00:00 2001 From: ParadiseSS13-Bot Date: Wed, 14 Dec 2016 02:00:18 -0500 Subject: [PATCH 40/70] Automatic changelog compile, [ci skip] --- html/changelog.html | 6 ++++++ html/changelogs/.all_changelog.yml | 3 +++ html/changelogs/AutoChangeLog-pr-5980.yml | 4 ---- 3 files changed, 9 insertions(+), 4 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-5980.yml diff --git a/html/changelog.html b/html/changelog.html index 61d50b86cbf..32f14061264 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -55,6 +55,12 @@ -->
            +

            14 December 2016

            +

            Fox McCloud updated:

            +
              +
            • Fixes the personal crafting cost of ED-209's being too expensive
            • +
            +

            13 December 2016

            TullyBurnalot updated:

              diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index 2506da5d6ae..3a3018fbdcc 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -3181,3 +3181,6 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. TullyBurnalot: - bugfix: Medbots no longer run after injured mobs if buckled. They also inform nearby players of this +2016-12-14: + Fox McCloud: + - bugfix: Fixes the personal crafting cost of ED-209's being too expensive diff --git a/html/changelogs/AutoChangeLog-pr-5980.yml b/html/changelogs/AutoChangeLog-pr-5980.yml deleted file mode 100644 index 3dfa79a86e4..00000000000 --- a/html/changelogs/AutoChangeLog-pr-5980.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Fox McCloud" -delete-after: True -changes: - - bugfix: "Fixes the personal crafting cost of ED-209's being too expensive" From 4b1bfe33ffbc63c4e80545105557197aa53b1248 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Wed, 14 Dec 2016 13:12:10 -0500 Subject: [PATCH 41/70] Wall Rot Effect Refactor --- code/game/objects/effects/overlays.dm | 14 ++++++++ code/game/turfs/simulated/walls.dm | 35 +++++++------------ code/game/turfs/simulated/walls_reinforced.dm | 4 +-- .../reagents/chemistry/reagents/toxins.dm | 6 ++-- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 62760324f76..7e49136d3cf 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -97,3 +97,17 @@ icon = 'icons/effects/effects.dmi' icon_state = "admin" layer = 4.1 + +/obj/effect/overlay/wall_rot + name = "Wallrot" + desc = "Ick..." + icon = 'icons/effects/wallrot.dmi' + anchored = 1 + density = 1 + layer = 5 + mouse_opacity = 0 + +/obj/effect/overlay/wall_rot/New() + ..() + pixel_x += rand(-10, 10) + pixel_y += rand(-10, 10) \ No newline at end of file diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index d1fb0326466..cb7cd8be813 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -23,7 +23,7 @@ var/hardness = 40 //lower numbers are harder. Used to determine the probability of a hulk smashing through. var/engraving, engraving_quality //engraving on the wall - + var/sheet_type = /obj/item/stack/sheet/metal var/obj/item/stack/sheet/builtin_sheet = null @@ -39,16 +39,14 @@ /turf/simulated/wall/New() ..() - builtin_sheet = new sheet_type - + builtin_sheet = new sheet_type + /turf/simulated/wall/BeforeChange() - for(var/obj/effect/E in src) - // such quality code - if(E.name == "Wallrot") - qdel(E) + for(var/obj/effect/overlay/wall_rot/WR in src) + qdel(WR) . = ..() - + //Appearance /turf/simulated/wall/examine(mob/user) . = ..(user) @@ -139,7 +137,7 @@ O.loc = src ChangeTurf(/turf/simulated/floor/plating) - + /turf/simulated/wall/proc/break_wall() builtin_sheet.amount = 2 builtin_sheet.loc = src @@ -187,21 +185,12 @@ var/number_rots = rand(2,3) for(var/i=0, iYou burn away the fungi with \the [WT].") playsound(src, 'sound/items/Welder.ogg', 10, 1) - for(var/obj/effect/E in src) if(E.name == "Wallrot") - qdel(E) + for(var/obj/effect/overlay/wall_rot/WR in src) + qdel(WR) rotting = 0 return else if(!is_sharp(W) && W.force >= 10 || W.force >= 20) diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index 1dbda894c52..49cfa1ace0f 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -29,8 +29,8 @@ if( WT.remove_fuel(0,user) ) to_chat(user, "You burn away the fungi with \the [WT].") playsound(src, 'sound/items/Welder.ogg', 10, 1) - for(var/obj/effect/E in src) if(E.name == "Wallrot") - qdel(E) + for(var/obj/effect/overlay/wall_rot/WR in src) + qdel(WR) rotting = 0 return else if(!is_sharp(W) && W.force >= 10 || W.force >= 20) diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index 3b59ff8e0b7..411e6a7bae5 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -913,11 +913,9 @@ /datum/reagent/atrazine/reaction_turf(turf/simulated/wall/W, volume) // Clear off wallrot fungi if(istype(W) && W.rotting) + for(var/obj/effect/overlay/wall_rot/WR in W) + qdel(WR) W.rotting = 0 - for(var/obj/effect/overlay/O in W) - if(O.name == "Wallrot") // This is so awful - qdel(O) - W.visible_message("The fungi are completely dissolved by the solution!") /datum/reagent/atrazine/reaction_obj(obj/O, volume) From b9abce843d01a6ec64b75214f4ab579cc29d51b1 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 14 Dec 2016 13:37:34 -0800 Subject: [PATCH 42/70] NanoUI Update: Seperate UI Data into ui_data() proc This commit changes how NanoUI's live data updating system works. Previously, data for the template was directly gathered in the ui_interact proc. Now, it is seperated into the proc `ui_data`. To players, this does absolutely nothing. To coders, this opens up the potential for a much more complicated and fancy graphical updating system in the future, because the data is available on-demand without ever having to call nanomanager.try_update_ui. --- .../components/omni_devices/filter.dm | 14 +- .../components/omni_devices/mixer.dm | 14 +- code/game/dna/dna_modifier.dm | 26 +-- code/game/gamemodes/nuclear/nuclearbomb.dm | 14 +- code/game/machinery/Freezer.dm | 54 +++-- code/game/machinery/Sleeper.dm | 23 +- code/game/machinery/adv_med.dm | 216 +++++++++--------- code/game/machinery/alarm.dm | 23 +- code/game/machinery/atmoalter/canister.dm | 48 ++-- code/game/machinery/atmoalter/pump.dm | 36 +-- code/game/machinery/atmoalter/scrubber.dm | 43 ++-- code/game/machinery/computer/Operating.dm | 17 +- code/game/machinery/computer/aifixer.dm | 16 +- code/game/machinery/computer/atmos_alert.dm | 14 +- code/game/machinery/computer/camera.dm | 28 +-- code/game/machinery/computer/card.dm | 14 +- code/game/machinery/computer/cloning.dm | 15 +- .../game/machinery/computer/communications.dm | 27 +-- .../computer/pod_tracking_console.dm | 16 +- code/game/machinery/computer/robot.dm | 18 +- code/game/machinery/cryo.dm | 34 ++- code/game/machinery/doors/airlock.dm | 29 +-- .../airlock_controllers.dm | 56 ++--- code/game/machinery/firealarm.dm | 18 +- code/game/machinery/poolcontroller.dm | 13 +- code/game/machinery/portable_tag_turret.dm | 17 +- code/game/machinery/portable_turret.dm | 15 +- code/game/machinery/requests_console.dm | 14 +- code/game/machinery/slotmachine.dm | 16 +- code/game/machinery/teleporter.dm | 19 +- code/game/machinery/turret_control.dm | 14 +- code/game/machinery/vending.dm | 13 +- code/game/mecha/mech_bay.dm | 27 +-- code/game/mecha/mecha_control_console.dm | 16 +- code/game/objects/items/devices/aicard.dm | 15 +- code/game/objects/items/devices/guitar.dm | 3 + .../items/devices/radio/electropack.dm | 14 +- .../game/objects/items/devices/radio/radio.dm | 28 ++- .../objects/items/devices/transfer_valve.dm | 28 +-- code/game/objects/items/devices/uplinks.dm | 24 +- code/game/objects/items/devices/violin.dm | 3 + code/game/objects/items/weapons/RCD.dm | 16 +- .../game/objects/items/weapons/tanks/tanks.dm | 35 ++- code/game/objects/structures/musician.dm | 23 +- .../awaymissions/bluespaceartillery.dm | 34 +-- code/modules/clothing/spacesuits/rig/rig.dm | 18 +- code/modules/economy/Accounts_DB.dm | 14 +- .../kitchen_machinery/smartfridge.dm | 15 +- code/modules/hydroponics/seed_machines.dm | 34 +-- .../mob/living/silicon/pai/software.dm | 25 +- code/modules/nano/modules/alarm_monitor.dm | 14 +- code/modules/nano/modules/atmos_control.dm | 11 +- code/modules/nano/modules/crew_monitor.dm | 19 +- code/modules/nano/modules/human_appearance.dm | 15 +- code/modules/nano/modules/law_manager.dm | 14 +- code/modules/nano/modules/power_monitor.dm | 14 +- code/modules/nano/nanoexternal.dm | 13 +- code/modules/nano/nanomanager.dm | 16 +- code/modules/nano/nanoui.dm | 17 +- code/modules/paperwork/faxmachine.dm | 15 +- code/modules/pda/PDA.dm | 34 +-- code/modules/power/apc.dm | 101 ++++---- code/modules/power/port_gen.dm | 16 +- code/modules/power/smes.dm | 28 +-- code/modules/power/solar.dm | 17 +- code/modules/power/supermatter/supermatter.dm | 14 +- .../chemistry/machinery/chem_dispenser.dm | 29 ++- .../chemistry/machinery/chem_heater.dm | 17 +- .../chemistry/machinery/chem_master.dm | 17 +- code/modules/recycling/disposal.dm | 15 +- code/modules/research/rdconsole.dm | 14 +- .../machinery/geosample_scanner.dm | 28 ++- .../security_levels/keycard authentication.dm | 25 +- code/modules/shuttle/supply.dm | 26 ++- nano/assets/libraries.min.js | 10 +- nano/assets/nano.js | 2 +- nano/assets/nanoui.css | 4 +- nano/scripts/nano/nano_state_manager.js | 2 +- 78 files changed, 964 insertions(+), 889 deletions(-) diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index 94efade9b1a..cbe1422c38a 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -108,22 +108,16 @@ return 1 -/obj/machinery/atmospherics/omni/filter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) +/obj/machinery/atmospherics/omni/filter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0) usr.set_machine(src) - var/list/data = new() - - data = build_uidata() - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "omni_filter.tmpl", "Omni Filter Control", 330, 330) - ui.set_initial_data(data) ui.open() -/obj/machinery/atmospherics/omni/filter/proc/build_uidata() - var/list/data = new() +/obj/machinery/atmospherics/omni/filter/ui_data(mob/user, datum/topic_state/state) + var/data[0] data["power"] = on data["config"] = configuring diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm index c64703773d3..07269c5f3db 100644 --- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm @@ -132,22 +132,16 @@ return 1 -/obj/machinery/atmospherics/omni/mixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) +/obj/machinery/atmospherics/omni/mixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0) usr.set_machine(src) - var/list/data = new() - - data = build_uidata() - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "omni_mixer.tmpl", "Omni Mixer Control", 360, 330) - ui.set_initial_data(data) ui.open() -/obj/machinery/atmospherics/omni/mixer/proc/build_uidata() - var/list/data = new() +/obj/machinery/atmospherics/omni/mixer/ui_data(mob/user, datum/topic_state/state) + var/data[0] data["power"] = on data["config"] = configuring diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 63c42687b67..bc4129d875d 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -476,7 +476,18 @@ if(user == connected.occupant) return - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "dna_modifier.tmpl", "DNA Modifier Console", 660, 700) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/computer/scan_consolenew/ui_data(mob/user, datum/topic_state/state) var/data[0] data["selectedMenuKey"] = selected_menu_key data["locked"] = src.connected.locked @@ -550,18 +561,7 @@ for(var/datum/reagent/R in connected.beaker.reagents.reagent_list) data["beakerVolume"] += R.volume - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "dna_modifier.tmpl", "DNA Modifier Console", 660, 700) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/computer/scan_consolenew/Topic(href, href_list) if(..()) diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 5c8dcecf05b..efd9e1ce01d 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -175,6 +175,13 @@ var/bomb_set return /obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "nuclear_bomb.tmpl", "Nuke Control Panel", 450, 550, state = physical_state) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/nuclearbomb/ui_data(mob/user, datum/topic_state/state) var/data[0] data["is_syndicate"] = is_syndicate data["hacking"] = 0 @@ -201,12 +208,7 @@ var/bomb_set if(yes_code) data["message"] = "*****" - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "nuclear_bomb.tmpl", "Nuke Control Panel", 450, 550, state = physical_state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/nuclearbomb/verb/make_deployable() set category = "Object" diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 7f1a89ab0a4..8a8c7a04114 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -98,7 +98,18 @@ src.ui_interact(user) /obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "freezer.tmpl", "Gas Cooling System", 540, 300) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/atmospherics/unary/cold_sink/freezer/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["on"] = on ? 1 : 0 data["gasPressure"] = round(air_contents.return_pressure()) @@ -117,19 +128,7 @@ else if(air_contents.temperature < (T0C - 20) && air_contents.temperature > (T0C - 100)) temp_class = "average" data["gasTemperatureClass"] = temp_class - - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "freezer.tmpl", "Gas Cooling System", 540, 300) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list) if(..()) @@ -257,7 +256,18 @@ src.ui_interact(user) /obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "freezer.tmpl", "Gas Heating System", 540, 300) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["on"] = on ? 1 : 0 data["gasPressure"] = round(air_contents.return_pressure()) @@ -274,19 +284,7 @@ if(air_contents.temperature > (T20C+40)) temp_class = "bad" data["gasTemperatureClass"] = temp_class - - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "freezer.tmpl", "Gas Heating System", 540, 300) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/atmospherics/unary/heat_reservoir/heater/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index d5179a9c19b..cc93beafb75 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -135,6 +135,13 @@ ui_interact(user) /obj/machinery/sleeper/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "sleeper.tmpl", "Sleeper", 550, 770) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/sleeper/ui_data(mob/user, datum/topic_state/state) var/data[0] data["hasOccupant"] = occupant ? 1 : 0 var/occupantData[0] @@ -229,13 +236,7 @@ chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("chemical" = temp.id), "occ_amount" = reagent_amount, "pretty_amount" = pretty_amount, "injectable" = injectable, "overdosing" = overdosing, "od_warning" = caution))) data["chemicals"] = chemicals - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "sleeper.tmpl", "Sleeper", 550, 770) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/sleeper/Topic(href, href_list) if(!controls_inside && usr == occupant) @@ -454,10 +455,10 @@ set name = "Eject Sleeper" set category = "Object" set src in oview(1) - + if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other return - + src.icon_state = "[base_icon]-open" src.go_out() add_fingerprint(usr) @@ -467,10 +468,10 @@ set name = "Remove Beaker" set category = "Object" set src in oview(1) - + if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other return - + if(beaker) filtering = 0 beaker.forceMove(usr.loc) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 8ea98b53c8b..f1da5f49ab7 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -322,140 +322,142 @@ /obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 600) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/body_scanconsole/ui_data(mob/user, datum/topic_state/state) var/data[0] data["connected"] = connected ? 1 : 0 - if(connected) - data["occupied"] = connected.occupant ? 1 : 0 + if(!connected) + return data - var/occupantData[0] - if(connected.occupant) - var/mob/living/carbon/human/H = connected.occupant - occupantData["name"] = H.name - occupantData["stat"] = H.stat - occupantData["health"] = H.health - occupantData["maxHealth"] = H.maxHealth + data["occupied"] = connected.occupant ? 1 : 0 - occupantData["hasVirus"] = H.viruses.len + var/occupantData[0] + if(connected.occupant) + var/mob/living/carbon/human/H = connected.occupant + occupantData["name"] = H.name + occupantData["stat"] = H.stat + occupantData["health"] = H.health + occupantData["maxHealth"] = H.maxHealth - occupantData["bruteLoss"] = H.getBruteLoss() - occupantData["oxyLoss"] = H.getOxyLoss() - occupantData["toxLoss"] = H.getToxLoss() - occupantData["fireLoss"] = H.getFireLoss() + occupantData["hasVirus"] = H.viruses.len - occupantData["radLoss"] = H.radiation - occupantData["cloneLoss"] = H.getCloneLoss() - occupantData["brainLoss"] = H.getBrainLoss() - occupantData["paralysis"] = H.paralysis - occupantData["paralysisSeconds"] = round(H.paralysis / 4) - occupantData["bodyTempC"] = H.bodytemperature-T0C - occupantData["bodyTempF"] = (((H.bodytemperature-T0C) * 1.8) + 32) + occupantData["bruteLoss"] = H.getBruteLoss() + occupantData["oxyLoss"] = H.getOxyLoss() + occupantData["toxLoss"] = H.getToxLoss() + occupantData["fireLoss"] = H.getFireLoss() - occupantData["hasBorer"] = H.has_brain_worms() + occupantData["radLoss"] = H.radiation + occupantData["cloneLoss"] = H.getCloneLoss() + occupantData["brainLoss"] = H.getBrainLoss() + occupantData["paralysis"] = H.paralysis + occupantData["paralysisSeconds"] = round(H.paralysis / 4) + occupantData["bodyTempC"] = H.bodytemperature-T0C + occupantData["bodyTempF"] = (((H.bodytemperature-T0C) * 1.8) + 32) - var/bloodData[0] - bloodData["hasBlood"] = 0 - if(ishuman(H) && H.vessel && !(H.species && H.species.flags & NO_BLOOD)) - var/blood_type = H.get_blood_name() - var/blood_volume = round(H.vessel.get_reagent_amount(blood_type)) - bloodData["hasBlood"] = 1 - bloodData["volume"] = blood_volume - bloodData["percent"] = round(((blood_volume / BLOOD_VOLUME_NORMAL)*100)) - bloodData["pulse"] = H.get_pulse(GETPULSE_TOOL) - bloodData["bloodLevel"] = blood_volume - bloodData["bloodMax"] = H.max_blood - occupantData["blood"] = bloodData + occupantData["hasBorer"] = H.has_brain_worms() - var/implantData[0] - for(var/obj/item/weapon/implant/I in H) - if(I.implanted && is_type_in_list(I, known_implants)) - var/implantSubData[0] - implantSubData["name"] = sanitize(I.name) - implantData.Add(list(implantSubData)) - occupantData["implant"] = implantData - occupantData["implant_len"] = implantData.len + var/bloodData[0] + bloodData["hasBlood"] = 0 + if(ishuman(H) && H.vessel && !(H.species && H.species.flags & NO_BLOOD)) + var/blood_type = H.get_blood_name() + var/blood_volume = round(H.vessel.get_reagent_amount(blood_type)) + bloodData["hasBlood"] = 1 + bloodData["volume"] = blood_volume + bloodData["percent"] = round(((blood_volume / BLOOD_VOLUME_NORMAL)*100)) + bloodData["pulse"] = H.get_pulse(GETPULSE_TOOL) + bloodData["bloodLevel"] = blood_volume + bloodData["bloodMax"] = H.max_blood + occupantData["blood"] = bloodData - var/extOrganData[0] - for(var/obj/item/organ/external/E in H.organs) - var/organData[0] - organData["name"] = E.name - organData["open"] = E.open - organData["germ_level"] = E.germ_level - organData["bruteLoss"] = E.brute_dam - organData["fireLoss"] = E.burn_dam - organData["totalLoss"] = E.brute_dam + E.burn_dam - organData["maxHealth"] = E.max_damage - organData["bruised"] = E.min_bruised_damage - organData["broken"] = E.min_broken_damage + var/implantData[0] + for(var/obj/item/weapon/implant/I in H) + if(I.implanted && is_type_in_list(I, known_implants)) + var/implantSubData[0] + implantSubData["name"] = sanitize(I.name) + implantData.Add(list(implantSubData)) + occupantData["implant"] = implantData + occupantData["implant_len"] = implantData.len - var/shrapnelData[0] - for(var/obj/I in E.implants) - var/shrapnelSubData[0] - shrapnelSubData["name"] = I.name + var/extOrganData[0] + for(var/obj/item/organ/external/E in H.organs) + var/organData[0] + organData["name"] = E.name + organData["open"] = E.open + organData["germ_level"] = E.germ_level + organData["bruteLoss"] = E.brute_dam + organData["fireLoss"] = E.burn_dam + organData["totalLoss"] = E.brute_dam + E.burn_dam + organData["maxHealth"] = E.max_damage + organData["bruised"] = E.min_bruised_damage + organData["broken"] = E.min_broken_damage - shrapnelData.Add(list(shrapnelSubData)) + var/shrapnelData[0] + for(var/obj/I in E.implants) + var/shrapnelSubData[0] + shrapnelSubData["name"] = I.name - organData["shrapnel"] = shrapnelData - organData["shrapnel_len"] = shrapnelData.len + shrapnelData.Add(list(shrapnelSubData)) - var/organStatus[0] - if(E.status & ORGAN_DESTROYED) - organStatus["destroyed"] = 1 - if(E.status & ORGAN_BROKEN) - organStatus["broken"] = E.broken_description - if(E.status & ORGAN_ROBOT) - organStatus["robotic"] = 1 - if(E.status & ORGAN_SPLINTED) - organStatus["splinted"] = 1 - if(E.status & ORGAN_BLEEDING) - organStatus["bleeding"] = 1 - if(E.status & ORGAN_DEAD) - organStatus["dead"] = 1 + organData["shrapnel"] = shrapnelData + organData["shrapnel_len"] = shrapnelData.len - organData["status"] = organStatus + var/organStatus[0] + if(E.status & ORGAN_DESTROYED) + organStatus["destroyed"] = 1 + if(E.status & ORGAN_BROKEN) + organStatus["broken"] = E.broken_description + if(E.status & ORGAN_ROBOT) + organStatus["robotic"] = 1 + if(E.status & ORGAN_SPLINTED) + organStatus["splinted"] = 1 + if(E.status & ORGAN_BLEEDING) + organStatus["bleeding"] = 1 + if(E.status & ORGAN_DEAD) + organStatus["dead"] = 1 - if(istype(E, /obj/item/organ/external/chest) && H.is_lung_ruptured()) - organData["lungRuptured"] = 1 + organData["status"] = organStatus - for(var/datum/wound/W in E.wounds) - if(W.internal) - organData["internalBleeding"] = 1 - break + if(istype(E, /obj/item/organ/external/chest) && H.is_lung_ruptured()) + organData["lungRuptured"] = 1 - extOrganData.Add(list(organData)) + for(var/datum/wound/W in E.wounds) + if(W.internal) + organData["internalBleeding"] = 1 + break - occupantData["extOrgan"] = extOrganData + extOrganData.Add(list(organData)) - var/intOrganData[0] - for(var/obj/item/organ/internal/I in H.internal_organs) - var/organData[0] - organData["name"] = I.name - organData["desc"] = I.desc - organData["germ_level"] = I.germ_level - organData["damage"] = I.damage - organData["maxHealth"] = I.max_damage - organData["bruised"] = I.min_broken_damage - organData["broken"] = I.min_bruised_damage - organData["robotic"] = I.robotic - organData["dead"] = (I.status & ORGAN_DEAD) + occupantData["extOrgan"] = extOrganData - intOrganData.Add(list(organData)) + var/intOrganData[0] + for(var/obj/item/organ/internal/I in H.internal_organs) + var/organData[0] + organData["name"] = I.name + organData["desc"] = I.desc + organData["germ_level"] = I.germ_level + organData["damage"] = I.damage + organData["maxHealth"] = I.max_damage + organData["bruised"] = I.min_broken_damage + organData["broken"] = I.min_bruised_damage + organData["robotic"] = I.robotic + organData["dead"] = (I.status & ORGAN_DEAD) - occupantData["intOrgan"] = intOrganData + intOrganData.Add(list(organData)) - occupantData["blind"] = (H.disabilities & BLIND) - occupantData["nearsighted"] = (H.disabilities & NEARSIGHTED) + occupantData["intOrgan"] = intOrganData - data["occupant"] = occupantData - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 600) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + occupantData["blind"] = (H.disabilities & BLIND) + occupantData["nearsighted"] = (H.disabilities & NEARSIGHTED) + data["occupant"] = occupantData + return data /obj/machinery/body_scanconsole/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 5515eb7ab3a..79a423c70cf 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -696,8 +696,14 @@ data["danger"] = danger return data -/obj/machinery/alarm/proc/get_nano_data(mob/user, href_list) +/obj/machinery/alarm/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + var/list/href_list = state.href_list() + + if(href_list) + data["remote_connection"] = href_list["remote_connection"] + data["remote_access"] = href_list["remote_access"] + data["name"] = sanitize(name) data["air"] = ui_air_status() data["alarmActivated"] = alarmActivated || danger_level == 2 @@ -807,22 +813,9 @@ return thresholds /obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) - var/list/href = state.href_list(user) - var/remote_connection = 0 - var/remote_access = 0 - if(href) - remote_connection = href["remote_connection"] // Remote connection means we're non-adjacent/connecting from another computer - remote_access = href["remote_access"] // Remote access means we also have the privilege to alter the air alarm. - - var/list/data = get_nano_data(user, href) - - data["remote_connection"] = remote_connection - data["remote_access"] = remote_access - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "air_alarm.tmpl", name, 570, 410, state = state) - ui.set_initial_data(data) ui.open() ui.set_auto_update(1) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 7eb01d06988..a7d62d74b94 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -88,8 +88,8 @@ var/datum/canister_icons/canister_icon_container = new() "quart" = "none") oldcolor = new /list() decals = list("cold" = 0, "hot" = 0, "plasma" = 0) - colorcontainer = new /list(4) - possibledecals = new /list(3) + colorcontainer = list() + possibledecals = list() update_icon() /obj/machinery/portable_atmospherics/canister/proc/init_data_vars() @@ -123,7 +123,7 @@ var/datum/canister_icons/canister_icon_container = new() L.Add(list("anycolor" = 1)) colorcontainer[C] = L - possibledecals = new /list(3) + possibledecals = list() var/i var/list/L = canister_icon_container.possibledecals @@ -382,10 +382,23 @@ update_flag /obj/machinery/portable_atmospherics/canister/attack_hand(var/mob/user as mob) return src.ui_interact(user) -/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) if(src.destroyed) return + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "canister.tmpl", "Canister", 480, 400, state = state) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + + +/obj/machinery/portable_atmospherics/canister/ui_data(mob/user, datum/topic_state/state) init_data_vars() //set up var/colorcontainer and var/possibledecals // this is the data which will be sent to the ui @@ -394,8 +407,10 @@ update_flag data["menu"] = menu ? 1 : 0 data["canLabel"] = can_label ? 1 : 0 data["canister_color"] = canister_color - data["colorContainer"] = colorcontainer - data["possibleDecals"] = possibledecals + data["colorContainer"] = colorcontainer.Copy() + colorcontainer.Cut() + data["possibleDecals"] = possibledecals.Copy() + possibledecals.Cut() data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) data["releasePressure"] = round(release_pressure ? release_pressure : 0) @@ -405,24 +420,9 @@ update_flag data["hasHoldingTank"] = holding ? 1 : 0 if(holding) - data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure())) - - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "canister.tmpl", "Canister", 480, 400, state = physical_state) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) - - //Disregard these, avoid cluttering up the VV window - colorcontainer = new /list(4) - possibledecals = new /list(3) + data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure())) + + return data /obj/machinery/portable_atmospherics/canister/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 9f716696591..8f7f6d72bb4 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -8,7 +8,7 @@ var/on = 0 var/direction_out = 0 //0 = siphoning, 1 = releasing var/target_pressure = 100 - + var/pressuremin = 0 var/pressuremax = 10 * ONE_ATMOSPHERE @@ -98,15 +98,27 @@ /obj/machinery/portable_atmospherics/pump/attack_ai(var/mob/user as mob) src.add_hiddenprint(user) return src.attack_hand(user) - + /obj/machinery/portable_atmospherics/pump/attack_ghost(var/mob/user as mob) return src.attack_hand(user) /obj/machinery/portable_atmospherics/pump/attack_hand(var/mob/user as mob) ui_interact(user) - -/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - var/list/data[0] + +/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "portpump.tmpl", "Portable Pump", 480, 400, state = state) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/portable_atmospherics/pump/ui_data(mob/user, datum/topic_state/state = physical_state) + var/data[0] data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) data["targetpressure"] = round(target_pressure) @@ -119,18 +131,7 @@ if(holding) data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0)) - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - 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 - ui = new(user, src, ui_key, "portpump.tmpl", "Portable Pump", 480, 400, state = physical_state) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/portable_atmospherics/pump/Topic(href, href_list) if(..()) @@ -155,4 +156,3 @@ update_icon() src.add_fingerprint(usr) - \ No newline at end of file diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 1fb0bdd1308..de5ac2dc49d 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -10,7 +10,7 @@ var/widenet = 0 //is this scrubber acting on the 3x3 area around it. volume = 750 - + var/minrate = 0//probably useless, but whatever var/maxrate = 10 * ONE_ATMOSPHERE @@ -52,7 +52,7 @@ if(istype(T)) for(var/turf/simulated/tile in T.GetAtmosAdjacentTurfs(alldir=1)) scrub(tile) - + /obj/machinery/portable_atmospherics/scrubber/proc/scrub(var/turf/simulated/tile) var/datum/gas_mixture/environment if(holding) @@ -108,7 +108,7 @@ /obj/machinery/portable_atmospherics/scrubber/attack_ai(var/mob/user as mob) src.add_hiddenprint(user) return src.attack_hand(user) - + /obj/machinery/portable_atmospherics/scrubber/attack_ghost(var/mob/user as mob) return src.attack_hand(user) @@ -116,8 +116,20 @@ ui_interact(user) return -/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - var/list/data[0] +/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = physical_state) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "portscrubber.tmpl", "Portable Scrubber", 480, 400, state = state) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/portable_atmospherics/scrubber/ui_data(mob/user, datum/topic_state/state = physical_state) + var/data[0] data["portConnected"] = connected_port ? 1 : 0 data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0) data["rate"] = round(volume_rate) @@ -129,18 +141,7 @@ if(holding) data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0)) - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - 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 - ui = new(user, src, ui_key, "portscrubber.tmpl", "Portable Scrubber", 480, 400, state = physical_state) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/portable_atmospherics/scrubber/Topic(href, href_list) if(..()) @@ -160,7 +161,7 @@ volume_rate = Clamp(volume_rate+diff, minrate, maxrate) src.add_fingerprint(usr) - + /obj/machinery/portable_atmospherics/scrubber/huge name = "Huge Air Scrubber" icon_state = "scrubber:0" @@ -172,7 +173,7 @@ var/global/gid = 1 var/id = 0 var/stationary = 0 - + /obj/machinery/portable_atmospherics/scrubber/huge/New() ..() id = gid @@ -207,7 +208,7 @@ else if((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1) atmosanalyzer_scan(air_contents, user) - + /obj/machinery/portable_atmospherics/scrubber/huge/stationary name = "Stationary Air Scrubber" - stationary = 1 \ No newline at end of file + stationary = 1 diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 08e3677b039..1c40370f56d 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -86,6 +86,13 @@ // onclose(user, "op") /obj/machinery/computer/operating/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)//ui is mostly copy pasta from the sleeper ui + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "op_computer.tmpl", "Patient Monitor", 650, 455) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/operating/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/mob/living/carbon/human/occupant = src.table.victim data["hasOccupant"] = occupant ? 1 : 0 @@ -156,15 +163,7 @@ data["healthAlarm"]=healthAlarm data["oxy"]=oxy - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "op_computer.tmpl", "Patient Monitor", 650, 455) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) - - - + return data /obj/machinery/computer/operating/Topic(href, href_list) diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 097efa2c75c..539edb24d65 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -33,6 +33,14 @@ to_chat(user, "You have been locked out from this console!") /obj/machinery/computer/aifixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + + if(!ui) + ui = new(user, src, ui_key, "ai_fixer.tmpl", "AI System Integrity Restorer", 550, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/aifixer/ui_data(mob/user, datum/topic_state/state) var/data[0] if(occupant) data["occupant"] = occupant.name @@ -49,13 +57,7 @@ data["laws"] = laws - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "ai_fixer.tmpl", "AI System Integrity Restorer", 550, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/aifixer/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index cecf755b37d..ea53374970a 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -24,6 +24,13 @@ var/global/list/minor_air_alarms = list() ui_interact(user) /obj/machinery/computer/atmos_alert/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "atmos_alert.tmpl", src.name, 500, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/atmos_alert/ui_data(mob/user, datum/topic_state/state) var/data[0] var/major_alarms[0] var/minor_alarms[0] @@ -37,12 +44,7 @@ var/global/list/minor_air_alarms = list() data["priority_alarms"] = major_alarms data["minor_alarms"] = minor_alarms - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "atmos_alert.tmpl", src.name, 500, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/atmos_alert/update_icon() var/list/alarms = atmosphere_alarm.major_alarms() diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 97a976ddc41..c2e58af92cf 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -70,6 +70,17 @@ if(user.stat) return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "sec_camera.tmpl", "Camera Console", 900, 800) + // adding a template with the key "mapContent" enables the map ui functionality + ui.add_template("mapContent", "sec_camera_map_content.tmpl") + // adding a template with the key "mapHeader" replaces the map header content + ui.add_template("mapHeader", "sec_camera_map_header.tmpl") + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/security/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["current"] = null @@ -115,18 +126,7 @@ if(current) data["current"] = current.nano_structure() - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "sec_camera.tmpl", "Camera Console", 900, 800) - - // adding a template with the key "mapContent" enables the map ui functionality - ui.add_template("mapContent", "sec_camera_map_content.tmpl") - // adding a template with the key "mapHeader" replaces the map header content - ui.add_template("mapHeader", "sec_camera_map_header.tmpl") - - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/security/Topic(href, href_list) if(..()) @@ -138,10 +138,10 @@ var/obj/machinery/camera/C = locate(href_list["switchTo"]) in cameranet.cameras if(!C) return 1 - + if(!can_access_camera(C)) return 1 // No href exploits for you. - + switch_to_camera(usr, C) else if(href_list["reset"]) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 7e78232de4d..a33d3aa02eb 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -173,9 +173,15 @@ var/time_last_changed_position = 0 ui_interact(user) -/obj/machinery/computer/card/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/machinery/computer/card/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "identification_computer.tmpl", src.name, 775, 700) + ui.open() + +/obj/machinery/computer/card/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["src"] = UID() data["station_name"] = station_name() @@ -242,11 +248,7 @@ var/time_last_changed_position = 0 data["regions"] = regions - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "identification_computer.tmpl", src.name, 775, 700) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/card/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 4afe9ba3cff..847f20a3f23 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -120,6 +120,14 @@ /obj/machinery/computer/cloning/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) if(stat & (NOPOWER|BROKEN)) return + + // Set up the Nano UI + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "cloning_console.tmpl", "Cloning Console UI", 640, 520) + ui.open() + +/obj/machinery/computer/cloning/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["menu"] = src.menu data["scanner"] = sanitize("[src.scanner]") @@ -175,12 +183,7 @@ else data["podready"] = 0 - // Set up the Nano UI - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "cloning_console.tmpl", "Cloning Console UI", 640, 520) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/cloning/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 01608efedcb..f7ee5908824 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -69,14 +69,14 @@ var/list/access = usr.get_access() if(allowed(usr)) authenticated = COMM_AUTHENTICATION_MIN - + if(access_captain in access) authenticated = COMM_AUTHENTICATION_MAX var/mob/living/carbon/human/H = usr var/obj/item/weapon/card/id = H.get_idcard(TRUE) if(istype(id)) crew_announcement.announcer = GetNameAndAssignmentFromId(id) - + nanomanager.update_uis(src) return @@ -313,7 +313,16 @@ ui_interact(user) /obj/machinery/computer/communications/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + 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 + ui = new(user, src, ui_key, "comm_console.tmpl", "Communications Console", 400, 500) + // open the new ui window + ui.open() + +/obj/machinery/computer/communications/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["is_ai"] = isAI(user)||isrobot(user) data["menu_state"] = data["is_ai"] ? ai_menu_state : menu_state @@ -377,16 +386,8 @@ else data["dock_request"] = 0 - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - 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 - ui = new(user, src, ui_key, "comm_console.tmpl", "Communications Console", 400, 500) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() + return data + /obj/machinery/computer/communications/proc/setCurrentMessage(var/mob/user,var/value) if(isAI(user) || isrobot(user)) diff --git a/code/game/machinery/computer/pod_tracking_console.dm b/code/game/machinery/computer/pod_tracking_console.dm index cf16c34e04d..8664d786a24 100644 --- a/code/game/machinery/computer/pod_tracking_console.dm +++ b/code/game/machinery/computer/pod_tracking_console.dm @@ -14,6 +14,13 @@ ui_interact(user) /obj/machinery/computer/podtracker/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "pod_tracking.tmpl", "Pod Tracking Console", 400, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/podtracker/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/list/pods[0] for(var/obj/item/device/spacepod_equipment/misc/tracker/TR in world) @@ -33,14 +40,7 @@ pods.Add(list(list("pod" = "\ref[my_pod]", "name" = podname) + chairs + list("x" = my_pod.x, "y" = my_pod.y, "z" = my_pod.z))) data["pods"] = pods - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "pod_tracking.tmpl", "Pod Tracking Console", 400, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/podtracker/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 160fbeb9827..6f7e3391457 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -35,6 +35,13 @@ return 0 /obj/machinery/computer/robotics/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "robot_control.tmpl", "Robotic Control Console", 400, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/robotics/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/list/robots = get_cyborgs(user) if(robots.len) @@ -43,14 +50,7 @@ // Also applies for cyborgs. Hides the manual self-destruct button. data["is_ai"] = issilicon(user) data["allowed"] = is_authenticated(user) - - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "robot_control.tmpl", "Robotic Control Console", 400, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/robotics/Topic(href, href_list) if(..()) @@ -242,4 +242,4 @@ return for(var/mob/living/silicon/robot/R in mob_list) if(R.name == name) - return R \ No newline at end of file + return R diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 67414971337..3a147e29287 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -179,7 +179,18 @@ * @return nothing */ /obj/machinery/atmospherics/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "cryo.tmpl", "Cryo Cell Control System", 520, 420) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/atmospherics/unary/cryo_cell/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["isOperating"] = on data["hasOccupant"] = occupant ? 1 : 0 @@ -206,13 +217,6 @@ data["cellTemperatureStatus"] = "average" data["isBeakerLoaded"] = beaker ? 1 : 0 - /* // Removing beaker contents list from front-end, replacing with a total remaining volume - var beakerContents[0] - if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) - for(var/datum/reagent/R in beaker.reagents.reagent_list) - beakerContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list... - data["beakerContents"] = beakerContents - */ data["beakerLabel"] = null data["beakerVolume"] = 0 if(beaker) @@ -222,19 +226,7 @@ data["beakerVolume"] += R.volume data["autoeject"] = autoeject - - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "cryo.tmpl", "Cryo Cell Control System", 520, 420) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/atmospherics/unary/cryo_cell/Topic(href, href_list) if(usr == occupant) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index c0fc86c8261..433f23a592b 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -560,6 +560,13 @@ About the new airlock wires panel: ui_interact(user) /obj/machinery/door/airlock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "door_control.tmpl", "Door Controls - [src]", 600, 375) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/door/airlock/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["main_power_loss"] = round(main_power_lost_until > 0 ? max(main_power_lost_until - world.time, 0) / 10 : main_power_lost_until, 1) @@ -568,22 +575,16 @@ About the new airlock wires panel: data["open"] = !density var/commands[0] - commands[++commands.len] = list("name" = "IdScan", "command"= "idscan", "active" = !aiDisabledIdScanner, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) - commands[++commands.len] = list("name" = "Bolts", "command"= "bolts", "active" = !locked, "enabled" = "Raised", "disabled" = "Dropped", "danger" = 0, "act" = 0) - commands[++commands.len] = list("name" = "Bolt Lights", "command"= "lights", "active" = lights, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) - commands[++commands.len] = list("name" = "Safeties", "command"= "safeties", "active" = safe, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) - commands[++commands.len] = list("name" = "Timing", "command"= "timing", "active" = normalspeed, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) - commands[++commands.len] = list("name" = "Door State", "command"= "open", "active" = density, "enabled" = "Closed", "disabled" = "Opened", "danger" = 0, "act" = 0) - commands[++commands.len] = list("name" = "Emergency Access", "command"= "emergency", "active" = !emergency, "enabled" = "Disabled", "disabled" = "Enabled", "danger" = 0, "act" = 0) + commands[++commands.len] = list("name" = "IdScan", "command"= "idscan", "active" = !aiDisabledIdScanner,"enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) + commands[++commands.len] = list("name" = "Bolts", "command"= "bolts", "active" = !locked, "enabled" = "Raised", "disabled" = "Dropped", "danger" = 0, "act" = 0) + commands[++commands.len] = list("name" = "Bolt Lights", "command"= "lights", "active" = lights, "enabled" = "Enabled", "disabled" = "Disable", "danger" = 0, "act" = 1) + commands[++commands.len] = list("name" = "Safeties", "command"= "safeties", "active" = safe, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) + commands[++commands.len] = list("name" = "Timing", "command"= "timing", "active" = normalspeed, "enabled" = "Nominal", "disabled" = "Overridden", "danger" = 1, "act" = 0) + commands[++commands.len] = list("name" = "Door State", "command"= "open", "active" = density, "enabled" = "Closed", "disabled" = "Opened", "danger" = 0, "act" = 0) + commands[++commands.len] = list("name" = "Emergency Access","command"= "emergency", "active" = !emergency, "enabled" = "Disabled", "disabled" = "Enabled", "danger" = 0, "act" = 0) data["commands"] = commands - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "door_control.tmpl", "Door Controls - [src]", 600, 375) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/door/airlock/proc/hack(mob/user as mob) if(src.aiHacking==0) diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm index 2b336859127..d9be59bde59 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers.dm @@ -21,6 +21,13 @@ name = "Advanced Airlock Controller" /obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "advanced_airlock_console.tmpl", name, 470, 290) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data = list( @@ -32,16 +39,7 @@ "secure" = program.memory["secure"] ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "advanced_airlock_console.tmpl", name, 470, 290) - - ui.set_initial_data(data) - - ui.open() - - ui.set_auto_update(1) + return data /obj/machinery/embedded_controller/radio/airlock/advanced_airlock_controller/Topic(href, href_list) if(..()) @@ -79,6 +77,13 @@ tag_secure = 1 /obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "simple_airlock_console.tmpl", name, 470, 290) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data = list( @@ -88,16 +93,7 @@ "processing" = program.memory["processing"], ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "simple_airlock_console.tmpl", name, 470, 290) - - ui.set_initial_data(data) - - ui.open() - - ui.set_auto_update(1) + return data /obj/machinery/embedded_controller/radio/airlock/airlock_controller/Topic(href, href_list) if(..()) @@ -144,6 +140,13 @@ icon_state = "access_control_off" /obj/machinery/embedded_controller/radio/airlock/access_controller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "door_access_console.tmpl", name, 330, 220) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/embedded_controller/radio/airlock/access_controller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data = list( @@ -152,16 +155,7 @@ "processing" = program.memory["processing"] ) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "door_access_console.tmpl", name, 330, 220) - - ui.set_initial_data(data) - - ui.open() - - ui.set_auto_update(1) + return data /obj/machinery/embedded_controller/radio/airlock/access_controller/Topic(href, href_list) if(..()) @@ -186,4 +180,4 @@ if(clean) program.receive_user_command(href_list["command"]) - return 1 \ No newline at end of file + return 1 diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index fcf9d56b355..b1f7d33244d 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -174,6 +174,13 @@ FIRE ALARM ui_interact(user) /obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "firealarm.tmpl", name, 400, 400, state = state) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/firealarm/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/area/A = get_area(src) @@ -186,16 +193,7 @@ FIRE ALARM var/minute = round(time / 60) data["time_left"] = "[minute ? "[minute]:" : ""][add_zero(num2text(second), 2)]" - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "firealarm.tmpl", name, 400, 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) - - - + return data /obj/machinery/firealarm/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index 452408ccdaa..80f5e8be5d7 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -130,18 +130,19 @@ /obj/machinery/poolcontroller/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "poolcontroller.tmpl", "Pool Controller Interface", 520, 410) + ui.open() + +/obj/machinery/poolcontroller/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["currentTemp"] = temperature data["emagged"] = emagged data["TempColor"] = temperaturecolor - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "poolcontroller.tmpl", "Pool Controller Interface", 520, 410) - ui.set_initial_data(data) - ui.open() - + return data /obj/machinery/poolcontroller/Topic(href, href_list) diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm index deafad7f9b7..de78d46178f 100644 --- a/code/game/machinery/portable_tag_turret.dm +++ b/code/game/machinery/portable_tag_turret.dm @@ -43,18 +43,19 @@ iconholder = 1 /obj/machinery/porta_turret/tag/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/porta_turret/tag/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["access"] = !isLocked(user) data["locked"] = locked data["enabled"] = enabled data["is_lethal"] = 0 - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/porta_turret/tag/update_icon() if(!anchored) @@ -121,4 +122,4 @@ if(istype(H.belt, target_weapon)) return TURRET_SECONDARY_TARGET - return TURRET_NOT_TARGET \ No newline at end of file + return TURRET_NOT_TARGET diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 83f2dfef93f..a6eb360f45d 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -194,6 +194,13 @@ var/list/turret_icons ui_interact(user) /obj/machinery/porta_turret/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 320) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/porta_turret/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["access"] = !isLocked(user) data["screen"] = screen @@ -224,13 +231,7 @@ var/list/turret_icons active = (access in req_access) accesses[++accesses.len] = list("name" = name, "active" = active, "number" = access) data["accesses"] = accesses - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 320) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/porta_turret/proc/HasController() var/area/A = get_area(src) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 7bf9b661a24..9de1806852f 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -109,6 +109,13 @@ var/list/obj/machinery/requests_console/allConsoles = list() ui_interact(user) /obj/machinery/requests_console/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/requests_console/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["department"] = department @@ -129,12 +136,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() data["msgVerified"] = msgVerified data["announceAuth"] = announceAuth - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/requests_console/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index 9705ef9dedd..c72e987cd92 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -22,6 +22,13 @@ ui_interact(user) /obj/machinery/slot_machine/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "slotmachine.tmpl", name, 350, 200) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/slot_machine/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["working"] = working @@ -30,12 +37,7 @@ data["result"] = result data["resultlvl"] = resultlvl - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "slotmachine.tmpl", name, 350, 200) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/slot_machine/Topic(href, href_list) add_fingerprint(usr) @@ -112,4 +114,4 @@ T.amount = "[amt]" T.date = current_date_string T.time = worldtime2text() - account.transaction_log.Add(T) \ No newline at end of file + account.transaction_log.Add(T) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 369cb0fc708..0fec852c2f5 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -11,7 +11,6 @@ var/calibrating var/turf/target //Used for one-time-use teleport cards (such as clown planet coordinates.) //Setting this to 1 will set src.locked to null after a player enters the portal and will not allow hand-teles to open portals to that location. - var/data[0] /obj/machinery/computer/teleporter/New() src.id = "[rand(1000, 9999)]" @@ -67,11 +66,17 @@ ui_interact(user) /obj/machinery/computer/teleporter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(..()) - return if(stat & (NOPOWER|BROKEN)) return + // Set up the Nano UI + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400) + ui.open() + +/obj/machinery/computer/teleporter/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["powerstation"] = power_station if(power_station) data["teleporterhub"] = power_station.teleporter_hub @@ -86,13 +91,7 @@ data["target"] = (!target) ? "None" : sanitize(targetarea.name) data["calibrating"] = calibrating data["locked"] = locked - - // Set up the Nano UI - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/teleporter/Topic(href, href_list) if(..()) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index d27df18523a..eda38ee6120 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -119,6 +119,13 @@ ui_interact(user) /obj/machinery/turretid/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/turretid/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["access"] = !isLocked(user) data["locked"] = locked @@ -136,12 +143,7 @@ settings[++settings.len] = list("category" = "Check Misc. Lifeforms", "setting" = "check_anomalies", "value" = check_anomalies) data["settings"] = settings - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0) if(..()) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 4199bf72d68..ed6a23998c4 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -411,6 +411,12 @@ /obj/machinery/vending/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600) + ui.open() + +/obj/machinery/vending/ui_data(mob/user, datum/topic_state/state = default_state) var/list/data = list() if(currently_vending) data["mode"] = 1 @@ -446,12 +452,7 @@ data["speaker"] = src.shut_up ? 0 : 1 else data["panel"] = 0 - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/vending/Topic(href, href_list) if(..()) diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index f60a37be397..ea8a06961cc 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -145,7 +145,18 @@ ui_interact(user) /obj/machinery/computer/mech_bay_power_console/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "mech_bay_console.tmpl", "Mech Bay Control Console", 500, 325) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/computer/mech_bay_power_console/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] if(!recharge_port) reconnect() if(recharge_port && !qdeleted(recharge_port)) @@ -160,20 +171,10 @@ data["mecha_charge_percentage"] = isnull(recharge_port.recharging_mecha) ? 0 : round(recharge_port.recharging_mecha.cell.percent()) else data["has_mech"] = 0 - ui = 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 - ui = new(user, src, ui_key, "mech_bay_console.tmpl", "Mech Bay Control Console", 500, 325) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/computer/mech_bay_power_console/initialize() reconnect() update_icon() - return ..() \ No newline at end of file + return ..() diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index 39cda37a167..6838aae1b29 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -17,6 +17,13 @@ ui_interact(user) /obj/machinery/computer/mecha/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "exosuit_control.tmpl", "Exosuit Control Console", 420, 500) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/mecha/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["screen"] = screen if(screen == 0) @@ -28,14 +35,7 @@ data["mechas"] = mechas if(screen == 1) data["log"] = stored_data - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "exosuit_control.tmpl", "Exosuit Control Console", 420, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/computer/mecha/Topic(href, href_list) if(..()) diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index d4668b3a69e..ab897d80ec0 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -41,6 +41,14 @@ /obj/item/device/aicard/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "aicard.tmpl", "[name]", 600, 400, state = state) + ui.open() + ui.set_auto_update(1) + + +/obj/item/device/aicard/ui_data(mob/user, datum/topic_state/state = inventory_state) var/data[0] var/mob/living/silicon/ai/AI = locate() in src @@ -59,12 +67,7 @@ data["laws"] = laws data["has_laws"] = laws.len - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "aicard.tmpl", "[name]", 600, 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/device/aicard/Topic(href, href_list, nowindow, state) diff --git a/code/game/objects/items/devices/guitar.dm b/code/game/objects/items/devices/guitar.dm index b95cea0aae3..73831d1f468 100644 --- a/code/game/objects/items/devices/guitar.dm +++ b/code/game/objects/items/devices/guitar.dm @@ -33,6 +33,9 @@ song.ui_interact(user, ui_key, ui, force_open) +/obj/item/device/guitar/ui_data(mob/user, datum/topic_state/state = default_state) + return song.ui_data(user, state) + /obj/item/device/guitar/Topic(href, href_list) song.Topic(href, href_list) diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index e37b267799b..51859fd27ac 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -99,15 +99,17 @@ /obj/item/device/radio/electropack/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "radio_electro.tmpl", "[name]", 400, 500) + ui.open() + ui.set_auto_update(1) + +/obj/item/device/radio/electropack/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["power"] = on data["freq"] = format_frequency(frequency) data["code"] = code - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "radio_electro.tmpl", "[name]", 400, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) \ No newline at end of file + return data diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 74a32ebfe19..6078f855b61 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -108,6 +108,13 @@ var/global/list/default_medbay_channels = list( return ui_interact(user) /obj/item/device/radio/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 550) + ui.open() + ui.set_auto_update(1) + +/obj/item/device/radio/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["mic_status"] = broadcasting @@ -126,12 +133,7 @@ var/global/list/default_medbay_channels = list( if(syndie) data["useSyndMode"] = 1 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 550) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/device/radio/proc/list_channels(var/mob/user) @@ -749,6 +751,13 @@ var/global/list/default_medbay_channels = list( . = ..() /obj/item/device/radio/borg/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 430, 500) + ui.open() + ui.set_auto_update(1) + +/obj/item/device/radio/borg/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["mic_status"] = broadcasting @@ -769,12 +778,7 @@ var/global/list/default_medbay_channels = list( data["has_subspace"] = 1 data["subspace"] = subspace_transmission - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 430, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/device/radio/proc/config(op) if(radio_controller) diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 9cd39c7a7d9..84b397780dc 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -90,26 +90,26 @@ ui_interact(user) /obj/item/device/transfer_valve/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "transfer_valve.tmpl", "Tank Transfer Valve", 460, 280) + // open the new ui window + ui.open() + // auto update every Master Controller tick + //ui.set_auto_update(1) - // this is the data which will be sent to the ui +/obj/item/device/transfer_valve/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["attachmentOne"] = tank_one ? tank_one.name : null data["attachmentTwo"] = tank_two ? tank_two.name : null data["valveAttachment"] = attached_device ? attached_device.name : null data["valveOpen"] = valve_open ? 1 : 0 - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "transfer_valve.tmpl", "Tank Transfer Valve", 460, 280) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - //ui.set_auto_update(1) + return data /obj/item/device/transfer_valve/Topic(href, href_list) ..() @@ -219,4 +219,4 @@ // this doesn't do anything but the timer etc. expects it to be here // eventually maybe have it update icon to show state (timer, prox etc.) like old bombs /obj/item/device/transfer_valve/proc/c_state() - return \ No newline at end of file + return diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index b019e2a9d95..d29e5e5ede4 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -187,8 +187,18 @@ var/list/world_uplinks = list() /* NANO UI FOR UPLINK WOOP WOOP */ -/obj/item/device/uplink/hidden/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/item/device/uplink/hidden/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) var/title = "Remote Uplink" + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "uplink.tmpl", title, 700, 600, state = state) + // open the new ui window + ui.open() + +/obj/item/device/uplink/hidden/ui_data(mob/user, datum/topic_state/state = inventory_state) var/data[0] data["welcome"] = welcome @@ -200,17 +210,7 @@ var/list/world_uplinks = list() data["nano_items"] = nanoui_items data += nanoui_data - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "uplink.tmpl", title, 700, 600, state = inventory_state) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - + return data // Interaction code. Gathers a list of items purchasable from the paren't uplink and displays it. It also adds a lock button. /obj/item/device/uplink/hidden/interact(mob/user) diff --git a/code/game/objects/items/devices/violin.dm b/code/game/objects/items/devices/violin.dm index 7a3d304309d..7802e832fde 100644 --- a/code/game/objects/items/devices/violin.dm +++ b/code/game/objects/items/devices/violin.dm @@ -38,5 +38,8 @@ song.ui_interact(user, ui_key, ui, force_open) +/obj/item/device/violin/ui_data(mob/user, datum/topic_state/state = default_state) + return song.ui_data(user, state) + /obj/item/device/violin/Topic(href, href_list) song.Topic(href, href_list) diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 8eb92562b7f..0a503aa7cb9 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -83,7 +83,14 @@ RCD ui_interact(user) /obj/item/weapon/rcd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "rcd.tmpl", "[name]", 400, 400, state = state) + ui.open() + ui.set_auto_update(1) + +/obj/item/weapon/rcd/ui_data(mob/user, datum/topic_state/state = inventory_state) + var/data[0] data["mode"] = mode data["door_type"] = door_type data["menu"] = menu @@ -100,12 +107,7 @@ RCD data["door_accesses"] = door_accesses_list - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "rcd.tmpl", "[name]", 400, 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/item/weapon/rcd/Topic(href, href_list, nowindow, state) if(..()) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index ae28bd61d17..5dbcc68ab2b 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -80,11 +80,11 @@ /obj/item/weapon/tank/examine(mob/user) if(!..(user, 0)) return - + var/obj/icon = src if(istype(loc, /obj/item/assembly)) icon = loc - + if(!in_range(src, user)) if(icon == src) to_chat(user, "It's \a [bicon(icon)][src]! If you want any more information you'll need to get closer.") @@ -141,14 +141,24 @@ ui_interact(user) /obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "tanks.tmpl", "Tank", 500, 300) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) +/obj/item/weapon/tank/ui_data(mob/user, datum/topic_state/state = default_state) var/using_internal - if(istype(loc,/mob/living/carbon)) - var/mob/living/carbon/location = loc - if(location.internal==src) + if(iscarbon(loc)) + var/mob/living/carbon/C = loc + if(C.internal == src) using_internal = 1 - // this is the data which will be sent to the ui var/data[0] data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0) @@ -170,18 +180,7 @@ if(H.head && (H.head.flags & AIRTIGHT)) data["maskConnected"] = 1 - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "tanks.tmpl", "Tank", 500, 300) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/item/weapon/tank/Topic(href, href_list) if(..()) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 563f9c5faa9..c28ebe05c55 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -113,6 +113,16 @@ repeat = 0 /datum/song/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + if(!instrumentObj) + return + + ui = nanomanager.try_update_ui(user, instrumentObj, ui_key, ui, force_open) + if(!ui) + ui = new(user, instrumentObj, ui_key, "song.tmpl", instrumentObj.name, 700, 500) + ui.open() + ui.set_auto_update(1) + +/datum/song/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["lines"] = lines @@ -125,15 +135,7 @@ data["minTempo"] = world.tick_lag data["maxTempo"] = 600 - if(!instrumentObj) - return - - ui = nanomanager.try_update_ui(user, instrumentObj, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, instrumentObj, ui_key, "song.tmpl", instrumentObj.name, 700, 500) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /datum/song/Topic(href, href_list) if(!in_range(instrumentObj, usr) || (issilicon(usr) && instrumentObj.loc != usr) || !isliving(usr) || !usr.canmove || usr.restrained()) @@ -294,6 +296,9 @@ song.ui_interact(user, ui_key, ui, force_open) +/obj/structure/piano/ui_data(mob/user, datum/topic_state/state = default_state) + return song.ui_data(user, state) + /obj/structure/piano/Topic(href, href_list) song.Topic(href, href_list) diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index 00263352325..9eb71904de5 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -7,18 +7,26 @@ var/last_fire = 0 var/reload_cooldown = 180 // 3 minute cooldown var/area/targetarea - + light_color = LIGHT_COLOR_LIGHTBLUE /obj/machinery/computer/artillerycontrol/attack_ai(user as mob) to_chat(user, "Access denied.") return - + /obj/machinery/computer/artillerycontrol/attack_hand(user as mob) ui_interact(user) - + /obj/machinery/computer/artillerycontrol/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "bluespace_artillery.tmpl", "Bluespace Control", 400, 260) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/computer/artillerycontrol/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + var/time_to_wait = round(reload_cooldown - ((world.time / 10) - last_fire), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) @@ -30,32 +38,26 @@ else data["target"] = "No Lock" - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + return data - if(!ui) - ui = new(user, src, ui_key, "bluespace_artillery.tmpl", "Bluespace Control", 400, 260) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) - /obj/machinery/computer/artillerycontrol/Topic(href, href_list) if(..()) return 1 - - if(href_list["area"]) + + if(href_list["area"]) var/A A = input("Select the target area.", "Select Area", A) in ghostteleportlocs|null var/area/thearea = ghostteleportlocs[A] if(..() || !istype(thearea)) return - + targetarea = thearea - + if(href_list["fire"]) var/delta = (world.time / 10) - last_fire if(reload_cooldown > delta) return 1 - + command_announcement.Announce("Bluespace artillery fire detected. Brace for impact.") message_admins("[key_name_admin(usr)] has launched an artillery strike.", 1) var/list/L = list() @@ -64,7 +66,7 @@ var/loc = pick(L) explosion(loc,2,5,11) last_fire = world.time / 10 - + nanomanager.update_uis(src) /obj/structure/artilleryplaceholder diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 085e57eb25b..7e5dfcad115 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -504,11 +504,18 @@ cell.use(cost*10) return 1 -/obj/item/weapon/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/nano_state = inventory_state) +/obj/item/weapon/rig/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) if(!user) return - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 480, 550, state = state) + ui.open() + ui.set_auto_update(1) + +/obj/item/weapon/rig/ui_data(mob/user, datum/topic_state/state = inventory_state) + var/data[0] data["primarysystem"] = null if(selected_module) @@ -575,12 +582,7 @@ if(module_list.len) data["modules"] = module_list - ui = 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) - ui.open() - ui.set_auto_update(1) + return data /obj/item/weapon/rig/update_icon(var/update_mob_icon) diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index 5a3a5814a70..1b238acea6e 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -76,10 +76,16 @@ /obj/machinery/computer/account_database/attack_hand(mob/user as mob) ui_interact(user) -/obj/machinery/computer/account_database/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/machinery/computer/account_database/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640) + ui.open() +/obj/machinery/computer/account_database/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["src"] = UID() data["id_inserted"] = !!held_card data["id_card"] = held_card ? text("[held_card.registered_name], [held_card.assignment]") : "-----" @@ -122,11 +128,7 @@ if(accounts.len > 0) data["accounts"] = accounts - ui = 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) - ui.open() + return data /obj/machinery/computer/account_database/Topic(href, href_list) if(..()) diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 2446b74ad22..4c487d05afb 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -317,7 +317,14 @@ /obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "smartfridge.tmpl", name, 400, 500) + ui.open() + +/obj/machinery/smartfridge/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["contents"] = null data["electrified"] = seconds_electrified > 0 data["shoot_inventory"] = shoot_inventory @@ -334,11 +341,7 @@ if(items.len > 0) data["contents"] = items - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "smartfridge.tmpl", name, 400, 500) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/smartfridge/Topic(href, href_list) if(..()) return 0 @@ -410,4 +413,4 @@ to_chat(usr, "Access denied.") nanomanager.update_uis(src) return 0 - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 42323841094..c50503d7aa5 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -157,11 +157,17 @@ degrade_upper = 70 - (tier * 10) //Tier 1: 60, Tier 4: 30 /obj/machinery/botany/extractor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(!user) return - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "botany_isolator.tmpl", "Lysis-isolation Centrifuge UI", 470, 450) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/botany/extractor/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] var/list/geneMasks[0] for(var/gene_tag in plant_controller.gene_tag_list) @@ -190,12 +196,7 @@ data["hasGenetics"] = 0 data["sourceName"] = 0 - ui = 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) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/botany/Topic(href, href_list) @@ -308,11 +309,17 @@ degrade_upper = 11 - tier //Tier 1: 10, Tier 4: 6 /obj/machinery/botany/editor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(!user) return - var/list/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "botany_editor.tmpl", "Bioballistic Delivery UI", 470, 450) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/botany/editor/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["activity"] = active @@ -340,12 +347,7 @@ else data["loaded"] = 0 - ui = 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) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/botany/editor/Topic(href, href_list) diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 539832d9c08..ed5ba8ce49a 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -37,19 +37,23 @@ var/global/list/default_pai_software = list() ui_interact(src) -/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) - if(user != src) - if(ui) ui.set_status(STATUS_CLOSE, 0) - return - +/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = self_state) if(ui_key != "main") var/datum/pai_software/S = software[ui_key] if(S && !S.toggle) S.on_ui_interact(src, ui, force_open) else - if(ui) ui.set_status(STATUS_CLOSE, 0) + if(ui) + ui.set_status(STATUS_CLOSE, 0) return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "pai_interface.tmpl", "pAI Software Interface", 450, 600, state = state) + ui.open() + ui.set_auto_update(1) + +/mob/living/silicon/pai/ui_data(mob/user, datum/topic_state/state = self_state) var/data[0] // Software we have bought @@ -84,12 +88,7 @@ var/global/list/default_pai_software = list() data["emotions"] = emotions data["current_emotion"] = card.current_emotion - ui = 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) - ui.open() - ui.set_auto_update(1) + return data /mob/living/silicon/pai/Topic(href, href_list) if(..()) @@ -122,4 +121,4 @@ var/global/list/default_pai_software = list() var/img = text2num(href_list["image"]) if(1 <= img && img <= 9) card.setEmotion(img) - return 1 \ No newline at end of file + return 1 diff --git a/code/modules/nano/modules/alarm_monitor.dm b/code/modules/nano/modules/alarm_monitor.dm index b6a8a70780d..cf90b61bf29 100644 --- a/code/modules/nano/modules/alarm_monitor.dm +++ b/code/modules/nano/modules/alarm_monitor.dm @@ -56,6 +56,13 @@ return 1 /datum/nano_module/alarm_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "alarm_monitor.tmpl", "Alarm Monitoring Console", 800, 800, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/alarm_monitor/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/categories[0] @@ -80,9 +87,4 @@ "lost_sources" = lost_sources.len ? sanitize(english_list(lost_sources, nothing_text = "", and_text = ", ")) : "")) data["categories"] = categories - ui = 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) - ui.open() - ui.set_auto_update(1) + return data diff --git a/code/modules/nano/modules/atmos_control.dm b/code/modules/nano/modules/atmos_control.dm index e43585243ae..ee776ba4467 100644 --- a/code/modules/nano/modules/atmos_control.dm +++ b/code/modules/nano/modules/atmos_control.dm @@ -29,20 +29,21 @@ alarm.ui_interact(usr, master_ui = ui_ref, state = TS) /datum/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) - var/data[0] - data["alarms"] = air_alarm_repository.air_alarm_data(monitored_alarms) - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 900, 800, state = state) ui.add_template("mapContent", "atmos_control_map_content.tmpl") ui.add_template("mapHeader", "atmos_control_map_header.tmpl") ui.set_show_map(1) - ui.set_initial_data(data) ui.open() ui.set_auto_update(1) ui_ref = ui +/datum/nano_module/atmos_control/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] + data["alarms"] = air_alarm_repository.air_alarm_data(monitored_alarms) + return data + /datum/nano_module/atmos_control/proc/generate_state(air_alarm) var/datum/topic_state/air_alarm/state = new() state.atmos_control = src diff --git a/code/modules/nano/modules/crew_monitor.dm b/code/modules/nano/modules/crew_monitor.dm index ce89f59947b..c5f8f6ecfb8 100644 --- a/code/modules/nano/modules/crew_monitor.dm +++ b/code/modules/nano/modules/crew_monitor.dm @@ -17,14 +17,7 @@ return 1 /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/data[0] - var/turf/T = get_turf(nano_host()) - - data["isAI"] = isAI(user) - data["crewmembers"] = crew_repository.health_data(T) - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800) @@ -33,8 +26,16 @@ // adding a template with the key "mapHeader" replaces the map header content ui.add_template("mapHeader", "crew_monitor_map_header.tmpl") - ui.set_initial_data(data) ui.open() // should make the UI auto-update; doesn't seem to? ui.set_auto_update(1) + +/datum/nano_module/crew_monitor/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] + var/turf/T = get_turf(nano_host()) + + data["isAI"] = isAI(user) + data["crewmembers"] = crew_repository.health_data(T) + + return data diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm index 21c14077886..8bc9058db37 100644 --- a/code/modules/nano/modules/human_appearance.dm +++ b/code/modules/nano/modules/human_appearance.dm @@ -211,6 +211,13 @@ return 0 /datum/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/appearance_changer/ui_data(mob/user, datum/topic_state/state = default_state) generate_data(check_whitelist, whitelist, blacklist) var/data[0] @@ -302,12 +309,8 @@ data["change_head_marking_color"] = can_change_markings("head") data["change_body_marking_color"] = can_change_markings("body") data["change_tail_marking_color"] = can_change_markings("tail") - ui = 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) - ui.open() - ui.set_auto_update(1) + + return data /datum/nano_module/appearance_changer/proc/update_dna() if(owner && (flags & APPEARANCE_UPDATE_DNA)) diff --git a/code/modules/nano/modules/law_manager.dm b/code/modules/nano/modules/law_manager.dm index 9f10759dbe5..0d79f719677 100644 --- a/code/modules/nano/modules/law_manager.dm +++ b/code/modules/nano/modules/law_manager.dm @@ -148,6 +148,13 @@ return 0 /datum/nano_module/law_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "law_manager.tmpl", sanitize("[src] - [owner.name]"), 800, is_malf(user) ? 600 : 400, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/law_manager/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] owner.lawsync() @@ -176,12 +183,7 @@ data["channels"] = channels data["law_sets"] = package_multiple_laws(data["isAdmin"] ? admin_laws : player_laws) - ui = 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.name]"), 800, is_malf(user) ? 600 : 400, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /datum/nano_module/law_manager/proc/package_laws(var/list/data, var/field, var/list/datum/ai_law/laws) var/packaged_laws[0] diff --git a/code/modules/nano/modules/power_monitor.dm b/code/modules/nano/modules/power_monitor.dm index 9b9ccc8a060..1ebe6e99c9f 100644 --- a/code/modules/nano/modules/power_monitor.dm +++ b/code/modules/nano/modules/power_monitor.dm @@ -12,6 +12,13 @@ powermonitor = nano_host() /datum/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 700, state = state) + ui.open() + ui.set_auto_update(1) + +/datum/nano_module/power_monitor/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["powermonitor"] = powermonitor @@ -28,12 +35,7 @@ data["powerdemand"] = powermonitor.powernet.load data["apcs"] = apc_repository.apc_data(powermonitor) - ui = 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, 700, state = state) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /datum/nano_module/power_monitor/Topic(href, href_list) if(..()) diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm index c463f895158..288a9df2255 100644 --- a/code/modules/nano/nanoexternal.dm +++ b/code/modules/nano/nanoexternal.dm @@ -28,7 +28,7 @@ /** * The ui_interact proc is used to open and update Nano UIs * If ui_interact is not used then the UI will not update correctly - * ui_interact is currently defined for /atom/movable + * ui_interact is currently defined for /datum * * @param user /mob The mob who is interacting with this ui * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") @@ -40,5 +40,16 @@ /datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = default_state) return +/** + * The ui_data proc is used to get data for the interface + * + * @param user /mob The mob who is viewing this ui + * @param state /datum/topic_state Current topic state of the UI + * + * @return list() + */ +/datum/proc/ui_data(mob/user, datum/topic_state/state = default_state) + return list() + // Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob /mob/var/list/open_uis = list() diff --git a/code/modules/nano/nanomanager.dm b/code/modules/nano/nanomanager.dm index 355397ef6cf..2d0fe09c887 100644 --- a/code/modules/nano/nanomanager.dm +++ b/code/modules/nano/nanomanager.dm @@ -10,7 +10,7 @@ * Get an open /nanoui ui for the current user, src_object and ui_key and try to update it with data * * @param user /mob The mob who opened/owns the ui - * @param src_object /obj|/mob The obj or mob which the ui belongs to + * @param src_object /datum The datum which the ui belongs to * @param ui_key string A string key used for the ui * @param ui /datum/nanoui An existing instance of the ui (can be null) * @param data list The data to be passed to the ui, if it exists @@ -18,19 +18,17 @@ * * @return /nanoui Returns the found ui, for null if none exists */ -/datum/nanomanager/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, var/datum/src_object, ui_key, var/datum/nanoui/ui, 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) - } + if(!isnull(ui)) - // The UI is already open + var/data = src_object.ui_data(user, ui.state) // Get data from src_object. if(!force_open) ui.push_data(data) - return ui else - //testing("nanomanager/try_update_ui mob [user.name] [src_object:name] [ui_key] [force_open] - forcing opening of ui") - ui.close() + ui.reinitialize(null, data) + return ui return null /** @@ -227,4 +225,4 @@ oldMob.open_uis.Cut() - return 1 // success \ No newline at end of file + return 1 // success diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index cd381a786de..be5ad871a36 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -46,7 +46,7 @@ nanoui is used to open and update nano browser uis // the map z level to display var/map_z_level = 1 // 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] + var/list/initial_data = null // Initialize as null for proper ! usage in initial set up // set to 1 to update the ui automatically every master_controller tick var/is_auto_updating = 0 // the current status/visibility of the ui @@ -405,19 +405,34 @@ nanoui is used to open and update nano browser uis /datum/nanoui/proc/open() if(!user.client) return + var/window_size = "" if(width && height) window_size = "size=[width]x[height];" + update_status(0) if(status == STATUS_CLOSE) return + if(!initial_data) + set_initial_data(src_object.ui_data(user, state)) // Get the UI data. + user << browse(get_html(), "window=[window_id];[window_size][window_options]") winset(user, "mapwindow.map", "focus=true") // return keyboard focus to map on_close_winset() //onclose(user, window_id) nanomanager.ui_opened(src) +/** + * Reinitialize the UI with + */ +/datum/nanoui/proc/reinitialize(template, list/data) + if(template) + add_template("main", template) + if(data) + set_initial_data(data) + open() + /** * Close this UI * diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 9aff6687f6e..27a671590db 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -57,7 +57,14 @@ var/list/alldepartments = list() to_chat(user, "You swipe the card through [src], but nothing happens.") /obj/machinery/photocopier/faxmachine/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "faxmachine.tmpl", "Fax Machine UI", 540, 450) + ui.open() + +/obj/machinery/photocopier/faxmachine/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + if(scan) data["scan_name"] = scan.name else @@ -82,11 +89,7 @@ var/list/alldepartments = list() else data["respectcooldown"] = 0 - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "faxmachine.tmpl", "Fax Machine UI", 540, 450) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/photocopier/faxmachine/Topic(href, href_list) if(..()) @@ -128,7 +131,7 @@ var/list/alldepartments = list() var/list/combineddepartments = alldepartments if(long_range_enabled) combineddepartments += admin_departments - + if(emagged) combineddepartments += hidden_admin_departments diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index fafa27a24f7..ed7c380c426 100755 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -99,7 +99,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if((!istype(over_object, /obj/screen)) && can_use()) return attack_self(M) -/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) +/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = inventory_state) ui_tick++ var/datum/nanoui/old_ui = nanomanager.get_open_ui(user, src, "main") var/auto_update = 1 @@ -115,8 +115,22 @@ var/global/list/obj/item/device/pda/PDAs = list() var/title = "Personal Data Assistant" - var/data[0] // This is the data that will be sent to the PDA + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "pda.tmpl", title, 630, 600, state = state) + ui.set_state_key("pda") + // open the new ui window + ui.open() + + // auto update every Master Controller tick + ui.set_auto_update(auto_update) + +/obj/item/device/pda/ui_data(mob/user, datum/topic_state/state = inventory_state) + var/data[0] data["owner"] = owner // Who is your daddy... data["ownjob"] = ownjob // ...and what does he do? @@ -164,21 +178,7 @@ var/global/list/obj/item/device/pda/PDAs = list() "template" = current_app.template, "has_back" = current_app.has_back) - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "pda.tmpl", title, 630, 600, state = inventory_state) - ui.set_state_key("pda") - - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - - // auto update every Master Controller tick - ui.set_auto_update(auto_update) + return data /obj/item/device/pda/attack_self(mob/user as mob) user.set_machine(src) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index b8ee00a9a5d..c91127d7f54 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -778,63 +778,64 @@ if(!user) return - var/list/data = list( - "locked" = is_locked(user), - "isOperating" = operating, - "externalPower" = main_status, - "powerCellStatus" = cell ? cell.percent() : null, - "chargeMode" = chargemode, - "chargingStatus" = charging, - "totalLoad" = round(lastused_equip + lastused_light + lastused_environ), - "coverLocked" = coverlocked, - "siliconUser" = istype(user, /mob/living/silicon), - "malfStatus" = get_malf_status(user), - - "powerChannels" = list( - list( - "title" = "Equipment", - "powerLoad" = round(lastused_equip), - "status" = equipment, - "topicParams" = list( - "auto" = list("eqp" = 3), - "on" = list("eqp" = 2), - "off" = list("eqp" = 1) - ) - ), - list( - "title" = "Lighting", - "powerLoad" = round(lastused_light), - "status" = lighting, - "topicParams" = list( - "auto" = list("lgt" = 3), - "on" = list("lgt" = 2), - "off" = list("lgt" = 1) - ) - ), - list( - "title" = "Environment", - "powerLoad" = round(lastused_environ), - "status" = environ, - "topicParams" = list( - "auto" = list("env" = 3), - "on" = list("env" = 2), - "off" = list("env" = 1) - ) - ) - ) - ) - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) // the ui does not exist, so we'll create a new one - ui = new(user, src, ui_key, "apc.tmpl", "[area.name] - APC", 510, data["siliconUser"] ? 535 : 460) - // When the UI is first opened this is the data it will use - ui.set_initial_data(data) + ui = new(user, src, ui_key, "apc.tmpl", "[area.name] - APC", 510, issilicon(user) ? 535 : 460) ui.open() // Auto update every Master Controller tick ui.set_auto_update(1) +/obj/machinery/power/apc/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] + data["locked"] = is_locked(user) + data["isOperating"] = operating + data["externalPower"] = main_status + data["powerCellStatus"] = cell ? cell.percent() : null + data["chargeMode"] = chargemode + data["chargingStatus"] = charging + data["totalLoad"] = round(lastused_equip + lastused_light + lastused_environ) + data["coverLocked"] = coverlocked + data["siliconUser"] = istype(user, /mob/living/silicon) + data["malfStatus"] = get_malf_status(user) + + var/powerChannels[0] + powerChannels[++powerChannels.len] = list( + "title" = "Equipment", + "powerLoad" = round(lastused_equip), + "status" = equipment, + "topicParams" = list( + "auto" = list("eqp" = 3), + "on" = list("eqp" = 2), + "off" = list("eqp" = 1) + ) + ) + powerChannels[++powerChannels.len] = list( + "title" = "Lighting", + "powerLoad" = round(lastused_light), + "status" = lighting, + "topicParams" = list( + "auto" = list("lgt" = 3), + "on" = list("lgt" = 2), + "off" = list("lgt" = 1) + ) + ) + powerChannels[++powerChannels.len] = list( + "title" = "Environment", + "powerLoad" = round(lastused_environ), + "status" = environ, + "topicParams" = list( + "auto" = list("env" = 3), + "on" = list("env" = 2), + "off" = list("env" = 1) + ) + ) + + data["powerChannels"] = powerChannels + + return data + /obj/machinery/power/apc/proc/report() return "[area.name] : [equipment]/[lighting]/[environ] ([lastused_equip+lastused_light+lastused_environ]) : [cell? cell.percent() : "N/C"] ([charging])" diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index fdb9fe34ae1..4a35e57764c 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -321,7 +321,15 @@ if(IsBroken()) return + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/power/port_gen/pacman/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["active"] = active if(istype(user, /mob/living/silicon/ai)) data["is_ai"] = 1 @@ -329,6 +337,7 @@ data["is_ai"] = 1 else data["is_ai"] = 0 + data["output_set"] = power_output data["output_max"] = max_power_output data["output_safe"] = max_safe_output @@ -342,12 +351,7 @@ data["fuel_usage"] = active ? round((power_output / time_per_sheet) * 1000) : 0 data["fuel_type"] = sheet_name - ui = 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) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/power/port_gen/pacman/Topic(href, href_list) if(..()) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 4af4ccaeee4..62557e85384 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -363,8 +363,21 @@ if(stat & BROKEN) return - // this is the data which will be sent to the ui + + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "smes.tmpl", "SMES Power Storage Unit", 540, 380) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/power/smes/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["nameTag"] = name_tag data["storedCapacity"] = round(100.0*charge/capacity, 0.1) data["charging"] = inputting @@ -383,18 +396,7 @@ else data["outputting"] = 0 // smes is not outputting - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "smes.tmpl", "SMES Power Storage Unit", 540, 380) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/power/smes/Topic(href, href_list) if(..()) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index a6a54c75feb..98d899cdbca 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -389,8 +389,14 @@ ui_interact(user) /obj/machinery/power/solar_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "solar_control.tmpl", name, 490, 420) + ui.open() + ui.set_auto_update(1) - var/data = list() +/obj/machinery/power/solar_control/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["generated"] = round(lastgen) data["angle"] = cdir @@ -403,12 +409,7 @@ data["connected_panels"] = connected_panels.len data["connected_tracker"] = (connected_tracker ? 1 : 0) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "solar_control.tmpl", name, 490, 420) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/power/solar_control/attackby(I as obj, user as mob, params) if(istype(I, /obj/item/weapon/screwdriver)) @@ -535,4 +536,4 @@ /obj/item/weapon/paper/solar name = "paper- 'Going green! Setup your own solar array instructions.'" - info = "

              Welcome

              At greencorps we love the environment, and space. With this package you are able to help mother nature and produce energy without any usage of fossil fuel or plasma! Singularity energy is dangerous while solar energy is safe, which is why it's better. Now here is how you setup your own solar array.

              You can make a solar panel by wrenching the solar assembly onto a cable node. Adding a glass panel, reinforced or regular glass will do, will finish the construction of your solar panel. It is that easy!

              Now after setting up 19 more of these solar panels you will want to create a solar tracker to keep track of our mother nature's gift, the sun. These are the same steps as before except you insert the tracker equipment circuit into the assembly before performing the final step of adding the glass. You now have a tracker! Now the last step is to add a computer to calculate the sun's movements and to send commands to the solar panels to change direction with the sun. Setting up the solar computer is the same as setting up any computer, so you should have no trouble in doing that. You do need to put a wire node under the computer, and the wire needs to be connected to the tracker.

              Congratulations, you should have a working solar array. If you are having trouble, here are some tips. Make sure all solar equipment are on a cable node, even the computer. You can always deconstruct your creations if you make a mistake.

              That's all to it, be safe, be green!

              " \ No newline at end of file + info = "

              Welcome

              At greencorps we love the environment, and space. With this package you are able to help mother nature and produce energy without any usage of fossil fuel or plasma! Singularity energy is dangerous while solar energy is safe, which is why it's better. Now here is how you setup your own solar array.

              You can make a solar panel by wrenching the solar assembly onto a cable node. Adding a glass panel, reinforced or regular glass will do, will finish the construction of your solar panel. It is that easy!

              Now after setting up 19 more of these solar panels you will want to create a solar tracker to keep track of our mother nature's gift, the sun. These are the same steps as before except you insert the tracker equipment circuit into the assembly before performing the final step of adding the glass. You now have a tracker! Now the last step is to add a computer to calculate the sun's movements and to send commands to the solar panels to change direction with the sun. Setting up the solar computer is the same as setting up any computer, so you should have no trouble in doing that. You do need to put a wire node under the computer, and the wire needs to be connected to the tracker.

              Congratulations, you should have a working solar array. If you are having trouble, here are some tips. Make sure all solar equipment are on a cable node, even the computer. You can always deconstruct your creations if you make a mistake.

              That's all to it, be safe, be green!

              " diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 420733f7c76..e0be4e3c0a0 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -259,6 +259,13 @@ // This is purely informational UI that may be accessed by AIs or robots /obj/machinery/power/supermatter_shard/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "supermatter_crystal.tmpl", "Supermatter Crystal", 500, 300) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/power/supermatter_shard/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["integrity_percentage"] = round(get_integrity()) @@ -277,12 +284,7 @@ else data["detonating"] = 0 - ui = 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) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/power/supermatter_shard/proc/transfer_energy() for(var/obj/machinery/power/rad_collector/R in rad_collectors) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 5103f246a27..acbdc19b659 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -107,22 +107,30 @@ * * @return nothing */ - /obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) if(broken_requirements.len) to_chat(user, "[src] is broken. [broken_requirements[broken_requirements[1]]]") return + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "chem_dispenser.tmpl", ui_title, 390, 655) + // open the new ui window + ui.open() - // this is the data which will be sent to the ui +/obj/machinery/chem_dispenser/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["amount"] = amount data["energy"] = round(energy) data["maxEnergy"] = round(max_energy) data["isBeakerLoaded"] = beaker ? 1 : 0 - var beakerContents[0] - var beakerCurrentVolume = 0 + var/beakerContents[0] + var/beakerCurrentVolume = 0 if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents.Add(list(list("name" = R.name, "id"=R.id, "volume" = R.volume))) // list in a list because Byond merges the first list... @@ -136,23 +144,14 @@ data["beakerCurrentVolume"] = null data["beakerMaxVolume"] = null - var chemicals[0] + var/chemicals[0] for(var/re in dispensable_reagents) var/datum/reagent/temp = chemical_reagents_list[re] if(temp) chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("dispense" = temp.id)))) // list in a list because Byond merges the first list... data["chemicals"] = chemicals - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "chem_dispenser.tmpl", ui_title, 390, 655) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() + return data /obj/machinery/chem_dispenser/Topic(href, href_list) if(..()) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 28d1f4c2afa..bd32fcee6cd 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -130,7 +130,15 @@ if(user.stat || user.restrained()) return + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + if(!ui) + ui = new(user, src, ui_key, "chem_heater.tmpl", "ChemHeater", 350, 270) + ui.open() + +/obj/machinery/chem_heater/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] + data["targetTemp"] = desired_temp data["isActive"] = on data["isBeakerLoaded"] = beaker ? 1 : 0 @@ -140,15 +148,10 @@ data["beakerMaxVolume"] = beaker ? beaker.volume : null //copy-pasted from chem dispenser - var beakerContents[0] + var/beakerContents[0] if(beaker) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list... data["beakerContents"] = beakerContents - // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - ui = new(user, src, ui_key, "chem_heater.tmpl", "ChemHeater", 350, 270) - ui.set_initial_data(data) - ui.open() \ No newline at end of file + return data \ No newline at end of file diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index b6b0de6e0a0..3ef20cff9b3 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -319,12 +319,17 @@ ui_interact(user) return -/obj/machinery/chem_master/ui_interact(mob/user, ui_key="main", datum/nanoui/ui = null, force_open = 1) - +/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) var/datum/asset/chem_master/assets = get_asset_datum(/datum/asset/chem_master) assets.send(user) - var/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "chem_master.tmpl", name, 575, 400) + ui.open() + +/obj/machinery/chem_master/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] data["condi"] = condi data["loaded_pill_bottle"] = (loaded_pill_bottle ? 1 : 0) @@ -347,11 +352,7 @@ data["bottlesprite"] = bottlesprite data["mode"] = mode - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "chem_master.tmpl", name, 575, 400) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/chem_master/proc/isgoodnumber(num) if(isnum(num)) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 232d2a9b3c5..98468d9df59 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -253,6 +253,13 @@ return /obj/machinery/disposal/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "disposal_bin.tmpl", "Waste Disposal Unit", 395, 250) + ui.open() + ui.set_auto_update(1) + +/obj/machinery/disposal/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] var/pressure = Clamp(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 100) @@ -271,13 +278,7 @@ data["pumpstatus"] = "Idle" data["pressure"] = pressure_round - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - - if(!ui) - ui = new(user, src, ui_key, "disposal_bin.tmpl", "Waste Disposal Unit", 395, 250) - ui.set_initial_data(data) - ui.open() - ui.set_auto_update(1) + return data /obj/machinery/disposal/Topic(href, href_list) if(usr.loc == src) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 84fc3573bae..a39c6485fc7 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -647,7 +647,13 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole/ui_interact(mob/user, ui_key="main", var/datum/nanoui/ui = null, var/force_open = 1) user.set_machine(src) - var/data = list() + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "r_n_d.tmpl", src.name, 800, 550) + ui.open() + +/obj/machinery/computer/rdconsole/ui_data(mob/user, datum/topic_state/state = default_state) + var/data[0] files.RefreshResearch() @@ -857,11 +863,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, loaded_chemical["volume"] = R.volume loaded_chemical["id"] = R.id - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "r_n_d.tmpl", src.name, 800, 550) - ui.set_initial_data(data) - ui.open() + return data //helper proc that guarantees the wait message will not freeze the UI /obj/machinery/computer/rdconsole/proc/add_wait_message(message, delay) diff --git a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm index 8bb917d3df4..c231912484b 100644 --- a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm +++ b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm @@ -112,11 +112,21 @@ coolant_purity = total_purity / fresh_coolant /obj/machinery/radiocarbon_spectrometer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) - if(user.stat) return - // this is the data which will be sent to the ui + // update the ui if it exists, returns null if no ui is passed/found + ui = nanomanager.try_update_ui(user, src, ui_key, ui, 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 + ui = new(user, src, ui_key, "geoscanner.tmpl", "High Res Radiocarbon Spectrometer", 900, 825) + // open the new ui window + ui.open() + // auto update every Master Controller tick + ui.set_auto_update(1) + +/obj/machinery/radiocarbon_spectrometer/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["scanned_item"] = (scanned_item ? scanned_item.name : "") data["scanned_item_desc"] = (scanned_item ? (scanned_item.desc ? scanned_item.desc : "No information on record.") : "") @@ -141,19 +151,7 @@ data["radiation"] = round(radiation) data["t_left_radspike"] = round(t_left_radspike) data["rad_shield_on"] = rad_shield - - // update the ui if it exists, returns null if no ui is passed/found - ui = 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 - ui = new(user, src, ui_key, "geoscanner.tmpl", "High Res Radiocarbon Spectrometer", 900, 825) - // when the ui is first opened this is the data it will use - ui.set_initial_data(data) - // open the new ui window - ui.open() - // auto update every Master Controller tick - ui.set_auto_update(1) + return data /obj/machinery/radiocarbon_spectrometer/process() if(scanning) diff --git a/code/modules/security_levels/keycard authentication.dm b/code/modules/security_levels/keycard authentication.dm index 8ff0ed6eb64..f2d36842504 100644 --- a/code/modules/security_levels/keycard authentication.dm +++ b/code/modules/security_levels/keycard authentication.dm @@ -3,7 +3,7 @@ desc = "This device is used to trigger station functions, which require more than one ID card to authenticate." icon = 'icons/obj/monitors.dmi' icon_state = "auth_off" - + var/active = 0 //This gets set to 1 on all devices except the one where the initial request was made. var/event = "" var/screen = 1 @@ -15,13 +15,13 @@ var/mob/event_triggered_by var/mob/event_confirmed_by var/ert_reason = "Reason for ERT" - + anchored = 1 use_power = 1 idle_power_usage = 2 active_power_usage = 6 power_channel = ENVIRON - + req_access = list(access_keycard_auth) /obj/machinery/keycard_auth/attack_ai(mob/user as mob) @@ -54,7 +54,7 @@ icon_state = "auth_off" else stat |= NOPOWER - + /obj/machinery/keycard_auth/attack_ghost(mob/user) ui_interact(user) @@ -70,25 +70,26 @@ user.set_machine(src) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 540, 320) + ui.open() + +/obj/machinery/keycard_auth/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["screen"] = screen data["event"] = event data["ertreason"] = ert_reason - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) - if(!ui) - ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 540, 320) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/keycard_auth/Topic(href, href_list) if(..()) return 1 - + if(busy) to_chat(usr, "This device is busy.") return - + if(href_list["triggerevent"]) event = href_list["triggerevent"] screen = 2 diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 05240d477f3..474cbd91915 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -425,6 +425,12 @@ ui_interact(user) /obj/machinery/computer/ordercomp/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + if(!ui) + ui = new(user, src, ui_key, "order_console.tmpl", name, ORDER_SCREEN_WIDTH, ORDER_SCREEN_HEIGHT) + ui.open() + +/obj/machinery/computer/ordercomp/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["last_viewed_group"] = last_viewed_group @@ -474,11 +480,7 @@ data["at_station"] = shuttle_master.supply.getDockedId() == "supply_home" data["timeleft"] = shuttle_master.supply.timeLeft(600) - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - ui = new(user, src, ui_key, "order_console.tmpl", name, ORDER_SCREEN_WIDTH, ORDER_SCREEN_HEIGHT) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/ordercomp/Topic(href, href_list) if(..()) @@ -572,7 +574,12 @@ return /obj/machinery/computer/supplycomp/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) - // data to send to ui + ui = nanomanager.try_update_ui(user, src, ui_key, ui) + if(!ui) + ui = new(user, src, ui_key, "supply_console.tmpl", name, SUPPLY_SCREEN_WIDTH, SUPPLY_SCREEN_HEIGHT) + ui.open() + +/obj/machinery/computer/supplycomp/ui_data(mob/user, datum/topic_state/state = default_state) var/data[0] data["last_viewed_group"] = last_viewed_group @@ -622,12 +629,7 @@ data["at_station"] = shuttle_master.supply.getDockedId() == "supply_home" data["timeleft"] = shuttle_master.supply.timeLeft(600) data["can_launch"] = !shuttle_master.supply.canMove() - - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) - if(!ui) - ui = new(user, src, ui_key, "supply_console.tmpl", name, SUPPLY_SCREEN_WIDTH, SUPPLY_SCREEN_HEIGHT) - ui.set_initial_data(data) - ui.open() + return data /obj/machinery/computer/supplycomp/proc/is_authorized(user) if(allowed(user)) diff --git a/nano/assets/libraries.min.js b/nano/assets/libraries.min.js index 6e3405a7be4..9cb2d2f24f6 100644 --- a/nano/assets/libraries.min.js +++ b/nano/assets/libraries.min.js @@ -1,5 +1,5 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t="length"in e&&e.length,n=oe.type(e);return"function"===n||oe.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(oe.isFunction(t))return oe.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return oe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(pe.test(t))return oe.filter(t,e,n);t=oe.filter(t,e)}return oe.grep(e,function(e){return oe.inArray(e,t)>=0!==n})}function o(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function r(e){var t=xe[e]={};return oe.each(e.match(be)||[],function(e,n){t[n]=!0}),t}function s(){he.addEventListener?(he.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1)):(he.detachEvent("onreadystatechange",a),e.detachEvent("onload",a))}function a(){(he.addEventListener||"load"===event.type||"complete"===he.readyState)&&(s(),oe.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(Ne,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:_e.test(n)?oe.parseJSON(n):n}catch(o){}oe.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!oe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,i){if(oe.acceptData(e)){var o,r,s=oe.expando,a=e.nodeType,l=a?oe.cache:e,u=a?e[s]:e[s]&&s;if(u&&l[u]&&(i||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=a?e[s]=Y.pop()||oe.guid++:s),l[u]||(l[u]=a?{}:{toJSON:oe.noop}),"object"!=typeof t&&"function"!=typeof t||(i?l[u]=oe.extend(l[u],t):l[u].data=oe.extend(l[u].data,t)),r=l[u],i||(r.data||(r.data={}),r=r.data),void 0!==n&&(r[oe.camelCase(t)]=n),"string"==typeof t?(o=r[t],null==o&&(o=r[oe.camelCase(t)])):o=r,o}}function f(e,t,n){if(oe.acceptData(e)){var i,o,r=e.nodeType,s=r?oe.cache:e,a=r?e[oe.expando]:oe.expando;if(s[a]){if(t&&(i=n?s[a]:s[a].data)){oe.isArray(t)?t=t.concat(oe.map(t,oe.camelCase)):t in i?t=[t]:(t=oe.camelCase(t),t=t in i?[t]:t.split(" ")),o=t.length;for(;o--;)delete i[t[o]];if(n?!u(i):!oe.isEmptyObject(i))return}(n||(delete s[a].data,u(s[a])))&&(r?oe.cleanData([e],!0):ne.deleteExpando||s!=s.window?delete s[a]:s[a]=null)}}}function p(){return!0}function d(){return!1}function h(){try{return he.activeElement}catch(e){}}function g(e){var t=We.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function m(e,t){var n,i,o=0,r=typeof e.getElementsByTagName!==Ce?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Ce?e.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],n=e.childNodes||e;null!=(i=n[o]);o++)!t||oe.nodeName(i,t)?r.push(i):oe.merge(r,m(i,t));return void 0===t||t&&oe.nodeName(e,t)?oe.merge([e],r):r}function v(e){He.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return oe.nodeName(e,"table")&&oe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==oe.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=Qe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,i=0;null!=(n=e[i]);i++)oe._data(n,"globalEval",!t||oe._data(t[i],"globalEval"))}function T(e,t){if(1===t.nodeType&&oe.hasData(e)){var n,i,o,r=oe._data(e),s=oe._data(t,r),a=r.events;if(a){delete s.handle,s.events={};for(n in a)for(i=0,o=a[n].length;o>i;i++)oe.event.add(t,n,a[n][i])}s.data&&(s.data=oe.extend({},s.data))}}function C(e,t){var n,i,o;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!ne.noCloneEvent&&t[oe.expando]){o=oe._data(t);for(i in o.events)oe.removeEvent(t,i,o.handle);t.removeAttribute(oe.expando)}"script"===n&&t.text!==e.text?(b(t).text=e.text,x(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),ne.html5Clone&&e.innerHTML&&!oe.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&He.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}function _(t,n){var i,o=oe(n.createElement(t)).appendTo(n.body),r=e.getDefaultComputedStyle&&(i=e.getDefaultComputedStyle(o[0]))?i.display:oe.css(o[0],"display");return o.detach(),r}function N(e){var t=he,n=Ze[e];return n||(n=_(e,t),"none"!==n&&n||(Je=(Je||oe("