MapEditor

Map editing context for the currently open map editor in SLADE.

Properties

Property Type Description
editMode number The current edit mode (see Mode)
sectorEditMode number The current sector edit mode (see SectorMode)
gridSize number The current grid size
map Map The map associated with this editor

Enumerations

Mode

Values: Vertices, Lines, Sectors, Things, Visual

SectorMode

Values: Both, Floor, Ceiling

Constructors

No Constructors

This type can not be created directly in scripts.

Functions

selectedVertices

Parameters

  • [boolean try_highlight : false]: Whether to get the current highlight if nothing is selected

Returns MapVertex[]

Returns an array of all currently selected vertices. If nothing is selected and try_highlight is true, the currently highlighted vertex is returned in the array.


selectedLines

Parameters

  • [boolean try_highlight : false]: Whether to get the current highlight if nothing is selected

Returns MapLine[]

Returns an array of all currently selected lines. If nothing is selected and try_highlight is true, the currently highlighted line is returned in the array.


selectedSectors

Parameters

  • [boolean try_highlight : false]: Whether to get the current highlight if nothing is selected

Returns MapSector[]

Returns an array of all currently selected sectors. If nothing is selected and try_highlight is true, the currently highlighted sector is returned in the array.


selectedThings

Parameters

  • [boolean try_highlight : false]: Whether to get the current highlight if nothing is selected

Returns MapThing[]

Returns an array of all currently selected things. If nothing is selected and try_highlight is true, the currently highlighted thing is returned in the array.


clearSelection

Deselects all currently selected items


select

Parameters

  • MapObject object: The MapObject to (de)select
  • [boolean select : true]: Whether to select or deselect the object

Selects or deselects the given MapObject (or derived type), depending on select.


setEditMode

Parameters

  • number mode: The edit mode to switch to
  • [number sector_mode : MapEditor.SectorMode.Both]: The sector edit mode to switch to

Sets the edit mode to the given mode. If the mode is being set to MapEditor.Mode.Sectors, the sector_mode parameter can be given to specify the sector edit mode.