From 0359229af6730709c44babc8112870e8f48b0cae Mon Sep 17 00:00:00 2001 From: nickofolas Date: Fri, 14 Jan 2022 23:12:16 -0600 Subject: [PATCH] Grid-align buttons in location UIs (and options) --- src/Locations/ui/CasinoLocation.tsx | 8 +- src/Locations/ui/CompanyLocation.tsx | 206 ++++++++++++------------ src/Locations/ui/GymLocation.tsx | 5 +- src/Locations/ui/SlumsLocation.tsx | 17 +- src/Locations/ui/TechVendorLocation.tsx | 5 +- src/Locations/ui/UniversityLocation.tsx | 10 +- src/ui/React/GameOptionsRoot.tsx | 16 +- 7 files changed, 130 insertions(+), 137 deletions(-) diff --git a/src/Locations/ui/CasinoLocation.tsx b/src/Locations/ui/CasinoLocation.tsx index 20992695e..096946b17 100644 --- a/src/Locations/ui/CasinoLocation.tsx +++ b/src/Locations/ui/CasinoLocation.tsx @@ -10,6 +10,7 @@ import { CoinFlip } from "../../Casino/CoinFlip"; import { Roulette } from "../../Casino/Roulette"; import { SlotMachine } from "../../Casino/SlotMachine"; import { IPlayer } from "../../PersonObjects/IPlayer"; +import { Box } from "@mui/material"; enum GameType { None = "none", @@ -33,15 +34,12 @@ export function CasinoLocation(props: IProps): React.ReactElement { return ( <> {game === GameType.None && ( - <> + -
-
-
- +
)} {game !== GameType.None && ( <> diff --git a/src/Locations/ui/CompanyLocation.tsx b/src/Locations/ui/CompanyLocation.tsx index 04fee9754..1a7ab0130 100644 --- a/src/Locations/ui/CompanyLocation.tsx +++ b/src/Locations/ui/CompanyLocation.tsx @@ -226,108 +226,114 @@ export function CompanyLocation(props: IProps): React.ReactElement { -------------------------
- -      - - setQuitOpen(false)} - /> )} -
- {company.hasAgentPositions() && ( - - )} - {company.hasBusinessConsultantPositions() && ( - - )} - {company.hasBusinessPositions() && ( - - )} - {company.hasEmployeePositions() && ( - - )} - {company.hasEmployeePositions() && ( - - )} - {company.hasITPositions() && ( - - )} - {company.hasSecurityPositions() && ( - - )} - {company.hasSoftwareConsultantPositions() && ( - - )} - {company.hasSoftwarePositions() && ( - - )} - {company.hasWaiterPositions() && ( - - )} - {company.hasWaiterPositions() && ( - - )} - {location.infiltrationData != null && } + + {isEmployedHere && ( + + + + setQuitOpen(false)} + /> + + ) + + } + {company.hasAgentPositions() && ( + + )} + {company.hasBusinessConsultantPositions() && ( + + )} + {company.hasBusinessPositions() && ( + + )} + {company.hasEmployeePositions() && ( + + )} + {company.hasEmployeePositions() && ( + + )} + {company.hasITPositions() && ( + + )} + {company.hasSecurityPositions() && ( + + )} + {company.hasSoftwareConsultantPositions() && ( + + )} + {company.hasSoftwarePositions() && ( + + )} + {company.hasWaiterPositions() && ( + + )} + {company.hasWaiterPositions() && ( + + )} + {location.infiltrationData != null && } + ); } diff --git a/src/Locations/ui/GymLocation.tsx b/src/Locations/ui/GymLocation.tsx index 5cffad7a3..cb8f6ca87 100644 --- a/src/Locations/ui/GymLocation.tsx +++ b/src/Locations/ui/GymLocation.tsx @@ -16,6 +16,7 @@ import { Server } from "../../Server/Server"; import { Money } from "../../ui/React/Money"; import { IRouter } from "../../ui/Router"; import { serverMetadata } from "../../Server/data/servers"; +import { Box } from "@mui/material"; type IProps = { loc: Location; @@ -56,7 +57,7 @@ export function GymLocation(props: IProps): React.ReactElement { const cost = CONSTANTS.ClassGymBaseCost * calculateCost(); return ( - <> + @@ -72,6 +73,6 @@ export function GymLocation(props: IProps): React.ReactElement { - + ); } diff --git a/src/Locations/ui/SlumsLocation.tsx b/src/Locations/ui/SlumsLocation.tsx index 79f5e274d..4072be4ff 100644 --- a/src/Locations/ui/SlumsLocation.tsx +++ b/src/Locations/ui/SlumsLocation.tsx @@ -11,6 +11,7 @@ import { Crimes } from "../../Crime/Crimes"; import { numeralWrapper } from "../../ui/numeralFormat"; import { use } from "../../ui/Context"; +import { Box } from "@mui/material"; export function SlumsLocation(): React.ReactElement { const player = use.Player(); @@ -113,73 +114,61 @@ export function SlumsLocation(): React.ReactElement { const heistChance = Crimes.Heist.successRate(player); return ( - <> + Attempt to shoplift from a low-end retailer}> -
Attempt to commit armed robbery on a high-end store}> -
Attempt to mug a random person on the street}> -
Attempt to rob property from someone's house}> -
Attempt to deal drugs}> -
Attempt to forge corporate bonds}> -
Attempt to smuggle illegal arms into the city}> -
Attempt to murder a random person on the street}> -
Attempt to commit grand theft auto}> -
Attempt to kidnap and ransom a high-profile-target}> -
Attempt to assassinate a high-profile target}> -
Attempt to pull off the ultimate heist}> -
- +
); } diff --git a/src/Locations/ui/TechVendorLocation.tsx b/src/Locations/ui/TechVendorLocation.tsx index fe5e373ec..b301773d9 100644 --- a/src/Locations/ui/TechVendorLocation.tsx +++ b/src/Locations/ui/TechVendorLocation.tsx @@ -18,6 +18,7 @@ import { Money } from "../../ui/React/Money"; import { use } from "../../ui/Context"; import { PurchaseServerModal } from "./PurchaseServerModal"; import { numeralWrapper } from "../../ui/numeralFormat"; +import { Box } from "@mui/material"; interface IServerProps { ram: number; @@ -70,7 +71,9 @@ export function TechVendorLocation(props: IProps): React.ReactElement { return ( <>
- {purchaseServerButtons} + + {purchaseServerButtons} +
"You can order bigger servers via scripts. We don't take custom orders in person." diff --git a/src/Locations/ui/UniversityLocation.tsx b/src/Locations/ui/UniversityLocation.tsx index 26f8188cc..fd65fa62c 100644 --- a/src/Locations/ui/UniversityLocation.tsx +++ b/src/Locations/ui/UniversityLocation.tsx @@ -15,6 +15,7 @@ import { Server } from "../../Server/Server"; import { Money } from "../../ui/React/Money"; import { use } from "../../ui/Context"; +import { Box } from "@mui/material"; type IProps = { loc: Location; @@ -72,45 +73,40 @@ export function UniversityLocation(props: IProps): React.ReactElement { const earnCharismaExpTooltip = `Gain charisma experience!`; return ( - <> + -
-
-
-
-
- +
); } diff --git a/src/ui/React/GameOptionsRoot.tsx b/src/ui/React/GameOptionsRoot.tsx index c93b8cadb..432f160e6 100644 --- a/src/ui/React/GameOptionsRoot.tsx +++ b/src/ui/React/GameOptionsRoot.tsx @@ -529,19 +529,19 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { )} - - + + - + Export your game to a text file.
}> - Import your game from a text file.
This will overwrite your current game. Back it up first!}> + Import your game from a text file.
This will overwrite your current game. Back it up first!}>
- + @@ -613,7 +613,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { - + @@ -637,7 +637,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { Incremental game plaza - + setDiagnosticOpen(false)} />