diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..047864cd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "daily" + ignore: + - dependency-name: "Newtonsoft.Json" + - dependency-name: "Bannerlord.ReferenceAssemblies.*" + - dependency-name: "Lib.Harmony" + - dependency-name: "Microsoft.Extensions.*" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/docfx.yml b/.github/workflows/docfx.yml index 8e3e3262..0abe6248 100644 --- a/.github/workflows/docfx.yml +++ b/.github/workflows/docfx.yml @@ -25,39 +25,10 @@ jobs: name: DocFX documentation runs-on: windows-latest steps: - - name: Checkout Repository - uses: actions/checkout@v2 + - name: DocFX Setup + uses: butr/actions-docfx-setup@v1.1 with: - submodules: recursive - fetch-depth: 0 - - - name: Setup .NET Core - uses: actions/setup-dotnet@master - with: - dotnet-version: 3.1.x - - name: Setup .NET Core - uses: actions/setup-dotnet@master - with: - dotnet-version: 5.0.x - - name: Setup BUTR GPR - uses: actions/setup-dotnet@master - with: - source-url: https://nuget.pkg.github.com/BUTR/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - name: Setup NuGet - uses: nuget/setup-nuget@v1 - with: - nuget-version: 'latest' - - - name: Generating Newtonsoft.Json xref maps - run: >- - dotnet run -p build/SandcastleXrefGenerator -- ` - Newtonsoft.Json 11.0.2 netstandard2.0 ` - https://www.newtonsoft.com/json/help/html/ ` - $PWD/docs/xrefs/Newtonsoft.Json-xrefmap.yml - shell: pwsh + github-token: ${{secrets.GITHUB_TOKEN}} - name: Build Bannerlord.ButterLib and DocFx.Plugin.LastModified run: >- diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e8ba3b6d..1685be7f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,20 +19,10 @@ jobs: name: Build for NexusMods (Stable) runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@master + - name: Setup + uses: butr/actions-common-setup@v1.2 with: - dotnet-version: 5.0.x - - - name: Setup BUTR GPR - uses: actions/setup-dotnet@master - with: - source-url: https://nuget.pkg.github.com/BUTR/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + github-token: ${{secrets.GITHUB_TOKEN}} - name: Build Bannerlord.ButterLib Module run: | @@ -88,20 +78,10 @@ jobs: runs-on: ubuntu-latest if: ${{false}} steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@master + - name: Setup + uses: butr/actions-common-setup@v1.2 with: - dotnet-version: 3.1.x - - - name: Setup BUTR GPR - uses: actions/setup-dotnet@master - with: - source-url: https://nuget.pkg.github.com/BUTR/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + github-token: ${{secrets.GITHUB_TOKEN}} - name: Download stable bannerlord folder uses: actions/download-artifact@v2 @@ -162,25 +142,10 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@master + - name: Setup + uses: butr/actions-common-setup@v1.2 with: - dotnet-version: 5.0.x - - - name: Setup .NET Core - uses: actions/setup-dotnet@master - with: - dotnet-version: 3.1.x - - - name: Setup BUTR GPR - uses: actions/setup-dotnet@master - with: - source-url: https://nuget.pkg.github.com/BUTR/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + github-token: ${{secrets.GITHUB_TOKEN}} - name: Pack Bannerlord.ButterLib (Release) run: dotnet pack src/Bannerlord.ButterLib/Bannerlord.ButterLib.csproj --configuration Release -o "./packages" @@ -222,20 +187,10 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@master - with: - dotnet-version: 3.1.x - - - name: Setup BUTR GPR - uses: actions/setup-dotnet@master + - name: Setup + uses: butr/actions-common-setup@v1.2 with: - source-url: https://nuget.pkg.github.com/BUTR/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + github-token: ${{secrets.GITHUB_TOKEN}} - name: Download stable bannerlord folder uses: actions/download-artifact@v2 diff --git a/.github/workflows/test-full.yml b/.github/workflows/test-full.yml index 2c5c1980..14e57449 100644 --- a/.github/workflows/test-full.yml +++ b/.github/workflows/test-full.yml @@ -6,11 +6,11 @@ on: # If a new version of the game is released, test the repo against it. # This way we will always know if the repo is broken on a new update. - game_version_update -# push: -# branches: -# - dev -# paths: -# - '.github/workflows/test-full.yml' + push: + branches: + - dev + paths: + - '.github/workflows/test-full.yml' # - 'src/**' # - 'tests/**' # - 'build/**' @@ -32,62 +32,23 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable sending .NET CLI telemetry to Microsoft. DOTNET_CLI_TELEMETRY_OPTOUT: true + TEST_FILTERS: "+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]* -[*]System.Diagnostics.CodeAnalysis* -[*]BUTR.DependencyInjection* -[*]Bannerlord.BUTR.Shared* -[*]HarmonyLib.BUTR*" jobs: test: name: Test Fully runs-on: windows-latest steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@master - with: - dotnet-version: 5.0.x - - - name: Setup BUTR GPR - uses: actions/setup-dotnet@master - with: - source-url: https://nuget.pkg.github.com/BUTR/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - name: Download DepotDownloader_2.3.6 - uses: i3h/download-release-asset@v1 + - name: Tests Setup + uses: butr/actions-tests-setup@v1.5 with: - owner: SteamRE - repo: DepotDownloader - tag: DepotDownloader_2.3.6 - file: depotdownloader-2.3.6.zip - - - name: Extract DepotDownloader_2.3.6 - uses: DuckSoft/extract-7z-action@v1.0 - with: - pathSource: depotdownloader-2.3.6.zip - pathTarget: depotdownloader - - - name: Download opencover.4.7.922 - uses: i3h/download-release-asset@v1 - with: - owner: OpenCover - repo: opencover - tag: 4.7.922 - file: opencover.4.7.922.zip - - - name: Extract opencover.4.7.922 - uses: DuckSoft/extract-7z-action@v1.0 - with: - pathSource: opencover.4.7.922.zip - pathTarget: opencover + github-token: ${{secrets.GITHUB_TOKEN}} - name: Test run: | $testproj = "$PWD/tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj"; $testprojimpl = "$PWD/tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj"; - $filter = "+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*"; - $gameversions = Get-Content -Path supported-game-versions.txt; For ($i = 0; $i -le $gameversions.Length - 1; $i++) @@ -100,20 +61,20 @@ jobs: dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot 261551 -beta $gameversion -filelist "$PWD/.github/resources/FileFilters.regexp" -username "${{secrets.STEAM_LOGIN}}" -password "${{secrets.STEAM_PASSWORD}}" -dir "$gamefolder"; } - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Debug -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"$filter" -output:"coverage_butterlib_$($gameversions[-1])_debug.xml" -mergebyhash; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Release -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"$filter" -output:"coverage_butterlib_$($gameversions[-1])_release.xml" -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Debug -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"${{env.TEST_FILTERS}}" -output:"coverage_butterlib_$($gameversions[-1])_debug.xml" -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testproj --configuration Release -p:OverrideGameVersion=$($gameversions[-1]) -p:GameFolder=""$PWD/bannerlord-$($gameversions[-1])""" -filter:"${{env.TEST_FILTERS}}" -output:"coverage_butterlib_$($gameversions[-1])_release.xml" -mergebyhash; For ($i = 0; $i -le $gameversions.Length - 1; $i++) { $gameversion = $gameversions[$i]; $gamefolder = "$PWD/bannerlord-$gameversion"; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Debug -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"$filter" -output:"coverage_butterlib_impl_$($gameversion)_debug.xml" -mergebyhash; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Release -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"$filter" -output:"coverage_butterlib_impl_$($gameversion)_release.xml" -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Debug -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"${{env.TEST_FILTERS}}" -output:"coverage_butterlib_impl_$($gameversion)_debug.xml" -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test $testprojimpl --configuration Release -p:OverrideGameVersion=$gameversion -p:GameFolder=""$gamefolder""" -filter:"${{env.TEST_FILTERS}}" -output:"coverage_butterlib_impl_$($gameversion)_release.xml" -mergebyhash; } shell: pwsh - name: ReportGenerator - uses: danielpalme/ReportGenerator-GitHub-Action@4.6.1 + uses: danielpalme/ReportGenerator-GitHub-Action@4.8.12 with: reports: '*.xml' targetdir: 'coveragereport' @@ -128,7 +89,7 @@ jobs: path: coveragereport - name: Upload ReportGenerator to CodeCov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2.0.2 with: token: ${{secrets.CODECOV_TOKEN}} file: coveragereport/Cobertura.xml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d15e569..b3e05d5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,65 +32,23 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable sending .NET CLI telemetry to Microsoft. DOTNET_CLI_TELEMETRY_OPTOUT: true + TEST_FILTERS: "+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]* -[*]System.Diagnostics.CodeAnalysis* -[*]BUTR.DependencyInjection* -[*]Bannerlord.BUTR.Shared* -[*]HarmonyLib.BUTR*" jobs: test: name: Test runs-on: windows-latest steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@master - with: - dotnet-version: 5.0.x - - - name: Setup BUTR GPR - uses: actions/setup-dotnet@master - with: - source-url: https://nuget.pkg.github.com/BUTR/index.json - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - name: Download DepotDownloader_2.3.6 - uses: i3h/download-release-asset@v1 - with: - owner: SteamRE - repo: DepotDownloader - tag: DepotDownloader_2.3.6 - file: depotdownloader-2.3.6.zip - - - name: Extract DepotDownloader_2.3.6 - uses: DuckSoft/extract-7z-action@v1.0 - with: - pathSource: depotdownloader-2.3.6.zip - pathTarget: depotdownloader - - - name: Download Bannerlord binaries (Stable) - run: >- - dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot 261551 -beta ${{secrets.SYNCED_GAME_STABLE_VERSION}} -username ${{secrets.STEAM_LOGIN}} - -password ${{secrets.STEAM_PASSWORD}} -filelist ./.github/resources/FileFilters.regexp -dir bannerlord-stable - shell: pwsh - - name: Download Bannerlord binaries (Beta) - run: >- - dotnet depotdownloader/DepotDownloader.dll -app 261550 -depot 261551 -beta ${{secrets.SYNCED_GAME_BETA_VERSION}} -username ${{secrets.STEAM_LOGIN}} - -password ${{secrets.STEAM_PASSWORD}} -filelist ./.github/resources/FileFilters.regexp -dir bannerlord-beta - shell: pwsh - - - name: Download opencover.4.7.922 - uses: i3h/download-release-asset@v1 - with: - owner: OpenCover - repo: opencover - tag: 4.7.922 - file: opencover.4.7.922.zip - - - name: Extract opencover.4.7.922 - uses: DuckSoft/extract-7z-action@v1.0 + - name: Tests Setup + uses: butr/actions-tests-setup@v1.4 with: - pathSource: opencover.4.7.922.zip - pathTarget: opencover + github-token: ${{secrets.GITHUB_TOKEN}} + steam-login: ${{secrets.STEAM_LOGIN}} + steam-password: ${{secrets.STEAM_PASSWORD}} + stable-version: ${{secrets.SYNCED_GAME_STABLE_VERSION}} + beta-version: ${{secrets.SYNCED_GAME_BETA_VERSION}} + stable-directory: 'bannerlord-stable' + beta-directory: 'bannerlord-beta' - name: Test run: >- @@ -111,16 +69,16 @@ jobs: - name: Test Coverage run: >- - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Debug --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_stable_debug.xml -mergebyhash; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Release --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_stable_release.xml -mergebyhash; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Debug --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_stable_debug.xml -mergebyhash; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Release --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_stable_release.xml -mergebyhash; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Debug --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_beta_debug.xml -mergebyhash; - opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Release --no-build" -filter:"+[Bannerlord.ButterLib*]* -[Bannerlord.ButterLib*.Tests]*" -output:coverage_butterlib_impl_beta_release.xml -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Debug --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_stable_debug.xml -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj --configuration Release --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_stable_release.xml -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Debug --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_stable_debug.xml -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Stable_Release --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_stable_release.xml -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Debug --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_beta_debug.xml -mergebyhash; + opencover/OpenCover.Console.exe -register -target:"dotnet.exe" -targetargs:"test tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj --configuration Beta_Release --no-build" -filter:"${{env.TEST_FILTERS}}" -output:coverage_butterlib_impl_beta_release.xml -mergebyhash; shell: pwsh - name: ReportGenerator - uses: danielpalme/ReportGenerator-GitHub-Action@4.6.1 + uses: danielpalme/ReportGenerator-GitHub-Action@4.8.12 with: reports: 'coverage_butterlib_stable_debug.xml;coverage_butterlib_stable_release.xml;coverage_butterlib_impl_stable_debug.xml;coverage_butterlib_impl_stable_release.xml;coverage_butterlib_impl_beta_debug.xml;coverage_butterlib_impl_beta_release.xml;' targetdir: 'coveragereport' @@ -135,7 +93,7 @@ jobs: path: coveragereport - name: Upload ReportGenerator to CodeCov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2.0.2 with: token: ${{secrets.CODECOV_TOKEN}} file: coveragereport/Cobertura.xml diff --git a/README.md b/README.md index 3607336b..6658febd 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,51 @@ # Bannerlord.ButterLib

- + +
- - CodeFactor + + + + CodeFactor + + + Code Climate maintainability + + + +
- Test - - + + GitHub Workflow Status (event) + + + GitHub Workflow Status (event) + + + +
- - - + +
- + + - + + - + + - + + - + +

diff --git a/build/common.props b/build/common.props index 591f319f..381ac209 100644 --- a/build/common.props +++ b/build/common.props @@ -4,15 +4,15 @@ - 1.0.27 + 1.0.28 2.1.1 2.0.0 - 1.0.0.33 - 1.6.1.41 - 2.0.0.39 + 1.0.0.36 + 1.6.1.54 + 2.0.0.44 @@ -102,7 +102,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/changelog.txt b/changelog.txt index d91be451..4b57b2a9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 1.0.28 +Game Versions: e1.4.3,e1.5.0,e1.5.1,e1.5.2,e1.5.3,e1.5.4,e1.5.5,e1.5.6,e1.5.7,e1.5.8,e1.5.9,e1.5.10,e1.6.0,e1.6.1,e1.6.2 +* Compatibility with e1.6.2 +* Improvements to mod order validation +* Improved stability for exception catching +--------------------------------------------------------------------------------------------------- Version: 1.0.27 Game Versions: e1.4.3,e1.5.0,e1.5.1,e1.5.2,e1.5.3,e1.5.4,e1.5.5,e1.5.6,e1.5.7,e1.5.8,e1.5.9,e1.5.10,e1.6.0,e1.6.1 * Fixed possible crash on load caused by MBSubModuleBaseEx diff --git a/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/CampaignIdentifierSubSystem.cs b/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/CampaignIdentifierSubSystem.cs index 371a9b49..b0d43571 100644 --- a/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/CampaignIdentifierSubSystem.cs +++ b/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/CampaignIdentifierSubSystem.cs @@ -28,7 +28,7 @@ public void Enable() #if e143 || e150 || e151 || e152 || e153 Patches.CharacterCreationContentApplyCulturePatch.Enable(_harmony); Patches.ClanInitializeClanPatch.Enable(_harmony); -#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 +#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 || e162 #else #error ConstGameVersionWithPrefix is not handled! #endif @@ -41,7 +41,7 @@ public void Disable() #if e143 || e150 || e151 || e152 || e153 //CharacterCreationContentApplyCulturePatch.Disable(_harmony); //ClanInitializeClanPatch.Disable(_harmony); -#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 +#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 || e162 #else #error ConstGameVersionWithPrefix is not handled! #endif diff --git a/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/Extensions/CampaignExtensionsImplementation.cs b/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/Extensions/CampaignExtensionsImplementation.cs index b1436f90..fa8400a5 100644 --- a/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/Extensions/CampaignExtensionsImplementation.cs +++ b/src/Bannerlord.ButterLib.Implementation/CampaignIdentifier/Extensions/CampaignExtensionsImplementation.cs @@ -16,7 +16,7 @@ internal sealed partial class CampaignExtensionsImplementation : ICampaignExtens return campaign.GameStarted && campaign.GetCampaignBehavior() is { } identifierBehavior ? identifierBehavior.CampaignId : null; -#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 +#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 || e162 return Campaign.Current.UniqueGameId; #else #error ConstGameVersionWithPrefix is not handled! @@ -30,7 +30,7 @@ internal sealed partial class CampaignExtensionsImplementation : ICampaignExtens return campaign.GameStarted && campaign.GetCampaignBehavior() is { } identifierBehavior ? identifierBehavior.CampaignDescriptor : null; -#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 +#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 || e162 return new BlankCampaignDescriptor(Campaign.Current); #else #error ConstGameVersionWithPrefix is not handled! diff --git a/src/Bannerlord.ButterLib.Implementation/DistanceMatrix/DistanceMatrixImplementation.cs b/src/Bannerlord.ButterLib.Implementation/DistanceMatrix/DistanceMatrixImplementation.cs index c1a49b91..3c248425 100644 --- a/src/Bannerlord.ButterLib.Implementation/DistanceMatrix/DistanceMatrixImplementation.cs +++ b/src/Bannerlord.ButterLib.Implementation/DistanceMatrix/DistanceMatrixImplementation.cs @@ -89,7 +89,7 @@ private Dictionary CalculateDistanceMatrix() { #if e143 || e150 || e151 || e152 || e153 || e154 || e155 || e156 || e157 || e158 || e159 || e1510 var activeHeroes = Hero.All -#elif e160 || e161 +#elif e160 || e161 || e162 var activeHeroes = Hero.AllAliveHeroes #else #error ConstGameVersionWithPrefix is not handled! diff --git a/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs b/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs index 9e05dae2..427cb3b8 100644 --- a/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs +++ b/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeyManagerImplementation.cs @@ -49,7 +49,7 @@ public override IReadOnlyList Build() var hotKeyCategoryContainer = new HotKeyCategoryContainer(_subModName, _hotKeys); #if e143 || e150 || e151 || e152 || e153 || e154 || e155 || e156 || e157 || e158 || e159 TWHotKeyManager.Initialize("Bannerlord", Utilities.GetConfigsPath() + "BannerlordGameKeys.xml", new List { hotKeyCategoryContainer }, true); -#elif e1510 || e160 || e161 +#elif e1510 || e160 || e161 || e162 TWHotKeyManager.Initialize(new PlatformFilePath(EngineFilePaths.ConfigsPath, "BannerlordGameKeys.xml"), new List { hotKeyCategoryContainer }, true); #else #error ConstGameVersionWithPrefix is not handled! diff --git a/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeySubSystem.cs b/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeySubSystem.cs index 0c1e9799..38208dca 100644 --- a/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeySubSystem.cs +++ b/src/Bannerlord.ButterLib.Implementation/HotKeys/HotKeySubSystem.cs @@ -55,7 +55,7 @@ private static void OnApplicationTick(float dt) hotKey.OnPressedInternal(); if (hotKey.GameKey.PrimaryKey.InputKey.IsReleased()) hotKey.OnReleasedInternal(); -#elif e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 +#elif e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 || e162 if (hotKey.GameKey.KeyboardKey?.InputKey.IsDown() == true || hotKey.GameKey.ControllerKey?.InputKey.IsDown() == true) hotKey.IsDownInternal(); if (hotKey.GameKey.KeyboardKey?.InputKey.IsPressed() == true || hotKey.GameKey.ControllerKey?.InputKey.IsPressed() == true) diff --git a/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectFinder.cs b/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectFinder.cs index e62251dc..12b9b695 100644 --- a/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectFinder.cs +++ b/src/Bannerlord.ButterLib.Implementation/ObjectSystem/MBObjectFinder.cs @@ -28,7 +28,7 @@ internal class MBObjectFinder : IMBObjectFinder return null; } } -#elif e160 || e161 +#elif e160 || e161 || e162 private static readonly AccessTools.FieldRef? CampaignObjectTypeObjects = AccessTools2.FieldRefAccess("_objects"); diff --git a/src/Bannerlord.ButterLib.Implementation/SubModule.cs b/src/Bannerlord.ButterLib.Implementation/SubModule.cs index 52113b0f..a0af00e3 100644 --- a/src/Bannerlord.ButterLib.Implementation/SubModule.cs +++ b/src/Bannerlord.ButterLib.Implementation/SubModule.cs @@ -47,7 +47,7 @@ public void OnServiceRegistration() services.AddSingleton(); #if e143 || e150 || e151 || e152 || e153 services.AddTransient(); -#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 +#elif e154 || e155 || e156 || e157 || e158 || e159 || e1510 || e160 || e161 || e162 services.AddTransient(); #else #error ConstGameVersionWithPrefix is not handled! diff --git a/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/EN/sta_strings.xml b/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/EN/sta_strings.xml index ae1cdd1a..85fe6d04 100644 --- a/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/EN/sta_strings.xml +++ b/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/EN/sta_strings.xml @@ -14,9 +14,11 @@ - - - + + + + + - \ No newline at end of file + diff --git a/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/RU/sta_strings.xml b/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/RU/sta_strings.xml index fd58960e..63cd4a9d 100644 --- a/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/RU/sta_strings.xml +++ b/src/Bannerlord.ButterLib.Implementation/_Module/ModuleData/Languages/RU/sta_strings.xml @@ -14,9 +14,11 @@ - - - + + + + + - \ No newline at end of file + diff --git a/src/Bannerlord.ButterLib/Bannerlord.ButterLib.csproj b/src/Bannerlord.ButterLib/Bannerlord.ButterLib.csproj index fab26ac3..69e649b8 100644 --- a/src/Bannerlord.ButterLib/Bannerlord.ButterLib.csproj +++ b/src/Bannerlord.ButterLib/Bannerlord.ButterLib.csproj @@ -41,7 +41,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs b/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs index 543f3d55..0340fe8a 100644 --- a/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs +++ b/src/Bannerlord.ButterLib/ExceptionHandler/ExceptionHandlerSubSystem.cs @@ -1,5 +1,4 @@ -using Bannerlord.ButterLib.Common.Helpers; -using Bannerlord.ButterLib.SubSystems; +using Bannerlord.ButterLib.SubSystems; using HarmonyLib; @@ -38,10 +37,7 @@ public void Enable() AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; - if (BUTR.Shared.Helpers.ModuleInfoHelper.GetLoadedModules().Any(m => string.Equals(m.Id, "BetterExceptionWindow", StringComparison.InvariantCultureIgnoreCase))) - { - BEWPatch.Enable(Harmony); - } + BEWPatch.Enable(Harmony); // re-enable BetterExceptionWindow and keep it as it is. It has now features we have yet to match. if (BUTR.Shared.Helpers.ModuleInfoHelper.GetLoadedModules().Any(m => string.Equals(m.Id, "BetterExceptionWindow", StringComparison.InvariantCultureIgnoreCase))) diff --git a/src/Bannerlord.ModuleLoader/Bannerlord.ModuleLoader.csproj b/src/Bannerlord.ModuleLoader/Bannerlord.ModuleLoader.csproj index 4280845d..ca39fb55 100644 --- a/src/Bannerlord.ModuleLoader/Bannerlord.ModuleLoader.csproj +++ b/src/Bannerlord.ModuleLoader/Bannerlord.ModuleLoader.csproj @@ -44,7 +44,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e298e10f..78d3a962 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - - + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index a9142ce4..9555f396 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,6 +1,5 @@ - - + diff --git a/supported-game-versions.txt b/supported-game-versions.txt index fc59b700..12f6cb26 100644 --- a/supported-game-versions.txt +++ b/supported-game-versions.txt @@ -1,3 +1,4 @@ +e1.6.2 e1.6.1 e1.6.0 e1.5.10 diff --git a/tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj b/tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj index 41ddf7f1..8d9f2087 100644 --- a/tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj +++ b/tests/Bannerlord.ButterLib.Implementation.Tests/Bannerlord.ButterLib.Implementation.Tests.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/tests/Bannerlord.ButterLib.Implementation.Tests/DependencyInjectionTests.cs b/tests/Bannerlord.ButterLib.Implementation.Tests/DependencyInjectionTests.cs index d16ed739..770ea9c5 100644 --- a/tests/Bannerlord.ButterLib.Implementation.Tests/DependencyInjectionTests.cs +++ b/tests/Bannerlord.ButterLib.Implementation.Tests/DependencyInjectionTests.cs @@ -133,7 +133,7 @@ public void CampaignDescriptor_Test() var hero = (Hero) FormatterServices.GetUninitializedObject(typeof(Hero)); #if e143 || e150 || e151 || e152 || e153 || e154 || e155 || e156 || e157 || e158 || e159 AccessTools.Field(typeof(Hero), "Name").SetValue(hero, new TextObject("TestHero")); -#elif e1510 || e160 || e161 +#elif e1510 || e160 || e161 || e162 AccessTools.Property(typeof(Hero), "Name").SetValue(hero, new TextObject("TestHero")); #else #error ConstGameVersionWithPrefix is not handled! diff --git a/tests/Bannerlord.ButterLib.ObjectSystem.Test/TestCampaignBehavior.cs b/tests/Bannerlord.ButterLib.ObjectSystem.Test/TestCampaignBehavior.cs index f5d78b62..6b7feb63 100644 --- a/tests/Bannerlord.ButterLib.ObjectSystem.Test/TestCampaignBehavior.cs +++ b/tests/Bannerlord.ButterLib.ObjectSystem.Test/TestCampaignBehavior.cs @@ -57,7 +57,7 @@ private void OnBeforeSave() #if e143 || e150 || e151 || e152 || e153 || e154 || e155 || e156 || e157 || e158 || e159 || e1510 foreach (var h in Hero.All) -#elif e160 || e161 +#elif e160 || e161 || e162 foreach (var h in Hero.AllAliveHeroes) #else #error ConstGameVersionWithPrefix is not handled! @@ -88,7 +88,7 @@ private void OnGameLoaded(CampaignGameStarter starter) #if e143 || e150 || e151 || e152 || e153 || e154 || e155 || e156 || e157 || e158 || e159 || e1510 foreach (var h in Hero.All) -#elif e160 || e161 +#elif e160 || e161 || e162 foreach (var h in Hero.AllAliveHeroes) #else #error ConstGameVersionWithPrefix is not handled! diff --git a/tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj b/tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj index d991467a..c77f829f 100644 --- a/tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj +++ b/tests/Bannerlord.ButterLib.Tests/Bannerlord.ButterLib.Tests.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index e298e10f..78d3a962 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,6 +1,6 @@ - - + + diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index 03632e9d..583df8eb 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -1,6 +1,5 @@ - - +