Skip to content

Commit

Permalink
Refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed Nov 11, 2024
1 parent 9f9e5df commit 226a430
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 14 deletions.
208 changes: 198 additions & 10 deletions Assets/Prefabs/Menus/CGS Games Browser Menu.prefab

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion Assets/Scripts/Cgs/CardGameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ internal void LookupCardGames()
{
var newCardGame = new UnityCardGame(this, gameDirectoryName);
newCardGame.ReadProperties();
Debug.LogWarning(newCardGame.ToString());
if (!string.IsNullOrEmpty(newCardGame.Error))
Debug.LogError(LoadErrorMessage + newCardGame.Error);
else
Expand Down
18 changes: 17 additions & 1 deletion Assets/Scripts/Cgs/Menu/CgsGamesBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ public class CgsGamesBrowser : SelectionPanel

private int _selectedGameId;

private IEnumerator Start()
private void Start()
{
StartCoroutine(RunRefreshCoroutine());
}

private IEnumerator RunRefreshCoroutine()
{
ClearPanel();

using var request = UnityWebRequest.Get(CgsGamesBrowseApiUrl);

yield return request.SendWebRequest();
Expand Down Expand Up @@ -74,6 +81,8 @@ private void Update()
EventSystem.current.currentSelectedGameObject.GetComponent<Toggle>().isOn = true;
else if (Inputs.IsOption)
GoToCgsGamesBrowser();
else if (Inputs.IsLoad)
Refresh();
else if (Inputs.IsSubmit)
Import();
else if (Inputs.IsPageVertical && !Inputs.WasPageVertical)
Expand Down Expand Up @@ -106,6 +115,13 @@ public void GoToCgsGamesBrowser()
Application.OpenURL(Tags.CgsGamesBrowseUrl);
}

[UsedImplicitly]
public void Refresh()
{
StopAllCoroutines();
StartCoroutine(RunRefreshCoroutine());
}

[UsedImplicitly]
public void Import()
{
Expand Down
10 changes: 10 additions & 0 deletions Assets/Scripts/Cgs/UI/SelectionPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ public class SelectionPanel : MonoBehaviour

protected List<Toggle> Toggles { get; } = new();

protected void ClearPanel()
{
if (toggleGroup != null)
toggleGroup.allowSwitchOff = true;

Toggles.Clear();
selectionContent.DestroyAllChildren();
selectionContent.sizeDelta = new Vector2(selectionContent.sizeDelta.x, 0);
}

protected void Rebuild<TKey, TValue>(IDictionary<TKey, TValue> options, OnSelectDelegate<TKey> select,
TKey current)
{
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ permalink: roadmap.html
- Bug-Fix: Deck Editor slows when loading too many cards
- Cards: Select left and right on zoom in Cards Explorer
- Game-Play: Enhanced Drawer Buttons
- Cards: Support mix of different card sizes in the same game
- Game-Play: Move card to zone, stack, or drawer (E)
- Game-Play: Animation for card and stack actions
- Cards: Animated highlight
- Game-Play: Special action buttons (i.e. button to reset rotation for all cards, button to turn all cards faceup, etc.)
- Cards: Support mix of different card sizes in the same game
- Game-Play: Apply permissions for each other's decks/stacks/cards, shuffling, moving, deleting, viewing facedown, etc
- Game-Play: Label which player is interacting with cards/playables
- Game-Play: Name-Plates indicating player seats
Expand Down Expand Up @@ -63,7 +63,7 @@ permalink: roadmap.html
- Games: Ability to re-skin CGS per game, changing the look of the buttons, background, scroll bar, etc

## Icebox - Priority 3
- Integration: Json Schema Generation via https://github.com/json-everything/json-everything
- Integration: Json Schema Generation via https://github.com/json-everything/json-everything and https://github.com/coveooss/json-schema-for-humans
- Cards Explorer & Deck Editor: Add sorting + Sort Menu
- Cards: Apply autoUpdate to cached images
- Cards: Set card image cache limit
Expand Down

0 comments on commit 226a430

Please sign in to comment.