Added option to suppress TIX limit/stop orders

This commit is contained in:
Olivier Gagnon 2021-12-08 20:21:44 -05:00
parent c915cd06d8
commit d195b00ab6
5 changed files with 41 additions and 21 deletions

22
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -17,6 +17,7 @@ import { numeralWrapper } from "../ui/numeralFormat";
import { Money } from "../ui/React/Money"; import { Money } from "../ui/React/Money";
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { dialogBoxCreate } from "../ui/React/DialogBox";
import { Settings } from "../Settings/Settings";
import * as React from "react"; import * as React from "react";
@ -150,12 +151,14 @@ function executeOrder(order: Order, refs: IProcessOrderRefs): void {
for (let i = 0; i < stockOrders.length; ++i) { for (let i = 0; i < stockOrders.length; ++i) {
if (order == stockOrders[i]) { if (order == stockOrders[i]) {
stockOrders.splice(i, 1); stockOrders.splice(i, 1);
dialogBoxCreate( if (!Settings.SuppressTIXPopup) {
<> dialogBoxCreate(
{order.type} for {stock.symbol} @ <Money money={order.price} /> ({pos}) was filled ( <>
{numeralWrapper.formatShares(Math.round(order.shares))} shares) {order.type} for {stock.symbol} @ <Money money={order.price} /> ({pos}) was filled (
</>, {numeralWrapper.formatShares(Math.round(order.shares))} shares)
); </>,
);
}
return; return;
} }
} }

@ -68,7 +68,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
const [suppressBuyAugmentationConfirmation, setSuppressBuyAugmentationConfirmation] = useState( const [suppressBuyAugmentationConfirmation, setSuppressBuyAugmentationConfirmation] = useState(
Settings.SuppressBuyAugmentationConfirmation, Settings.SuppressBuyAugmentationConfirmation,
); );
const [suppressTIXPopup, setSuppressTIXPopup] = useState(Settings.SuppressTIXPopup);
const [suppressBladeburnerPopup, setSuppressBladeburnerPopup] = useState(Settings.SuppressBladeburnerPopup); const [suppressBladeburnerPopup, setSuppressBladeburnerPopup] = useState(Settings.SuppressBladeburnerPopup);
const [disableHotkeys, setDisableHotkeys] = useState(Settings.DisableHotkeys); const [disableHotkeys, setDisableHotkeys] = useState(Settings.DisableHotkeys);
@ -128,6 +128,11 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
Settings.SuppressBuyAugmentationConfirmation = event.target.checked; Settings.SuppressBuyAugmentationConfirmation = event.target.checked;
} }
function handleSuppressTIXPopupChange(event: React.ChangeEvent<HTMLInputElement>): void {
setSuppressTIXPopup(event.target.checked);
Settings.SuppressTIXPopup = event.target.checked;
}
function handleSuppressBladeburnerPopupChange(event: React.ChangeEvent<HTMLInputElement>): void { function handleSuppressBladeburnerPopupChange(event: React.ChangeEvent<HTMLInputElement>): void {
setSuppressBladeburnerPopup(event.target.checked); setSuppressBladeburnerPopup(event.target.checked);
Settings.SuppressBladeburnerPopup = event.target.checked; Settings.SuppressBladeburnerPopup = event.target.checked;
@ -382,6 +387,18 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
} }
/> />
</ListItem> </ListItem>
<ListItem>
<FormControlLabel
control={<Switch checked={suppressTIXPopup} onChange={handleSuppressTIXPopupChange} />}
label={
<Tooltip
title={<Typography>If this is set, the stock market will never create any popup.</Typography>}
>
<Typography>Suppress TIX messages</Typography>
</Tooltip>
}
/>
</ListItem>
{!!props.player.bladeburner && ( {!!props.player.bladeburner && (
<ListItem> <ListItem>
<FormControlLabel <FormControlLabel