UI: Improve soft reset dialog, and always confirm soft resets (#809)

This commit is contained in:
missymae#2783 2023-09-17 14:30:10 -06:00 committed by GitHub
parent b9d13063ac
commit e1d2e12747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 12 deletions

@ -163,8 +163,7 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
<br />- home ram and cores
<br />
<br />
It is recommended to install several Augmentations at once. Preferably everything from any faction of
your choosing.
It is recommended to install several Augmentations at once.
</>
}
/>

@ -3,7 +3,6 @@ import { Box, Button, List, ListItemButton, Paper, Tooltip, Typography } from "@
import { default as React, useRef, useState } from "react";
import { FileDiagnosticModal } from "../../Diagnostic/FileDiagnosticModal";
import { ImportData, saveObject } from "../../SaveObject";
import { Settings } from "../../Settings/Settings";
import { StyleEditorButton } from "../../Themes/ui/StyleEditorButton";
import { ThemeEditorButton } from "../../Themes/ui/ThemeEditorButton";
import { ConfirmationModal } from "../../ui/React/ConfirmationModal";
@ -196,10 +195,7 @@ export const GameOptionsSidebar = (props: IProps): React.ReactElement => {
</Button>
</Tooltip>
<Box sx={{ gridArea: "reset", "& .MuiButton-root": { height: "100%", width: "100%" } }}>
<SoftResetButton
noConfirmation={Settings.SuppressBuyAugmentationConfirmation}
onTriggered={props.softReset}
/>
<SoftResetButton onTriggered={props.softReset} />
</Box>
<Tooltip
title={
@ -267,7 +263,8 @@ export const GameOptionsSidebar = (props: IProps): React.ReactElement => {
open={confirmResetOpen}
onClose={() => setConfirmResetOpen(false)}
onConfirm={props.reactivateTutorial}
confirmationText={"This will reset all your stats to 1 and money to 1k. Are you sure?"}
confirmationText={"Reset your stats and money to start the tutorial? Home scripts will not be reset."}
additionalButton={<Button onClick={() => setConfirmResetOpen(false)}>Cancel</Button>}
/>
</Box>
);

@ -31,7 +31,7 @@ function travel(to: CityName): void {
Player.loseMoney(cost, "other");
Player.travel(to);
dialogBoxCreate(`You are now in ${to}!`);
if (!Settings.SuppressTravelConfirmation) dialogBoxCreate(`You are now in ${to}!`);
Router.toPage(Page.City);
}

@ -29,6 +29,7 @@ export function TravelConfirmationModal(props: IProps): React.ReactElement {
<Button onClick={travel}>
<Typography>Travel</Typography>
</Button>
<Button onClick={() => props.onClose()}>Cancel</Button>
</Modal>
);
}

@ -34,6 +34,7 @@ export function DeleteGameButton({ color = "primary" }: IProps): React.ReactElem
open={modalOpened}
onClose={() => setModalOpened(false)}
confirmationText={"Really delete your game? (It's permanent!)"}
additionalButton={<Button onClick={() => setModalOpened(false)}>Cancel</Button>}
/>
</>
);

@ -2,7 +2,7 @@ import React, { useState } from "react";
import { ConfirmationModal } from "./ConfirmationModal";
import Button from "@mui/material/Button";
import { Tooltip } from "@mui/material";
import { Tooltip, Typography } from "@mui/material";
import RestartAltIcon from "@mui/icons-material/RestartAlt";
interface IProps {
@ -26,9 +26,22 @@ export function SoftResetButton({
}
}
const confirmationMessage = `Soft Reset will:
- Reset basic stats and money
- Accumulate Favor for companies and factions
- Install Augmentations if you have any purchased
- Reset servers, programs, recent scripts and terminal
- Scripts on your home server will stop, but aren't deleted
- Stop some special mechanics like Bladeburner tasks
- You will not lose overall progress or access to special mechanics
Are you sure?
`;
return (
<>
<Tooltip title="Perform a soft reset. Resets everything as if you had just installed Augmentations without installing them.">
<Tooltip title="Perform a Soft Reset - similar to installing Augmentations, even if you have none.">
<Button startIcon={<RestartAltIcon />} color={color} onClick={handleButtonClick}>
Soft Reset
</Button>
@ -37,7 +50,8 @@ export function SoftResetButton({
onConfirm={onTriggered}
open={modalOpened}
onClose={() => setModalOpened(false)}
confirmationText={"This will perform the same action as installing Augmentations, are you sure?"}
confirmationText={<Typography style={{ whiteSpace: "pre-wrap" }}>{confirmationMessage}</Typography>}
additionalButton={<Button onClick={() => setModalOpened(false)}>Cancel</Button>}
/>
</>
);