From 62331af141f97bb90c84395ac0d1db98ea2f94a4 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Thu, 10 Mar 2022 22:43:01 -0600 Subject: [PATCH 1/6] Properly expand gang equipment cards to fill entire screen --- src/Gang/ui/EquipmentsSubpage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gang/ui/EquipmentsSubpage.tsx b/src/Gang/ui/EquipmentsSubpage.tsx index b2f53c0d8..5c057eed7 100644 --- a/src/Gang/ui/EquipmentsSubpage.tsx +++ b/src/Gang/ui/EquipmentsSubpage.tsx @@ -273,7 +273,7 @@ export function EquipmentsSubpage(): React.ReactElement { sx={{ m: 1, width: '15%' }} /> - + {members.map((member: GangMember) => ( ))} From a1b3dddf9ef2fefc823d4ac827f2f0a87b5704c6 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Fri, 11 Mar 2022 11:10:28 -0600 Subject: [PATCH 2/6] Add minHeight to editor tabs --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 37 ++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index 2093f0af0..9851c6d7f 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -232,7 +232,7 @@ export function Root(props: IProps): React.ReactElement { MonacoVim.VimMode.Vim.mapCommand("gT", "action", "prevTabs", {}, { context: "normal" }); editor.focus(); }); - } catch {} + } catch { } } else if (!options.vim) { // Whem vim mode is disabled vimEditor?.dispose(); @@ -478,7 +478,7 @@ export function Root(props: IProps): React.ReactElement { } try { infLoop(newCode); - } catch (err) {} + } catch (err) { } } function saveScript(scriptToSave: OpenScript): void { @@ -829,15 +829,15 @@ export function Root(props: IProps): React.ReactElement { maxHeight: "38.5px", ...(currentScript?.fileName === openScripts[index].fileName ? { - background: Settings.theme.button, - borderColor: Settings.theme.button, - color: Settings.theme.primary, - } + background: Settings.theme.button, + borderColor: Settings.theme.button, + color: Settings.theme.primary, + } : { - background: Settings.theme.backgroundsecondary, - borderColor: Settings.theme.backgroundsecondary, - color: Settings.theme.secondary, - }), + background: Settings.theme.backgroundsecondary, + borderColor: Settings.theme.backgroundsecondary, + color: Settings.theme.secondary, + }), }; const scriptTabText = `${hostname}:~/${fileName} ${dirty(index)}`; @@ -870,18 +870,19 @@ export function Root(props: IProps): React.ReactElement { }} style={{ maxWidth: `${tabTextWidth}px`, + minHeight: '38.5px', overflow: "hidden", ...(currentScript?.fileName === openScripts[index].fileName ? { - background: Settings.theme.button, - borderColor: Settings.theme.button, - color: Settings.theme.primary, - } + background: Settings.theme.button, + borderColor: Settings.theme.button, + color: Settings.theme.primary, + } : { - background: Settings.theme.backgroundsecondary, - borderColor: Settings.theme.backgroundsecondary, - color: Settings.theme.secondary, - }), + background: Settings.theme.backgroundsecondary, + borderColor: Settings.theme.backgroundsecondary, + color: Settings.theme.secondary, + }), }} > From 30776e5aca8d2b0b4025747420f5d815f66404eb Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Fri, 11 Mar 2022 15:19:10 -0500 Subject: [PATCH 3/6] added arcade --- src/Arcade/ui/ArcadeRoot.tsx | 43 +++++++ src/Arcade/ui/BBCabinet.tsx | 52 ++++++++ src/Locations/Locations.ts | 8 +- src/Locations/data/LocationNames.ts | 1 + src/Locations/data/LocationsMetadata.ts | 5 + src/Locations/ui/City.tsx | 7 +- src/Locations/ui/SpecialLocation.tsx | 11 +- src/ui/GameRoot.tsx | 153 +++++++----------------- 8 files changed, 161 insertions(+), 119 deletions(-) create mode 100644 src/Arcade/ui/ArcadeRoot.tsx create mode 100644 src/Arcade/ui/BBCabinet.tsx diff --git a/src/Arcade/ui/ArcadeRoot.tsx b/src/Arcade/ui/ArcadeRoot.tsx new file mode 100644 index 000000000..efb1f92d9 --- /dev/null +++ b/src/Arcade/ui/ArcadeRoot.tsx @@ -0,0 +1,43 @@ +import React, { useState } from "react"; +import { BBCabinetRoot } from "./BBCabinet"; + +import Button from "@mui/material/Button"; +import { use } from "../../ui/Context"; +import { AlertEvents } from "../../ui/React/AlertManager"; + +enum Page { + None, + Megabyteburner2000, +} + +export function ArcadeRoot(): React.ReactElement { + const player = use.Player(); + const [page, setPage] = useState(Page.None); + + function mbBurner2000(): void { + if (player.sourceFileLvl(1) === 0) { + AlertEvents.emit("This machine is broken."); + } else { + setPage(Page.Megabyteburner2000); + } + } + + if (page === Page.None) { + return ( + <> + + + ); + } + let currentGame = <>; + switch (page) { + case Page.Megabyteburner2000: + currentGame = ; + } + return ( + <> + + {currentGame} + + ); +} diff --git a/src/Arcade/ui/BBCabinet.tsx b/src/Arcade/ui/BBCabinet.tsx new file mode 100644 index 000000000..d88d7b61b --- /dev/null +++ b/src/Arcade/ui/BBCabinet.tsx @@ -0,0 +1,52 @@ +import React from "react"; +import Typography from "@mui/material/Typography"; + +const metaBB = "https://bitburner-official.github.io/bitburner-legacy/"; + +const style = { + width: "1060px", + height: "800px", + border: "0px", +} as any; + +export function BBCabinetRoot(): React.ReactElement { + // prettier-ignore + const joystick = + <> + + ,'" "', .-. + / \ ( ) + | | .-. '-' .-. + \ / ( ) ( ) + '.___.' '-' .-. '-' + ||| ( ) + ||| '-' + ; + return ( + <> +
+