Skip to content

Commit

Permalink
Fix scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed Dec 28, 2023
1 parent 4c1b026 commit af3825e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
10 changes: 6 additions & 4 deletions Assets/Scripts/Cgs/CardGameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,11 @@ private void OnDeepLinkActivated(string deepLink)
{
Debug.Log("OnDeepLinkActivated!");
var autoUpdateUrl = GetAutoUpdateUrl(deepLink);
if (string.IsNullOrEmpty(autoUpdateUrl))
if (string.IsNullOrEmpty(autoUpdateUrl) ||
!Uri.IsWellFormedUriString(autoUpdateUrl, UriKind.RelativeOrAbsolute))
{
Debug.LogError("OnDeepLinkActivated::autoUpdateUrlMissing!");
Messenger.Show("OnDeepLinkActivated::autoUpdateUrlMissing!");
Debug.LogError("OnDeepLinkActivated::autoUpdateUrlMissingOrMalformed: " + deepLink);
Messenger.Show("OnDeepLinkActivated::autoUpdateUrlMissingOrMalformed: " + deepLink);
}
else
StartGetCardGame(autoUpdateUrl);
Expand Down Expand Up @@ -620,7 +621,8 @@ private IEnumerator Start()
while (Current is {IsDownloading: true})
yield return null;

bool callGameReady = Current == null || Current == UnityCardGame.UnityInvalid || !string.IsNullOrEmpty(Current.Error)
bool callGameReady =
Current == null || Current == UnityCardGame.UnityInvalid || !string.IsNullOrEmpty(Current.Error)
|| Current.Id.Equals(Tags.StandardPlayingCardsDirectoryName);
Debug.Log("CardGameManager::Start:callGameReady " + callGameReady);
if (callGameReady)
Expand Down
12 changes: 9 additions & 3 deletions Assets/Scripts/Cgs/UI/ScrollRects/RotateZoomableScrollRect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ protected override void SetContentAnchoredPosition(Vector2 position)

public override void OnDrag(PointerEventData eventData)
{
if (Input.GetMouseButton(0) && !(Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)))
if (Input.GetMouseButton(0) && !(Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
&& Input.touchCount <= 1)
return;

PointerPositions[eventData.pointerId] = eventData.position;
Expand All @@ -106,7 +107,10 @@ public override void OnDrag(PointerEventData eventData)

case PointerEventData.InputButton.Left:
default:
OnDragRotate(eventData);
if (PointerPositions.Count >= 2)
OnDragTouch(eventData);
else
base.OnDrag(eventData);
break;
}
}
Expand All @@ -118,14 +122,16 @@ private void OnDragPan(PointerEventData mouseEventData)
Mathf.Clamp(normalizedPosition.y, 0.0f, 1.0f));
}

private void OnDragRotate(PointerEventData touchEventData)
private void OnDragTouch(PointerEventData touchEventData)
{
if (PointerPositions.Count < 2)
{
base.OnDrag(touchEventData);
return;
}

OnDragPan(touchEventData);

Vector2 referencePoint = content.position;
foreach (var position in
PointerPositions.Where(position => position.Key != touchEventData.pointerId))
Expand Down
1 change: 0 additions & 1 deletion docs/pages/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ permalink: roadmap.html

## Active Sprint
- Bug-fix: Game creation menu copyright on portrait
- Bug-fix: Game play deck positions on android
- Bug-Fix: Image quality management/LODs for card images
- Bug-Fix: Game Boards
- Game-Play: Display values on Card in Play Area
Expand Down

0 comments on commit af3825e

Please sign in to comment.