mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
merge dev
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export type WordWrapOptions = 'on' | 'off' | 'bounded' | 'wordWrapColumn';
|
||||
export type WordWrapOptions = "on" | "off" | "bounded" | "wordWrapColumn";
|
||||
export interface Options {
|
||||
theme: string;
|
||||
insertSpaces: boolean;
|
||||
|
||||
@@ -235,7 +235,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();
|
||||
@@ -481,7 +481,7 @@ export function Root(props: IProps): React.ReactElement {
|
||||
}
|
||||
try {
|
||||
infLoop(newCode);
|
||||
} catch (err) { }
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
function saveScript(scriptToSave: OpenScript): void {
|
||||
@@ -794,11 +794,11 @@ export function Root(props: IProps): React.ReactElement {
|
||||
setFilter(event.target.value);
|
||||
}
|
||||
function handleExpandSearch(): void {
|
||||
setFilter("")
|
||||
setSearchExpanded(!searchExpanded)
|
||||
setFilter("");
|
||||
setSearchExpanded(!searchExpanded);
|
||||
}
|
||||
const filteredOpenScripts = Object.values(openScripts).filter(
|
||||
(script) => (script.hostname.includes(filter) || script.fileName.includes(filter))
|
||||
(script) => script.hostname.includes(filter) || script.fileName.includes(filter),
|
||||
);
|
||||
|
||||
// Toolbars are roughly 112px:
|
||||
@@ -835,7 +835,7 @@ export function Root(props: IProps): React.ReactElement {
|
||||
}}
|
||||
>
|
||||
<Tooltip title={"Search Open Scripts"}>
|
||||
{searchExpanded ?
|
||||
{searchExpanded ? (
|
||||
<TextField
|
||||
value={filter}
|
||||
onChange={handleFilterChange}
|
||||
@@ -843,33 +843,41 @@ export function Root(props: IProps): React.ReactElement {
|
||||
InputProps={{
|
||||
startAdornment: <SearchIcon />,
|
||||
spellCheck: false,
|
||||
endAdornment: <CloseIcon onClick={handleExpandSearch} />
|
||||
endAdornment: <CloseIcon onClick={handleExpandSearch} />,
|
||||
}}
|
||||
/> : <Button onClick={handleExpandSearch} ><SearchIcon /></Button>}
|
||||
/>
|
||||
) : (
|
||||
<Button onClick={handleExpandSearch}>
|
||||
<SearchIcon />
|
||||
</Button>
|
||||
)}
|
||||
</Tooltip>
|
||||
{filteredOpenScripts.map(({ fileName, hostname }, index) => {
|
||||
const editingCurrentScript = currentScript?.fileName === openScripts[index].fileName &&
|
||||
currentScript?.hostname === openScripts[index].hostname
|
||||
const externalScript = hostname !== 'home'
|
||||
const colorProps = editingCurrentScript ? {
|
||||
background: Settings.theme.button,
|
||||
borderColor: Settings.theme.button,
|
||||
color: Settings.theme.primary
|
||||
} : {
|
||||
background: Settings.theme.backgroundsecondary,
|
||||
borderColor: Settings.theme.backgroundsecondary,
|
||||
color: Settings.theme.secondary
|
||||
}
|
||||
const editingCurrentScript =
|
||||
currentScript?.fileName === filteredOpenScripts[index].fileName &&
|
||||
currentScript?.hostname === filteredOpenScripts[index].hostname;
|
||||
const externalScript = hostname !== "home";
|
||||
const colorProps = editingCurrentScript
|
||||
? {
|
||||
background: Settings.theme.button,
|
||||
borderColor: Settings.theme.button,
|
||||
color: Settings.theme.primary,
|
||||
}
|
||||
: {
|
||||
background: Settings.theme.backgroundsecondary,
|
||||
borderColor: Settings.theme.backgroundsecondary,
|
||||
color: Settings.theme.secondary,
|
||||
};
|
||||
|
||||
if (externalScript) {
|
||||
colorProps.color = Settings.theme.info
|
||||
colorProps.color = Settings.theme.info;
|
||||
}
|
||||
const iconButtonStyle = {
|
||||
maxWidth: `${tabIconWidth}px`,
|
||||
minWidth: `${tabIconWidth}px`,
|
||||
minHeight: "38.5px",
|
||||
maxHeight: "38.5px",
|
||||
...colorProps
|
||||
...colorProps,
|
||||
};
|
||||
|
||||
const scriptTabText = `${hostname}:~/${fileName} ${dirty(index)}`;
|
||||
@@ -902,7 +910,7 @@ export function Root(props: IProps): React.ReactElement {
|
||||
}}
|
||||
style={{
|
||||
maxWidth: `${tabTextWidth}px`,
|
||||
minHeight: '38.5px',
|
||||
minHeight: "38.5px",
|
||||
overflow: "hidden",
|
||||
...colorProps,
|
||||
}}
|
||||
|
||||
@@ -260,7 +260,6 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
token: "ns",
|
||||
foreground: "FFB86C",
|
||||
fontStyle: "italic",
|
||||
|
||||
},
|
||||
{
|
||||
token: "netscriptfunction",
|
||||
@@ -273,7 +272,7 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
{
|
||||
token: "type.identifier.js",
|
||||
foreground: "7EE9FD",
|
||||
fontStyle: "italic"
|
||||
fontStyle: "italic",
|
||||
},
|
||||
{
|
||||
token: "delimiter.square.js",
|
||||
@@ -281,7 +280,7 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
},
|
||||
{
|
||||
token: "delimiter.parenthesis.js",
|
||||
foreground: "FFD709"
|
||||
foreground: "FFD709",
|
||||
},
|
||||
{
|
||||
token: "delimiter.bracket.js",
|
||||
@@ -293,7 +292,7 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
fontStyle: "italic",
|
||||
},
|
||||
],
|
||||
"colors": {
|
||||
colors: {
|
||||
"editor.foreground": "#F8F8F2",
|
||||
"editor.background": "#282A36",
|
||||
"editorLineNumber.foreground": "#6272A4",
|
||||
@@ -402,6 +401,6 @@ export async function loadThemes(monaco: { editor: any }): Promise<void> {
|
||||
"scrollbarSlider.background": "#4E566680",
|
||||
"scrollbarSlider.activeBackground": "#747D9180",
|
||||
"scrollbarSlider.hoverBackground": "#5A637580",
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user