App
The App
scripting namespace contains a set of functions for general interaction with the SLADE application.
Functions
Overview
Logging
Editor
LogMessage
Writes a message to the SLADE log.
Parameters
message (string ): The message to print to the log
Example
App.LogMessage('This is a log message')
LogWarning
Writes a warning message to the SLADE log. Warning messages are displayed in a yellow colour in the console log window.
Parameters
message (string ): The message to print to the log
LogError
Writes an error message to the SLADE log. Error messages are displayed in a red colour in the console log window.
Parameters
message (string ): The message to print to the log
CurrentArchive
Gets the archive for the currently open tab in the main SLADE window.
Returns
Archive : The archive for the currently open tab in the main SLADE window
CurrentEntry
Gets the currently open entry in the main SLADE window.
Returns
ArchiveEntry : The currently open entry in the main SLADE window
CurrentEntrySelection
Gets the currently selected entries in the main SLADE window.
Returns
ArchiveEntry[] : An array of the currently selected entries in the main SLADE window
CurrentPalette
Gets the current palette.
Parameters
[entryFor] (ArchiveEntry ): If given, the appropriate palette for this entry will be found (if 'Existing/Global' is selected). Default isnil
Returns
Palette : The currently selected palette
Notes
If 'Existing/Global' is selected in the main window palette dropdown, this will return the palette from the currently selected base resource archive. Additionally, if PLAYPAL
as its palette, and return the appropriate palette instead.
ShowArchive
Shows the tab for the given
Parameters
archive (Archive ): The archive to show
ShowEntry
Shows the given
Parameters
entry (ArchiveEntry ): The entry to show
MapEditor
Gets the currently open map editor (if any).
Returns
MapEditor : The currently open map editor