Merge remote-tracking branch 'upstream/master' into add-chat-truncation

This commit is contained in:
Dean Herbert 2019-09-09 12:09:14 +09:00
commit d0e8b1efce
3 changed files with 37 additions and 8 deletions

View File

@ -1,5 +1,7 @@
<Project>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputPath>bin\$(Configuration)</OutputPath>
<WarningLevel>4</WarningLevel>
<SchemaVersion>2.0</SchemaVersion>
@ -35,7 +37,7 @@
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<ErrorReport>prompt</ErrorReport>
<EnableLLVM>true</EnableLLVM>
<EnableLLVM>true</EnableLLVM>
<AndroidManagedSymbols>false</AndroidManagedSymbols>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>

View File

@ -62,21 +62,31 @@ namespace osu.Game.Graphics.Containers
protected override bool OnClick(ClickEvent e)
{
closeIfOutside(e);
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
Hide();
return base.OnClick(e);
}
protected override bool OnDragEnd(DragEndEvent e)
{
closeIfOutside(e);
return base.OnDragEnd(e);
}
private bool closeOnDragEnd;
private void closeIfOutside(MouseEvent e)
protected override bool OnDragStart(DragStartEvent e)
{
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
closeOnDragEnd = true;
return base.OnDragStart(e);
}
protected override bool OnDragEnd(DragEndEvent e)
{
if (closeOnDragEnd)
{
Hide();
closeOnDragEnd = false;
}
return base.OnDragEnd(e);
}
public virtual bool OnPressed(GlobalAction action)

View File

@ -313,5 +313,22 @@ namespace osu.Game.Screens.Play
return base.OnMouseMove(e);
}
}
[Resolved]
private GlobalActionContainer globalAction { get; set; }
protected override bool Handle(UIEvent e)
{
switch (e)
{
case ScrollEvent _:
if (ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
return globalAction.TriggerEvent(e);
break;
}
return base.Handle(e);
}
}
}