Merge branch '1.5' into dotnet7

# Conflicts:
#	Content/Shaders/GI/DDGI.flax
#	Content/Shaders/GI/GlobalSurfaceAtlas.flax
#	Content/Shaders/TAA.flax
#	Content/Shaders/VolumetricFog.flax
#	Source/Tools/Flax.Build/Projects/VisualStudio/VCProjectGenerator.cs
This commit is contained in:
Wojciech Figat
2023-01-17 11:52:52 +01:00
134 changed files with 1895 additions and 621 deletions

View File

@@ -205,6 +205,15 @@ namespace FlaxEngine.GUI
BorderColorHighlighted = BorderColor;
}
/// <inheritdoc />
public override void ClearState()
{
base.ClearState();
if (_isPressed)
OnPressEnd();
}
/// <inheritdoc />
public override void DrawSelf()
{

View File

@@ -750,6 +750,20 @@ namespace FlaxEngine.GUI
}
}
/// <inheritdoc />
public override void ClearState()
{
base.ClearState();
// Clear state for any nested controls
for (int i = 0; i < _children.Count; i++)
{
var child = _children[i];
//if (child.Enabled && child.Enabled)
child.ClearState();
}
}
/// <summary>
/// Draw the control and the children.
/// </summary>

View File

@@ -131,6 +131,7 @@ namespace FlaxEngine.GUI
else
{
oldParentSize = Float2.Zero;
ClearState();
}
_parent = value;
@@ -214,20 +215,8 @@ namespace FlaxEngine.GUI
if (_isEnabled != value)
{
_isEnabled = value;
// Check if control has been disabled
if (!_isEnabled)
{
Defocus();
// Clear flags
if (_isMouseOver)
OnMouseLeave();
if (_isDragOver)
OnDragLeave();
while (_touchOvers != null && _touchOvers.Count != 0)
OnTouchLeave(_touchOvers[0]);
}
ClearState();
}
}
}
@@ -259,20 +248,8 @@ namespace FlaxEngine.GUI
if (_isVisible != value)
{
_isVisible = value;
// Check on control hide event
if (!_isVisible)
{
Defocus();
// Clear flags
if (_isMouseOver)
OnMouseLeave();
if (_isDragOver)
OnDragLeave();
while (_touchOvers != null && _touchOvers.Count != 0)
OnTouchLeave(_touchOvers[0]);
}
ClearState();
OnVisibleChanged();
_parent?.PerformLayout();
@@ -453,6 +430,20 @@ namespace FlaxEngine.GUI
{
}
/// <summary>
/// Called to clear UI state. For example, removes mouse over state or drag and drop when control gets disabled or hidden (including hierarchy).
/// </summary>
public virtual void ClearState()
{
Defocus();
if (_isMouseOver)
OnMouseLeave();
if (_isDragOver)
OnDragLeave();
while (_touchOvers != null && _touchOvers.Count != 0)
OnTouchLeave(_touchOvers[0]);
}
#region Focus
/// <summary>
@@ -1338,6 +1329,12 @@ namespace FlaxEngine.GUI
/// </summary>
protected virtual void OnVisibleChanged()
{
// Clear state when control gets hidden
if (!_isVisible && _isMouseOver)
{
OnMouseLeave();
}
VisibleChanged?.Invoke(this);
}

View File

@@ -349,7 +349,7 @@ void TextRender::Draw(RenderContext& renderContext)
renderContext.View.GetWorldMatrix(_transform, world);
GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, world);
const DrawPass drawModes = (DrawPass)(DrawModes & renderContext.View.Pass & (uint32)renderContext.View.GetShadowsDrawPassMask(ShadowsMode));
const DrawPass drawModes = DrawModes & renderContext.View.Pass & renderContext.View.GetShadowsDrawPassMask(ShadowsMode);
if (_vb0.Data.Count() > 0 && drawModes != DrawPass::None)
{
// Flush buffers
@@ -386,13 +386,13 @@ void TextRender::Draw(RenderContext& renderContext)
// Submit draw calls
for (const auto& e : _drawChunks)
{
auto chunkDrawModes = drawModes & e.Material->GetDrawModes();
if (chunkDrawModes == 0)
const DrawPass chunkDrawModes = drawModes & e.Material->GetDrawModes();
if (chunkDrawModes == DrawPass::None)
continue;
drawCall.Draw.IndicesCount = e.IndicesCount;
drawCall.Draw.StartIndex = e.StartIndex;
drawCall.Material = e.Material;
renderContext.List->AddDrawCall(renderContext, (DrawPass)chunkDrawModes, GetStaticFlags(), drawCall, true);
renderContext.List->AddDrawCall(renderContext, chunkDrawModes, GetStaticFlags(), drawCall, true);
}
}