Reverted ToastVariant back to an enum internally. Still exposed to player as just possible strings.
Changed all 1-line documentation comments to actually be 1-line. Moved some because they were not providing documentation for the thing they were trying to.
Saved scripts is stored on servers with its starting & trailing whitespace removed, so
comparison would fail and show the file as dirty when there was a
trailing newline in the script.
Found most (hopefully all) places where the error message wording
incorrectly was shown to the tune of 'no script exists', where it should
have been showing to the effect of 'script is not running'.
Also cleaned up some of the consistency in the wording and added a
'helper' export for knowing valid script extensions used in validation
of 'isScriptFilename', so we can have consistent error messaging.
Resolvesdanielyxie/bitburner#1966
For some time now, filenames have included the extension, so there's no need to append ".js" either on a single-file download or zip download.
While I was in the area, I also fixed .txt files in a folder - they had the same bug as scripts used to (appear in the zip as an underscore). I consolidated the code since it was the same for script files and text files.
I also added the ability to download *.js and *.ns (previously only supported *, *.script, and *.txt)
I also made the wildcard matching just a bit more flexible, so if someone really wanted to, they could go "download *blah.js" and get all scripts ending with that pattern ¯\_(ツ)_/¯