mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Implement MouseWheel input.
This commit is contained in:
@@ -89,6 +89,11 @@ namespace SS14.Client
|
||||
/// </summary>
|
||||
public void MouseWheel(MouseWheelEventArgs mouseWheelEventArgs)
|
||||
{
|
||||
_userInterfaceManager.MouseWheel(mouseWheelEventArgs);
|
||||
if (mouseWheelEventArgs.Handled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_stateManager.MouseWheelMove(mouseWheelEventArgs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,8 @@ namespace SS14.Client.Interfaces.UserInterface
|
||||
|
||||
void MouseMove(MouseMoveEventArgs mouseMoveEventArgs);
|
||||
|
||||
void MouseWheel(MouseWheelEventArgs args);
|
||||
|
||||
void TextEntered(TextEventArgs textEvent);
|
||||
|
||||
void KeyDown(KeyEventArgs keyEvent);
|
||||
|
||||
@@ -213,6 +213,22 @@ namespace SS14.Client.UserInterface
|
||||
}
|
||||
}
|
||||
|
||||
public void MouseWheel(MouseWheelEventArgs args)
|
||||
{
|
||||
var control = MouseGetControl(args.Position);
|
||||
if (control == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
args.Handle();
|
||||
|
||||
var guiArgs = new GUIMouseWheelEventArgs(args.WheelDirection, control, Mouse.ButtonMask.None, args.Position,
|
||||
args.Position - control.GlobalPosition, args.Alt, args.Control, args.Shift, args.System);
|
||||
|
||||
_doMouseGuiInput(control, guiArgs, (c, ev) => c.MouseWheel(ev));
|
||||
}
|
||||
|
||||
public void TextEntered(TextEventArgs textEvent)
|
||||
{
|
||||
if (KeyboardFocused == null)
|
||||
|
||||
Reference in New Issue
Block a user