diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e68847e7..9fe9686ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -155,7 +155,7 @@ jobs: - StandaloneLinux64 - WebGL outputs: - buildVersion: ${{ steps.build.outputs.buildVersion }} + buildVersion: ${{ steps.buildStep.outputs.buildVersion }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -186,7 +186,7 @@ jobs: with: large-packages: false - name: Build Unity Project - id: build + id: buildStep uses: game-ci/unity-builder@main env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL_PERSONAL }} @@ -227,11 +227,11 @@ jobs: buildWithMac: name: Build for StandaloneOSX - runs-on: macos-latest + runs-on: macos-14 needs: [tests, lint] if: github.event.action == 'published' || contains(github.event.inputs.workflow_mode, 'release') || contains(github.event.inputs.workflow_mode, 'Steam') || contains(github.event.inputs.workflow_mode, 'Standalone') outputs: - buildVersion: ${{ steps.build.outputs.buildVersion }} + buildVersion: ${{ steps.buildStep.outputs.buildVersion }} timeout-minutes: 180 steps: - name: Checkout Repository @@ -258,7 +258,7 @@ jobs: key: Library-buildMac-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} restore-keys: Library-buildMac- - name: Build Unity Project - id: build + id: buildStep uses: game-ci/unity-builder@main env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL_PERSONAL }} @@ -316,7 +316,7 @@ jobs: deployToAppStore: name: Deploy to the App Store - runs-on: macos-latest + runs-on: macos-14 needs: buildWithLinux if: github.event.action == 'published' || (contains(github.event.inputs.workflow_mode, 'release') && contains(github.event.inputs.workflow_mode, 'iOS')) steps: @@ -448,7 +448,7 @@ jobs: deployToMacAppStore: name: Deploy to the Mac App Store - runs-on: macos-latest + runs-on: macos-14 needs: buildWithMac if: github.event.action == 'published' || (contains(github.event.inputs.workflow_mode, 'release') && contains(github.event.inputs.workflow_mode, 'StandaloneOSX')) steps: @@ -484,7 +484,7 @@ jobs: runs-on: windows-2022 needs: [buildWithLinux, buildWithMac] outputs: - buildVersion: ${{ steps.build.outputs.buildVersion }} + buildVersion: ${{ steps.buildStep.outputs.buildVersion }} strategy: fail-fast: false matrix: @@ -518,7 +518,7 @@ jobs: Library-buildWindows-${{ matrix.targetPlatform }}- Library-buildWindows- - name: Build Unity Project - id: build + id: buildStep timeout-minutes: 45 uses: game-ci/unity-builder@main env: @@ -782,11 +782,18 @@ jobs: UwpProjectDirectory: build\WSAPlayer\WSAPlayer\Card Game Simulator SigningCertificate: Card Game Simulator_StoreKey.pfx run: Remove-Item -path $env:UwpProjectDirectory\$env:SigningCertificate + - name: Copy .appxupload + working-directory: C:/Card-Game-Simulator.git + shell: pwsh + env: + APPX_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) }} + path: ${{ format('{0}\Card Game Simulator_{1}.0_x86_x64_arm_arm64_bundle_Master.appxupload', 'C:\Card-Game-Simulator.git', needs.buildWSAPlayer.outputs.buildVersion) }} + run: Copy-Item ".\$env:APPX_PATH\" -Destination ".\$env:path\" - name: Upload .appxupload uses: actions/upload-artifact@v4 with: name: ${{ format('Card Game Simulator_{0}.0_x86_x64_arm_arm64_bundle_Master.appxupload', needs.buildWSAPlayer.outputs.buildVersion) }} - 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) }} + path: ${{ format('{0}\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 working-directory: C:/Card-Game-Simulator.git shell: pwsh diff --git a/Assets/Prefabs/Components/Buttons/Framed.meta b/Assets/Prefabs/Components/Buttons/Framed.meta new file mode 100644 index 000000000..9935d8a83 --- /dev/null +++ b/Assets/Prefabs/Components/Buttons/Framed.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 87bb172ecc0c3dd44be76df422d455e4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Components/Buttons/Framed ButtonPair.prefab b/Assets/Prefabs/Components/Buttons/Framed/Framed ButtonPair.prefab similarity index 100% rename from Assets/Prefabs/Components/Buttons/Framed ButtonPair.prefab rename to Assets/Prefabs/Components/Buttons/Framed/Framed ButtonPair.prefab diff --git a/Assets/Prefabs/Components/Buttons/Framed ButtonPair.prefab.meta b/Assets/Prefabs/Components/Buttons/Framed/Framed ButtonPair.prefab.meta similarity index 100% rename from Assets/Prefabs/Components/Buttons/Framed ButtonPair.prefab.meta rename to Assets/Prefabs/Components/Buttons/Framed/Framed ButtonPair.prefab.meta diff --git a/Assets/Prefabs/Components/Buttons/Framed Image Button.prefab b/Assets/Prefabs/Components/Buttons/Framed/Framed Image Button.prefab similarity index 100% rename from Assets/Prefabs/Components/Buttons/Framed Image Button.prefab rename to Assets/Prefabs/Components/Buttons/Framed/Framed Image Button.prefab diff --git a/Assets/Prefabs/Components/Buttons/Framed Image Button.prefab.meta b/Assets/Prefabs/Components/Buttons/Framed/Framed Image Button.prefab.meta similarity index 100% rename from Assets/Prefabs/Components/Buttons/Framed Image Button.prefab.meta rename to Assets/Prefabs/Components/Buttons/Framed/Framed Image Button.prefab.meta diff --git a/Assets/Prefabs/Components/Buttons/Framed Labeled Button.prefab b/Assets/Prefabs/Components/Buttons/Framed/Framed Labeled Button.prefab similarity index 100% rename from Assets/Prefabs/Components/Buttons/Framed Labeled Button.prefab rename to Assets/Prefabs/Components/Buttons/Framed/Framed Labeled Button.prefab diff --git a/Assets/Prefabs/Components/Buttons/Framed Labeled Button.prefab.meta b/Assets/Prefabs/Components/Buttons/Framed/Framed Labeled Button.prefab.meta similarity index 100% rename from Assets/Prefabs/Components/Buttons/Framed Labeled Button.prefab.meta rename to Assets/Prefabs/Components/Buttons/Framed/Framed Labeled Button.prefab.meta diff --git a/Assets/Prefabs/Components/Buttons/Frameless.meta b/Assets/Prefabs/Components/Buttons/Frameless.meta new file mode 100644 index 000000000..568cda94f --- /dev/null +++ b/Assets/Prefabs/Components/Buttons/Frameless.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e4ea543fef41d347a4164e6e7640338 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Components/Buttons/Image Button.prefab b/Assets/Prefabs/Components/Buttons/Frameless/Image Button.prefab similarity index 100% rename from Assets/Prefabs/Components/Buttons/Image Button.prefab rename to Assets/Prefabs/Components/Buttons/Frameless/Image Button.prefab diff --git a/Assets/Prefabs/Components/Buttons/Image Button.prefab.meta b/Assets/Prefabs/Components/Buttons/Frameless/Image Button.prefab.meta similarity index 100% rename from Assets/Prefabs/Components/Buttons/Image Button.prefab.meta rename to Assets/Prefabs/Components/Buttons/Frameless/Image Button.prefab.meta diff --git a/Assets/Prefabs/Components/Buttons/Labeled Button.prefab b/Assets/Prefabs/Components/Buttons/Frameless/Labeled Button.prefab similarity index 100% rename from Assets/Prefabs/Components/Buttons/Labeled Button.prefab rename to Assets/Prefabs/Components/Buttons/Frameless/Labeled Button.prefab diff --git a/Assets/Prefabs/Components/Buttons/Labeled Button.prefab.meta b/Assets/Prefabs/Components/Buttons/Frameless/Labeled Button.prefab.meta similarity index 100% rename from Assets/Prefabs/Components/Buttons/Labeled Button.prefab.meta rename to Assets/Prefabs/Components/Buttons/Frameless/Labeled Button.prefab.meta diff --git a/Assets/Prefabs/Components/Buttons/Text Button.prefab b/Assets/Prefabs/Components/Buttons/Frameless/Text Button.prefab similarity index 100% rename from Assets/Prefabs/Components/Buttons/Text Button.prefab rename to Assets/Prefabs/Components/Buttons/Frameless/Text Button.prefab diff --git a/Assets/Prefabs/Components/Buttons/Text Button.prefab.meta b/Assets/Prefabs/Components/Buttons/Frameless/Text Button.prefab.meta similarity index 100% rename from Assets/Prefabs/Components/Buttons/Text Button.prefab.meta rename to Assets/Prefabs/Components/Buttons/Frameless/Text Button.prefab.meta diff --git a/Assets/Prefabs/Components/Buttons/Navigation Button.prefab b/Assets/Prefabs/Components/Buttons/Selectable Button.prefab similarity index 99% rename from Assets/Prefabs/Components/Buttons/Navigation Button.prefab rename to Assets/Prefabs/Components/Buttons/Selectable Button.prefab index 4769638f7..b46127b05 100644 --- a/Assets/Prefabs/Components/Buttons/Navigation Button.prefab +++ b/Assets/Prefabs/Components/Buttons/Selectable Button.prefab @@ -90,7 +90,7 @@ GameObject: - component: {fileID: 6745484287206745386} - component: {fileID: 60276916285824526} m_Layer: 5 - m_Name: Navigation Button + m_Name: Selectable Button m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Assets/Prefabs/Components/Buttons/Navigation Button.prefab.meta b/Assets/Prefabs/Components/Buttons/Selectable Button.prefab.meta similarity index 100% rename from Assets/Prefabs/Components/Buttons/Navigation Button.prefab.meta rename to Assets/Prefabs/Components/Buttons/Selectable Button.prefab.meta diff --git a/Assets/Prefabs/Menus/Games Management Menu.prefab b/Assets/Prefabs/Menus/Games Management Menu.prefab index 1292a288e..57583f1f2 100644 --- a/Assets/Prefabs/Menus/Games Management Menu.prefab +++ b/Assets/Prefabs/Menus/Games Management Menu.prefab @@ -142,8 +142,8 @@ MonoBehaviour: type: 3} browseButton: {fileID: 8073464704216129576} newButton: {fileID: 5415527586037167891} - editButton: {fileID: 3230080269742705660} - syncButton: {fileID: 2049986293988591451} + editButton: {fileID: 7098728383774738389} + syncButton: {fileID: 870083851265308053} --- !u!1 &1157992469845490830 GameObject: m_ObjectHideFlags: 0 @@ -457,7 +457,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0.00035001847} + m_AnchoredPosition: {x: 0, y: 0.0007663933} m_SizeDelta: {x: 0, y: 300} m_Pivot: {x: 0, y: 1} --- !u!114 &8222419885346354308 @@ -531,9 +531,9 @@ RectTransform: - {fileID: 8073464704216129576} - {fileID: 5415527586037167891} - {fileID: 1780242740204422869} - - {fileID: 8202997973238591162} - - {fileID: 3230080269742705660} - - {fileID: 2049986293988591451} + - {fileID: 4735624667956225649} + - {fileID: 7098728383774738389} + - {fileID: 870083851265308053} m_Father: {fileID: 1570242636571681144} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -846,7 +846,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1642032761377498598} + m_TransformParent: {fileID: 870083851265308053} m_Modifications: - target: {fileID: 633149931556260068, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -911,7 +911,7 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchorMax.x - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -926,17 +926,17 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_SizeDelta.x - value: 432.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_SizeDelta.y - value: 85 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -961,27 +961,27 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchoredPosition.x - value: 1453.75 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchoredPosition.y - value: -42.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -1175,7 +1175,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1642032761377498598} + m_TransformParent: {fileID: 7098728383774738389} m_Modifications: - target: {fileID: 633149931556260068, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -1220,7 +1220,7 @@ PrefabInstance: - target: {fileID: 633149931556260070, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -1240,7 +1240,7 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchorMax.x - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -1255,17 +1255,17 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_SizeDelta.x - value: 346 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_SizeDelta.y - value: 85 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -1290,27 +1290,27 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchoredPosition.x - value: 1151 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchoredPosition.y - value: -42.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -1374,6 +1374,139 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 2601649460009911067} m_PrefabAsset: {fileID: 0} +--- !u!1001 &3140258046109072330 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1642032761377498598} + m_Modifications: + - target: {fileID: 2848342772243254878, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Name + value: Sync Button + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_SizeDelta.x + value: 417.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_SizeDelta.y + value: 80 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 1252.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -42.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7269854554250268642, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + insertIndex: 0 + addedObject: {fileID: 2049986293988591451} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 30c175fe170c9e0459ee166821450a03, type: 3} +--- !u!224 &870083851265308053 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + m_PrefabInstance: {fileID: 3140258046109072330} + m_PrefabAsset: {fileID: 0} --- !u!1001 &4264484456897501747 PrefabInstance: m_ObjectHideFlags: 0 @@ -1570,7 +1703,7 @@ PrefabInstance: - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, type: 3} propertyPath: m_SizeDelta.x - value: 402.5 + value: 417.5 objectReference: {fileID: 0} - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, type: 3} @@ -1615,7 +1748,7 @@ PrefabInstance: - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, type: 3} propertyPath: m_AnchoredPosition.x - value: 402.5 + value: 417.5 objectReference: {fileID: 0} - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, type: 3} @@ -1878,6 +2011,144 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 4971259644129827266} m_PrefabAsset: {fileID: 0} +--- !u!1001 &4973354372684319114 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1642032761377498598} + m_Modifications: + - target: {fileID: 2848342772243254878, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Name + value: Edit Button + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254878, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_SizeDelta.x + value: 334 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_SizeDelta.y + value: 80 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 1002 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -42.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7269854554250268642, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + insertIndex: 0 + addedObject: {fileID: 3230080269742705660} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 30c175fe170c9e0459ee166821450a03, type: 3} +--- !u!224 &7098728383774738389 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + m_PrefabInstance: {fileID: 4973354372684319114} + m_PrefabAsset: {fileID: 0} --- !u!1001 &6308960296440999543 PrefabInstance: m_ObjectHideFlags: 0 @@ -1945,7 +2216,7 @@ PrefabInstance: - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, type: 3} propertyPath: m_SizeDelta.x - value: 402.5 + value: 417.5 objectReference: {fileID: 0} - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, type: 3} @@ -2058,6 +2329,139 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 6308960296440999543} m_PrefabAsset: {fileID: 0} +--- !u!1001 &7367617559333955630 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1642032761377498598} + m_Modifications: + - target: {fileID: 2848342772243254878, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Name + value: Share Button + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_SizeDelta.x + value: 417.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_SizeDelta.y + value: 80 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 835 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_AnchoredPosition.y + value: -42.5 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7269854554250268642, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + insertIndex: 0 + addedObject: {fileID: 8202997973238591162} + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 30c175fe170c9e0459ee166821450a03, type: 3} +--- !u!224 &4735624667956225649 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 2848342772243254879, guid: 30c175fe170c9e0459ee166821450a03, + type: 3} + m_PrefabInstance: {fileID: 7367617559333955630} + m_PrefabAsset: {fileID: 0} --- !u!1001 &7827406839536859468 PrefabInstance: m_ObjectHideFlags: 0 @@ -2410,7 +2814,7 @@ PrefabInstance: serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 1642032761377498598} + m_TransformParent: {fileID: 4735624667956225649} m_Modifications: - target: {fileID: 633149931556260068, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -2470,7 +2874,7 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchorMax.x - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -2485,17 +2889,17 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchorMin.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_SizeDelta.x - value: 432.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_SizeDelta.y - value: 85 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} @@ -2520,27 +2924,27 @@ PrefabInstance: - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchoredPosition.x - value: 1021.25 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} propertyPath: m_AnchoredPosition.y - value: -42.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 633149931556260071, guid: 050b35c711bf97548b7054e54e7b44b4, type: 3} diff --git a/Assets/Scripts/Cgs/CardGameManager.cs b/Assets/Scripts/Cgs/CardGameManager.cs index 543ba2d50..5400bb0c3 100644 --- a/Assets/Scripts/Cgs/CardGameManager.cs +++ b/Assets/Scripts/Cgs/CardGameManager.cs @@ -8,7 +8,6 @@ using System.IO; using System.Linq; using System.Runtime.CompilerServices; -using System.Text.RegularExpressions; using System.Web; using Cgs.Menu; using FinolDigital.Cgs.CardGameDef; @@ -639,11 +638,10 @@ private void IgnoreCurrentErroredGame() public void Share() { - Debug.Log("CGS Share:: Deep:" + Current.CgsGamesLink + " Auto:" + Current.AutoUpdateUrl); - if (Current.AutoUpdateUrl != null && Current.AutoUpdateUrl.IsWellFormedOriginalString()) + Debug.Log("CGS Share:: CgsGamesLink:" + Current.CgsGamesLink); + if (Current.CgsGamesLink != null && Current.CgsGamesLink.IsWellFormedOriginalString()) { - var deepLink = Current.CgsGamesLink?.OriginalString ?? BuildDeepLink(); - var shareMessage = string.Format(ShareDeepLinkMessage, Current.Name, deepLink); + var shareMessage = string.Format(ShareDeepLinkMessage, Current.Name, Current.CgsGamesLink); #if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR var nativeShare = new NativeShare(); nativeShare.SetText(shareMessage).Share(); @@ -656,20 +654,6 @@ public void Share() ExportGame(); } - private static string BuildDeepLink() - { - var deepLink = "https://cgs.link/?link="; - deepLink += "https://www.cardgamesimulator.com/link?url%3D" + - HttpUtility.UrlEncode(HttpUtility.UrlEncode(Current.AutoUpdateUrl?.OriginalString)); - deepLink += "&apn=com.finoldigital.cardgamesim&isi=1392877362&ibi=com.finoldigital.CardGameSim"; - var regex = new Regex("[^a-zA-Z0-9 -]"); - var encodedName = regex.Replace(Current.Name, "+"); - deepLink += "&st=Card+Game+Simulator+-+" + encodedName + "&sd=Play+" + encodedName + "+on+CGS!"; - if (Current.BannerImageUrl != null && Current.BannerImageUrl.IsWellFormedOriginalString()) - deepLink += "&si=" + Current.BannerImageUrl.OriginalString; - return deepLink; - } - private static void ExportGame() { var container = Path.Combine(UnityCardGame.GamesExportPath, UnityFileMethods.GetSafeFileName(Current.Id)); diff --git a/Assets/Scripts/Cgs/CardGameView/Multiplayer/CardStack.cs b/Assets/Scripts/Cgs/CardGameView/Multiplayer/CardStack.cs index 4e2037214..2add0b9d6 100644 --- a/Assets/Scripts/Cgs/CardGameView/Multiplayer/CardStack.cs +++ b/Assets/Scripts/Cgs/CardGameView/Multiplayer/CardStack.cs @@ -88,16 +88,25 @@ public string Name [NotNull] public IReadOnlyList Cards { - // This getter is slow, so it should be cached when appropriate get { - List cards = new(); + if (!CgsNetManager.Instance.IsOnline) + return _cards; + + _cards = new List(); foreach (var cardId in _cardIds) - cards.Add(CardGameManager.Current.Cards[cardId]); - return cards; + _cards.Add(CardGameManager.Current.Cards[cardId]); + return _cards; } set { + _cards = new List(); + foreach (var unityCard in value) + _cards.Add(unityCard); + + if (!CgsNetManager.Instance.IsOnline) + return; + if (!CgsNetManager.Instance.IsConnectedClient || IsOwner) { _cardIds.Clear(); @@ -109,7 +118,8 @@ public IReadOnlyList Cards } } - private NetworkList _cardIds; + private List _cards = new(); + private readonly NetworkList _cardIds = new(); private readonly NetworkVariable _actionText = new(); private readonly NetworkVariable _actionTime = new(); @@ -144,13 +154,16 @@ public bool IsTopFaceup public override void OnNetworkSpawn() { + _cards = new List(); + foreach (var cardId in _cardIds) + _cards.Add(CardGameManager.Current.Cards[cardId]); _isTopFaceup = _isTopFaceupNetworkVariable.Value; } protected override void OnAwakePlayable() { - _cardIds = new NetworkList(); _name.OnValueChanged += OnChangeName; + _cardIds.OnListChanged += OnCardsUpdated; _isTopFaceupNetworkVariable.OnValueChanged += OnChangeIsTopFaceup; } @@ -168,8 +181,7 @@ protected override void OnStartPlayable() if (!IsOwner) deckLabel.text = Name; - countLabel.text = _cardIds.Count.ToString(); - _cardIds.OnListChanged += OnCardsUpdated; + countLabel.text = Cards.Count.ToString(); topCard.sprite = CardGameManager.Current.CardBackImageSprite; if (IsTopFaceup) @@ -257,16 +269,16 @@ public static CardStack GetPointerDrag(PointerEventData eventData) private void DragCard(PointerEventData eventData) { - if (_cardIds.Count < 1) + if (Cards.Count < 1) { Debug.LogWarning("Attempted to remove from an empty card stack"); return; } - var unityCard = CardGameManager.Current.Cards[_cardIds[^1]]; + var unityCard = Cards[^1]; if (CgsNetManager.Instance.IsOnline) - CgsNetManager.Instance.LocalPlayer.RequestRemoveAt(gameObject, _cardIds.Count - 1); + CgsNetManager.Instance.LocalPlayer.RequestRemoveAt(gameObject, Cards.Count - 1); else PopCard(); @@ -275,7 +287,7 @@ private void DragCard(PointerEventData eventData) RemovePointer(eventData); - if (PlaySettings.AutoStackCards && _cardIds.Count < 1) + if (PlaySettings.AutoStackCards && Cards.Count < 1) RequestDelete(); } @@ -289,15 +301,24 @@ public void OnChangeName(CgsNetString oldName, CgsNetString newName) // ReSharper disable once ParameterTypeCanBeEnumerable.Local private void UpdateCardsServerRpc(CgsNetString[] cardIds) { + _cards = new List(); _cardIds.Clear(); foreach (var cardId in cardIds) + { + _cards.Add(CardGameManager.Current.Cards[cardId]); _cardIds.Add(cardId); + } } private void OnCardsUpdated(NetworkListEvent changeEvent) { + _cards = new List(); + foreach (var cardId in _cardIds) + _cards.Add(CardGameManager.Current.Cards[cardId]); + if (IsTopFaceup) { + // Should this be part of SyncView()? if (changeEvent.Type.Equals(NetworkListEvent.EventType.RemoveAt) && changeEvent.Index == _cardIds.Count) { @@ -317,7 +338,12 @@ private void OnCardsUpdated(NetworkListEvent changeEvent) } } - countLabel.text = _cardIds.Count.ToString(); + SyncView(); + } + + private void SyncView() + { + countLabel.text = Cards.Count.ToString(); if (Viewer != null) Viewer.Sync(this); } @@ -330,8 +356,8 @@ public void OnDrop(CardModel cardModel) public void OnDrop(CardStack cardStack) { - for (var i = _cardIds.Count - 1; i >= 0; i--) - cardStack.RequestInsert(0, _cardIds[i]); + for (var i = _cards.Count - 1; i >= 0; i--) + cardStack.RequestInsert(0, _cards[i].Id); RequestDelete(); } @@ -345,22 +371,30 @@ public void RequestInsert(int index, string cardId) public void OwnerInsert(int index, string cardId) { - Debug.Log($"CardStack: {name} insert {cardId} at {index} of {_cardIds.Count}"); - _cardIds.Insert(index, cardId); + Debug.Log($"CardStack: {name} insert {cardId} at {index} of {Cards.Count}"); + _cards.Insert(index, CardGameManager.Current.Cards[cardId]); + if (CgsNetManager.Instance.IsOnline) + _cardIds.Insert(index, cardId); + else + SyncView(); } public string RemoveAt(int index) { - if (index < 0 || index >= _cardIds.Count) + if (index < 0 || index >= Cards.Count) return UnityCard.Blank.Id; - var cardId = _cardIds[index]; - _cardIds.RemoveAt(index); + var cardId = _cards[index].Id; + _cards.RemoveAt(index); + if (CgsNetManager.Instance.IsOnline) + _cardIds.RemoveAt(index); + else + SyncView(); return cardId; } public string PopCard() { - return RemoveAt(_cardIds.Count - 1); + return RemoveAt(Cards.Count - 1); } [ServerRpc(RequireOwnership = false)] @@ -396,7 +430,7 @@ public void PromptShuffle() private void Shuffle() { - if (CgsNetManager.Instance != null && CgsNetManager.Instance.IsOnline) + if (CgsNetManager.Instance.IsOnline) CgsNetManager.Instance.LocalPlayer.RequestShuffle(gameObject); else DoShuffle(); @@ -404,19 +438,23 @@ private void Shuffle() public void DoShuffle() { + var cards = Cards.Select(card => card.Id).ToList(); + cards.Shuffle(); + + _cards = cards.Select(card => CardGameManager.Current.Cards[card]).ToList(); + + if (!CgsNetManager.Instance.IsOnline) + return; + if (CgsNetManager.Instance.IsConnectedClient && !IsServer) { Debug.LogError("Attempted to shuffle on client!"); return; } - var cards = new List(); - foreach (var card in _cardIds) - cards.Add(card); - cards.Shuffle(); _cardIds.Clear(); - foreach (var card in cards) - _cardIds.Add(card); + foreach (var card in _cards) + _cardIds.Add(card.Id); _actionText.Value = ShuffleText; _actionTime.Value = 1; diff --git a/Assets/Scripts/Cgs/CardGameView/Viewer/StackViewer.cs b/Assets/Scripts/Cgs/CardGameView/Viewer/StackViewer.cs index aaa8bffda..df37bb459 100644 --- a/Assets/Scripts/Cgs/CardGameView/Viewer/StackViewer.cs +++ b/Assets/Scripts/Cgs/CardGameView/Viewer/StackViewer.cs @@ -146,7 +146,7 @@ private void OnAddCardModel(CardZone cardZone, CardModel cardModel) var cardModels = contentCardZone.GetComponentsInChildren(); countLabel.text = cardModels.Length.ToString(); - if (_handIndex != null) + if (CgsNetManager.Instance.IsOnline && _handIndex != null) CgsNetManager.Instance.LocalPlayer.RequestSyncHand((int) _handIndex, cardModels.Select(card => (CgsNetString) card.Id).ToArray()); @@ -166,7 +166,7 @@ private void OnRemoveCardModel(CardZone cardZone, CardModel cardModel) var cardModels = contentCardZone.GetComponentsInChildren(); countLabel.text = cardModels.Length.ToString(); - if (_handIndex != null) + if (CgsNetManager.Instance.IsOnline && _handIndex != null) CgsNetManager.Instance.LocalPlayer.RequestSyncHand((int) _handIndex, cardModels.Select(card => (CgsNetString) card.Id).ToArray()); diff --git a/Assets/Scripts/Cgs/Decks/DeckLoadMenu.cs b/Assets/Scripts/Cgs/Decks/DeckLoadMenu.cs index 1e8aff3a1..0e8d632b7 100644 --- a/Assets/Scripts/Cgs/Decks/DeckLoadMenu.cs +++ b/Assets/Scripts/Cgs/Decks/DeckLoadMenu.cs @@ -222,7 +222,7 @@ public void DeleteFile() } catch (Exception e) { - Debug.LogError(DeckDeleteErrorMessage + e.Message); + Debug.LogError(DeckDeleteErrorMessage + e); } _selectedFilePath = string.Empty; @@ -244,7 +244,7 @@ public void Share() } catch (Exception e) { - Debug.LogError(DeckLoadErrorMessage + e.Message); + Debug.LogError(DeckLoadErrorMessage + e); CardGameManager.Instance.Messenger.Show(DeckLoadErrorMessage + e.Message); } } @@ -262,7 +262,7 @@ public void LoadFromFileAndHide() } catch (Exception e) { - Debug.LogError(DeckLoadErrorMessage + e.Message); + Debug.LogError(DeckLoadErrorMessage + e); CardGameManager.Instance.Messenger.Show(DeckLoadErrorMessage + e.Message); } } @@ -348,7 +348,7 @@ private void DoSave() } catch (Exception e) { - Debug.LogError(DeckSaveErrorMessage + e.Message); + Debug.LogError(DeckSaveErrorMessage + e); } } diff --git a/Assets/Scripts/Cgs/Menu/CardGameEditorMenu.cs b/Assets/Scripts/Cgs/Menu/CardGameEditorMenu.cs index b4d11bd32..7a60bc197 100644 --- a/Assets/Scripts/Cgs/Menu/CardGameEditorMenu.cs +++ b/Assets/Scripts/Cgs/Menu/CardGameEditorMenu.cs @@ -36,7 +36,6 @@ public class CardGameEditorMenu : Modal public const string SelectPlayMatImageFilePrompt = "Select PlayMat Image File"; #endif public const string ImportImageWarningMessage = "No image file selected for import!"; - public const string CreateWarningMessage = "A game with that name already exists!"; public const string CreationWarningMessage = "Failed to create the custom card game! "; public const string CreationCleanupErrorMessage = "Failed to both create and cleanup during creation! "; @@ -425,14 +424,24 @@ private IEnumerator CreateGame() yield break; var gameName = GameName.Trim().Replace("@", ""); - if (CardGameManager.Instance.AllCardGames.ContainsKey(gameName)) - { - CardGameManager.Instance.Messenger.Show(CreateWarningMessage); - yield break; - } var unityCardGame = _game; - if (!_isEdit) + if (_isEdit) + { + unityCardGame.Name = gameName; + unityCardGame.CardSize = new Float2(_width, _height); + unityCardGame.BannerImageFileType = BannerImageFileType == 0 ? "png" : "jpg"; + unityCardGame.CardBackImageFileType = CardBackImageFileType == 0 ? "png" : "jpg"; + unityCardGame.PlayMatImageFileType = PlayMatImageFileType == 0 ? "png" : "jpg"; + unityCardGame.Copyright = string.IsNullOrWhiteSpace(Copyright) ? "" : Copyright; + unityCardGame.RulesUrl = + Uri.IsWellFormedUriString(RulesUrl, UriKind.Absolute) ? new Uri(RulesUrl) : null; + unityCardGame.CardPrimaryProperty = string.IsNullOrWhiteSpace(CardProperty) ? "" : CardProperty; + unityCardGame.CardProperties = string.IsNullOrWhiteSpace(CardProperty) + ? new List() + : Of(CardProperty); + } + else { unityCardGame = new UnityCardGame(CardGameManager.Instance, gameName) { diff --git a/Assets/Scripts/Cgs/Menu/GamesManagementMenu.cs b/Assets/Scripts/Cgs/Menu/GamesManagementMenu.cs index 7c5100743..18a9c9499 100644 --- a/Assets/Scripts/Cgs/Menu/GamesManagementMenu.cs +++ b/Assets/Scripts/Cgs/Menu/GamesManagementMenu.cs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ using System; +using System.IO; using System.Linq; using Cgs.UI; using JetBrains.Annotations; @@ -204,10 +205,21 @@ public void Delete() public void Sync() { if (CardGameManager.Current.AutoUpdateUrl?.IsWellFormedOriginalString() ?? false) + { + if (File.Exists(CardGameManager.Current.BannerImageFilePath)) + File.Delete(CardGameManager.Current.BannerImageFilePath); + if (File.Exists(CardGameManager.Current.CardBackImageFilePath)) + File.Delete(CardGameManager.Current.CardBackImageFilePath); + if (File.Exists(CardGameManager.Current.PlayMatImageFilePath)) + File.Delete(CardGameManager.Current.PlayMatImageFilePath); + if (Directory.Exists(CardGameManager.Current.SetsDirectoryPath)) + Directory.Delete(CardGameManager.Current.SetsDirectoryPath, true); CardGameManager.Instance.StartCoroutine( CardGameManager.Instance.UpdateCardGame(CardGameManager.Current)); + } else CardGameManager.Instance.Messenger.Show(NoSyncMessage); + Hide(); } diff --git a/Assets/Scripts/Cgs/Play/Drawer/CardDrawer.cs b/Assets/Scripts/Cgs/Play/Drawer/CardDrawer.cs index 368431717..a29712665 100644 --- a/Assets/Scripts/Cgs/Play/Drawer/CardDrawer.cs +++ b/Assets/Scripts/Cgs/Play/Drawer/CardDrawer.cs @@ -166,7 +166,8 @@ public void AddTab() viewer.drops.Add(cardZoneCardDropArea); tabTemplate.CardZoneCardDropArea = cardZoneCardDropArea; - CgsNetManager.Instance.LocalPlayer.RequestNewHand(DefaultDrawerName); + if (CgsNetManager.Instance.IsOnline) + CgsNetManager.Instance.LocalPlayer.RequestNewHand(DefaultDrawerName); } [UsedImplicitly] @@ -174,7 +175,7 @@ public void SelectTab(int tabIndex) { if (tabIndex >= cardZoneRectTransforms.Count) { - Debug.Log($"SelectTab {tabIndex} but not created yet."); + Debug.LogWarning($"SelectTab {tabIndex} but not created yet."); return; } @@ -183,7 +184,8 @@ public void SelectTab(int tabIndex) var cardZone = cardZoneRectTransforms[tabIndex].GetComponentInChildren(); var localCardIds = cardZone.GetComponentsInChildren().Select(cardModel => cardModel.Id).ToList(); - if (CgsNetManager.Instance != null && CgsNetManager.Instance.LocalPlayer != null) + if (CgsNetManager.Instance != null && CgsNetManager.Instance.IsOnline && + CgsNetManager.Instance.LocalPlayer != null) { CgsNetManager.Instance.LocalPlayer.RequestUseHand(tabIndex); var handCards = CgsNetManager.Instance.LocalPlayer.HandCards; @@ -255,7 +257,7 @@ private void RemoveTab(int tabIndex) viewer.drops.Remove(tabTemplate.CardZoneCardDropArea); viewer.drops.Remove(tabTemplate.TabCardDropArea); - var cardZoneRectTransform = cardZoneRectTransforms[tabIndex - 1]; + var cardZoneRectTransform = cardZoneRectTransforms[tabIndex]; cardZoneRectTransforms.Remove(cardZoneRectTransform); Destroy(cardZoneRectTransform.gameObject); @@ -273,7 +275,8 @@ private void RemoveTab(int tabIndex) sizeDelta = new Vector2(sizeDelta.x - ((RectTransform) tabPrefab.transform).sizeDelta.x, sizeDelta.y); tabsRectTransform.sizeDelta = sizeDelta; - CgsNetManager.Instance.LocalPlayer.RequestRemoveHand(tabIndex); + if (CgsNetManager.Instance.IsOnline) + CgsNetManager.Instance.LocalPlayer.RequestRemoveHand(tabIndex); } public void Clear() diff --git a/Gemfile.lock b/Gemfile.lock index 65aae3615..ca0637ef3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM base64 nkf rexml - activesupport (7.1.2) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -33,29 +33,29 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.921.0) - aws-sdk-core (3.193.0) + aws-partitions (1.930.0) + aws-sdk-core (3.196.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.80.0) + aws-sdk-kms (1.81.0) aws-sdk-core (~> 3, >= 3.193.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.148.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-s3 (1.151.0) + aws-sdk-core (~> 3, >= 3.194.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.8) aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) - bigdecimal (3.1.5) + bigdecimal (3.1.8) claide (1.1.0) - cocoapods (1.14.3) + cocoapods (1.15.2) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.14.3) + cocoapods-core (= 1.15.2) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -70,7 +70,7 @@ GEM nap (~> 1.0) ruby-macho (>= 2.3.0, < 3.0) xcodeproj (>= 1.23.0, < 2.0) - cocoapods-core (1.14.3) + cocoapods-core (1.15.2) activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) @@ -93,15 +93,14 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) domain_name (0.6.20240107) dotenv (2.8.1) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) emoji_regex (3.2.3) escape (0.0.4) ethon (0.16.0) @@ -222,7 +221,7 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.14.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.7.2) @@ -230,10 +229,10 @@ GEM base64 mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.23.0) molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.4.0) + multipart-post (2.4.1) mutex_m (0.2.0) nanaimo (0.3.0) nap (1.1.0) @@ -252,7 +251,8 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) rouge (2.0.7) ruby-macho (2.5.1) ruby2_keywords (0.0.5) @@ -267,6 +267,7 @@ GEM CFPropertyList naturally sshkey (3.0.0) + strscan (3.1.0) terminal-notifier (2.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) diff --git a/ProjectSettings/QualitySettings.asset b/ProjectSettings/QualitySettings.asset index e4736f074..1d9ed697d 100644 --- a/ProjectSettings/QualitySettings.asset +++ b/ProjectSettings/QualitySettings.asset @@ -302,8 +302,8 @@ QualitySettings: excludedTargetPlatforms: [] m_TextureMipmapLimitGroupNames: [] m_PerPlatformDefaultQuality: - Android: 0 + Android: 5 Server: 5 Standalone: 5 - WebGL: 0 + WebGL: 5 Windows Store Apps: 5 diff --git a/docs/pages/roadmap.md b/docs/pages/roadmap.md index 08777bcd8..a71b4868c 100644 --- a/docs/pages/roadmap.md +++ b/docs/pages/roadmap.md @@ -4,27 +4,21 @@ permalink: roadmap.html # Roadmap -## What's New - v1.106 -- Bug-Fix: Multiplayer syncing of rotating card -- Games Management Menu: Edit Button +## What's New - v1.107 +Minor Bug Fixes ## Active Sprint -- Bug-Fix: Grand Archive TCG multi-player +- Bug-Fix: LAN connectivity +- Bug-Fix: When the Stack becomes 3, it clones the last 2 cards as a separate stack +- Bug-Fix: Grand Archive TCG multi-player` - Memory Zones aren't displayed on the joining client. - Host's Decks aren't shown on the Joining Client. - Memory zone face done cards aren't shown on the joining client. - Loaded Decks on the joining client don't go to their respective zones -- Bug-Fix: Deleting drawers - - https://github.com/finol-digital/Card-Game-Simulator/issues/131 - - https://github.com/finol-digital/Card-Game-Simulator/issues/132 -- Bug-Fix: LAN -- Bug-Fix: Sync button does not update Game -- Bug-Fix: Card image blurriness/image quality management -- Bug-Fix: When the Stack becomes 3, it clones the last 2 cards as a separate stack +- Cards: Support more than 1 card face (Dual-Faced Cards) +- Game-Play: Cards Action modal - includes draw many and contextual green button for default action based on card location ## Backlog - Priority 1 -- Games Management Menu: CGS Games Browser -- Game-Play: Right-click for context menu - includes draw many and contextual green button for default action based on card location - Game-Play: Name-Plates indicating player seats - Game-Play: Label which player is interacting with cards/playables - Game-Play: Counter system for players and cards (Dice grouping/parenting) @@ -51,10 +45,10 @@ permalink: roadmap.html - Option for card count limits, i.e. 3 copies per deck - Option to have a hard deck size limit applied, as well as for extras, I.e. 50 card main deck, 5 card extra deck - Cards: Support mix of different card sizes in the same game -- Cards: Support more than 1 card face (Dual-Faced Cards) - Cards: Support multiple card backs ## Backlog - Priority 3 +- Games Management Menu: CGS Games Browser - Game-Play: Support multiple playmats - Game-Play: Setup gamepad and keyboard shortcuts/hotkeys for Game-Play and Settings - Platforms: Display gamepad and keyboard shortcuts/hotkeys in-app