mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 09:43:54 +01:00
UI: cat
: proper line breaks when showing .js, .script, or .txt files (#192)
Currently, the HTML line break sequence `<br /><br />` is hardcoded into the dialog box message when showing the content of these file types: ".js", ".script", and ".txt". By default, the function `dialogBoxCreate()` currently assumes that its first parameter is not HTML, but a text string, so whatever is in the string will appear in the dialog box. Use the newline character instead for line break.
This commit is contained in:
parent
6ac04717fe
commit
55b2cbb549
@ -49,7 +49,7 @@ export function cat(args: (string | number | boolean)[], server: BaseServer): vo
|
||||
} else if (filename.endsWith(".script") || filename.endsWith(".js")) {
|
||||
const script = Terminal.getScript(relative_filename);
|
||||
if (script != null) {
|
||||
dialogBoxCreate(`${script.filename}<br /><br />${script.code}`);
|
||||
dialogBoxCreate(`${script.filename}\n\n${script.code}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ export class TextFile {
|
||||
|
||||
/** Shows the content to the user via the game's dialog box. */
|
||||
show(): void {
|
||||
dialogBoxCreate(`${this.fn}<br /><br />${this.text}`);
|
||||
dialogBoxCreate(`${this.fn}\n\n${this.text}`);
|
||||
}
|
||||
|
||||
/** Serialize the current file to a JSON save state. */
|
||||
|
Loading…
Reference in New Issue
Block a user