Skip to content

Editor Manager

Zay Arriaga edited this page Jun 11, 2026 · 11 revisions

System Summary

The Editor State is where a user can make any changes to their level, whether placing tiles and objects, adjusting object properties, or exporting the level data.

The EditorManager script controls all of these functions, as it is attached to a Node2D that parents all the constituent nodes and receives signals from the UI components.


Connected Systems

List of connecting/parent/subsystems.

Connecting Systems:

Subsystems:


Related Controls

List of related controls.

While the Editor Manager does not have any controls itself, controls related to tools and modifying the grid are under Tool Manager, whereas hotkeys for switching tools are under Hokey Manager.


Bugs

List of known bugs. Be descriptive but keep it brief!

  • Notes.

Feature List / Breakdown of Features

  • Tool Manager: Different tools can be selected with different functionalities. The Brush and Box Brush tools are used to easily place down different tiles, while the Cursor tool is used to place, edit, and move entities.
    • Tile Manager: Manages the Brush and Box Brush tools, specifically how they place and delete tiles.
    • Entity Manager: Manages the Cursor tool, and how it places, deletes, moves, and opens up the editing menu for properties of entities.
  • Grid Lines Manager: Fills in the grid line TileMapLayer dynamically with grid line tiles. This scales with the world size.
  • Preview Manager: Shows a preview to the user when they have a tool and object selected, so that they can easily see where the object they are placing will go.
    • Preview tiles will fill the entire highlighted area when using the box brush.
    • Appears with a red modulate if on an invalid placement area, following these conditions:
      • Being out of bounds
      • Hovering over an entity with the brush tool
      • Hovering over a tile with the cursor tool
    • Entities are not highlighted when inside a box brush preview area.
  • Custom Cursor Manager: Handles the different custom cursors that replace the default cursor when in different states. A brush when using the Brush tool, a brush with a box when using the Box Brush tool, or a cursor when using the Cursor tool.
  • Hotkey Manager: Allows the user to easily swap tools or objects based on the hotkey they press. Switching objects is as easy as using the number keys, while switching tools is easy as using Z, X, or C.

Important Variables

Name the most important variables, their type, and what their purpose is

  • tileSet : TileMapLayer = A reference to the main tile set and tile map, where objects are placed in.

  • previewTileSet: TileMapLayer = A reference to the tile set and tile map, where previews of placements of objects are shown.

  • isValidated: bool = A boolean that tells whether the level has been validated (beaten) as it currently is.

  • isPlaceable: bool = A boolean that tells whether the currently highlighted cell can be placed within.

  • playerExists: bool = A boolean that tells whether the player exists in the editing scene.

  • goalExists: bool = A boolean that tells whether a goal exists in the editing scene.

Important Functions

Name of the most important functions, their parameters, and what they do.

  • func change_current_hotbar(newState: Global.HotbarState) -> void: Changes the object hotbar.

  • func get_grid_mouse_position(mousePosition: Vector2) -> Vector2: Returns a Vector2 of the current cell the mouse is in.

  • func check_out_of_bounds(mousePosition: Vector2i) -> bool: Returns whether the mouse is considered out of bounds of the grid.

  • func open_asset_manager() -> void: Opens up the asset manager, and pauses the editing scene.


Future Work / Risks

List and description of upcoming work/risks.

Future Work: 2. None at the moment, but more managers under Editor Manager may be added as needed.

Risks:

  • The Tile types are distinguished by an atlas source ID. This must be in synchronization with the global TileType enumerator. Desync issues may result otherwise.

Miscellaneous Notes

A place for miscellaneous notes pertaining to this system.

  • None.

Clone this wiki locally