mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
Add toPreviousPage in router
- Allows the WorkInProgress cancel & unfocus to go back to the previous page instead of a default one. - Change layout of overview buttons - Add a back button in the overview, only visible in pages with a sidebar - Clear the history on augmentation install & on prestige
This commit is contained in:
@@ -36,12 +36,12 @@ export function WorkInProgressRoot(): React.ReactElement {
|
||||
const faction = Factions[player.currentWorkFactionName];
|
||||
if (player.workType == CONSTANTS.WorkTypeFaction) {
|
||||
function cancel(): void {
|
||||
router.toFaction(faction);
|
||||
player.finishFactionWork(true);
|
||||
router.toPreviousPage(() => router.toFaction(faction));
|
||||
}
|
||||
function unfocus(): void {
|
||||
router.toFaction(faction);
|
||||
player.stopFocusing();
|
||||
router.toPreviousPage(() => router.toFaction(faction));
|
||||
}
|
||||
return (
|
||||
<Grid container direction="column" justifyContent="center" alignItems="center" style={{ minHeight: "100vh" }}>
|
||||
@@ -120,13 +120,12 @@ export function WorkInProgressRoot(): React.ReactElement {
|
||||
if (player.className !== "") {
|
||||
function cancel(): void {
|
||||
player.finishClass(true);
|
||||
router.toCity();
|
||||
router.toPreviousPage(() => router.toCity());
|
||||
}
|
||||
|
||||
function unfocus(): void {
|
||||
router.toFaction(faction);
|
||||
router.toCity();
|
||||
player.stopFocusing();
|
||||
router.toPreviousPage(() => router.toCity());
|
||||
}
|
||||
|
||||
let stopText = "";
|
||||
@@ -212,11 +211,11 @@ export function WorkInProgressRoot(): React.ReactElement {
|
||||
|
||||
function cancel(): void {
|
||||
player.finishWork(true);
|
||||
router.toJob();
|
||||
router.toPreviousPage(() => router.toJob());
|
||||
}
|
||||
function unfocus(): void {
|
||||
player.stopFocusing();
|
||||
router.toJob();
|
||||
router.toPreviousPage(() => router.toJob());
|
||||
}
|
||||
|
||||
const position = player.jobs[player.companyName];
|
||||
@@ -304,11 +303,11 @@ export function WorkInProgressRoot(): React.ReactElement {
|
||||
if (player.workType == CONSTANTS.WorkTypeCompanyPartTime) {
|
||||
function cancel(): void {
|
||||
player.finishWorkPartTime(true);
|
||||
router.toJob();
|
||||
router.toPreviousPage(() => router.toJob());
|
||||
}
|
||||
function unfocus(): void {
|
||||
player.stopFocusing();
|
||||
router.toJob();
|
||||
router.toPreviousPage(() => router.toJob());
|
||||
}
|
||||
const comp = Companies[player.companyName];
|
||||
let companyRep = 0;
|
||||
@@ -440,11 +439,11 @@ export function WorkInProgressRoot(): React.ReactElement {
|
||||
if (player.createProgramName !== "") {
|
||||
function cancel(): void {
|
||||
player.finishCreateProgramWork(true);
|
||||
router.toTerminal();
|
||||
router.toPreviousPage(() => router.toTerminal());
|
||||
}
|
||||
function unfocus(): void {
|
||||
router.toTerminal();
|
||||
player.stopFocusing();
|
||||
router.toPreviousPage(() => router.toTerminal());
|
||||
}
|
||||
return (
|
||||
<Grid container direction="column" justifyContent="center" alignItems="center" style={{ minHeight: "100vh" }}>
|
||||
|
||||
Reference in New Issue
Block a user