From fe787391c436bf255577649a4c05cdefc62ec0c4 Mon Sep 17 00:00:00 2001 From: Geeves Date: Tue, 28 Nov 2023 13:25:18 +0200 Subject: [PATCH] Hivenet Manifest (#17493) * Hivenet Manifest * booga --- aurorastation.dme | 1 + .../mob/living/carbon/human/human_powers.dm | 12 +++ .../human/species/station/vaurca/vaurca.dm | 3 +- .../station/vaurca/vaurca_subspecies.dm | 6 +- code/modules/organs/subtypes/vaurca.dm | 10 ++- code/modules/tgui/modules/hivenet_manifest.dm | 73 +++++++++++++++++++ html/changelogs/geeves-hivenet_manifest.yml | 6 ++ tgui/packages/tgui/index.tsx | 1 + .../tgui/interfaces/HivenetManifest.tsx | 60 +++++++++++++++ tgui/packages/tgui/styles/themes/vaurca.scss | 69 ++++++++++++++++++ 10 files changed, 236 insertions(+), 5 deletions(-) create mode 100644 code/modules/tgui/modules/hivenet_manifest.dm create mode 100644 html/changelogs/geeves-hivenet_manifest.yml create mode 100644 tgui/packages/tgui/interfaces/HivenetManifest.tsx create mode 100644 tgui/packages/tgui/styles/themes/vaurca.scss diff --git a/aurorastation.dme b/aurorastation.dme index efa250896ee..ca91f62a92e 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -3391,6 +3391,7 @@ #include "code\modules\tgui\tgui_window.dm" #include "code\modules\tgui\modules\armor_values.dm" #include "code\modules\tgui\modules\flavor_text.dm" +#include "code\modules\tgui\modules\hivenet_manifest.dm" #include "code\modules\tgui\states\admin.dm" #include "code\modules\tgui\states\always.dm" #include "code\modules\tgui\states\conscious.dm" diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index a21d0250721..0201f11eb4e 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -2091,3 +2091,15 @@ infest.replaced(H, affected) msg_admin_attack("[key_name_admin(src)] infected [key_name_admin(H)] with black k'ois! (JMP)",ckey=key_name(src),ckey_target=key_name(H)) + +/mob/living/carbon/human/proc/hivenet_manifest() + set name = "Hivenet Manifest" + set desc = "Get a list of all vaurca currently on the Hivenet." + set category = "Hivenet" + + var/list/all_vaurca = list() + for(var/mob/living/carbon/human/vaurca in human_mob_list) + if(!vaurca.stat && isvaurca(vaurca) && vaurca.internal_organs_by_name[BP_NEURAL_SOCKET]) + all_vaurca += vaurca + var/datum/tgui_module/hivenet_manifest/HM = new /datum/tgui_module/hivenet_manifest(usr, all_vaurca) + HM.ui_interact(usr) diff --git a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm index 78567caca35..5b04fb38c75 100644 --- a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm +++ b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca.dm @@ -129,7 +129,8 @@ ) inherent_verbs = list( - /mob/living/carbon/human/proc/hivenet_recieve + /mob/living/carbon/human/proc/hivenet_recieve, + /mob/living/carbon/human/proc/hivenet_manifest ) default_h_style = "Classic Antennae" diff --git a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm index f0ad6f7c4eb..b05011b2ca5 100644 --- a/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/vaurca/vaurca_subspecies.dm @@ -120,7 +120,8 @@ /mob/living/carbon/human/proc/hivemute, /mob/living/carbon/human/proc/hiveban, /mob/living/carbon/human/proc/hivevoid, - /mob/living/carbon/human/proc/hivenet_transmit + /mob/living/carbon/human/proc/hivenet_transmit, + /mob/living/carbon/human/proc/hivenet_manifest ) default_h_style = "Bald" @@ -209,7 +210,8 @@ /mob/living/carbon/human/proc/devour_head, /mob/living/carbon/human/proc/formic_spray, /mob/living/carbon/human/proc/trample, - /mob/living/carbon/human/proc/hivenet_recieve + /mob/living/carbon/human/proc/hivenet_recieve, + /mob/living/carbon/human/proc/hivenet_manifest ) has_organ = list( diff --git a/code/modules/organs/subtypes/vaurca.dm b/code/modules/organs/subtypes/vaurca.dm index fe5549e88eb..23833ba094a 100644 --- a/code/modules/organs/subtypes/vaurca.dm +++ b/code/modules/organs/subtypes/vaurca.dm @@ -77,7 +77,12 @@ var/adminperms = FALSE var/encryption_key var/decryption_key - var/list/granted_verbs = list(/mob/living/carbon/human/proc/hivenet_recieve) + + var/list/granted_verbs = list( + /mob/living/carbon/human/proc/hivenet_recieve, + /mob/living/carbon/human/proc/hivenet_manifest + ) + var/list/all_hive_verbs = list( /mob/living/carbon/human/proc/hiveban, /mob/living/carbon/human/proc/hivevoid, @@ -148,7 +153,8 @@ /mob/living/carbon/human/proc/hivenet_encrypt, /mob/living/carbon/human/proc/hivenet_camera, /mob/living/carbon/human/proc/hivenet_lattice, - /mob/living/carbon/human/proc/hivenet_decrypt + /mob/living/carbon/human/proc/hivenet_decrypt, + /mob/living/carbon/human/proc/hivenet_manifest ) /obj/item/organ/internal/vaurca/neuralsocket/admin/process() diff --git a/code/modules/tgui/modules/hivenet_manifest.dm b/code/modules/tgui/modules/hivenet_manifest.dm new file mode 100644 index 00000000000..08989b097e1 --- /dev/null +++ b/code/modules/tgui/modules/hivenet_manifest.dm @@ -0,0 +1,73 @@ +/datum/tgui_module/hivenet_manifest + var/list/all_vaurca = list() + +/datum/tgui_module/hivenet_manifest/New(mob/user, var/list/set_all_vaurca) + ..() + all_vaurca = set_all_vaurca + +/datum/tgui_module/hivenet_manifest/ui_interact(var/mob/user, var/datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "HivenetManifest", "Hivenet Manifest", 350, 400) + ui.autoupdate = FALSE + ui.open() + +/datum/tgui_module/hivenet_manifest/ui_data(mob/user) + var/list/data = list() + + var/list/zora_vaurca = list() + var/list/cthur_vaurca = list() + var/list/klax_vaurca = list() + + for(var/mob/living/carbon/human/vaurca as anything in all_vaurca) + var/list/fullname = splittext(vaurca.real_name, " ") + var/surname = fullname[2] + switch(surname) + if("Zo'ra") + zora_vaurca += vaurca_to_data(vaurca) + if("C'thur") + cthur_vaurca += vaurca_to_data(vaurca) + if("K'lax") + klax_vaurca += vaurca_to_data(vaurca) + + data["all_vaurca"] = list( + "Zo'ra" = list("vaurca" = sort_vaurca_list(zora_vaurca), "color" = "Security"), + "C'thur" = list("vaurca" = sort_vaurca_list(cthur_vaurca), "color" = "Command"), + "K'lax" = list("vaurca" = sort_vaurca_list(klax_vaurca), "color" = "Medical") + ) + + return data + +/datum/tgui_module/hivenet_manifest/proc/vaurca_to_data(var/mob/living/carbon/human/vaurca) + var/list/fullname = splittext(vaurca.real_name, "'") + var/identifier = fullname[1] + return list(list( + "name" = vaurca.real_name, + "bold" = identifier == "Ta" ? TRUE : FALSE + )) + +/datum/tgui_module/hivenet_manifest/proc/sort_vaurca_list(var/list/vaurca_list) + if(!length(vaurca_list)) + return vaurca_list + + var/list/identifiers = list("Ta", "Za", "Ka", "Ra") + var/list/statuses = list("Akaix", "Viax") + var/list/sorting_operations = list() + + for(var/status in statuses) + for(var/identifier in identifiers) + sorting_operations += list(list( + identifier, + status + )) + + var/list/return_list = list() + for(var/list/sort in sorting_operations) + for(var/list/vaurca in vaurca_list) + var/list/fullname = splittext(vaurca["name"], "'") + var/vaurca_identifier = fullname[1] + var/vaurca_status = fullname[2] + if(vaurca_identifier == sort[1] && vaurca_status == sort[2]) + return_list += list(vaurca) + + return return_list diff --git a/html/changelogs/geeves-hivenet_manifest.yml b/html/changelogs/geeves-hivenet_manifest.yml new file mode 100644 index 00000000000..a642574af49 --- /dev/null +++ b/html/changelogs/geeves-hivenet_manifest.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Added a hivenet manifest, which lets Vaurca see other Vaurca that're awake." diff --git a/tgui/packages/tgui/index.tsx b/tgui/packages/tgui/index.tsx index 019ab3c8a37..bc948e7b7c5 100644 --- a/tgui/packages/tgui/index.tsx +++ b/tgui/packages/tgui/index.tsx @@ -31,6 +31,7 @@ import './styles/themes/nanotrasen.scss'; import './styles/themes/zenghu.scss'; import './styles/themes/hephaestus.scss'; import './styles/themes/sol.scss'; +import './styles/themes/vaurca.scss'; import { StoreProvider, configureStore } from './store'; diff --git a/tgui/packages/tgui/interfaces/HivenetManifest.tsx b/tgui/packages/tgui/interfaces/HivenetManifest.tsx new file mode 100644 index 00000000000..9dc32cd7157 --- /dev/null +++ b/tgui/packages/tgui/interfaces/HivenetManifest.tsx @@ -0,0 +1,60 @@ +import { useBackend } from '../backend'; +import { Box, Section, Table } from '../components'; +import { Window } from '../layouts'; +import { TableCell, TableRow } from '../components/Table'; + +export type VaurcaData = { + name: string; + bold: boolean; +}; + +export type VaurcaListData = { + vaurca: VaurcaData[]; + color: string; +}; + +export type HivenetManifestData = { + all_vaurca: VaurcaListData[]; +}; + +export const HivenetManifest = (props, context) => { + const { act, data } = useBackend(context); + + return ( + + + {Object.keys(data.all_vaurca).map((hive) => { + const hiveData = data.all_vaurca[hive]; + return hiveData.vaurca.length ? ( +
+ + {hiveData.vaurca.map((vaurca) => { + return ( + + + + {' - '} + {vaurca.name} + {' - '} + + + + ); + })} +
+
+ ) : null; + })} +
+
+ ); +}; diff --git a/tgui/packages/tgui/styles/themes/vaurca.scss b/tgui/packages/tgui/styles/themes/vaurca.scss new file mode 100644 index 00000000000..b8ec5e0dbef --- /dev/null +++ b/tgui/packages/tgui/styles/themes/vaurca.scss @@ -0,0 +1,69 @@ +@use 'sass:color'; +@use 'sass:meta'; + +@use '../colors.scss' with ( + $primary: #ff0000, + $fg-map-keys: (), + $bg-map-keys: (), +); + +@use '../base.scss' with ( + $color-bg: #1b1212, + $color-bg-grad-spread: 0%, +); + +.theme-vaurca { + // Atomic classes + @include meta.load-css('../atomic/color.scss'); + + // Import Crew Manifest for color values + @include meta.load-css('../interfaces/CrewManifest.scss'); + + // Components + @include meta.load-css( + '../components/Button.scss', + $with: ( + 'color-default': colors.$primary, + 'color-disabled': #6a4a4a, + 'color-selected': #ff0000 + ) + ); + @include meta.load-css( + '../components/Tabs.scss', + $with: ( + 'color-default': colors.$primary, + 'tab-color-selected': #ff00003f, + 'text-color': #e7e7e7 + ) + ); + @include meta.load-css( + '../components/Input.scss', + $with: ('border-color': colors.$primary) + ); + @include meta.load-css('../components/Modal.scss'); + @include meta.load-css('../components/Section.scss'); + + // Layouts + @include meta.load-css('../layouts/Layout.scss'); + @include meta.load-css('../layouts/Window.scss'); + @include meta.load-css( + '../layouts/TitleBar.scss', + $with: ('background-color': #3d2222) + ); + + .Layout__content { + background-image: none; + } + + .Button { + font-family: monospace; + border-width: base.em(2px); + border-style: outset; + border-color: #aa0000; + outline: base.em(1px) solid rgb(122, 0, 0); + } + + .candystripe:nth-child(odd) { + background-color: rgba(100, 0, 0, 0.5); + } +}