ToolManager class
#include <Jazz2/Editor/Tools/EditorTool.h>
Keeps the tools and which of them is used.
A tool can be chosen for a while only, as the hand while Space is held, after which the one used before comes back.
Constructors, destructors, conversion operators
- ToolManager(IToolHost& host) explicit
- Creates all tools.
- ~ToolManager()
Public functions
- auto GetActive() const -> EditorTool*
- Returns the tool in use.
- auto GetActiveType() const -> EditorToolType
- Returns the type of the tool in use.
- auto GetChosenType() const -> EditorToolType
- Returns the type of the tool chosen, not just for a while.
- void SetActive(EditorToolType type)
- Chooses a tool.
- void BeginTemporary(EditorToolType type)
- Uses a tool for a while.
- void EndTemporary(EditorToolType type)
- Returns to the tool used before the one used for a while.
- auto Get(EditorToolType type) const -> EditorTool*
- Returns a tool.
- auto GetSettings() -> ToolSettings&
- Returns the options shared by the tools.
Public variables
- Function<void(EditorToolType)> OnChosen
- Called whenever a tool is chosen by SetActive(), the same one again too, not for a tool used for a while.