mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
UI: Infiltration rewards default to the faction you're currently working for (#1114)
* Better infiltration victory faction default * Better condition for "none" default * Fix default faction type.
This commit is contained in:
parent
6288eec6d7
commit
4c7f192645
@ -17,6 +17,7 @@ import {
|
|||||||
calculateTradeInformationRepReward,
|
calculateTradeInformationRepReward,
|
||||||
} from "../formulas/victory";
|
} from "../formulas/victory";
|
||||||
import { getEnumHelper } from "../../utils/EnumHelper";
|
import { getEnumHelper } from "../../utils/EnumHelper";
|
||||||
|
import { isFactionWork } from "../../Work/FactionWork";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
StartingDifficulty: number;
|
StartingDifficulty: number;
|
||||||
@ -26,7 +27,8 @@ interface IProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Victory(props: IProps): React.ReactElement {
|
export function Victory(props: IProps): React.ReactElement {
|
||||||
const [factionName, setFactionName] = useState("none");
|
const defaultFaction = isFactionWork(Player.currentWork) ? Player.currentWork.factionName : "none";
|
||||||
|
const [factionName, setFactionName] = useState(defaultFaction);
|
||||||
|
|
||||||
function quitInfiltration(): void {
|
function quitInfiltration(): void {
|
||||||
handleInfiltrators();
|
handleInfiltrators();
|
||||||
@ -79,9 +81,11 @@ export function Victory(props: IProps): React.ReactElement {
|
|||||||
<Box sx={{ width: "fit-content" }}>
|
<Box sx={{ width: "fit-content" }}>
|
||||||
<Box sx={{ width: "100%" }}>
|
<Box sx={{ width: "100%" }}>
|
||||||
<Select value={factionName} onChange={changeDropdown} sx={{ mr: 1 }}>
|
<Select value={factionName} onChange={changeDropdown} sx={{ mr: 1 }}>
|
||||||
<MenuItem key={"none"} value={"none"}>
|
{defaultFaction === "none" && (
|
||||||
{"none"}
|
<MenuItem key={"none"} value={"none"}>
|
||||||
</MenuItem>
|
{"none"}
|
||||||
|
</MenuItem>
|
||||||
|
)}
|
||||||
{Player.factions
|
{Player.factions
|
||||||
.filter((f) => Factions[f].getInfo().offersWork())
|
.filter((f) => Factions[f].getInfo().offersWork())
|
||||||
.map((f) => (
|
.map((f) => (
|
||||||
|
Loading…
Reference in New Issue
Block a user