Skip to content

Commit

Permalink
Update card validation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed Nov 20, 2024
1 parent 226a430 commit fef8aa0
Show file tree
Hide file tree
Showing 4 changed files with 148,669 additions and 8 deletions.
16 changes: 14 additions & 2 deletions Assets/Scripts/Cgs/Cards/CardEditorMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,18 @@ public class CardEditorMenu : Modal
public Image cardImage;
public Button saveButton;

[UsedImplicitly] public string CardName { get; set; }
[UsedImplicitly]
public string CardName
{
get => _cardName;
set
{
_cardName = value;
ValidateSaveButton();
}
}

private string _cardName = string.Empty;

[UsedImplicitly]
public string CardId
Expand Down Expand Up @@ -231,11 +242,12 @@ private IEnumerator UpdateCardImage()
Debug.LogWarning(ImageImportFailedWarningMessage);
}

[UsedImplicitly]
public void ValidateSaveButton()
{
saveButton.interactable =
!string.IsNullOrEmpty(CardName) && CardImageUri != null && CardImageUri.IsAbsoluteUri;
Debug.Log("ValidateSaveButton: " + CardName + " " + CardImageUri);
Debug.Log("ValidateSaveButton: " + saveButton.interactable);
}

[UsedImplicitly]
Expand Down
Loading

0 comments on commit fef8aa0

Please sign in to comment.