From 5b22ba93845ecbc04849cc3c3ca9e066e6a6ef91 Mon Sep 17 00:00:00 2001 From: David Finol Date: Mon, 12 Aug 2024 23:14:17 -0500 Subject: [PATCH 1/6] Update workflow --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 31057afc..2e4dfe99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -850,7 +850,6 @@ jobs: app-id: 9N96N5S4W3J0 package-path: ${{ format('{0}\build\WSAPlayer\WSAPlayer\AppPackages\Card Game Simulator\Card Game Simulator_{1}.0_x86_x64_arm_arm64_bundle_Master.appxupload', 'C:\Card-Game-Simulator.git', needs.buildWSAPlayer.outputs.buildVersion) }} - name: Upload to the Microsoft Store - if: false working-directory: C:/Card-Game-Simulator.git shell: pwsh env: From 3c7719aa3e1c1f1eb0ba55715f6b41a4197805ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:01:35 +0000 Subject: [PATCH 2/6] Bump rexml from 3.3.4 to 3.3.6 Bumps [rexml](https://github.com/ruby/rexml) from 3.3.4 to 3.3.6. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.4...v3.3.6) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ca820f23..4ae030eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -250,7 +250,7 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.3.4) + rexml (3.3.6) strscan rouge (2.0.7) ruby-macho (2.5.1) From dfc838f3d6071148216df66720c094dbea0d5dd2 Mon Sep 17 00:00:00 2001 From: David Finol Date: Thu, 22 Aug 2024 23:42:16 -0500 Subject: [PATCH 3/6] Fix Android --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e4dfe99..fbaf9de9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -200,7 +200,7 @@ jobs: androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }} androidKeyaliasName: cgs androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }} - androidTargetSdkVersion: AndroidApiLevel33 + androidTargetSdkVersion: AndroidApiLevel34 - name: Upload Build uses: actions/upload-artifact@v4 if: github.event_name == 'pull_request' || github.event.action == 'published' || contains(github.event.inputs.workflow_mode, matrix.targetPlatform) || (contains(github.event.inputs.workflow_mode, 'Steam') && matrix.targetPlatform == 'StandaloneLinux64') From 3267fdd03500be7ed7b4fbca477437ba9322012f Mon Sep 17 00:00:00 2001 From: David Finol Date: Thu, 22 Aug 2024 23:49:34 -0500 Subject: [PATCH 4/6] Update roadmap --- docs/pages/roadmap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/roadmap.md b/docs/pages/roadmap.md index 1445dad5..d3dc3d0a 100644 --- a/docs/pages/roadmap.md +++ b/docs/pages/roadmap.md @@ -4,7 +4,7 @@ permalink: roadmap.html # Roadmap -## What's New - v1.116 +## What's New - v1.117 - Bug-Fixes ## Sprint - Priority 1 From 005c03fedf25b57cc64ffc39fbf7ffb57f9e6daf Mon Sep 17 00:00:00 2001 From: davidmfinol <1088474+davidmfinol@users.noreply.github.com> Date: Sat, 24 Aug 2024 00:56:17 +0000 Subject: [PATCH 5/6] [create-pull-request] automated change --- Assets/Plugins/FinolDigital.Cgs.CardGameDef.dll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Plugins/FinolDigital.Cgs.CardGameDef.dll b/Assets/Plugins/FinolDigital.Cgs.CardGameDef.dll index 80bd363f..258f3a7e 100644 --- a/Assets/Plugins/FinolDigital.Cgs.CardGameDef.dll +++ b/Assets/Plugins/FinolDigital.Cgs.CardGameDef.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:386de0ae9c885e3e746556d80c3274985287051b76ac11fc60a15dfb85ca9c98 +oid sha256:06f83fb25247aba874a453da9700ce664f3019c17359f91fcc9e10dfda160c0c size 75776 From 553eaa332c8b9c5af8a1c57cfd1aace2c21d3d2f Mon Sep 17 00:00:00 2001 From: David Finol Date: Sat, 24 Aug 2024 00:27:07 -0500 Subject: [PATCH 6/6] Add Card Image Queue --- Assets/Scenes/CardsExplorer.unity | 146 ++++++++++++++++-- Assets/Scripts/Cgs/CardGameManager.cs | 5 + Assets/Scripts/Cgs/Cards/CardsExplorer.cs | 24 ++- .../ImageQueueService.cs | 65 ++++++++ .../ImageQueueService.cs.meta | 11 ++ .../UnityCard.cs | 50 ++---- docs/pages/roadmap.md | 3 +- 7 files changed, 251 insertions(+), 53 deletions(-) create mode 100644 Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs create mode 100644 Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs.meta diff --git a/Assets/Scenes/CardsExplorer.unity b/Assets/Scenes/CardsExplorer.unity index a3240a3d..3a1882de 100644 --- a/Assets/Scenes/CardsExplorer.unity +++ b/Assets/Scenes/CardsExplorer.unity @@ -105,7 +105,7 @@ NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -118,7 +118,7 @@ NavMeshSettings: cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -156,7 +156,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1299719831} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -250,7 +249,6 @@ RectTransform: - {fileID: 1272889841} - {fileID: 1473139181} m_Father: {fileID: 508283652} - m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} @@ -330,7 +328,6 @@ RectTransform: - {fileID: 1956308802} - {fileID: 1385403561} m_Father: {fileID: 508283652} - m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -438,7 +435,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1272889841} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} @@ -632,7 +628,9 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -656,7 +654,6 @@ RectTransform: - {fileID: 101628742} - {fileID: 1606626926} m_Father: {fileID: 0} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -675,6 +672,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 24310abe0ee01ff429fae5577df9ab6f, type: 3} m_Name: m_EditorClassIdentifier: + gamesManagementMenuPrefab: {fileID: 622408515558105024, guid: a8f47c13e131e5942b6e88f7f829ea47, + type: 3} cardSetImportModalPrefab: {fileID: 5810182567772607080, guid: 864bd2a9f44369e488e6d6f6edc1582e, type: 3} cardEditorMenuPrefab: {fileID: 7821632309527891152, guid: cafd3a7bba711f44d95d40ed78851829, @@ -709,6 +708,7 @@ MonoBehaviour: inputField: {fileID: 8036524127044591431} countText: {fileID: 1272889839} scrollRect: {fileID: 294750918} + isInteractable: 0 --- !u!114 &508283655 MonoBehaviour: m_ObjectHideFlags: 0 @@ -741,6 +741,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 508283652} m_Modifications: - target: {fileID: 8266031536408079396, guid: 79e94f8a015a0e242a9b4cc04523d574, @@ -859,6 +860,9 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 79e94f8a015a0e242a9b4cc04523d574, type: 3} --- !u!224 &931411704 stripped RectTransform: @@ -871,6 +875,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 508283652} m_Modifications: - target: {fileID: 2431982676670645471, guid: 06f7fede5f8506f4aaaca01736a75a9b, @@ -1045,6 +1050,9 @@ PrefabInstance: value: Main Menu objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 06f7fede5f8506f4aaaca01736a75a9b, type: 3} --- !u!224 &1198789063 stripped RectTransform: @@ -1057,6 +1065,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 4841538938736364, guid: b53f62b4ec10d6049be19f0009b4a204, type: 3} @@ -1092,12 +1101,16 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: b53f62b4ec10d6049be19f0009b4a204, type: 3} --- !u!1001 &1272889838 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 101628742} m_Modifications: - target: {fileID: 1636166841839465175, guid: eb9a84c1b0b6d25479b907acb118cde9, @@ -1221,6 +1234,21 @@ PrefabInstance: value: SearchResults PageCount Text objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 1636166841839465175, guid: eb9a84c1b0b6d25479b907acb118cde9, + type: 3} + insertIndex: -1 + addedObject: {fileID: 360213796} + - targetCorrespondingSourceObject: {fileID: 1636166841839465175, guid: eb9a84c1b0b6d25479b907acb118cde9, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1687775920} + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 7755028453825778640, guid: eb9a84c1b0b6d25479b907acb118cde9, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1272889842} m_SourcePrefab: {fileID: 100100000, guid: eb9a84c1b0b6d25479b907acb118cde9, type: 3} --- !u!114 &1272889839 stripped MonoBehaviour: @@ -1293,7 +1321,6 @@ RectTransform: m_Children: - {fileID: 21480367} m_Father: {fileID: 294750915} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1374,6 +1401,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 101628742} m_Modifications: - target: {fileID: 2431982675642039748, guid: 06f7fede5f8506f4aaaca01736a75a9b, @@ -1558,6 +1586,13 @@ PrefabInstance: value: Delete objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 2431982676814096018, guid: 06f7fede5f8506f4aaaca01736a75a9b, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1473139183} m_SourcePrefab: {fileID: 100100000, guid: 06f7fede5f8506f4aaaca01736a75a9b, type: 3} --- !u!224 &1473139181 stripped RectTransform: @@ -1589,6 +1624,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 508283652} m_Modifications: - target: {fileID: 2431982676670645471, guid: 06f7fede5f8506f4aaaca01736a75a9b, @@ -1743,6 +1779,9 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 06f7fede5f8506f4aaaca01736a75a9b, type: 3} --- !u!224 &1606626926 stripped RectTransform: @@ -1783,7 +1822,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1272889841} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -1902,6 +1940,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 7182009478751603585, guid: 8e2012e2fcbc3ba4dadd8e437eb036e1, @@ -1965,6 +2004,9 @@ PrefabInstance: value: EventSystem objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8e2012e2fcbc3ba4dadd8e437eb036e1, type: 3} --- !u!1 &1782536894 GameObject: @@ -1977,6 +2019,7 @@ GameObject: - component: {fileID: 1782536895} - component: {fileID: 1782536897} - component: {fileID: 1782536896} + - component: {fileID: 1782536898} m_Layer: 5 m_Name: Banner m_TagString: Untagged @@ -1997,7 +2040,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 508283652} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1} @@ -2042,11 +2084,68 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1782536894} m_CullTransparentMesh: 0 +--- !u!114 &1782536898 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1782536894} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Highlighted + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1782536896} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 508283653} + m_TargetAssemblyTypeName: Cgs.Cards.CardsExplorer, Cgs + m_MethodName: ShowGamesManagementMenu + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1001 &1844554168 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 4566502268858140, guid: 7aeec7aac0a4d0446bb25fbba25238ea, type: 3} @@ -2082,6 +2181,9 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 7aeec7aac0a4d0446bb25fbba25238ea, type: 3} --- !u!224 &1956308802 stripped RectTransform: @@ -2094,6 +2196,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 101628742} m_Modifications: - target: {fileID: 2431982676670645471, guid: 06f7fede5f8506f4aaaca01736a75a9b, @@ -2258,6 +2361,9 @@ PrefabInstance: value: New objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 06f7fede5f8506f4aaaca01736a75a9b, type: 3} --- !u!224 &2140515672 stripped RectTransform: @@ -2276,6 +2382,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 294750915} m_Modifications: - target: {fileID: 1829473601405758889, guid: 545336a218e4b2e43acf2260017946f3, @@ -2404,12 +2511,16 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 545336a218e4b2e43acf2260017946f3, type: 3} --- !u!1001 &2119387724375501495 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 508283652} m_Modifications: - target: {fileID: 1937112080862322656, guid: f21d26d7d58ad754090ee1fa5ed1746c, @@ -2553,6 +2664,9 @@ PrefabInstance: value: SetInput objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: f21d26d7d58ad754090ee1fa5ed1746c, type: 3} --- !u!224 &7858367718469537993 stripped RectTransform: @@ -2577,6 +2691,7 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: + serializedVersion: 3 m_TransformParent: {fileID: 294750915} m_Modifications: - target: {fileID: 9087162818281288176, guid: 0e544730aeae63048b6b7ee2a8429d38, @@ -2690,4 +2805,15 @@ PrefabInstance: value: HeaderDropShadow objectReference: {fileID: 0} m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0e544730aeae63048b6b7ee2a8429d38, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1229453696} + - {fileID: 1702196353} + - {fileID: 508283652} + - {fileID: 1844554168} diff --git a/Assets/Scripts/Cgs/CardGameManager.cs b/Assets/Scripts/Cgs/CardGameManager.cs index e6d2d3f7..3c55bbdb 100644 --- a/Assets/Scripts/Cgs/CardGameManager.cs +++ b/Assets/Scripts/Cgs/CardGameManager.cs @@ -752,6 +752,11 @@ private void Delete() } } + private void Update() + { + ImageQueueService.Instance.ProcessQueue(this); + } + private void LateUpdate() { Inputs.WasFocusBack = Inputs.IsFocusBack; diff --git a/Assets/Scripts/Cgs/Cards/CardsExplorer.cs b/Assets/Scripts/Cgs/Cards/CardsExplorer.cs index b497e1ca..fec28d48 100644 --- a/Assets/Scripts/Cgs/Cards/CardsExplorer.cs +++ b/Assets/Scripts/Cgs/Cards/CardsExplorer.cs @@ -24,6 +24,8 @@ public class CardsExplorer : MonoBehaviour public const string SingleCard = "Single Card"; public const string SetOfCards = "Set of Cards"; + public GameObject gamesManagementMenuPrefab; + public GameObject cardSetImportModalPrefab; public GameObject cardEditorMenuPrefab; public GameObject setImportMenuPrefab; @@ -32,6 +34,13 @@ public class CardsExplorer : MonoBehaviour public List editButtons; public SearchResults searchResults; +#if !UNITY_WEBGL + private GamesManagementMenu GamesManagement => + _gamesManagement ??= Instantiate(gamesManagementMenuPrefab).GetOrAddComponent(); + + private GamesManagementMenu _gamesManagement; +#endif + private DecisionModal NewCardSetModal => _newCardSetModal ??= Instantiate(cardSetImportModalPrefab).GetOrAddComponent(); @@ -60,8 +69,10 @@ private void Update() CardGameManager.Instance.ModalCanvas != null || searchResults.inputField.isFocused) return; - if (Inputs.IsFocus) + if (Inputs.IsFocusNext) searchResults.inputField.ActivateInputField(); + else if (Inputs.IsFocusBack && !Inputs.WasFocusBack) + ShowGamesManagementMenu(); else if (Inputs.IsFilter) searchResults.ShowSearchMenu(); else if (Inputs.IsNew) @@ -79,6 +90,14 @@ private void ResetBannerCardsAndButtons() button.SetActive(Settings.DeveloperMode); } + [UsedImplicitly] + public void ShowGamesManagementMenu() + { +#if !UNITY_WEBGL + GamesManagement.Show(); +#endif + } + [UsedImplicitly] public void ShowNewCardSetModal() { @@ -91,7 +110,8 @@ public void ShowNewCardSetModal() return; } - NewCardSetModal.Show(NewCardSetDecisionPrompt, new Tuple(SingleCard, ShowCardEditorMenu), + NewCardSetModal.Show(NewCardSetDecisionPrompt, + new Tuple(SingleCard, ShowCardEditorMenu), new Tuple(SetOfCards, ShowSetImportMenu)); } diff --git a/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs b/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs new file mode 100644 index 00000000..c50038d8 --- /dev/null +++ b/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs @@ -0,0 +1,65 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +using System.Collections; +using System.Collections.Concurrent; +using System.IO; +using UnityEngine; +using UnityExtensionMethods; + +namespace FinolDigital.Cgs.CardGameDef.Unity +{ + public class ImageQueueService + { + public const string SizeWarningMessage = "WARNING: Card image for {0} ({1}) is too large! \n" + + "Recommended Action: Delete the Card, compress the image file using a tool like " + + "https://www.iloveimg.com/compress-image " + + ", then re-import."; + + private static int ConcurrentQueueSize => 5; + + public static ImageQueueService Instance { get; } = new(); + + private readonly ConcurrentQueue _queue = new(); + + private int _concurrentQueueCount; + + public void Enqueue(UnityCard unityCard) + { + _queue.Enqueue(unityCard); + } + + public void ProcessQueue(MonoBehaviour coroutineRunner) + { + if (_concurrentQueueCount >= ConcurrentQueueSize || !_queue.TryDequeue(out var unityCard)) + return; + + _concurrentQueueCount++; + coroutineRunner.StartCoroutine(LoadImageSprite(unityCard)); + } + + private IEnumerator LoadImageSprite(UnityCard unityCard) + { + Sprite newSprite = null; +#if UNITY_WEBGL + yield return UnityFileMethods.RunOutputCoroutine( + UnityFileMethods.CreateAndOutputSpriteFromImageFile(unityCard.ImageWebUrl) + , output => newSprite = output); +#else + yield return UnityFileMethods.RunOutputCoroutine( + UnityFileMethods.CreateAndOutputSpriteFromImageFile(unityCard.ImageFilePath, + unityCard.ImageWebUrl.Replace(" ", "%20")) + , output => newSprite = output); + var fileInfo = new FileInfo(unityCard.ImageFilePath); + if (fileInfo.Exists && fileInfo.Length > 2_000_000) + { + var sizeWarningMessage = string.Format(SizeWarningMessage, unityCard.Name, unityCard.Id); + Debug.LogError(sizeWarningMessage); + } +#endif + unityCard.OnLoadImage(newSprite); + _concurrentQueueCount--; + } + } +} diff --git a/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs.meta b/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs.meta new file mode 100644 index 00000000..955f43e2 --- /dev/null +++ b/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/ImageQueueService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc7eb60946a281f4f9f7b0da7023bdd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/UnityCard.cs b/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/UnityCard.cs index c43362b8..c3a8ec49 100644 --- a/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/UnityCard.cs +++ b/Assets/Scripts/FinolDigital.Cgs.CardGameDef.Unity/UnityCard.cs @@ -2,10 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -using System; -using System.Collections; using System.Collections.Generic; -using System.IO; using UnityEngine; using UnityExtensionMethods; using Object = UnityEngine.Object; @@ -14,11 +11,6 @@ namespace FinolDigital.Cgs.CardGameDef.Unity { public class UnityCard : Card { - public const string SizeWarningMessage = "WARNING: Card image for {0} ({1}) is too large! \n" + - "Recommended Action: Delete the Card, compress the image file using a tool like " + - "https://www.iloveimg.com/compress-image " + - ", then re-import."; - public static readonly UnityCard Blank = new(UnityCardGame.UnityInvalid, string.Empty, string.Empty, string.Empty, new Dictionary(), false); @@ -27,9 +19,8 @@ public string ImageFileName get { var id = Id; - var backFaceIdExtension = "." + BackFaceId; - if (!IsBackFaceCard && !string.IsNullOrEmpty(BackFaceId) && id.Contains(backFaceIdExtension)) - id = id[..id.IndexOf(backFaceIdExtension, StringComparison.Ordinal)]; + if (!IsBackFaceCard && !string.IsNullOrEmpty(BackFaceId) && id.EndsWith("." + BackFaceId)) + id = id[..id.LastIndexOf('.')]; return UnityFileMethods.GetSafeFileName(id + "." + SourceGame.CardImageFileType); } } @@ -76,38 +67,19 @@ public void RegisterDisplay(ICardDisplay cardDisplay) if (ImageSprite != null) cardDisplay.SetImageSprite(ImageSprite); else if (!IsLoadingImage) - { - if (((UnityCardGame) SourceGame).CoroutineRunner != null) - ((UnityCardGame) SourceGame).CoroutineRunner.StartCoroutine(GetAndSetImageSprite()); - else - Debug.LogWarning("RegisterDisplay::NoImageOrImageLoader"); - } + EnqueueImageLoad(); } - public IEnumerator GetAndSetImageSprite() + private void EnqueueImageLoad() { - if (IsLoadingImage) - yield break; - IsLoadingImage = true; - Sprite newSprite = null; -#if UNITY_WEBGL - yield return UnityFileMethods.RunOutputCoroutine( - UnityFileMethods.CreateAndOutputSpriteFromImageFile(ImageWebUrl) - , output => newSprite = output); -#else - yield return UnityFileMethods.RunOutputCoroutine( - UnityFileMethods.CreateAndOutputSpriteFromImageFile(ImageFilePath, ImageWebUrl.Replace(" ", "%20")) - , output => newSprite = output); - var fileInfo = new FileInfo(ImageFilePath); - if (fileInfo.Exists && fileInfo.Length > 2_000_000) - { - var sizeWarningMessage = string.Format(SizeWarningMessage, Name, Id); - Debug.LogError(sizeWarningMessage); - } -#endif - if (newSprite != null) - ImageSprite = newSprite; + ImageQueueService.Instance.Enqueue(this); + } + + public void OnLoadImage(Sprite imageSprite) + { + if (imageSprite != null) + ImageSprite = imageSprite; IsLoadingImage = false; } diff --git a/docs/pages/roadmap.md b/docs/pages/roadmap.md index d3dc3d0a..fd11b586 100644 --- a/docs/pages/roadmap.md +++ b/docs/pages/roadmap.md @@ -5,13 +5,12 @@ permalink: roadmap.html # Roadmap ## What's New - v1.117 -- Bug-Fixes +- Cards Explorer: Add Games Management Menu button ## Sprint - Priority 1 - Bug-Fix: Android/iOS/iPad crashes - Bug-Fix: macOS Mission Control freezes - Game-Play: Support for card back faces - - Initial card image load when reprints not hidden error - Select backs folder in Game Editor Menu - Select back from dropdown in Card Creator Menu - Search backs in Card Search/Filter Menu