Class LotTool
A tool is a type of game mode that is currently active. Tools are split up into the PlayModeTool and BuildTools, the latter of which holds all tools that can be found in the build menu.
public class LotTool : Tool
- Inheritance
-
LotTool
- Inherited Members
- Extension Methods
Constructors
LotTool()
public LotTool()
Methods
CanUndoRedo(bool)
Returns whether or not the UndoRedoStack can currently operate and thus, whether the Undo() or Redo() actions can be called.
public override bool CanUndoRedo(bool cursorOnUi)
Parameters
cursorOnUibool
Returns
- bool
Whether the undo or redo commands can be used right now.
Closed()
Called when this build tool is closed. By default, this method removes its elements from the ui.
public override void Closed()
Draw(GameTime, SpriteBatch, bool)
This method is called every draw frame for the CurrentTool. By default, this method invokes OnDraw.
public override void Draw(GameTime time, SpriteBatch batch, bool cursorOnUi)
Parameters
timeGameTimeThe game's time
batchSpriteBatchThe sprite batch used for drawing
cursorOnUiboolWhether the cursor is currently covering the ui.
InitBuildModeUi(Panel, Panel)
Override this method to add custom content to the passed ui elements. By default, this method does nothing.
protected override void InitBuildModeUi(Panel content, Panel zoom)
Parameters
contentPanelThe main content panel. Add custom BuildModeButton(string, string, GenericCallback, DrawCallback, float, IEnumerable<TextureRegion>, string, IEnumerable<string>, float?) instances here.
zoomPanelThe zoom panel that contains ColorSelection(ColorSettings, Action<int, int>, Func<int, int, bool>, LnCategory) and object previews
OnButtonCreated(Button)
A method that is called when this tool's build mode button is created.
public override void OnButtonCreated(Button button)
Parameters
buttonButtonThe button that was created.
ShouldHighlightSelectedObject(object)
Whether or not the selected object should currently have a white highlight around it. This method defaults to return true if IsCursorOnUi() is false.
public override bool ShouldHighlightSelectedObject(object obj)
Parameters
Returns
- bool
Whether or not the selected object should be highlighted
Update(GameTime, bool)
This method is called every update frame for the CurrentTool. By default, this method updates the MousePos and invokes OnUpdate, and also manages the UndoRedoStack.
public override void Update(GameTime time, bool cursorOnUi)
Parameters
timeGameTimeThe game's time
cursorOnUiboolWhether the cursor is currently covering the ui.