The slade scripting namespace contains a set of functions for general interaction with the SLADE application.
logMessage
Parameters
stringmessage: The message to print to the log
Writes a message to the SLADE log.
Example
slade.logMessage('This is a log message')
globalError
Returns string
Returns the most recently generated error message
messageBox
Parameters
stringtitle: The dialog captionstringmessage: The message to display
Shows a simple message dialog
promptString
Parameters
stringtitle: The dialog captionstringmessage: The message to displaystringdefaultValue: The initial default value
Returns string
Shows a dialog prompt for the user to enter a string value
promptNumber
Parameters
stringtitle: The dialog captionstringmessage: The message to displaynumberdefaultValue: The initial default valuenumbermin: The minimum value allowednumbermax: The maximum value allowed
Returns number
Shows a dialog prompt for the user to enter a numeric value
promptYesNo
Parameters
stringtitle: The dialog captionstringmessage: The message to display
Returns boolean
Shows a dialog prompt with 'Yes' and 'No' buttons, returning true for yes or false for no
browseFile
Parameters
stringtitle: The dialog captionstringextensions: A formatted list of selectable file extensions (see description for format)stringfilename: The name of the file to browse for
Returns string
Shows a file browser dialog allowing the user to select a file and returns the full path to the selected file. If no file was selected it will return an empty string.
The extensions parameter must be in the following format:
<Type Name 1>|<Extension 1>|<Type Name 2>|<Extension 2>|...
Where <Type Name X> is the name to display in the type selection dropdown, and <Extension> is the wildcard file extension for that type
Example
local path = slade.browseFile('Select a File', 'Wad Files (*.wad)|*.wad|All Files|*.*', '')
slade.logMessage('Selected file ' .. path)
browseFiles
Parameters
stringtitle: The dialog captionstringextensions: A formatted list of selectable file extensions
Returns string array
Shows a file browser dialog allowing the user to select multiple files and returns an array of full paths to the selected files. If no file was selected it will return an empty array. See browseFile above for the formatting of the extensions parameter.
currentArchive
Returns Archive
Returns the archive for the currently open tab in the main SLADE window.
currentEntry
Returns ArchiveEntry
Returns the currently open entry in the main SLADE window.
currentEntrySelection
Returns ArchiveEntry array
Returns an array of the currently selected entries in the main SLADE window.
showArchive
Parameters
Archivearchive: The archive to show
Shows the tab for the given archive in the main SLADE window.
showEntry
Parameters
ArchiveEntryentry: The entry to show
Shows the given entry in a tab in the main SLADE window.
Latest Release: 3.2.4
Home | Downloads | Tutorials | Wiki Index | SLADE Homepage