From f7a5ee09d248fec39356b7e2e442688589614a3a Mon Sep 17 00:00:00 2001 From: David Finol Date: Wed, 19 Jul 2023 00:27:30 -0500 Subject: [PATCH] Fixes --- Assets/Resources/Card Game Manager.prefab | 23 +++-------- Assets/Resources/NetworkPrefabs-42212.asset | 38 +++++++++++++++++++ .../Resources/NetworkPrefabs-42212.asset.meta | 8 ++++ Assets/Scenes/PlayGame.unity | 20 ++++++++++ Assets/Scripts/Cgs/Decks/DeckEditor.cs | 7 +++- .../Cgs/Play/Multiplayer/CgsNetPlayer.cs | 16 ++++++++ Assets/Scripts/Cgs/Play/PlayController.cs | 8 ++++ Assets/Scripts/Cgs/Play/PlayMenu.cs | 4 +- Assets/Scripts/Cgs/Play/PlaySettingsMenu.cs | 4 +- docs/pages/roadmap.md | 10 +++-- 10 files changed, 112 insertions(+), 26 deletions(-) create mode 100644 Assets/Resources/NetworkPrefabs-42212.asset create mode 100644 Assets/Resources/NetworkPrefabs-42212.asset.meta diff --git a/Assets/Resources/Card Game Manager.prefab b/Assets/Resources/Card Game Manager.prefab index cf68fc94..970f7566 100644 --- a/Assets/Resources/Card Game Manager.prefab +++ b/Assets/Resources/Card Game Manager.prefab @@ -126,23 +126,9 @@ MonoBehaviour: NetworkTransport: {fileID: 4526732702672025491} PlayerPrefab: {fileID: 1833244134286464, guid: 576a15ab1b0e4f34c8981877e9ab8029, type: 3} - NetworkPrefabs: - - Override: 0 - Prefab: {fileID: 1700305412181862, guid: 3b506588d6983aa468c58a6d81eea204, type: 3} - SourcePrefabToOverride: {fileID: 0} - SourceHashToOverride: 0 - OverridingTargetPrefab: {fileID: 0} - - Override: 0 - Prefab: {fileID: 4087591186767669376, guid: 5fdc698f4f037cc44921305d641fd80b, - type: 3} - SourcePrefabToOverride: {fileID: 0} - SourceHashToOverride: 0 - OverridingTargetPrefab: {fileID: 0} - - Override: 0 - Prefab: {fileID: 1968217138345596, guid: ad08570ff81cf4145b19e1647f828c6e, type: 3} - SourcePrefabToOverride: {fileID: 0} - SourceHashToOverride: 0 - OverridingTargetPrefab: {fileID: 0} + Prefabs: + NetworkPrefabsLists: + - {fileID: 11400000, guid: ddad69d1ebe3a2d4a8a80894f40a8f1d, type: 2} TickRate: 30 ClientConnectionBufferTimeout: 10 ConnectionApproval: 0 @@ -158,6 +144,7 @@ MonoBehaviour: LoadSceneTimeOut: 120 SpawnTimeout: 1 EnableNetworkLogs: 1 + OldPrefabList: [] --- !u!114 &4526732702672025491 MonoBehaviour: m_ObjectHideFlags: 0 @@ -180,7 +167,7 @@ MonoBehaviour: ConnectionData: Address: 127.0.0.1 Port: 7777 - ServerListenAddress: + ServerListenAddress: 127.0.0.1 DebugSimulator: PacketDelayMS: 0 PacketJitterMS: 0 diff --git a/Assets/Resources/NetworkPrefabs-42212.asset b/Assets/Resources/NetworkPrefabs-42212.asset new file mode 100644 index 00000000..10525808 --- /dev/null +++ b/Assets/Resources/NetworkPrefabs-42212.asset @@ -0,0 +1,38 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e651dbb3fbac04af2b8f5abf007ddc23, type: 3} + m_Name: NetworkPrefabs-42212 + m_EditorClassIdentifier: + IsDefault: 0 + List: + - Override: 0 + Prefab: {fileID: 1700305412181862, guid: 3b506588d6983aa468c58a6d81eea204, type: 3} + SourcePrefabToOverride: {fileID: 0} + SourceHashToOverride: 0 + OverridingTargetPrefab: {fileID: 0} + - Override: 0 + Prefab: {fileID: 4087591186767669376, guid: 5fdc698f4f037cc44921305d641fd80b, + type: 3} + SourcePrefabToOverride: {fileID: 0} + SourceHashToOverride: 0 + OverridingTargetPrefab: {fileID: 0} + - Override: 0 + Prefab: {fileID: 1968217138345596, guid: ad08570ff81cf4145b19e1647f828c6e, type: 3} + SourcePrefabToOverride: {fileID: 0} + SourceHashToOverride: 0 + OverridingTargetPrefab: {fileID: 0} + - Override: 0 + Prefab: {fileID: 5127053305123712531, guid: c6a1cf8ae8ec3d647b7d1abc3b0a4b7b, + type: 3} + SourcePrefabToOverride: {fileID: 0} + SourceHashToOverride: 0 + OverridingTargetPrefab: {fileID: 0} diff --git a/Assets/Resources/NetworkPrefabs-42212.asset.meta b/Assets/Resources/NetworkPrefabs-42212.asset.meta new file mode 100644 index 00000000..91ca44b2 --- /dev/null +++ b/Assets/Resources/NetworkPrefabs-42212.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ddad69d1ebe3a2d4a8a80894f40a8f1d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/PlayGame.unity b/Assets/Scenes/PlayGame.unity index 2eef3c6c..f0921c0b 100644 --- a/Assets/Scenes/PlayGame.unity +++ b/Assets/Scenes/PlayGame.unity @@ -2237,6 +2237,11 @@ PrefabInstance: propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4511551359358340090, guid: 7aeec7aac0a4d0446bb25fbba25238ea, + type: 3} + propertyPath: ConnectionData.ServerListenAddress + value: 127.0.0.1 + objectReference: {fileID: 0} - target: {fileID: 4526732702672025491, guid: 7aeec7aac0a4d0446bb25fbba25238ea, type: 3} propertyPath: ConnectionData.ServerListenAddress @@ -4091,6 +4096,21 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 3339357086198550866, guid: 73eb2297a0629694bbe390c58d10e332, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3339357086198550866, guid: 73eb2297a0629694bbe390c58d10e332, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3339357086198550866, guid: 73eb2297a0629694bbe390c58d10e332, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 3475859695529778834, guid: 73eb2297a0629694bbe390c58d10e332, type: 3} propertyPath: m_Name diff --git a/Assets/Scripts/Cgs/Decks/DeckEditor.cs b/Assets/Scripts/Cgs/Decks/DeckEditor.cs index 08c19074..94a98268 100644 --- a/Assets/Scripts/Cgs/Decks/DeckEditor.cs +++ b/Assets/Scripts/Cgs/Decks/DeckEditor.cs @@ -45,9 +45,14 @@ public class DeckEditor : MonoBehaviour, ICardDropHandler public Text countText; public SearchResults searchResults; + private static readonly Dictionary 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 CardModels { diff --git a/Assets/Scripts/Cgs/Play/Multiplayer/CgsNetPlayer.cs b/Assets/Scripts/Cgs/Play/Multiplayer/CgsNetPlayer.cs index e584ca86..008fa5a5 100644 --- a/Assets/Scripts/Cgs/Play/Multiplayer/CgsNetPlayer.cs +++ b/Assets/Scripts/Cgs/Play/Multiplayer/CgsNetPlayer.cs @@ -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() diff --git a/Assets/Scripts/Cgs/Play/PlayController.cs b/Assets/Scripts/Cgs/Play/PlayController.cs index 6ee58d99..86217808 100644 --- a/Assets/Scripts/Cgs/Play/PlayController.cs +++ b/Assets/Scripts/Cgs/Play/PlayController.cs @@ -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(); diff --git a/Assets/Scripts/Cgs/Play/PlayMenu.cs b/Assets/Scripts/Cgs/Play/PlayMenu.cs index 39f86e85..1c557477 100644 --- a/Assets/Scripts/Cgs/Play/PlayMenu.cs +++ b/Assets/Scripts/Cgs/Play/PlayMenu.cs @@ -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; @@ -66,7 +64,7 @@ public void CreateDie() [UsedImplicitly] public void CreateToken() { - controller.CreateToken(); + controller.CreateDefaultToken(); } [UsedImplicitly] diff --git a/Assets/Scripts/Cgs/Play/PlaySettingsMenu.cs b/Assets/Scripts/Cgs/Play/PlaySettingsMenu.cs index 04d4819e..1788b921 100644 --- a/Assets/Scripts/Cgs/Play/PlaySettingsMenu.cs +++ b/Assets/Scripts/Cgs/Play/PlaySettingsMenu.cs @@ -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; @@ -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] diff --git a/docs/pages/roadmap.md b/docs/pages/roadmap.md index 276b5927..d0b75687 100644 --- a/docs/pages/roadmap.md +++ b/docs/pages/roadmap.md @@ -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 @@ -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)