Skip to content

Commit

Permalink
Fix parsing HOI4 scripted_diplomatic_actions folder
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Aug 20, 2022
1 parent 09ae1e2 commit ce009e0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/IronyModManager.Parser.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-16-2020
//
// Last Modified By : Mario
// Last Modified On : 07-12-2022
// Last Modified On : 08-20-2022
// ***********************************************************************
// <copyright file="Constants.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -279,6 +279,11 @@ public static class HOI4
/// </summary>
public static readonly string Resources = MergePath(CommonPath, "resources");

/// <summary>
/// The scripted diplomatic actions
/// </summary>
public static readonly string ScriptedDiplomaticActions = MergePath(CommonPath, "scripted_diplomatic_actions");

/// <summary>
/// The scripted GUI
/// </summary>
Expand Down
15 changes: 15 additions & 0 deletions src/IronyModManager.Parser.Tests/HOI4InnerLayerParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,21 @@ public void CanParse_wargoals_should_be_true()
parser.CanParse(args).Should().BeTrue();
}

/// <summary>
/// Defines the test method CanParse_scripted_diplomatic_actions_should_be_true.
/// </summary>
[Fact]
public void CanParse_scripted_diplomatic_actions_should_be_true()
{
var args = new CanParseArgs()
{
File = "common\\scripted_diplomatic_actions\\test.txt",
GameType = "HeartsofIronIV"
};
var parser = new Games.HOI4.InnerLayerParser(new CodeParser(new Logger()), null);
parser.CanParse(args).Should().BeTrue();
}

/// <summary>
/// Defines the test method Parse_should_yield_results.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/IronyModManager.Parser/Games/HOI4/InnerLayerParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 01-29-2022
//
// Last Modified By : Mario
// Last Modified On : 07-20-2022
// Last Modified On : 08-20-2022
// ***********************************************************************
// <copyright file="InnerLayerParser.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -51,7 +51,7 @@ public class InnerLayerParser : BaseParser, IGameParser
Common.Constants.HOI4.Technologies, Common.Constants.HOI4.UnitLeader,
Common.Constants.HOI4.CountryLeader, Common.Constants.HOI4.Aces,
Common.Constants.HOI4.AIAreas, Common.Constants.HOI4.Buildings, Common.Constants.HOI4.Ideologies,
Common.Constants.HOI4.Resources, Common.Constants.HOI4.Wargoals
Common.Constants.HOI4.Resources, Common.Constants.HOI4.Wargoals, Common.Constants.HOI4.ScriptedDiplomaticActions
};

#endregion Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-12-2020
//
// Last Modified By : Mario
// Last Modified On : 08-12-2022
// Last Modified On : 08-20-2022
// ***********************************************************************
// <copyright file="GameRegistration.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -177,7 +177,7 @@ private IGameType GetHOI4(string baseUserDir)
game.RemoteSteamUserDirectory = SteamDirectory.GetUserDataFolders(game.SteamAppId).Select(p => p.StandardizeDirectorySeparator()).ToList();
game.AdvancedFeatures = IronyModManager.Models.Common.GameAdvancedFeatures.ReadOnly;
game.ParadoxGameId = Shared.Constants.GamesTypes.HeartsOfIron4.ParadoxGameId;
game.GameIndexCacheVersion = 3;
game.GameIndexCacheVersion = 4;
MapGameSettings(game, GetExecutableSettings(game));
return game;
}
Expand Down

0 comments on commit ce009e0

Please sign in to comment.