Restructured for new direction.
This commit is contained in:
@@ -57,7 +57,18 @@ namespace BriarQueen.Framework.Managers.UI
|
||||
|
||||
private bool _useVirtualCursor;
|
||||
|
||||
public CursorStyleEntry CurrentStyleEntry => _styleMap[_currentStyle];
|
||||
public CursorStyleEntry CurrentStyleEntry
|
||||
{
|
||||
get
|
||||
{
|
||||
if (TryGetStyleEntry(GetEffectiveStyle(), out var entry))
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
[Inject]
|
||||
private void Construct(EventCoordinator eventCoordinator)
|
||||
@@ -192,6 +203,22 @@ namespace BriarQueen.Framework.Managers.UI
|
||||
return _isStyleOverridden ? _currentStyleOverride : _currentStyle;
|
||||
}
|
||||
|
||||
private bool TryGetStyleEntry(CursorStyle style, out CursorStyleEntry entry)
|
||||
{
|
||||
if (_styleMap.TryGetValue(style, out entry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_styleMap.TryGetValue(CursorStyle.Default, out entry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
entry = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
private void ApplyVirtualCursorStyle(CursorStyle style)
|
||||
{
|
||||
if (_virtualCursorImage == null)
|
||||
@@ -282,4 +309,4 @@ namespace BriarQueen.Framework.Managers.UI
|
||||
public Vector2 TooltipOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user