-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump PGCG.commonItems from 14.1.4 to 15.0.0 in /ImperatorToCK3 (#2284)
Bumps [PGCG.commonItems](https://github.com/ParadoxGameConverters/commonItems.NET) from 14.1.4 to 15.0.0. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/ParadoxGameConverters/PGCG.commonItems/commit/6c8af20d9684317f0c0dfbc572f446d9124d5def"><code>6c8af20</code></a> Use defines when loading script values (<a href="https://redirect.github.com/ParadoxGameConverters/commonItems.NET/issues/531">#531</a>)</li> <li>See full diff in <a href="https://github.com/ParadoxGameConverters/commonItems.NET/compare/14.1.4...15.0.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=PGCG.commonItems&package-manager=nuget&previous-version=14.1.4&new-version=15.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: iht <[email protected]>
- Loading branch information
1 parent
b72e3d5
commit 5071582
Showing
11 changed files
with
30 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
using commonItems; | ||
using commonItems.Mods; | ||
using ImperatorToCK3.Helpers; | ||
using System; | ||
using System.Text.Json; | ||
|
||
namespace ImperatorToCK3.Imperator; | ||
|
||
public sealed class Defines { | ||
public sealed class ImperatorDefines : Defines { | ||
public int CohortSize { get; private set; } = 500; | ||
|
||
public void LoadDefines(ModFilesystem imperatorModFs) { | ||
public new void LoadDefines(ModFilesystem modFS) { | ||
Logger.Info("Loading Imperator defines..."); | ||
|
||
var definesFiles = imperatorModFs.GetAllFilesInFolderRecursive("common/defines"); | ||
foreach (var fileInfo in definesFiles) { | ||
string jsonString = string.Empty; | ||
try { | ||
jsonString = RakalyCaller.GetJson(fileInfo.AbsolutePath); | ||
var jsonRoot = JsonDocument.Parse(jsonString).RootElement; | ||
|
||
if (jsonRoot.TryGetProperty("NUnit", out var unitProp) && unitProp.TryGetProperty("COHORT_SIZE", out var cohortSizeProp)) { | ||
CohortSize = cohortSizeProp.GetInt32(); | ||
} | ||
} catch (Exception e) { | ||
Logger.Warn($"Failed to read defines from {fileInfo.AbsolutePath}:\n\tJSON string: {jsonString}\n\texception: {e}"); | ||
} | ||
base.LoadDefines(modFS); | ||
|
||
var cohortSizeStr = GetValue("NUnit", "COHORT_SIZE"); | ||
if (cohortSizeStr is not null) { | ||
CohortSize = int.Parse(cohortSizeStr); | ||
} | ||
|
||
Logger.IncrementProgress(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters