Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmfinol committed Jul 19, 2023
1 parent 2f37b14 commit f7a5ee0
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 26 deletions.
23 changes: 5 additions & 18 deletions Assets/Resources/Card Game Manager.prefab

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

38 changes: 38 additions & 0 deletions Assets/Resources/NetworkPrefabs-42212.asset

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

8 changes: 8 additions & 0 deletions Assets/Resources/NetworkPrefabs-42212.asset.meta

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

20 changes: 20 additions & 0 deletions Assets/Scenes/PlayGame.unity

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

7 changes: 6 additions & 1 deletion Assets/Scripts/Cgs/Decks/DeckEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ public class DeckEditor : MonoBehaviour, ICardDropHandler
public Text countText;
public SearchResults searchResults;

private static readonly Dictionary<int, int> ResolutionIndexToCardsPerColumn = new()
{
{0, 4}, {1, 6}, {2, 8}, {3, 10}
};

private static int CardsPerZone =>
Mathf.FloorToInt(CardGameManager.PixelsPerInch * CardGameManager.Current.CardSize.Y / CardPrefabHeight *
8);
ResolutionIndexToCardsPerColumn[ResolutionManager.ResolutionIndex]);

public List<CardModel> CardModels
{
Expand Down
16 changes: 16 additions & 0 deletions Assets/Scripts/Cgs/Play/Multiplayer/CgsNetPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,22 @@ private void CreateDieServerRpc(int min, int max)

#endregion

#region Tokens

public void RequestNewToken()
{
CreateTokenServerRpc();
}

[ServerRpc]
// ReSharper disable once MemberCanBeMadeStatic.Local
private void CreateTokenServerRpc()
{
PlayController.Instance.CreateToken();
}

#endregion

#region RestartGame

public void RequestRestart()
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/Cgs/Play/PlayController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,14 @@ public Die CreateDie(int min, int max)
return die;
}

public void CreateDefaultToken()
{
if (CgsNetManager.Instance.IsOnline && CgsNetManager.Instance.LocalPlayer != null)
CgsNetManager.Instance.LocalPlayer.RequestNewToken();
else
CreateToken();
}

public Token CreateToken()
{
var token = Instantiate(tokenPrefab, playMat.transform).GetOrAddComponent<Token>();
Expand Down
4 changes: 1 addition & 3 deletions Assets/Scripts/Cgs/Play/PlayMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ namespace Cgs.Play
{
public class PlayMenu : MonoBehaviour
{
public const string NoRulesErrorMessage = "Rules Url does not exist for this game!";

public GameObject panels;

public PlayController controller;
Expand Down Expand Up @@ -66,7 +64,7 @@ public void CreateDie()
[UsedImplicitly]
public void CreateToken()
{
controller.CreateToken();
controller.CreateDefaultToken();
}

[UsedImplicitly]
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/Cgs/Play/PlaySettingsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace Cgs.Play
{
public class PlaySettingsMenu : Modal
{
public const string NoRulesErrorMessage = "Rules Url does not exist for this game!";

public Toggle autoStackCardsToggle;
public Toggle doubleClickToViewStacksToggle;
public Dropdown stackViewerOverlapDropdown;
Expand Down Expand Up @@ -45,7 +47,7 @@ public void ViewRules()
CardGameManager.Current.RulesUrl.IsWellFormedOriginalString())
Application.OpenURL(CardGameManager.Current.RulesUrl.OriginalString);
else
CardGameManager.Instance.Messenger.Show("NoRulesErrorMessage");
CardGameManager.Instance.Messenger.Show(NoRulesErrorMessage);
}

[UsedImplicitly]
Expand Down
10 changes: 7 additions & 3 deletions docs/pages/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ permalink: roadmap.html

# Roadmap

## What's New - v1.87
- Cards: Preview card image on hover
- Game-Play: Remove drawers and delete tokens
## What's New - v1.88
- Bug-Fix: Delete token/dice button
- Bug-Fix: Synchronize tokens in Multi-player
- Deck-Editor: Change how many cards appear per column based on resolution

## Active Sprint
- Bug: Sometimes stacks will duplicate the bottom two cards below the stack, creating another stack underneath
- Game-Play: Pre-defined card zones/stacks
- Game-Play: Combine Stacks when dropped on each other
- Game-Play: Put Card on bottom of Stack when Stack is dropped on Card
Expand Down Expand Up @@ -41,11 +43,13 @@ permalink: roadmap.html
- Decouple games and decks, so you can use any deck from any game
- Decks: Add extra tags (\*CMDR\* for .txt; sideboards for .dec and .ydk)
- Decks: Show error(s) when a card is not found
- Decks: Group cards in Deck Editor

## Backlog - 2024
- Cards Explorer & Deck Editor: Add sorting + Sort Menu
- Game-Play: Support multiple playmats
- Game-Play: Setup gamepad and keyboard shortcuts/hotkeys for Game-Play and Settings
- Games: Ability to re-skin CGS per game, changing the look of the buttons, background, scroll bar, etc
- Integration: Private Lobbies & Deep links to join multiplayer rooms
- Platforms: Productionize WebGL version by adding fullscreen and enabling Multiplayer and Developer Mode
- Platforms: Full controller support (Steam)
Expand Down

0 comments on commit f7a5ee0

Please sign in to comment.