mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 04:17:05 +02:00
Hacking missions inside GameRoot
This commit is contained in:
+11
-2
@@ -56,6 +56,7 @@ import { TerminalRoot } from "../Terminal/ui/TerminalRoot";
|
||||
import { TutorialRoot } from "../Tutorial/ui/TutorialRoot";
|
||||
import { ActiveScriptsRoot } from "../ui/ActiveScripts/ActiveScriptsRoot";
|
||||
import { FactionsRoot } from "../Faction/ui/FactionsRoot";
|
||||
import { HackingMissionRoot } from "../HackingMission/ui/HackingMissionRoot";
|
||||
import { FactionRoot } from "../Faction/ui/FactionRoot";
|
||||
import { CharacterStats } from "./CharacterStats";
|
||||
import { TravelAgencyRoot } from "../Locations/ui/TravelAgencyRoot";
|
||||
@@ -65,7 +66,6 @@ import { CharacterOverview } from "./React/CharacterOverview";
|
||||
import { BladeburnerCinematic } from "../Bladeburner/ui/BladeburnerCinematic";
|
||||
import { workerScripts } from "../Netscript/WorkerScripts";
|
||||
|
||||
import { startHackingMission } from "../Faction/FactionHelpers";
|
||||
import { enterBitNode } from "../RedPill";
|
||||
import { Context } from "./Context";
|
||||
|
||||
@@ -173,6 +173,9 @@ export let Router: IRouter = {
|
||||
toLocation: () => {
|
||||
throw new Error("Router called before initialization");
|
||||
},
|
||||
toHackingMission: () => {
|
||||
throw new Error("Router called before initialization");
|
||||
},
|
||||
};
|
||||
|
||||
function determineStartPage(player: IPlayer): Page {
|
||||
@@ -262,6 +265,10 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
|
||||
setLocation(location);
|
||||
setPage(Page.Location);
|
||||
},
|
||||
toHackingMission: (faction: Faction) => {
|
||||
setPage(Page.HackingMission);
|
||||
setFaction(faction);
|
||||
},
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -284,6 +291,8 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
|
||||
<BitverseRoot flume={flume} enter={enterBitNode} quick={quick} />
|
||||
) : page === Page.Infiltration ? (
|
||||
<InfiltrationRoot location={location} />
|
||||
) : page === Page.HackingMission ? (
|
||||
<HackingMissionRoot faction={faction} />
|
||||
) : page === Page.BladeburnerCinematic ? (
|
||||
<BladeburnerCinematic />
|
||||
) : page === Page.Work ? (
|
||||
@@ -309,7 +318,7 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
|
||||
) : page === Page.Factions ? (
|
||||
<FactionsRoot player={player} router={Router} />
|
||||
) : page === Page.Faction ? (
|
||||
<FactionRoot faction={faction} startHackingMissionFn={startHackingMission} />
|
||||
<FactionRoot faction={faction} />
|
||||
) : page === Page.Milestones ? (
|
||||
<MilestonesRoot player={player} />
|
||||
) : page === Page.Tutorial ? (
|
||||
|
||||
Reference in New Issue
Block a user