diff --git a/src/Augmentation/AugmentationHelpers.jsx b/src/Augmentation/AugmentationHelpers.jsx index 0cb0c45eb..c3f4849d4 100644 --- a/src/Augmentation/AugmentationHelpers.jsx +++ b/src/Augmentation/AugmentationHelpers.jsx @@ -211,7 +211,7 @@ function initAugmentations() { name: AugmentationNames.Targeting3, moneyCost: 1.15e8, repCost: 2.75e4, - info: "The latest version of the 'Augmented Targeting' implant adds the ability to " + "lock-on and track threats.", + info: "The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.", prereqs: [AugmentationNames.Targeting2], dexterity_mult: 1.3, }); diff --git a/src/Faction/ui/AugmentationsPage.tsx b/src/Faction/ui/AugmentationsPage.tsx index d643e6d14..1c5116a2f 100644 --- a/src/Faction/ui/AugmentationsPage.tsx +++ b/src/Faction/ui/AugmentationsPage.tsx @@ -36,7 +36,6 @@ export function AugmentationsPage(props: IProps): React.ReactElement { } function getAugs(): string[] { - console.log(props.faction.augmentations); if (isPlayersGang) { const augs: string[] = []; for (const augName in Augmentations) { diff --git a/src/Faction/ui/Info.tsx b/src/Faction/ui/Info.tsx index 88abe7f6a..3d466dd2d 100644 --- a/src/Faction/ui/Info.tsx +++ b/src/Faction/ui/Info.tsx @@ -44,13 +44,15 @@ export function Info(props: IProps): React.ReactElement { - You will have {Favor(props.faction.favor + favorGain)} faction favor after installing an Augmentation. + <> + + You will have {Favor(props.faction.favor + favorGain)} faction favor after installing an Augmentation. + - + } > Reputation: {Reputation(props.faction.playerReputation)} @@ -62,13 +64,15 @@ export function Info(props: IProps): React.ReactElement { - Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction - favor is gained whenever you install an Augmentation. The amount of favor you gain depends on the total - amount of reputation you earned with this faction. Across all resets. + <> + + Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction + favor is gained whenever you install an Augmentation. The amount of favor you gain depends on the total + amount of reputation you earned with this faction. Across all resets. + - + } > Faction Favor: {Favor(props.faction.favor)} diff --git a/src/Faction/ui/PurchaseableAugmentation.tsx b/src/Faction/ui/PurchaseableAugmentation.tsx index c44a83785..1813265a3 100644 --- a/src/Faction/ui/PurchaseableAugmentation.tsx +++ b/src/Faction/ui/PurchaseableAugmentation.tsx @@ -40,24 +40,29 @@ function Requirements(props: IReqProps): React.ReactElement { const aug = Augmentations[props.augName]; if (!props.hasReq) { return ( - - Requires {aug.prereqs.map((aug) => AugFormat(aug))} + + + Requires{" "} + {aug.prereqs.map((aug, i) => ( + + ))} + ); } - let color = !props.hasRep && !props.hasCost ? "error" : "primary"; + let color = !props.hasRep || !props.hasCost ? "error" : "primary"; return ( - <> - + + - + Requires {Reputation(props.rep)} faction reputation - + ); } @@ -122,38 +127,10 @@ export function PurchaseableAugmentation(props: IProps): React.ReactElement { const repCost = getRepCost(); const hasReq = hasPrereqs(); const hasRep = hasReputation(); - const hasCost = aug.baseCost !== 0 && props.p.money.lt(aug.baseCost * props.faction.getInfo().augmentationPriceMult); + const hasCost = aug.baseCost !== 0 && props.p.money.gt(aug.baseCost * props.faction.getInfo().augmentationPriceMult); // Determine UI properties - let disabled = false; - let status: JSX.Element | null = null; - let color: "primary" | "error" = "primary"; - if (!hasReq) { - disabled = true; - status = <>LOCKED (Requires {aug.prereqs.map((aug) => AugFormat(aug))} as prerequisite); - color = "error"; - } else if (aug.name !== AugmentationNames.NeuroFluxGovernor && (aug.owned || owned())) { - disabled = true; - } else if (hasRep) { - status = ( - <> - UNLOCKED (at {Reputation(repCost)} faction reputation) - - - ); - } else { - disabled = true; - status = ( - <> - LOCKED (Requires {Reputation(repCost)} faction reputation - ) - - ); - color = "error"; - } - - if (hasCost) { - disabled = true; - color = "error"; - } + const color: "error" | "primary" = !hasReq || !hasRep || !hasCost ? "error" : "primary"; // Determine button txt let btnTxt = aug.name; @@ -162,16 +139,16 @@ export function PurchaseableAugmentation(props: IProps): React.ReactElement { } let tooltip = <>; - if (typeof aug.info === "string") + if (typeof aug.info === "string") { tooltip = ( <> - + {aug.info}

{aug.stats} ); - else + } else tooltip = ( <> {aug.info} @@ -182,7 +159,7 @@ export function PurchaseableAugmentation(props: IProps): React.ReactElement { ); function handleClick(): void { - if (disabled) return; + if (color === "error") return; if (!Settings.SuppressBuyAugmentationConfirmation) { const popupId = "purchase-augmentation-popup"; createPopup(popupId, PurchaseAugmentationPopup, { @@ -201,15 +178,13 @@ export function PurchaseableAugmentation(props: IProps): React.ReactElement { return ( {!props.owned && ( - - {status && ( - - )} + + )} - + {tooltip}} @@ -225,6 +200,7 @@ export function PurchaseableAugmentation(props: IProps): React.ReactElement { {!props.owned && ( , document.getElementById("mainmenu-container"), ); + +// setTimeout(() => { +// colors.primary = "#fff"; +// refreshTheme(); +// ReactDOM.render( +// +// +// , +// document.getElementById("mainmenu-container"), +// ); +// }, 5000); diff --git a/src/ui/React/Augmentation.tsx b/src/ui/React/Augmentation.tsx index d4b55936e..6f4135b5e 100644 --- a/src/ui/React/Augmentation.tsx +++ b/src/ui/React/Augmentation.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -export function Augmentation(name: string): JSX.Element { +export function Augmentation({ name }: { name: string }): JSX.Element { return ( {name} diff --git a/src/ui/React/Theme.tsx b/src/ui/React/Theme.tsx index fe01358b5..728d03bb0 100644 --- a/src/ui/React/Theme.tsx +++ b/src/ui/React/Theme.tsx @@ -25,7 +25,7 @@ declare module "@mui/material/styles" { }; } } -export const colors = { +export let colors = { primarylight: "#0f0", primary: "#0c0", primarydark: "#090", @@ -60,235 +60,241 @@ export const colors = { rep: "#faffdf", }; -export const theme = createTheme({ - colors: { - hp: "#dd3434", - money: "#ffd700", - hack: "#adff2f", - combat: "#faffdf", - cha: "#a671d1", - int: "#6495ed", - rep: "#faffdf", - }, - palette: { - primary: { - light: colors.primarylight, - main: colors.primary, - dark: colors.primarydark, +export let theme: Theme; + +export function refreshTheme() { + theme = createTheme({ + colors: { + hp: "#dd3434", + money: "#ffd700", + hack: "#adff2f", + combat: "#faffdf", + cha: "#a671d1", + int: "#6495ed", + rep: "#faffdf", }, - secondary: { - light: colors.secondarylight, - main: colors.secondary, - dark: colors.secondarydark, + palette: { + primary: { + light: colors.primarylight, + main: colors.primary, + dark: colors.primarydark, + }, + secondary: { + light: colors.secondarylight, + main: colors.secondary, + dark: colors.secondarydark, + }, + error: { + light: colors.errorlight, + main: colors.error, + dark: colors.errordark, + }, + info: { + light: colors.infolight, + main: colors.info, + dark: colors.infodark, + }, + warning: { + light: colors.warninglight, + main: colors.warning, + dark: colors.warningdark, + }, + background: { + default: colors.black, + paper: colors.well, + }, }, - error: { - light: colors.errorlight, - main: colors.error, - dark: colors.errordark, + typography: { + fontFamily: "monospace", + button: { + textTransform: "none", + }, }, - info: { - light: colors.infolight, - main: colors.info, - dark: colors.infodark, - }, - warning: { - light: colors.warninglight, - main: colors.warning, - dark: colors.warningdark, - }, - background: { - default: colors.black, - paper: colors.well, - }, - }, - typography: { - fontFamily: "monospace", - button: { - textTransform: "none", - }, - }, - components: { - MuiInputBase: { - styleOverrides: { - root: { - backgroundColor: colors.well, - color: colors.primary, + components: { + MuiInputBase: { + styleOverrides: { + root: { + backgroundColor: colors.well, + color: colors.primary, + }, + input: { + "&::placeholder": { + userSelect: "none", + color: colors.primarydark, + }, + }, }, - input: { - "&::placeholder": { + }, + + MuiInput: { + styleOverrides: { + root: { + backgroundColor: colors.well, + borderBottomColor: "#fff", + }, + underline: { + "&:hover": { + borderBottomColor: colors.primarydark, + }, + "&:before": { + borderBottomColor: colors.primary, + }, + "&:after": { + borderBottomColor: colors.primarylight, + }, + }, + }, + }, + + MuiInputLabel: { + styleOverrides: { + root: { + color: colors.primarydark, // why is this switched? userSelect: "none", - color: colors.primarydark, + "&:before": { + color: colors.primarylight, + }, }, }, }, - }, + MuiButton: { + styleOverrides: { + root: { + backgroundColor: "#333", + border: "1px solid " + colors.well, + // color: colors.primary, + margin: "5px", + padding: "3px 5px", + "&:hover": { + backgroundColor: colors.black, + }, - MuiInput: { - styleOverrides: { - root: { - backgroundColor: colors.well, - borderBottomColor: "#fff", - }, - underline: { - "&:hover": { - borderBottomColor: colors.primarydark, - }, - "&:before": { - borderBottomColor: colors.primary, - }, - "&:after": { - borderBottomColor: colors.primarylight, + borderRadius: 0, }, }, }, - }, - - MuiInputLabel: { - styleOverrides: { - root: { - color: colors.primarydark, // why is this switched? - userSelect: "none", - "&:before": { - color: colors.primarylight, + MuiSelect: { + styleOverrides: { + icon: { + color: colors.primary, }, }, }, - }, - MuiButton: { - styleOverrides: { - root: { - backgroundColor: "#333", - border: "1px solid " + colors.well, - // color: colors.primary, - margin: "5px", - padding: "3px 5px", - "&:hover": { + MuiMenu: { + styleOverrides: { + list: { + backgroundColor: colors.well, + }, + }, + }, + MuiMenuItem: { + styleOverrides: { + root: { + color: colors.primary, + }, + }, + }, + MuiAccordionSummary: { + styleOverrides: { + root: { + backgroundColor: "#111", + }, + }, + }, + MuiAccordionDetails: { + styleOverrides: { + root: { backgroundColor: colors.black, }, - - borderRadius: 0, }, }, - }, - MuiSelect: { - styleOverrides: { - icon: { - color: colors.primary, - }, - }, - }, - MuiMenu: { - styleOverrides: { - list: { - backgroundColor: colors.well, - }, - }, - }, - MuiMenuItem: { - styleOverrides: { - root: { - color: colors.primary, - }, - }, - }, - MuiAccordionSummary: { - styleOverrides: { - root: { - backgroundColor: "#111", - }, - }, - }, - MuiAccordionDetails: { - styleOverrides: { - root: { - backgroundColor: colors.black, - }, - }, - }, - MuiIconButton: { - styleOverrides: { - root: { - color: colors.primary, - }, - }, - }, - MuiTooltip: { - styleOverrides: { - tooltip: { - fontSize: "1em", - color: colors.primary, - backgroundColor: colors.well, - borderRadius: 0, - border: "2px solid white", - maxWidth: "100vh", - }, - }, - }, - MuiSlider: { - styleOverrides: { - valueLabel: { - color: colors.primary, - backgroundColor: colors.well, - }, - }, - }, - MuiDrawer: { - styleOverrides: { - paper: { - "&::-webkit-scrollbar": { - // webkit - display: "none", + MuiIconButton: { + styleOverrides: { + root: { + color: colors.primary, }, - scrollbarWidth: "none", // firefox - backgroundColor: colors.black, }, - paperAnchorDockedLeft: { - borderRight: "1px solid " + colors.welllight, + }, + MuiTooltip: { + styleOverrides: { + tooltip: { + fontSize: "1em", + color: colors.primary, + backgroundColor: colors.well, + borderRadius: 0, + border: "2px solid white", + maxWidth: "100vh", + }, + }, + }, + MuiSlider: { + styleOverrides: { + valueLabel: { + color: colors.primary, + backgroundColor: colors.well, + }, + }, + }, + MuiDrawer: { + styleOverrides: { + paper: { + "&::-webkit-scrollbar": { + // webkit + display: "none", + }, + scrollbarWidth: "none", // firefox + backgroundColor: colors.black, + }, + paperAnchorDockedLeft: { + borderRight: "1px solid " + colors.welllight, + }, + }, + }, + MuiDivider: { + styleOverrides: { + root: { + backgroundColor: colors.welllight, + }, + }, + }, + MuiFormControlLabel: { + styleOverrides: { + root: { + color: colors.primary, + }, + }, + }, + MuiSwitch: { + styleOverrides: { + switchBase: { + color: colors.primarydark, + }, + track: { + backgroundColor: colors.welllight, + }, + }, + }, + MuiPaper: { + styleOverrides: { + root: { + borderRadius: 0, + backgroundColor: colors.black, + border: "1px solid " + colors.welllight, + }, + }, + }, + MuiTablePagination: { + styleOverrides: { + select: { + color: colors.primary, + }, }, }, }, - MuiDivider: { - styleOverrides: { - root: { - backgroundColor: colors.welllight, - }, - }, - }, - MuiFormControlLabel: { - styleOverrides: { - root: { - color: colors.primary, - }, - }, - }, - MuiSwitch: { - styleOverrides: { - switchBase: { - color: colors.primarydark, - }, - track: { - backgroundColor: colors.welllight, - }, - }, - }, - MuiPaper: { - styleOverrides: { - root: { - borderRadius: 0, - backgroundColor: colors.black, - border: "1px solid " + colors.welllight, - }, - }, - }, - MuiTablePagination: { - styleOverrides: { - select: { - color: colors.primary, - }, - }, - }, - }, -}); + }); + console.log("refreshed"); +} +refreshTheme(); interface IProps { children: JSX.Element[] | JSX.Element;