From 9db702abf7f6c12f75789a8fd9f74f7e8d61cc8d Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 13:42:56 -0500 Subject: [PATCH 01/18] Increment VIS defines for mob huds Prevents mob intents from being visible --- code/__defines/mobs_vr.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/__defines/mobs_vr.dm b/code/__defines/mobs_vr.dm index 99ff177e52..8121e7b2bd 100644 --- a/code/__defines/mobs_vr.dm +++ b/code/__defines/mobs_vr.dm @@ -1,13 +1,13 @@ #undef VIS_COUNT -#define VIS_CH_STATUS_R 22 -#define VIS_CH_HEALTH_VR 23 -#define VIS_CH_BACKUP 24 -#define VIS_CH_VANTAG 25 +#define VIS_CH_STATUS_R 23 +#define VIS_CH_HEALTH_VR 24 +#define VIS_CH_BACKUP 25 +#define VIS_CH_VANTAG 26 -#define VIS_AUGMENTED 26 +#define VIS_AUGMENTED 27 -#define VIS_COUNT 26 +#define VIS_COUNT 27 //Protean organs #define O_ORCH "orchestrator" From 6af54bfec2ba2d1d3e1d0368c14a96447516384e Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 14:14:52 -0500 Subject: [PATCH 02/18] NanoUI Subsystem Fixes Don't do this, the asset subsystem does this for you --- code/controllers/subsystems/nanoui.dm | 32 +--------------------- code/modules/admin/view_variables/topic.dm | 2 +- code/modules/client/client procs.dm | 1 - 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/code/controllers/subsystems/nanoui.dm b/code/controllers/subsystems/nanoui.dm index 78f47e8c7b..c916eb2739 100644 --- a/code/controllers/subsystems/nanoui.dm +++ b/code/controllers/subsystems/nanoui.dm @@ -1,41 +1,17 @@ SUBSYSTEM_DEF(nanoui) name = "NanoUI" wait = 5 + flags = SS_NO_INIT // a list of current open /nanoui UIs, grouped by src_object and ui_key var/list/open_uis = list() // a list of current open /nanoui UIs, not grouped, for use in processing var/list/processing_uis = list() - // a list of asset filenames which are to be sent to the client on user logon - var/list/asset_files = list() - -/datum/controller/subsystem/nanoui/Initialize() - var/list/nano_asset_dirs = list(\ - "nano/css/",\ - "nano/images/",\ - "nano/images/status_icons/",\ - "nano/images/modular_computers/",\ - "nano/js/",\ - "nano/templates/"\ - ) - - var/list/filenames = null - for (var/path in nano_asset_dirs) - filenames = flist(path) - for(var/filename in filenames) - if(copytext(filename, length(filename)) != "/") // filenames which end in "/" are actually directories, which we want to ignore - if(fexists(path + filename)) - asset_files[filename] = fcopy_rsc(path + filename) // add this file to asset_files for sending to clients when they connect - .=..() - for(var/i in GLOB.clients) - send_resources(i) /datum/controller/subsystem/nanoui/Recover() if(SSnanoui.open_uis) open_uis |= SSnanoui.open_uis if(SSnanoui.processing_uis) processing_uis |= SSnanoui.processing_uis - if(SSnanoui.asset_files) - asset_files |= SSnanoui.asset_files /datum/controller/subsystem/nanoui/stat_entry() return ..("[processing_uis.len] UIs") @@ -44,9 +20,3 @@ SUBSYSTEM_DEF(nanoui) for(var/thing in processing_uis) var/datum/nanoui/UI = thing UI.process() - -//Sends asset files to a client, called on client/New() -/datum/controller/subsystem/nanoui/proc/send_resources(client) - if(!subsystem_initialized) - return - getFilesSlow(client, asset_files) \ No newline at end of file diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index c2b7132494..20b1e24ae4 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -449,7 +449,7 @@ to_chat(usr, "This can only be done on mobs with clients") return - SSnanoui.send_resources(H.client) + H.client.send_resources() to_chat(usr, "Resource files sent") to_chat(H, "Your NanoUI Resource files have been refreshed") diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index d09986360d..cb8b70519e 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -168,7 +168,6 @@ log_client_to_db() send_resources() - SSnanoui.send_resources(src) if(!void) void = new() From 7a5cf8d8b28670d56d826d4478e956d9e684136d Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 14:19:16 -0500 Subject: [PATCH 03/18] Remove sergal comic sans Oops. --- code/modules/vchat/css/ss13styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/vchat/css/ss13styles.css b/code/modules/vchat/css/ss13styles.css index 5ed999990d..6c70b588af 100644 --- a/code/modules/vchat/css/ss13styles.css +++ b/code/modules/vchat/css/ss13styles.css @@ -169,7 +169,7 @@ h1.alert, h2.alert {color: #000000;} .soghun {color: #228B22;} .solcom {color: #22228B;} .changeling {color: #800080;} -.sergal {color: #0077FF; font-family: "Comic Sans MS";} +.sergal {color: #0077FF;} .birdsongc {color: #CC9900;} .vulpkanin {color: #B97A57;} .enochian {color: #848A33; letter-spacing:-1pt; word-spacing:4pt; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;} From b33c359df5b2e869fdcf1dda3cd5ee098c70825b Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 14:35:13 -0500 Subject: [PATCH 04/18] Allow narrate/globalnarrate shenanigans Allows HTML if your entire thing is HTML --- code/modules/admin/verbs/randomverbs.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 6cdc49f0fb..66cb6aaccf 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -106,7 +106,9 @@ if (!holder) return - var/msg = sanitize(input("Message:", text("Enter the text you wish to appear to everyone:")) as text) + var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text + if(!(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'. + msg = sanitize(msg) if (!msg) return @@ -128,7 +130,9 @@ if(!M) return - var/msg = sanitize(input("Message:", text("Enter the text you wish to appear to your target:")) as text) + var/msg = input("Message:", text("Enter the text you wish to appear to your target:")) as text + if(!(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'. + msg = sanitize(msg) if( !msg ) return From a5af4695fcba3dbd4dc9c18866e296eebe8a0934 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 15:02:08 -0500 Subject: [PATCH 05/18] Disable bicon() icon object cache, and create text tag cache --- code/_helpers/text.dm | 9 ++++++--- code/modules/vchat/vchat_client.dm | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 6776555348..67844cf4a2 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -301,12 +301,15 @@ proc/TextPreview(var/string,var/len=40) //For generating neat chat tag-images //The icon var could be local in the proc, but it's a waste of resources // to always create it and then throw it out. -/var/icon/text_tag_icons = new('./icons/chattags.dmi') +/var/icon/text_tag_icons = 'icons/chattags.dmi' +/var/list/text_tag_cache = list() /proc/create_text_tag(var/tagname, var/tagdesc = tagname, var/client/C = null) if(!(C && C.is_preference_enabled(/datum/client_preference/chat_tags))) return tagdesc - var/icon/tag = icon(text_tag_icons.icon, tagname) - return bicon(tag,TRUE,"text_tag") //"[tagdesc]" + if(!text_tag_cache[tagname]) + var/icon/tag = icon(text_tag_icons, tagname) + text_tag_cache[tagname] = bicon(tag, TRUE, "text_tag") + return text_tag_cache[tagname] /proc/contains_az09(var/input) for(var/i=1, i<=length(input), i++) diff --git a/code/modules/vchat/vchat_client.dm b/code/modules/vchat/vchat_client.dm index cd6437a81c..20dc7661ab 100644 --- a/code/modules/vchat/vchat_client.dm +++ b/code/modules/vchat/vchat_client.dm @@ -244,10 +244,11 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic var/static/list/bicon_cache = list() if (isicon(obj)) - if (!bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it. - bicon_cache["\ref[obj]"] = icon2base64(obj) + //Icon refs get reused all the time especially on temporarily made ones like chat tags, too difficult to cache. + //if (!bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it. + //bicon_cache["\ref[obj]"] = icon2base64(obj) - return "" + return "" // Either an atom or somebody fucked up and is gonna get a runtime, which I'm fine with. var/atom/A = obj From affcbbde5f177b079e175965b7ea89db704def4e Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 15:14:15 -0500 Subject: [PATCH 06/18] AI Tweak bugfixes --- code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm | 2 +- code/modules/ai/ai_holder.dm | 4 ++++ code/modules/ai/ai_holder_targeting.dm | 2 +- .../living/simple_mob/subtypes/animal/giant_spider/nurse.dm | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm b/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm index 540a9e5397..019d806698 100644 --- a/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm +++ b/code/modules/ai/aI_holder_subtypes/slime_xenobio_ai.dm @@ -167,7 +167,7 @@ return 1 // Melee (eat) the target if dead/dying, don't shoot it. return ..() -/datum/ai_holder/simple_mob/xenobio_slime/can_attack(atom/movable/AM) +/datum/ai_holder/simple_mob/xenobio_slime/can_attack(atom/movable/AM, var/vision_required = TRUE) . = ..() if(.) // Do some additional checks because we have Special Code(tm). if(ishuman(AM)) diff --git a/code/modules/ai/ai_holder.dm b/code/modules/ai/ai_holder.dm index e22abf8ee0..c1638d207a 100644 --- a/code/modules/ai/ai_holder.dm +++ b/code/modules/ai/ai_holder.dm @@ -224,6 +224,10 @@ /datum/ai_holder/proc/handle_stance_strategical() ai_log("++++++++++ Slow Process Beginning ++++++++++", AI_LOG_TRACE) ai_log("handle_stance_strategical() : Called.", AI_LOG_TRACE) + + //We got left around for some reason. Goodbye cruel world. + if(!holder) + qdel(src) ai_log("handle_stance_strategical() : LTT=[lose_target_time]", AI_LOG_TRACE) if(lose_target_time && (lose_target_time + lose_target_timeout < world.time)) // We were tracking an enemy but they are gone. diff --git a/code/modules/ai/ai_holder_targeting.dm b/code/modules/ai/ai_holder_targeting.dm index 40f2c5752f..f1f5ff4a3a 100644 --- a/code/modules/ai/ai_holder_targeting.dm +++ b/code/modules/ai/ai_holder_targeting.dm @@ -115,7 +115,7 @@ sorted_targets += A return sorted_targets -/datum/ai_holder/proc/can_attack(atom/movable/the_target, vision_required = TRUE) +/datum/ai_holder/proc/can_attack(atom/movable/the_target, var/vision_required = TRUE) if(!can_see_target(the_target) && vision_required) return FALSE diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/nurse.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/nurse.dm index 84f3d533cf..51b07954a6 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/nurse.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/nurse.dm @@ -255,7 +255,7 @@ return ..(targets) -/datum/ai_holder/simple_mob/melee/nurse_spider/can_attack(atom/movable/the_target) +/datum/ai_holder/simple_mob/melee/nurse_spider/can_attack(atom/movable/the_target, var/vision_required = TRUE) . = ..() if(!.) // Parent returned FALSE. if(istype(the_target, /obj)) From 2e6fa059c1351ac4a8a0524b7801859cbfdc3851 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 15:14:23 -0500 Subject: [PATCH 07/18] VS: AI Tweak bugfixes --- .../mob/living/simple_mob/subtypes/vore/solargrub_larva.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm index 42ce8a2897..156ad340bc 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/solargrub_larva.dm @@ -223,7 +223,7 @@ var/global/list/grub_machine_overlays = list() actual_targets += M return actual_targets -/datum/ai_holder/simple_mob/solargrub_larva/can_attack(atom/movable/the_target) +/datum/ai_holder/simple_mob/solargrub_larva/can_attack(atom/movable/the_target, var/vision_required = TRUE) .=..() var/obj/machinery/M = the_target if(!istype(M)) From f71bfa7100101fb872a079116f7bbf3f4533cecb Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 17:22:31 -0500 Subject: [PATCH 08/18] Ore Scanner is written incorrectly Only revealed by vchat --- code/modules/mining/drilling/scanner.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/mining/drilling/scanner.dm b/code/modules/mining/drilling/scanner.dm index 3f94363681..79ae5f1573 100644 --- a/code/modules/mining/drilling/scanner.dm +++ b/code/modules/mining/drilling/scanner.dm @@ -9,13 +9,13 @@ var/scan_time = 5 SECONDS /obj/item/weapon/mining_scanner/attack_self(mob/user as mob) - to_chat(user, "You begin sweeping \the [src] about, scanning for metal deposits.") + to_chat(user, "You begin sweeping \the [src] about, scanning for metal deposits.") playsound(loc, 'sound/items/goggles_charge.ogg', 50, 1, -6) if(!do_after(user, scan_time)) return - ScanTurf(user, get_turf(user)) + ScanTurf(get_turf(user), user) /obj/item/weapon/mining_scanner/proc/ScanTurf(var/atom/target, var/mob/user, var/exact = FALSE) var/list/metals = list( @@ -45,7 +45,7 @@ if(ore_type) metals[ore_type] += T.resources[metal] - to_chat(user, "[bicon(src)] The scanner beeps and displays a readout.") + var/message = "[bicon(src)] The scanner beeps and displays a readout." for(var/ore_type in metals) var/result = "no sign" @@ -59,4 +59,6 @@ else result = metals[ore_type] - to_chat(user, "- [result] of [ore_type].") + message += "
- [result] of [ore_type]." + + to_chat(user, message) From 4ae6283cd1a199e400df7562de750aa25978c6f8 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Sun, 1 Mar 2020 19:05:52 -0500 Subject: [PATCH 09/18] Fixes 2 VChat bugs --- code/modules/vchat/css/ss13styles.css | 21 +++++++++++---------- code/modules/vchat/html/vchat.html | 2 +- code/modules/vchat/js/vchat.js | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/code/modules/vchat/css/ss13styles.css b/code/modules/vchat/css/ss13styles.css index 6c70b588af..661f09a866 100644 --- a/code/modules/vchat/css/ss13styles.css +++ b/code/modules/vchat/css/ss13styles.css @@ -1,6 +1,15 @@ /* VChat Styles */ +body.inverted { + background-color: #111111; +} + +#topmenu { + overflow-x: auto; + overflow-y: hidden; +} + #contentbox { - margin-top: 3rem; /* Make room for the fixed top menu */ + margin-top: 3.3rem; /* Make room for the fixed top menu */ overflow-wrap: break-word; word-wrap: break-word; /* IE, blah */ } @@ -18,11 +27,6 @@ font-size: 10px; } -#app > .menu { - overflow-x: auto; - overflow-y: hidden; -} - .item { cursor: pointer; } @@ -31,10 +35,6 @@ color: red; } -body.inverted { - background-color: #111111; -} - .blinkwarn { color: #FF0000; animation: blink-animation 1s steps(5, start) infinite; @@ -56,6 +56,7 @@ body.inverted { #messagebox.vc_info .vc_info { display: block; } #messagebox.vc_deadchat .vc_deadchat { display: block; } #messagebox.vc_globalooc .vc_globalooc { display: block; } +#messagebox.vc_looc .vc_looc { display: block; } #messagebox.vc_adminpm .vc_adminpm { display: block; } #messagebox.vc_adminchat .vc_adminchat { display: block; } #messagebox.vc_modchat .vc_modchat { display: block; } diff --git a/code/modules/vchat/html/vchat.html b/code/modules/vchat/html/vchat.html index 6e254a3616..29cc115af8 100644 --- a/code/modules/vchat/html/vchat.html +++ b/code/modules/vchat/html/vchat.html @@ -24,7 +24,7 @@