public override void ControlPressed(Input.Controls control) { if (hovered && control == Input.Controls.LeftClick) { Select(); } }
public override void ControlPressed(Input.Controls control) { if (hovered && control == Input.Controls.LeftClick) { state = ButtonState.Pressed; } }
public override void ControlPressed(Input.Controls control) { if (!hovered && (control == Input.Controls.LeftClick || control == Input.Controls.RightClick)) //TODO: more ways to close this, like ESC { Close(); } }
public override void ControlReleased(Input.Controls control) { if (control == Input.Controls.RightClick) { panning = false; } if (control == Input.Controls.EditorErase) { eraseMode = false; } }
public override void ControlPressed(Input.Controls control) { if (hovered) { if (control == Input.Controls.ScrollUp) { ScrollUp(); } else if (control == Input.Controls.ScrollDown) { ScrollDown(); } } }
public override void ControlReleased(Input.Controls control) { if (control == Input.Controls.LeftClick) { //Only perform the action if this is the same button that was pressed initially, otherwise just release if (state == ButtonState.Pressed) { clickAction(); state = ButtonState.Hovered; } else if (state == ButtonState.DraggedAway) { state = ButtonState.None; } } }
public override void ControlHeld(Input.Controls control) { if (hovered) { if (control == Input.Controls.LeftClick) { if (eraseMode) { EraseBlock(GetHoveredBlockPos(), editor.IsBackground()); } else { SelectableBlock selectedBlock = editor.GetSelectedBlock(); if (selectedBlock != null) { SetBlock(GetHoveredBlockPos(), selectedBlock.GetBlock(), editor.IsBackground()); editor.MarkChanged(); } } } } }
public override void ControlPressed(Input.Controls control) { if (hovered) { if (control == Input.Controls.RightClick) { panning = true; } else if (control == Input.Controls.EditorPickBlock) { StructureBlockInfo blockInfo = GetHoveredBlockInfo(); if (blockInfo.block != null) { editor.SetSelectedBlock(blockInfo.block.name); } } } if (control == Input.Controls.EditorErase) { eraseMode = true; } }
/// <summary> /// Called when the control is released (anywhere on the screen). /// In many cases, should be ignored if !this.hovered. /// </summary> /// <param name="control">The control that was released.</param> public virtual void ControlReleased(Input.Controls control) { }
/// <summary> /// Called when the control is held down (anywhere on the screen). /// In many cases, should be ignored if !this.hovered. /// </summary> /// <param name="control">The control that was held.</param> public virtual void ControlHeld(Input.Controls control) { }
/// <summary> /// Called when the control is pressed (anywhere on the screen). /// In many cases, should be ignored if !this.hovered. /// </summary> /// <param name="control">The control that was pressed.</param> public virtual void ControlPressed(Input.Controls control) { }