Skip to content

Commit

Permalink
Actually fixes the manifest (#16634)
Browse files Browse the repository at this point in the history
* fix the manifest

* cl

* if your voices will feel the sky

* OOPS

* Update html/changelogs/mattatlas-manifix.yml

---------

Co-authored-by: Matt Atlas <[email protected]>
  • Loading branch information
NonQueueingMatt and Matt Atlas authored Jul 4, 2023
1 parent 3ff22e4 commit ef28348
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 92 deletions.
2 changes: 1 addition & 1 deletion code/controllers/subsystems/records.dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
/datum/controller/subsystem/records/proc/open_manifest_tgui(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CrewManifest")
ui = new(user, src, "CrewManifest", "Crew Manifest")
ui.open()

/datum/controller/subsystem/records/proc/get_manifest_text()
Expand Down
41 changes: 41 additions & 0 deletions html/changelogs/mattatlas-manifix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################

# Your name.
author: MattAtlas

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Fixes the manifest on the PDA not having a header. Again."
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/NTOSManifest.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NtosWindow } from '../layouts';
import { Manifest } from './common/Manifest';
import { ManifestSection } from './common/ManifestSection';

export const NTOSManifest = () => {
return (
<NtosWindow width={500} height={700}>
<NtosWindow.Content scrollable>
<Manifest />
<ManifestSection />
</NtosWindow.Content>
</NtosWindow>
);
Expand Down
91 changes: 2 additions & 89 deletions tgui/packages/tgui/interfaces/common/Manifest.tsx
Original file line number Diff line number Diff line change
@@ -1,98 +1,11 @@
import { BooleanLike } from '../../../common/react';
import { useBackend } from '../../backend';
import { Button, Icon, Section, Table, Tooltip } from '../../components';
import { TableCell, TableRow } from '../../components/Table';
import { Window } from '../../layouts';

type ManifestData = {
manifest: { department: Crew[] };
allow_follow: BooleanLike;
};

type Crew = {
name: string;
rank: string;
active: string;
head: BooleanLike;
};
import { ManifestSection } from './ManifestSection';

export const Manifest = (props, context) => {
const { act, data } = useBackend<ManifestData>(context);
const manifest = data.manifest || {};
const allow_follow = data.allow_follow;
return (
<Window width={500} height={700}>
<Window.Content scrollable>
<Section>
{Object.keys(manifest).length === 0 && 'There are no crew active.'}
{Object.keys(manifest).map((dept) => {
const deptCrew = manifest[dept];
return (
<Section
key={dept}
title={dept}
textAlign="center"
className={'border-dept-' + dept.toLowerCase()}
backgroundColor="rgba(10, 10, 10, 0.75)">
<Table>
{deptCrew.map((crewmate) => {
return (
<TableRow
key={crewmate.name}
bold={crewmate.head}
overflow="hidden">
<TableCell
width="50%"
textAlign="center"
pt="10px"
nowrap>
{crewmate.name}
</TableCell>
<TableCell
width="45%"
textAlign="right"
pr="2%"
pt="10px"
nowrap>
{crewmate.rank}
</TableCell>
<TableCell
textAlign="right"
width="5%"
pr="3%"
pt="10px">
<Tooltip content={crewmate.active}>
<Icon
name="circle"
className={
'manifest-indicator-' +
crewmate.active.toLowerCase()
}
/>
</Tooltip>
</TableCell>
{allow_follow ? (
<TableCell textAlign="right">
<Tooltip content="Follow Mob">
<Button
content="F"
onClick={() =>
act('follow', { name: crewmate.name })
}
/>
</Tooltip>
</TableCell>
) : (
''
)}
</TableRow>
);
})}
</Table>
</Section>
);
})}
</Section>
<ManifestSection />
</Window.Content>
</Window>
);
Expand Down
86 changes: 86 additions & 0 deletions tgui/packages/tgui/interfaces/common/ManifestSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { BooleanLike } from '../../../common/react';
import { useBackend } from '../../backend';
import { Button, Icon, Section, Table, Tooltip } from '../../components';
import { TableCell, TableRow } from '../../components/Table';

type ManifestData = {
manifest: { department: Crew[] };
allow_follow: BooleanLike;
};

type Crew = {
name: string;
rank: string;
active: string;
head: BooleanLike;
};

export const ManifestSection = (props, context) => {
const { act, data } = useBackend<ManifestData>(context);
const manifest = data.manifest || {};
const allow_follow = data.allow_follow;
return (
<Section>
{Object.keys(manifest).length === 0 && 'There are no crew active.'}
{Object.keys(manifest).map((dept) => {
const deptCrew = manifest[dept];
return (
<Section
key={dept}
title={dept}
textAlign="center"
className={'border-dept-' + dept.toLowerCase()}
backgroundColor="rgba(10, 10, 10, 0.75)">
<Table>
{deptCrew.map((crewmate) => {
return (
<TableRow
key={crewmate.name}
bold={crewmate.head}
overflow="hidden">
<TableCell width="50%" textAlign="center" pt="10px" nowrap>
{crewmate.name}
</TableCell>
<TableCell
width="45%"
textAlign="right"
pr="2%"
pt="10px"
nowrap>
{crewmate.rank}
</TableCell>
<TableCell textAlign="right" width="5%" pr="3%" pt="10px">
<Tooltip content={crewmate.active}>
<Icon
name="circle"
className={
'manifest-indicator-' +
crewmate.active.toLowerCase()
}
/>
</Tooltip>
</TableCell>
{allow_follow ? (
<TableCell textAlign="right">
<Tooltip content="Follow Mob">
<Button
content="F"
onClick={() =>
act('follow', { name: crewmate.name })
}
/>
</Tooltip>
</TableCell>
) : (
''
)}
</TableRow>
);
})}
</Table>
</Section>
);
})}
</Section>
);
};

0 comments on commit ef28348

Please sign in to comment.