Archives

The Archives scripting namespace contains functions for managing archives.

Functions

all

Returns Archive[]

Returns an array of all currently open archives.


create

Parameters

Returns Archive

Creates a new archive of the format specified in format_id. Returns nil if the archive could not be created (generally if the format_id is invalid).

Note

Currently only wad and zip formats are supported for creation


openFile

Parameters

  • string path: The full path + name of the archive file to open

Returns Archive

Attempts to open the file at path on disk. Returns the archive if it opened successfully, or nil if it could not be opened.

If opening fails, the error that occurred should be available via slade.globalError().


close (1)

Parameters

  • Archive archive: The archive to close

Returns boolean

Closes the given archive. Returns false if archive is invalid or not currently open.


close (2)

Parameters

  • number index: The index of the archive to close

Returns boolean

Closes the archive at index in the list of currently open archives (see all). Returns false if the given index is invalid.


closeAll

Closes all currently open archives.


fileExtensionsString

Returns string

Returns a string with the extension filter for all supported archive file types.

See slade.browseFile and the Open Archive example for more information.


baseResource

Returns Archive

Returns the currently loaded base resource archive.


baseResourcePaths

Returns string[]

Returns an array of configured base resource archive file paths.

TODO

Needs a better description


openBaseResource

Parameters

  • number index: The base resource path index to open

Returns boolean

Opens the base resource archive from the path at index in the list of base resource archive file paths (see baseResourcePaths).

TODO

Needs a better description


programResource

Returns Archive

Returns the program resource archive (either slade.pk3 or the res folder if you are running a dev build).


recentFiles

Returns string[]

Returns an array of file paths to recently opened archives.


bookmarks

Returns ArchiveEntry[]

Returns an array of all currently bookmarked entries.


addBookmark

Parameters

Adds entry as a bookmark.


removeBookmark

Parameters

Returns boolean

Removes entry from the bookmarked entries list. Returns false if the given entry was not currently bookmarked.