From 0113007acb29b656d48c6fd3e8d52f0551f25659 Mon Sep 17 00:00:00 2001 From: Thunder12345 Date: Mon, 17 Jan 2022 23:30:34 +0000 Subject: [PATCH] Adds blood brother teammates to antag info (#64143) Makes blood brother antag info display the names of their blood brothers. --- code/modules/antagonists/brother/brother.dm | 8 +++ .../tgui/interfaces/AntagInfoBrother.tsx | 67 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 tgui/packages/tgui/interfaces/AntagInfoBrother.tsx diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm index 7b1023e19b6..ec83e7e5bae 100644 --- a/code/modules/antagonists/brother/brother.dm +++ b/code/modules/antagonists/brother/brother.dm @@ -5,6 +5,7 @@ var/special_role = ROLE_BROTHER antag_hud_name = "brother" hijack_speed = 0.5 + ui_name = "AntagInfoBrother" suicide_cry = "FOR MY BROTHER!!" var/datum/team/brother_team/team antag_moodlet = /datum/mood_event/focused @@ -111,6 +112,13 @@ message_admins("[key_name_admin(admin)] made [key_name_admin(new_owner)] and [key_name_admin(bro)] into blood brothers.") log_admin("[key_name(admin)] made [key_name(new_owner)] and [key_name(bro)] into blood brothers.") +/datum/antagonist/brother/ui_static_data(mob/user) + var/list/data = list() + data["antag_name"] = name + data["objectives"] = get_objectives() + data["brothers"] = get_brother_names() + return data + /datum/team/brother_team name = "brotherhood" member_name = "blood brother" diff --git a/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx b/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx new file mode 100644 index 00000000000..d4a7c382d5f --- /dev/null +++ b/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx @@ -0,0 +1,67 @@ +import { useBackend } from '../backend'; +import { Section, Stack } from '../components'; +import { BooleanLike } from 'common/react'; +import { Window } from '../layouts'; + +type Objective = { + count: number; + name: string; + explanation: string; + complete: BooleanLike; + was_uncompleted: BooleanLike; + reward: number; +} + +type Info = { + antag_name: string; + objectives: Objective[]; + brothers: string; +}; + +export const AntagInfoBrother = (props, context) => { + const { data } = useBackend(context); + const { + antag_name, + brothers, + } = data; + return ( + + +
+ + + You are the {antag_name} of {brothers}! + + + + + +
+
+
+ ); +}; + +const ObjectivePrintout = (props, context) => { + const { data } = useBackend(context); + const { + objectives, + } = data; + return ( + + + Your objectives: + + + {!objectives && "None!" + || objectives.map(objective => ( + + #{objective.count}: {objective.explanation} + + )) } + + + ); +};