Files
RobustToolbox/Robust.Client/Interfaces/UserInterface/IUserInterfaceManager.cs
ShadowCommander a8d6c294ab Input System Refactor (#840)
* Fixes right click menu stopping input

Removed a flag change when the modal stack was showing, which preventing the click from getting passed to the next function.

* Added parsing for mod2 and mod3 from Keybind YAML

* Fixes a crash on context change when a keybind is not defined in keybinds.yml

* Implemented ShowDebugConsole Hotkey

* Refactored input system

Refactored input system to run Key and Mouse input through the InputManager before doing stuff.

* Upgraded LineEdit and classes that use it. Fixed input while KeyboardFocused.

Upgraded LineEdit to use Keybinds.
Upgraded DebugConsole to use Keybinds.
Replaced all references to MouseDown, MouseUp, KeyDown, and KeyUp with KeyBindUp and KeyBindDown.
Moved UserInterfaceManager call from GameController.Input to InputManager event.
Stopped input going to simulation while a control has focus in UserInterfaceManager.

* Some fixes for input system

Fixed keybinds getting stuck when selecting a LineEdit.
Changed MenuBar to not error.
Fixed a few cases where LineEdit would eat input if you hovered over it and where mouse input got eaten when clicking in the world while a LineEdit was selected.

* Removed extra dependencies

* Added GUIBoundKeyEventArgs to ButtonEventArgs

* Fixes for input with LineEdit selected

Fixed multiple keybinds mapped to the same key not triggering.
Fixed keybind input not getting to LineEdit when hovering over a control.

* Implemented Key Repeat for LineEdit

* Fix for input on Robust.Lite Launcher

* Renames NonFocusKeybinds to EnableAllKeybinds

Renamed NonFocusKeybinds to EnableAllKeybinds and added comment to clarify usage

* Adds repeating keybinds

Used for TextBackspace, TextCursorLeft, and TextCursorRight
Reverts a change to LineEdit that implemented repeating keys
Adds some documentation comments
2019-08-21 17:13:48 +02:00

105 lines
3.1 KiB
C#

using System;
using Robust.Client.Input;
using Robust.Client.Interfaces.Graphics;
using Robust.Client.UserInterface;
using Robust.Shared.Input;
using Robust.Shared.Maths;
using Robust.Shared.Timing;
namespace Robust.Client.Interfaces.UserInterface
{
public interface IUserInterfaceManager
{
UITheme ThemeDefaults { get; }
Stylesheet Stylesheet { get; set; }
Control KeyboardFocused { get; }
Control StateRoot { get; }
Control WindowRoot { get; }
Control ModalRoot { get; }
Control CurrentlyHovered { get; }
float UIScale { get; }
/// <summary>
/// The "root" control to which all other controls are parented,
/// potentially indirectly.
/// </summary>
Control RootControl { get; }
IDebugMonitors DebugMonitors { get; }
void Popup(string contents, string title = "Alert!");
Control MouseGetControl(Vector2 coordinates);
/// <summary>
/// Give a control keyboard focus, releasing focus on the currently focused control (if any).
/// </summary>
/// <param name="control">The control to give keyboard focus to.</param>
/// <exception cref="ArgumentNullException">Thrown if <see cref="control"/> is <c>null</c>.</exception>
/// <exception cref="ArgumentException">
/// Thrown if <see cref="control"/> has <see cref="Control.CanKeyboardFocus"/> <c>false</c>.
/// </exception>
void GrabKeyboardFocus(Control control);
/// <summary>
/// Release keyboard focus from the currently focused control, if any.
/// </summary>
void ReleaseKeyboardFocus();
/// <summary>
/// Conditionally release keyboard focus if <see cref="ifControl"/> has keyboard focus.
/// </summary>
/// <exception cref="ArgumentNullException">
/// Thrown if <see cref="ifControl"/> is <c>null</c>.
/// </exception>
/// <seealso cref="ReleaseKeyboardFocus()"/>
void ReleaseKeyboardFocus(Control ifControl);
}
internal interface IUserInterfaceManagerInternal : IUserInterfaceManager
{
/// <summary>
/// Clears and disposes of all UI components.
/// Highly destructive!
/// </summary>
void DisposeAllComponents();
void Initialize();
void InitializeTesting();
void Update(FrameEventArgs args);
void FrameUpdate(FrameEventArgs args);
void KeyBindDown(BoundKeyEventArgs args);
void KeyBindUp(BoundKeyEventArgs args);
void MouseMove(MouseMoveEventArgs mouseMoveEventArgs);
void MouseWheel(MouseWheelEventArgs args);
void TextEntered(TextEventArgs textEvent);
void ControlHidden(Control control);
void ControlRemovedFromTree(Control control);
void PushModal(Control modal);
void RemoveModal(Control modal);
void Render(IRenderHandle renderHandle);
void QueueStyleUpdate(Control control);
void QueueLayoutUpdate(Control control);
}
}