mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +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,
|
||||
} from "../formulas/victory";
|
||||
import { getEnumHelper } from "../../utils/EnumHelper";
|
||||
import { isFactionWork } from "../../Work/FactionWork";
|
||||
|
||||
interface IProps {
|
||||
StartingDifficulty: number;
|
||||
@ -26,7 +27,8 @@ interface IProps {
|
||||
}
|
||||
|
||||
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 {
|
||||
handleInfiltrators();
|
||||
@ -79,9 +81,11 @@ export function Victory(props: IProps): React.ReactElement {
|
||||
<Box sx={{ width: "fit-content" }}>
|
||||
<Box sx={{ width: "100%" }}>
|
||||
<Select value={factionName} onChange={changeDropdown} sx={{ mr: 1 }}>
|
||||
<MenuItem key={"none"} value={"none"}>
|
||||
{"none"}
|
||||
</MenuItem>
|
||||
{defaultFaction === "none" && (
|
||||
<MenuItem key={"none"} value={"none"}>
|
||||
{"none"}
|
||||
</MenuItem>
|
||||
)}
|
||||
{Player.factions
|
||||
.filter((f) => Factions[f].getInfo().offersWork())
|
||||
.map((f) => (
|
||||
|
Loading…
Reference in New Issue
Block a user