diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index 00e71e36a..249da8f36 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -34,6 +34,7 @@ import Link from "@mui/material/Link"; import Box from "@mui/material/Box"; import SettingsIcon from "@mui/icons-material/Settings"; import SyncIcon from '@mui/icons-material/Sync'; +import CloseIcon from '@mui/icons-material/Close'; import Table from "@mui/material/Table"; import TableCell from "@mui/material/TableCell"; import TableRow from "@mui/material/TableRow"; @@ -42,6 +43,7 @@ import { PromptEvent } from "../../ui/React/PromptManager"; import { Modal } from "../../ui/React/Modal"; import libSource from "!!raw-loader!../NetscriptDefinitions.d.ts"; +import { Tooltip } from "@mui/material"; interface IProps { // Map of filename -> code @@ -700,7 +702,7 @@ export function Root(props: IProps): React.ReactElement { if (openScript.code !== serverScriptCode) { PromptEvent.emit({ - txt: "Do you want to overwrite " + openScript.fileName + " with the contents saved on the server?", + txt: "Do you want to overwrite " + openScript.fileName + " with the contents saved on the server? This cannot be undone.", resolve: (result: boolean) => { if (result) { // Save changes @@ -718,7 +720,6 @@ export function Root(props: IProps): React.ReactElement { updateRAM(openScript.code); editorRef.current.focus(); } - rerender(); } }, }); @@ -773,79 +774,74 @@ export function Root(props: IProps): React.ReactElement { overflowX: "scroll", }} > - {openScripts.map(({ fileName, hostname }, index) => ( - - {(provided) => ( -
- - - -
- )} -
- ))} + style={{ + ...(currentScript?.fileName === openScripts[index].fileName ? { + background: Settings.theme.button, + borderColor: Settings.theme.button, + color: Settings.theme.primary + } : { + background: Settings.theme.backgroundsecondary, + borderColor: Settings.theme.backgroundsecondary, + color: Settings.theme.secondary + }) + }} + > + {hostname}:~/{fileName} {dirty(index)} + + + + + + + )} + + ) + })} {provided.placeholder} )}