diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 339f2a9e8..7cdbc9260 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -14,25 +14,30 @@ on: prerelease: description: 'Is this a prerelease?' required: true - default: 'true' + type: boolean + default: true source-feed: - description: | - Which source feed to publish to? - (Valid values are 'NuGet' or 'GitHub') + description: 'Which source feed to publish to?' required: true - default: GitHub + type: choice + options: + - GitHub + - NuGet + default: 'GitHub' jobs: build: name: "Build MonoGame.Extended" runs-on: ubuntu-latest env: - IS_PRERELEASE: ${{ inputs.prerelease == 'true' }} - BUILD_NUMBER: ${{ inputs.prerelease == 'true' && github.run_number || '' }} + IS_PRERELEASE: ${{ inputs.prerelease || '' }} + BUILD_NUMBER: ${{ inputs.prerelease && github.run_number || '' }} steps: - name: Clone Repository uses: actions/checkout@v4 + with: + ref: ${{ inputs.prerelease && 'develop' || 'main' }} - name: Setup Dotnet uses: actions/setup-dotnet@v4 diff --git a/Directory.Build.props b/Directory.Build.props index 6552621ae..1f01b9a03 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ - 3.9.0 + 4.0.0 -prerelease .$(BUILD_NUMBER) $(MonoGameExtendedVersion)$(IsPrerelease)$(BuildNumber) diff --git a/FNA.Extended.sln b/FNA.Extended.sln index e3308961a..ace964c9c 100644 --- a/FNA.Extended.sln +++ b/FNA.Extended.sln @@ -7,34 +7,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "source", "source", "{2BD6F8 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended", "source\MonoGame.Extended\FNA.Extended.csproj", "{C8717306-E333-418E-86A7-8D9781D7FDAC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Animations", "source\MonoGame.Extended.Animations\FNA.Extended.Animations.csproj", "{71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Collisions", "source\MonoGame.Extended.Collisions\FNA.Extended.Collisions.csproj", "{7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Entities", "source\MonoGame.Extended.Entities\FNA.Extended.Entities.csproj", "{CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Graphics", "source\MonoGame.Extended.Graphics\FNA.Extended.Graphics.csproj", "{56627685-4BA7-44E3-ACA6-F2990DE089F2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Input", "source\MonoGame.Extended.Input\FNA.Extended.Input.csproj", "{76B39424-7884-4EEC-A8D5-5126B29941B7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Particles", "source\MonoGame.Extended.Particles\FNA.Extended.Particles.csproj", "{BE74938D-9004-4D36-AD50-5C6C141A7180}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Tiled", "source\MonoGame.Extended.Tiled\FNA.Extended.Tiled.csproj", "{572C908D-4627-4678-9641-D4950DE43B13}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Tweening", "source\MonoGame.Extended.Tweening\FNA.Extended.Tweening.csproj", "{F144A062-4FF3-44EC-9A04-31C654B436B0}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{61C82014-E3A9-4AB3-8705-FBBD5F799BA6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Collisions.Tests", "tests\MonoGame.Extended.Collisions.Tests\FNA.Extended.Collisions.Tests.csproj", "{58F88A3C-C09F-4664-A34E-60E89252870A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Entities.Tests", "tests\MonoGame.Extended.Entities.Tests\FNA.Extended.Entities.Tests.csproj", "{D3B0E350-B92E-4E49-99A3-68E66CB53F16}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Tests", "tests\MonoGame.Extended.Tests\FNA.Extended.Tests.csproj", "{E1339B07-EB0B-454F-9803-E923843DB5C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Tiled.Tests", "tests\MonoGame.Extended.Tiled.Tests\FNA.Extended.Tiled.Tests.csproj", "{BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.Extended.Tweening.Tests", "tests\MonoGame.Extended.Tweening.Tests\FNA.Extended.Tweening.Tests.csproj", "{C2A9982B-7BF7-4243-9E05-CFD31752B6DC}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FNA", "FNA", "{4B7E02CB-D58F-4326-A0A4-7AE70E47F8E3}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FNA.NetStandard", "..\FNA\FNA.NetStandard.csproj", "{E628BEDB-B51C-42ED-8E2B-FD8CA2A3BF3B}" @@ -55,86 +31,6 @@ Global {C8717306-E333-418E-86A7-8D9781D7FDAC}.Release|Any CPU.Build.0 = Release|Any CPU {C8717306-E333-418E-86A7-8D9781D7FDAC}.Release|x86.ActiveCfg = Release|Any CPU {C8717306-E333-418E-86A7-8D9781D7FDAC}.Release|x86.Build.0 = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|x86.ActiveCfg = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|x86.Build.0 = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|Any CPU.Build.0 = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|x86.ActiveCfg = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|x86.Build.0 = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|x86.ActiveCfg = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|x86.Build.0 = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|Any CPU.Build.0 = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|x86.ActiveCfg = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|x86.Build.0 = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|x86.ActiveCfg = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|x86.Build.0 = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|Any CPU.Build.0 = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|x86.ActiveCfg = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|x86.Build.0 = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|x86.ActiveCfg = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|x86.Build.0 = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|Any CPU.Build.0 = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|x86.ActiveCfg = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|x86.Build.0 = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|x86.ActiveCfg = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|x86.Build.0 = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|Any CPU.Build.0 = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|x86.ActiveCfg = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|x86.Build.0 = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|x86.ActiveCfg = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|x86.Build.0 = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|Any CPU.Build.0 = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|x86.ActiveCfg = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|x86.Build.0 = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|x86.ActiveCfg = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|x86.Build.0 = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|Any CPU.Build.0 = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|x86.ActiveCfg = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|x86.Build.0 = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|x86.ActiveCfg = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|x86.Build.0 = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|Any CPU.Build.0 = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|x86.ActiveCfg = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|x86.Build.0 = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|x86.ActiveCfg = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|x86.Build.0 = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|Any CPU.Build.0 = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|x86.ActiveCfg = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|x86.Build.0 = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|x86.ActiveCfg = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|x86.Build.0 = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|Any CPU.Build.0 = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|x86.ActiveCfg = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|x86.Build.0 = Release|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -143,22 +39,6 @@ Global {E1339B07-EB0B-454F-9803-E923843DB5C4}.Release|Any CPU.Build.0 = Release|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Release|x86.ActiveCfg = Release|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Release|x86.Build.0 = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|x86.ActiveCfg = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|x86.Build.0 = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|Any CPU.Build.0 = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|x86.ActiveCfg = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|x86.Build.0 = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|x86.ActiveCfg = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|x86.Build.0 = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|Any CPU.Build.0 = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|x86.ActiveCfg = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|x86.Build.0 = Release|Any CPU {E628BEDB-B51C-42ED-8E2B-FD8CA2A3BF3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E628BEDB-B51C-42ED-8E2B-FD8CA2A3BF3B}.Debug|Any CPU.Build.0 = Debug|Any CPU {E628BEDB-B51C-42ED-8E2B-FD8CA2A3BF3B}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -173,19 +53,7 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {C8717306-E333-418E-86A7-8D9781D7FDAC} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {56627685-4BA7-44E3-ACA6-F2990DE089F2} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {76B39424-7884-4EEC-A8D5-5126B29941B7} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {BE74938D-9004-4D36-AD50-5C6C141A7180} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {572C908D-4627-4678-9641-D4950DE43B13} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {F144A062-4FF3-44EC-9A04-31C654B436B0} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {58F88A3C-C09F-4664-A34E-60E89252870A} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} - {D3B0E350-B92E-4E49-99A3-68E66CB53F16} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} {E1339B07-EB0B-454F-9803-E923843DB5C4} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} {E628BEDB-B51C-42ED-8E2B-FD8CA2A3BF3B} = {4B7E02CB-D58F-4326-A0A4-7AE70E47F8E3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/KNI.Extended.sln b/KNI.Extended.sln index f21009f63..7f1bbee0f 100644 --- a/KNI.Extended.sln +++ b/KNI.Extended.sln @@ -7,40 +7,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "source", "source", "{2BD6F8 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended", "source\MonoGame.Extended\KNI.Extended.csproj", "{C8717306-E333-418E-86A7-8D9781D7FDAC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Animations", "source\MonoGame.Extended.Animations\KNI.Extended.Animations.csproj", "{71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Collisions", "source\MonoGame.Extended.Collisions\KNI.Extended.Collisions.csproj", "{7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Content.Pipeline", "source\MonoGame.Extended.Content.Pipeline\KNI.Extended.Content.Pipeline.csproj", "{4A4066EB-B49A-4E80-B424-9E0BD2147886}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Entities", "source\MonoGame.Extended.Entities\KNI.Extended.Entities.csproj", "{CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Graphics", "source\MonoGame.Extended.Graphics\KNI.Extended.Graphics.csproj", "{56627685-4BA7-44E3-ACA6-F2990DE089F2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Input", "source\MonoGame.Extended.Input\KNI.Extended.Input.csproj", "{76B39424-7884-4EEC-A8D5-5126B29941B7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Particles", "source\MonoGame.Extended.Particles\KNI.Extended.Particles.csproj", "{BE74938D-9004-4D36-AD50-5C6C141A7180}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Tiled", "source\MonoGame.Extended.Tiled\KNI.Extended.Tiled.csproj", "{572C908D-4627-4678-9641-D4950DE43B13}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Tweening", "source\MonoGame.Extended.Tweening\KNI.Extended.Tweening.csproj", "{F144A062-4FF3-44EC-9A04-31C654B436B0}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{61C82014-E3A9-4AB3-8705-FBBD5F799BA6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Collisions.Tests", "tests\MonoGame.Extended.Collisions.Tests\KNI.Extended.Collisions.Tests.csproj", "{58F88A3C-C09F-4664-A34E-60E89252870A}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Content.Pipeline.Tests", "tests\MonoGame.Extended.Content.Pipeline.Tests\KNI.Extended.Content.Pipeline.Tests.csproj", "{A127A61A-B26E-4A01-BD4C-9896FDB287AE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Content.Pipeline.Tests.Tiled", "tests\MonoGame.Extended.Content.Pipeline.Tests.Tiled\KNI.Extended.Content.Pipeline.Tests.Tiled.csproj", "{0426263A-B8DE-43FC-A91E-21544F61D80E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Entities.Tests", "tests\MonoGame.Extended.Entities.Tests\KNI.Extended.Entities.Tests.csproj", "{D3B0E350-B92E-4E49-99A3-68E66CB53F16}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Tests", "tests\MonoGame.Extended.Tests\KNI.Extended.Tests.csproj", "{E1339B07-EB0B-454F-9803-E923843DB5C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Tiled.Tests", "tests\MonoGame.Extended.Tiled.Tests\KNI.Extended.Tiled.Tests.csproj", "{BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KNI.Extended.Tweening.Tests", "tests\MonoGame.Extended.Tweening.Tests\KNI.Extended.Tweening.Tests.csproj", "{C2A9982B-7BF7-4243-9E05-CFD31752B6DC}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -57,22 +31,6 @@ Global {C8717306-E333-418E-86A7-8D9781D7FDAC}.Release|Any CPU.Build.0 = Release|Any CPU {C8717306-E333-418E-86A7-8D9781D7FDAC}.Release|x86.ActiveCfg = Release|Any CPU {C8717306-E333-418E-86A7-8D9781D7FDAC}.Release|x86.Build.0 = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|x86.ActiveCfg = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Debug|x86.Build.0 = Debug|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|Any CPU.Build.0 = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|x86.ActiveCfg = Release|Any CPU - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3}.Release|x86.Build.0 = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|x86.ActiveCfg = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Debug|x86.Build.0 = Debug|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|Any CPU.Build.0 = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|x86.ActiveCfg = Release|Any CPU - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5}.Release|x86.Build.0 = Release|Any CPU {4A4066EB-B49A-4E80-B424-9E0BD2147886}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A4066EB-B49A-4E80-B424-9E0BD2147886}.Debug|Any CPU.Build.0 = Debug|Any CPU {4A4066EB-B49A-4E80-B424-9E0BD2147886}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -81,62 +39,6 @@ Global {4A4066EB-B49A-4E80-B424-9E0BD2147886}.Release|Any CPU.Build.0 = Release|Any CPU {4A4066EB-B49A-4E80-B424-9E0BD2147886}.Release|x86.ActiveCfg = Release|Any CPU {4A4066EB-B49A-4E80-B424-9E0BD2147886}.Release|x86.Build.0 = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|x86.ActiveCfg = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Debug|x86.Build.0 = Debug|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|Any CPU.Build.0 = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|x86.ActiveCfg = Release|Any CPU - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38}.Release|x86.Build.0 = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|x86.ActiveCfg = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Debug|x86.Build.0 = Debug|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|Any CPU.Build.0 = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|x86.ActiveCfg = Release|Any CPU - {56627685-4BA7-44E3-ACA6-F2990DE089F2}.Release|x86.Build.0 = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|x86.ActiveCfg = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Debug|x86.Build.0 = Debug|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|Any CPU.Build.0 = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|x86.ActiveCfg = Release|Any CPU - {76B39424-7884-4EEC-A8D5-5126B29941B7}.Release|x86.Build.0 = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|x86.ActiveCfg = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Debug|x86.Build.0 = Debug|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|Any CPU.Build.0 = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|x86.ActiveCfg = Release|Any CPU - {BE74938D-9004-4D36-AD50-5C6C141A7180}.Release|x86.Build.0 = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|x86.ActiveCfg = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Debug|x86.Build.0 = Debug|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|Any CPU.Build.0 = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|x86.ActiveCfg = Release|Any CPU - {572C908D-4627-4678-9641-D4950DE43B13}.Release|x86.Build.0 = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|x86.ActiveCfg = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Debug|x86.Build.0 = Debug|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|Any CPU.Build.0 = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|x86.ActiveCfg = Release|Any CPU - {F144A062-4FF3-44EC-9A04-31C654B436B0}.Release|x86.Build.0 = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|x86.ActiveCfg = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Debug|x86.Build.0 = Debug|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|Any CPU.Build.0 = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|x86.ActiveCfg = Release|Any CPU - {58F88A3C-C09F-4664-A34E-60E89252870A}.Release|x86.Build.0 = Release|Any CPU {A127A61A-B26E-4A01-BD4C-9896FDB287AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A127A61A-B26E-4A01-BD4C-9896FDB287AE}.Debug|Any CPU.Build.0 = Debug|Any CPU {A127A61A-B26E-4A01-BD4C-9896FDB287AE}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -145,22 +47,6 @@ Global {A127A61A-B26E-4A01-BD4C-9896FDB287AE}.Release|Any CPU.Build.0 = Release|Any CPU {A127A61A-B26E-4A01-BD4C-9896FDB287AE}.Release|x86.ActiveCfg = Release|Any CPU {A127A61A-B26E-4A01-BD4C-9896FDB287AE}.Release|x86.Build.0 = Release|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Debug|x86.ActiveCfg = Debug|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Debug|x86.Build.0 = Debug|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Release|Any CPU.Build.0 = Release|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Release|x86.ActiveCfg = Release|Any CPU - {0426263A-B8DE-43FC-A91E-21544F61D80E}.Release|x86.Build.0 = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|x86.ActiveCfg = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Debug|x86.Build.0 = Debug|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|Any CPU.Build.0 = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|x86.ActiveCfg = Release|Any CPU - {D3B0E350-B92E-4E49-99A3-68E66CB53F16}.Release|x86.Build.0 = Release|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -169,44 +55,15 @@ Global {E1339B07-EB0B-454F-9803-E923843DB5C4}.Release|Any CPU.Build.0 = Release|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Release|x86.ActiveCfg = Release|Any CPU {E1339B07-EB0B-454F-9803-E923843DB5C4}.Release|x86.Build.0 = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|x86.ActiveCfg = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Debug|x86.Build.0 = Debug|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|Any CPU.Build.0 = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|x86.ActiveCfg = Release|Any CPU - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5}.Release|x86.Build.0 = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|x86.ActiveCfg = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Debug|x86.Build.0 = Debug|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|Any CPU.Build.0 = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|x86.ActiveCfg = Release|Any CPU - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {C8717306-E333-418E-86A7-8D9781D7FDAC} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {71A8D50C-DAF1-4D08-99FD-2EACD6EAD5E3} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {7F60B59F-4B84-401F-8A13-AAA3F0B9E4A5} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} {4A4066EB-B49A-4E80-B424-9E0BD2147886} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {CD5C1878-13B6-4FAD-91AE-AEA3C1520E38} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {56627685-4BA7-44E3-ACA6-F2990DE089F2} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {76B39424-7884-4EEC-A8D5-5126B29941B7} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {BE74938D-9004-4D36-AD50-5C6C141A7180} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {572C908D-4627-4678-9641-D4950DE43B13} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {F144A062-4FF3-44EC-9A04-31C654B436B0} = {2BD6F851-7287-4361-85AB-DAE9DF30D932} - {58F88A3C-C09F-4664-A34E-60E89252870A} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} {A127A61A-B26E-4A01-BD4C-9896FDB287AE} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} - {0426263A-B8DE-43FC-A91E-21544F61D80E} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} - {D3B0E350-B92E-4E49-99A3-68E66CB53F16} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} {E1339B07-EB0B-454F-9803-E923843DB5C4} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} - {BF0EC593-4BAB-424F-B7E9-BB13EC78A0E5} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} - {C2A9982B-7BF7-4243-9E05-CFD31752B6DC} = {61C82014-E3A9-4AB3-8705-FBBD5F799BA6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {8ED5A62D-25EC-4331-9F99-BDD1E10C02A0} diff --git a/source/MonoGame.Extended.Content.Pipeline/MonoGame.Extended.Content.Pipeline.targets b/source/MonoGame.Extended.Content.Pipeline/MonoGame.Extended.Content.Pipeline.targets index 65268a5ab..7bd43c307 100644 --- a/source/MonoGame.Extended.Content.Pipeline/MonoGame.Extended.Content.Pipeline.targets +++ b/source/MonoGame.Extended.Content.Pipeline/MonoGame.Extended.Content.Pipeline.targets @@ -1,11 +1,13 @@ - + diff --git a/source/MonoGame.Extended/Animations/AnimationController.cs b/source/MonoGame.Extended/Animations/AnimationController.cs index ad4cdf9f4..6fe949b30 100644 --- a/source/MonoGame.Extended/Animations/AnimationController.cs +++ b/source/MonoGame.Extended/Animations/AnimationController.cs @@ -15,6 +15,7 @@ public class AnimationController : IAnimationController { private readonly IAnimation _definition; private int _direction; + private int _internalFrame; /// /// Gets a value that indicates whether this animation has been disposed of. @@ -50,7 +51,7 @@ public bool IsReversed public TimeSpan CurrentFrameTimeRemaining { get; private set; } /// - public int CurrentFrame { get; private set; } + public int CurrentFrame => _definition.Frames[_internalFrame].FrameIndex; /// public int FrameCount => _definition.FrameCount; @@ -68,6 +69,9 @@ public AnimationController(IAnimation definition) IsReversed = definition.IsReversed; IsPingPong = definition.IsPingPong; Speed = 1.0f; + + // Start off playing + Play(); } /// @@ -87,7 +91,7 @@ public bool Pause(bool resetFrameDuration) if (resetFrameDuration) { - CurrentFrameTimeRemaining = _definition.Frames[CurrentFrame].Duration; + CurrentFrameTimeRemaining = _definition.Frames[_internalFrame].Duration; } return true; @@ -111,8 +115,8 @@ public bool Play(int startingFrame) } IsAnimating = true; - CurrentFrame = startingFrame; - CurrentFrameTimeRemaining = _definition.Frames[CurrentFrame].Duration; + _internalFrame = startingFrame; + CurrentFrameTimeRemaining = _definition.Frames[_internalFrame].Duration; return true; } @@ -125,8 +129,8 @@ public void Reset() IsAnimating = false; IsPaused = true; Speed = 1.0d; - CurrentFrame = IsReversed ? _definition.FrameCount - 1 : 0; - CurrentFrameTimeRemaining = _definition.Frames[CurrentFrame].Duration; + _internalFrame = IsReversed ? _definition.FrameCount - 1 : 0; + CurrentFrameTimeRemaining = _definition.Frames[_internalFrame].Duration; } /// @@ -137,8 +141,8 @@ public void SetFrame(int index) throw new ArgumentOutOfRangeException(nameof(index), $"{nameof(index)} cannot be less than zero or greater than or equal to the total number of frames in this {nameof(AnimationController)}"); } - CurrentFrame = index; - CurrentFrameTimeRemaining = _definition.Frames[CurrentFrame].Duration; + _internalFrame = index; + CurrentFrameTimeRemaining = _definition.Frames[_internalFrame].Duration; OnAnimationEvent?.Invoke(this, AnimationEventTrigger.FrameBegin); } @@ -215,10 +219,10 @@ public void Update(GameTime gameTime) private bool AdvanceFrame() { // Increment the current frame - CurrentFrame += _direction; + _internalFrame += _direction; // Ensure frame is in bounds - if (CurrentFrame < 0 || CurrentFrame >= _definition.FrameCount) + if (_internalFrame < 0 || _internalFrame >= _definition.FrameCount) { // Is this a looping animation? if (IsLooping) @@ -227,11 +231,11 @@ private bool AdvanceFrame() if (IsPingPong) { _direction = -_direction; - CurrentFrame += _direction * 2; + _internalFrame += _direction * 2; } else { - CurrentFrame = IsReversed ? _definition.FrameCount - 1 : 0; + _internalFrame = IsReversed ? _definition.FrameCount - 1 : 0; } // We looped @@ -240,13 +244,13 @@ private bool AdvanceFrame() else { // No looping and we've reached the end, stop the animation - CurrentFrame -= _direction; + _internalFrame -= _direction; Stop(AnimationEventTrigger.AnimationCompleted); return false; } } - CurrentFrameTimeRemaining = _definition.Frames[CurrentFrame].Duration; + CurrentFrameTimeRemaining = _definition.Frames[_internalFrame].Duration; OnAnimationEvent?.Invoke(this, AnimationEventTrigger.FrameBegin); return true; } diff --git a/source/MonoGame.Extended/Graphics/AnimatedSprite.cs b/source/MonoGame.Extended/Graphics/AnimatedSprite.cs index 2f22f11fa..a23e0d80d 100644 --- a/source/MonoGame.Extended/Graphics/AnimatedSprite.cs +++ b/source/MonoGame.Extended/Graphics/AnimatedSprite.cs @@ -24,6 +24,11 @@ public class AnimatedSprite : Sprite /// public IAnimationController Controller { get; private set; } + /// + /// Gets the name of the current animation playing. + /// + public string CurrentAnimation => _animation.Name; + /// /// Initializes a new instance of the class with the specified /// . @@ -44,8 +49,8 @@ public AnimatedSprite(SpriteSheet spriteSheet) /// The initial animation to play public AnimatedSprite(SpriteSheet spriteSheet, string initialAnimation) :this(spriteSheet) { - SpriteSheetAnimation definition = spriteSheet.GetAnimation(initialAnimation); - Controller = new AnimationController(definition); + _animation = spriteSheet.GetAnimation(initialAnimation); + Controller = new AnimationController(_animation); } /// @@ -72,8 +77,7 @@ public void Update(GameTime gameTime) // If the current frame changed during the update, change the texture region if (index != Controller.CurrentFrame) { - int regionIndex = _animation.Frames[Controller.CurrentFrame].FrameIndex; - TextureRegion = _spriteSheet.TextureAtlas[regionIndex]; + TextureRegion = _spriteSheet.TextureAtlas[Controller.CurrentFrame]; } } } diff --git a/tests/MonoGame.Extended.Tests/Animations/AnimationTests.cs b/tests/MonoGame.Extended.Tests/Animations/AnimationTests.cs index 4c5ba801a..f1ac3bf2a 100644 --- a/tests/MonoGame.Extended.Tests/Animations/AnimationTests.cs +++ b/tests/MonoGame.Extended.Tests/Animations/AnimationTests.cs @@ -52,16 +52,6 @@ public AnimationTests() _animationController = new AnimationController(_animation); } - [Fact] - public void Play_ShouldStartAnimation() - { - var result = _animationController.Play(); - - Assert.True(result); - Assert.True(_animationController.IsAnimating); - Assert.Equal(0, _animationController.CurrentFrame); - } - [Fact] public void Play_ShouldThrowException_ForInvalidFrame() {