mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
Implement faction augs page shortcut
This commit is contained in:
parent
e39817cb57
commit
e960fbfa28
@ -24,6 +24,7 @@ import { CovenantPurchasesRoot } from "../../PersonObjects/Sleeve/ui/CovenantPur
|
||||
|
||||
type IProps = {
|
||||
faction: Faction;
|
||||
augPage: boolean;
|
||||
};
|
||||
|
||||
// Info text for all options on the UI
|
||||
@ -185,7 +186,7 @@ export function FactionRoot(props: IProps): React.ReactElement {
|
||||
|
||||
const faction = props.faction;
|
||||
|
||||
const [purchasingAugs, setPurchasingAugs] = useState(false);
|
||||
const [purchasingAugs, setPurchasingAugs] = useState(props.augPage);
|
||||
|
||||
return purchasingAugs ? (
|
||||
<AugmentationsPage faction={faction} routeToMainPage={() => setPurchasingAugs(false)} />
|
||||
|
@ -41,6 +41,10 @@ export function FactionsRoot(props: IProps): React.ReactElement {
|
||||
props.router.toFaction(faction);
|
||||
}
|
||||
|
||||
function openFactionAugPage(faction: Faction): void {
|
||||
props.router.toFaction(faction, true);
|
||||
}
|
||||
|
||||
function acceptInvitation(event: React.MouseEvent<HTMLButtonElement, MouseEvent>, faction: string): void {
|
||||
if (!event.isTrusted) return;
|
||||
joinFaction(Factions[faction]);
|
||||
@ -61,7 +65,7 @@ export function FactionsRoot(props: IProps): React.ReactElement {
|
||||
</Typography>
|
||||
{(props.player.factions.length > 0 && (
|
||||
<Paper sx={{ my: 1, p: 1, pb: 0, display: "inline-block" }}>
|
||||
<Table padding="none">
|
||||
<Table padding="none" style={{ width: "fit-content" }}>
|
||||
<TableBody>
|
||||
{props.player.factions.map((faction: string) => (
|
||||
<TableRow key={faction}>
|
||||
@ -76,13 +80,15 @@ export function FactionsRoot(props: IProps): React.ReactElement {
|
||||
</Box>
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<Typography noWrap ml={10} mb={1}>
|
||||
<Box ml={1} mb={1}>
|
||||
<Button sx={{ width: '100%' }} onClick={() => openFactionAugPage(Factions[faction])}>
|
||||
Augmentations Left: {Factions[faction]
|
||||
.augmentations
|
||||
.filter((augmentation: string) =>
|
||||
!props.player.hasAugmentation(augmentation))
|
||||
.length}
|
||||
</Typography>
|
||||
</Button>
|
||||
</Box>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
Loading…
Reference in New Issue
Block a user