Skip to content

Commit

Permalink
Applied comments from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
fcolarich committed Jan 31, 2025
1 parent 87dd500 commit ce64315
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Explorer/Assets/DCL/Chat/ChatInputBoxElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void EnableInputBoxSubmissions()
validatedInputField.InputFieldSubmit += InputFieldSubmit;
}

public void OnViewHide()
public void ClosePopups()
{
closePopupTask.TrySetResult();
}
Expand Down
2 changes: 1 addition & 1 deletion Explorer/Assets/DCL/Chat/ChatView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public void OnPointerExit(PointerEventData eventData)
public override UniTask HideAsync(CancellationToken ct, bool isInstant = false)
{
closePopupTask.TrySetResult();
chatInputBox.OnViewHide();
chatInputBox.ClosePopups();
return base.HideAsync(ct, isInstant);
}

Expand Down
5 changes: 5 additions & 0 deletions Explorer/Assets/DCL/Chat/Commands/ChatCommandsBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace DCL.Chat.Commands
{

/// <summary>
/// This bus is used by chat commands, to avoid sending references to classes they should not have, like specific controllers or views
/// Just send this interface to both ends, subscribe to the event in the controller/etc. and wait for the chat to raise the event. Just like magic.
/// </summary>
public interface IChatCommandsBus
{
event Action<bool> OnSetConnectionStatusPanelVisibility;
Expand Down
5 changes: 2 additions & 3 deletions Explorer/Assets/DCL/Input/DCLCursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ public class DCLCursor : ICursor
private readonly Vector2 normalCursorHotspot;
private readonly Vector2 interactionCursorHotspot;
private CursorStyle cursorStyle = CursorStyle.None;
private bool isForced;

public bool IsForced() => isForced;
public bool IsStyleForced { get; private set; }

public DCLCursor(Texture2D normalCursor, Texture2D interactionCursor, Vector2 normalCursorHotspot, Vector2 interactionCursorHotspot)
{
Expand Down Expand Up @@ -54,7 +53,7 @@ public void SetVisibility(bool visible)
public void SetStyle(CursorStyle style, bool force = false)
{
if (cursorStyle == style) return;
isForced = force;
IsStyleForced = force;

cursorStyle = style;

Expand Down
6 changes: 5 additions & 1 deletion Explorer/Assets/DCL/Input/ICursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public interface ICursor

void SetStyle(CursorStyle style, bool force = false);

bool IsForced();
/// <summary>
/// Indicates whether the Style of the cursor will be handled by the ECS system
/// or if it will ignore it and keep the style set when setting it with a forced flag
/// </summary>
bool IsStyleForced { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private void UpdateCursor(ref CursorComponent cursorComponent)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void UpdateCursorVisualState(ref CursorComponent cursorComponent, IReadOnlyList<RaycastResult> raycastResults)
{
if (cursor.IsForced()) return;
if (cursor.IsStyleForced) return;

CursorStyle cursorStyle = CursorStyle.Normal;

Expand Down

0 comments on commit ce64315

Please sign in to comment.