Merge remote-tracking branch 'origin/master' into 1.9

This commit is contained in:
Wojtek Figat
2024-05-31 22:12:03 +02:00
40 changed files with 552 additions and 222 deletions

View File

@@ -200,6 +200,8 @@ namespace FlaxEngine.GUI
/// <inheritdoc />
public override void Update(float deltaTime)
{
base.Update(deltaTime);
// Update navigation
if (SkipEvents)
{
@@ -215,8 +217,6 @@ namespace FlaxEngine.GUI
UpdateNavigation(deltaTime, _canvas.NavigateRight.Name, NavDirection.Right, ref _navigationHeldTimeRight, ref _navigationRateTimeRight);
UpdateNavigation(deltaTime, _canvas.NavigateSubmit.Name, ref _navigationHeldTimeSubmit, ref _navigationRateTimeSubmit, SubmitFocused);
}
base.Update(deltaTime);
}
private void ConditionalNavigate(NavDirection direction)

View File

@@ -48,8 +48,8 @@ namespace FlaxEngine.GUI
{
if (alphaText.Length == 3 && alphaText[0] == '#')
style.Color.A = ((StringUtils.HexDigit(alphaText[1]) << 4) + StringUtils.HexDigit(alphaText[2])) / 255.0f;
else if (alphaText.Length > 1 && alphaText[alphaText.Length - 1] == '%')
style.Color.A = float.Parse(alphaText.Substring(0, alphaText.Length - 1)) / 100.0f;
else if (alphaText.Length > 1 && alphaText[alphaText.Length - 1] == '%' && float.TryParse(alphaText.Substring(0, alphaText.Length - 1), out var alpha))
style.Color.A = alpha / 100.0f;
}
context.StyleStack.Push(style);
}
@@ -297,8 +297,8 @@ namespace FlaxEngine.GUI
{
if (float.TryParse(text, out var width))
output = width;
if (text.Length > 1 && text[text.Length - 1] == '%')
output = input * float.Parse(text.Substring(0, text.Length - 1)) / 100.0f;
if (text.Length > 1 && text[text.Length - 1] == '%' && float.TryParse(text.Substring(0, text.Length - 1), out width))
output = input * width / 100.0f;
used = true;
}
return used;